2025-04-25 06:53:17 +02:00

141948 lines
6.9 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// <reference path="./gdk-2.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./cairo.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./atk-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://Gtk?version=2.0' {
// Module dependencies
import type Gdk from 'gi://Gdk?version=2.0';
import type cairo from 'cairo';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
export namespace Gtk {
/**
* Gtk-2.0
*/
export namespace AnchorType {
export const $gtype: GObject.GType<AnchorType>;
}
enum AnchorType {
CENTER,
NORTH,
NORTH_WEST,
NORTH_EAST,
SOUTH,
SOUTH_WEST,
SOUTH_EAST,
WEST,
EAST,
N,
NW,
NE,
S,
SW,
SE,
W,
E,
}
export namespace ArrowPlacement {
export const $gtype: GObject.GType<ArrowPlacement>;
}
enum ArrowPlacement {
BOTH,
START,
END,
}
export namespace ArrowType {
export const $gtype: GObject.GType<ArrowType>;
}
enum ArrowType {
UP,
DOWN,
LEFT,
RIGHT,
NONE,
}
/**
* An enum for determining the page role inside the #GtkAssistant. It's
* used to handle buttons sensitivity and visibility.
*
* Note that an assistant needs to end its page flow with a page of type
* %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or
* %GTK_ASSISTANT_PAGE_PROGRESS to be correct.
*/
/**
* An enum for determining the page role inside the #GtkAssistant. It's
* used to handle buttons sensitivity and visibility.
*
* Note that an assistant needs to end its page flow with a page of type
* %GTK_ASSISTANT_PAGE_CONFIRM, %GTK_ASSISTANT_PAGE_SUMMARY or
* %GTK_ASSISTANT_PAGE_PROGRESS to be correct.
*/
export namespace AssistantPageType {
export const $gtype: GObject.GType<AssistantPageType>;
}
enum AssistantPageType {
/**
* The page has regular contents.
*/
CONTENT,
/**
* The page contains an introduction to the
* assistant task.
*/
INTRO,
/**
* The page lets the user confirm or deny the
* changes.
*/
CONFIRM,
/**
* The page informs the user of the changes
* done.
*/
SUMMARY,
/**
* Used for tasks that take a long time to
* complete, blocks the assistant until the page is marked as complete.
*/
PROGRESS,
}
class BuilderError extends GLib.Error {
static $gtype: GObject.GType<BuilderError>;
// Static fields
static INVALID_TYPE_FUNCTION: number;
static UNHANDLED_TAG: number;
static MISSING_ATTRIBUTE: number;
static INVALID_ATTRIBUTE: number;
static INVALID_TAG: number;
static MISSING_PROPERTY_VALUE: number;
static INVALID_VALUE: number;
static VERSION_MISMATCH: number;
static DUPLICATE_ID: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
export namespace ButtonBoxStyle {
export const $gtype: GObject.GType<ButtonBoxStyle>;
}
enum ButtonBoxStyle {
DEFAULT_STYLE,
SPREAD,
EDGE,
START,
END,
CENTER,
}
/**
* Prebuilt sets of buttons for the dialog. If
* none of these choices are appropriate, simply use %GTK_BUTTONS_NONE
* then call gtk_dialog_add_buttons().
* <note>
* Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO
* and %GTK_BUTTONS_OK_CANCEL are discouraged by the
* <ulink url="http://library.gnome.org/devel/hig-book/stable/">GNOME HIG</ulink>.
* </note>
*/
/**
* Prebuilt sets of buttons for the dialog. If
* none of these choices are appropriate, simply use %GTK_BUTTONS_NONE
* then call gtk_dialog_add_buttons().
* <note>
* Please note that %GTK_BUTTONS_OK, %GTK_BUTTONS_YES_NO
* and %GTK_BUTTONS_OK_CANCEL are discouraged by the
* <ulink url="http://library.gnome.org/devel/hig-book/stable/">GNOME HIG</ulink>.
* </note>
*/
export namespace ButtonsType {
export const $gtype: GObject.GType<ButtonsType>;
}
enum ButtonsType {
/**
* no buttons at all
*/
NONE,
/**
* an OK button
*/
OK,
/**
* a Close button
*/
CLOSE,
/**
* a Cancel button
*/
CANCEL,
/**
* Yes and No buttons
*/
YES_NO,
/**
* OK and Cancel buttons
*/
OK_CANCEL,
}
export namespace CListDragPos {
export const $gtype: GObject.GType<CListDragPos>;
}
enum CListDragPos {
NONE,
BEFORE,
INTO,
AFTER,
}
export namespace CTreeExpanderStyle {
export const $gtype: GObject.GType<CTreeExpanderStyle>;
}
enum CTreeExpanderStyle {
NONE,
SQUARE,
TRIANGLE,
CIRCULAR,
}
export namespace CTreeExpansionType {
export const $gtype: GObject.GType<CTreeExpansionType>;
}
enum CTreeExpansionType {
EXPAND,
EXPAND_RECURSIVE,
COLLAPSE,
COLLAPSE_RECURSIVE,
TOGGLE,
TOGGLE_RECURSIVE,
}
export namespace CTreeLineStyle {
export const $gtype: GObject.GType<CTreeLineStyle>;
}
enum CTreeLineStyle {
NONE,
SOLID,
DOTTED,
TABBED,
}
export namespace CTreePos {
export const $gtype: GObject.GType<CTreePos>;
}
enum CTreePos {
BEFORE,
AS_CHILD,
AFTER,
}
export namespace CellRendererAccelMode {
export const $gtype: GObject.GType<CellRendererAccelMode>;
}
enum CellRendererAccelMode {
GTK,
OTHER,
}
export namespace CellRendererMode {
export const $gtype: GObject.GType<CellRendererMode>;
}
enum CellRendererMode {
INERT,
ACTIVATABLE,
EDITABLE,
}
export namespace CellType {
export const $gtype: GObject.GType<CellType>;
}
enum CellType {
EMPTY,
TEXT,
PIXMAP,
PIXTEXT,
WIDGET,
}
export namespace CornerType {
export const $gtype: GObject.GType<CornerType>;
}
enum CornerType {
TOP_LEFT,
BOTTOM_LEFT,
TOP_RIGHT,
BOTTOM_RIGHT,
}
export namespace CurveType {
export const $gtype: GObject.GType<CurveType>;
}
enum CurveType {
LINEAR,
SPLINE,
FREE,
}
export namespace DeleteType {
export const $gtype: GObject.GType<DeleteType>;
}
enum DeleteType {
CHARS,
WORD_ENDS,
WORDS,
DISPLAY_LINES,
DISPLAY_LINE_ENDS,
PARAGRAPH_ENDS,
PARAGRAPHS,
WHITESPACE,
}
export namespace DirectionType {
export const $gtype: GObject.GType<DirectionType>;
}
enum DirectionType {
TAB_FORWARD,
TAB_BACKWARD,
UP,
DOWN,
LEFT,
RIGHT,
}
export namespace DragResult {
export const $gtype: GObject.GType<DragResult>;
}
enum DragResult {
SUCCESS,
NO_TARGET,
USER_CANCELLED,
TIMEOUT_EXPIRED,
GRAB_BROKEN,
ERROR,
}
export namespace EntryIconPosition {
export const $gtype: GObject.GType<EntryIconPosition>;
}
enum EntryIconPosition {
PRIMARY,
SECONDARY,
}
export namespace ExpanderStyle {
export const $gtype: GObject.GType<ExpanderStyle>;
}
enum ExpanderStyle {
COLLAPSED,
SEMI_COLLAPSED,
SEMI_EXPANDED,
EXPANDED,
}
/**
* Describes whether a #GtkFileChooser is being used to open existing files
* or to save to a possibly new file.
*/
/**
* Describes whether a #GtkFileChooser is being used to open existing files
* or to save to a possibly new file.
*/
export namespace FileChooserAction {
export const $gtype: GObject.GType<FileChooserAction>;
}
enum FileChooserAction {
/**
* Indicates open mode. The file chooser
* will only let the user pick an existing file.
*/
OPEN,
/**
* Indicates save mode. The file chooser
* will let the user pick an existing file, or type in a new
* filename.
*/
SAVE,
/**
* Indicates an Open mode for
* selecting folders. The file chooser will let the user pick an
* existing folder.
*/
SELECT_FOLDER,
/**
* Indicates a mode for creating a
* new folder. The file chooser will let the user name an existing or
* new folder.
*/
CREATE_FOLDER,
}
/**
* Used as a return value of handlers for the
* #GtkFileChooser::confirm-overwrite signal of a #GtkFileChooser. This
* value determines whether the file chooser will present the stock
* confirmation dialog, accept the user's choice of a filename, or
* let the user choose another filename.
*/
/**
* Used as a return value of handlers for the
* #GtkFileChooser::confirm-overwrite signal of a #GtkFileChooser. This
* value determines whether the file chooser will present the stock
* confirmation dialog, accept the user's choice of a filename, or
* let the user choose another filename.
*/
export namespace FileChooserConfirmation {
export const $gtype: GObject.GType<FileChooserConfirmation>;
}
enum FileChooserConfirmation {
/**
* The file chooser will present
* its stock dialog to confirm about overwriting an existing file.
*/
CONFIRM,
/**
* The file chooser will
* terminate and accept the user's choice of a file name.
*/
ACCEPT_FILENAME,
/**
* The file chooser will
* continue running, so as to let the user select another file name.
*/
SELECT_AGAIN,
}
/**
* These identify the various errors that can occur while calling
* #GtkFileChooser functions.
*/
class FileChooserError extends GLib.Error {
static $gtype: GObject.GType<FileChooserError>;
// Static fields
/**
* Indicates that a file does not exist.
*/
static NONEXISTENT: number;
/**
* Indicates a malformed filename.
*/
static BAD_FILENAME: number;
/**
* Indicates a duplicate path (e.g. when
* adding a bookmark).
*/
static ALREADY_EXISTS: number;
/**
* Indicates an incomplete hostname (e.g. "http://foo" without a slash after that).
*/
static INCOMPLETE_HOSTNAME: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Registers an error quark for #GtkFileChooser if necessary.
*/
static quark(): GLib.Quark;
}
export namespace IMPreeditStyle {
export const $gtype: GObject.GType<IMPreeditStyle>;
}
enum IMPreeditStyle {
NOTHING,
CALLBACK,
NONE,
}
export namespace IMStatusStyle {
export const $gtype: GObject.GType<IMStatusStyle>;
}
enum IMStatusStyle {
NOTHING,
CALLBACK,
NONE,
}
export namespace IconSize {
export const $gtype: GObject.GType<IconSize>;
}
enum IconSize {
INVALID,
MENU,
SMALL_TOOLBAR,
LARGE_TOOLBAR,
BUTTON,
DND,
DIALOG,
}
/**
* Error codes for GtkIconTheme operations.
*/
class IconThemeError extends GLib.Error {
static $gtype: GObject.GType<IconThemeError>;
// Static fields
/**
* The icon specified does not exist in the theme
*/
static NOT_FOUND: number;
/**
* An unspecified error occurred.
*/
static FAILED: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
export namespace IconViewDropPosition {
export const $gtype: GObject.GType<IconViewDropPosition>;
}
enum IconViewDropPosition {
NO_DROP,
DROP_INTO,
DROP_LEFT,
DROP_RIGHT,
DROP_ABOVE,
DROP_BELOW,
}
/**
* Describes the image data representation used by a #GtkImage. If you
* want to get the image from the widget, you can only get the
* currently-stored representation. e.g. if the
* gtk_image_get_storage_type() returns #GTK_IMAGE_PIXBUF, then you can
* call gtk_image_get_pixbuf() but not gtk_image_get_stock(). For empty
* images, you can request any storage type (call any of the "get"
* functions), but they will all return %NULL values.
*/
/**
* Describes the image data representation used by a #GtkImage. If you
* want to get the image from the widget, you can only get the
* currently-stored representation. e.g. if the
* gtk_image_get_storage_type() returns #GTK_IMAGE_PIXBUF, then you can
* call gtk_image_get_pixbuf() but not gtk_image_get_stock(). For empty
* images, you can request any storage type (call any of the "get"
* functions), but they will all return %NULL values.
*/
export namespace ImageType {
export const $gtype: GObject.GType<ImageType>;
}
enum ImageType {
/**
* there is no image displayed by the widget
*/
EMPTY,
/**
* the widget contains a #GdkPixmap
*/
PIXMAP,
/**
* the widget contains a #GdkImage
*/
IMAGE,
/**
* the widget contains a #GdkPixbuf
*/
PIXBUF,
/**
* the widget contains a stock icon name (see <xref linkend="gtk-Stock-Items"/>)
*/
STOCK,
/**
* the widget contains a #GtkIconSet
*/
ICON_SET,
/**
* the widget contains a #GdkPixbufAnimation
*/
ANIMATION,
/**
* the widget contains a named icon.
* This image type was added in GTK+ 2.6
*/
ICON_NAME,
/**
* the widget contains a #GIcon.
* This image type was added in GTK+ 2.14
*/
GICON,
}
export namespace Justification {
export const $gtype: GObject.GType<Justification>;
}
enum Justification {
LEFT,
RIGHT,
CENTER,
FILL,
}
export namespace MatchType {
export const $gtype: GObject.GType<MatchType>;
}
enum MatchType {
ALL,
ALL_TAIL,
HEAD,
TAIL,
EXACT,
LAST,
}
export namespace MenuDirectionType {
export const $gtype: GObject.GType<MenuDirectionType>;
}
enum MenuDirectionType {
PARENT,
CHILD,
NEXT,
PREV,
}
/**
* The type of message being displayed in the dialog.
*/
/**
* The type of message being displayed in the dialog.
*/
export namespace MessageType {
export const $gtype: GObject.GType<MessageType>;
}
enum MessageType {
/**
* Informational message
*/
INFO,
/**
* Nonfatal warning message
*/
WARNING,
/**
* Question requiring a choice
*/
QUESTION,
/**
* Fatal error message
*/
ERROR,
/**
* None of the above, doesn't get an icon
*/
OTHER,
}
export namespace MetricType {
export const $gtype: GObject.GType<MetricType>;
}
enum MetricType {
PIXELS,
INCHES,
CENTIMETERS,
}
export namespace MovementStep {
export const $gtype: GObject.GType<MovementStep>;
}
enum MovementStep {
LOGICAL_POSITIONS,
VISUAL_POSITIONS,
WORDS,
DISPLAY_LINES,
DISPLAY_LINE_ENDS,
PARAGRAPHS,
PARAGRAPH_ENDS,
PAGES,
BUFFER_ENDS,
HORIZONTAL_PAGES,
}
export namespace NotebookTab {
export const $gtype: GObject.GType<NotebookTab>;
}
enum NotebookTab {
FIRST,
LAST,
}
export namespace NumberUpLayout {
export const $gtype: GObject.GType<NumberUpLayout>;
}
enum NumberUpLayout {
LRTB,
LRBT,
RLTB,
RLBT,
TBLR,
TBRL,
BTLR,
BTRL,
}
export namespace Orientation {
export const $gtype: GObject.GType<Orientation>;
}
enum Orientation {
HORIZONTAL,
VERTICAL,
}
export namespace PackDirection {
export const $gtype: GObject.GType<PackDirection>;
}
enum PackDirection {
LTR,
RTL,
TTB,
BTT,
}
export namespace PackType {
export const $gtype: GObject.GType<PackType>;
}
enum PackType {
START,
END,
}
export namespace PageOrientation {
export const $gtype: GObject.GType<PageOrientation>;
}
enum PageOrientation {
PORTRAIT,
LANDSCAPE,
REVERSE_PORTRAIT,
REVERSE_LANDSCAPE,
}
export namespace PageSet {
export const $gtype: GObject.GType<PageSet>;
}
enum PageSet {
ALL,
EVEN,
ODD,
}
export namespace PathPriorityType {
export const $gtype: GObject.GType<PathPriorityType>;
}
enum PathPriorityType {
LOWEST,
GTK,
APPLICATION,
THEME,
RC,
HIGHEST,
}
export namespace PathType {
export const $gtype: GObject.GType<PathType>;
}
enum PathType {
WIDGET,
WIDGET_CLASS,
CLASS,
}
export namespace PolicyType {
export const $gtype: GObject.GType<PolicyType>;
}
enum PolicyType {
ALWAYS,
AUTOMATIC,
NEVER,
}
export namespace PositionType {
export const $gtype: GObject.GType<PositionType>;
}
enum PositionType {
LEFT,
RIGHT,
TOP,
BOTTOM,
}
export namespace PreviewType {
export const $gtype: GObject.GType<PreviewType>;
}
enum PreviewType {
COLOR,
GRAYSCALE,
}
export namespace PrintDuplex {
export const $gtype: GObject.GType<PrintDuplex>;
}
enum PrintDuplex {
SIMPLEX,
HORIZONTAL,
VERTICAL,
}
class PrintError extends GLib.Error {
static $gtype: GObject.GType<PrintError>;
// Static fields
static GENERAL: number;
static INTERNAL_ERROR: number;
static NOMEM: number;
static INVALID_FILE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Registers an error quark for #GtkPrintOperation if necessary.
*/
static quark(): GLib.Quark;
}
export namespace PrintOperationAction {
export const $gtype: GObject.GType<PrintOperationAction>;
}
enum PrintOperationAction {
PRINT_DIALOG,
PRINT,
PREVIEW,
EXPORT,
}
export namespace PrintOperationResult {
export const $gtype: GObject.GType<PrintOperationResult>;
}
enum PrintOperationResult {
ERROR,
APPLY,
CANCEL,
IN_PROGRESS,
}
export namespace PrintPages {
export const $gtype: GObject.GType<PrintPages>;
}
enum PrintPages {
ALL,
CURRENT,
RANGES,
SELECTION,
}
export namespace PrintQuality {
export const $gtype: GObject.GType<PrintQuality>;
}
enum PrintQuality {
LOW,
NORMAL,
HIGH,
DRAFT,
}
export namespace PrintStatus {
export const $gtype: GObject.GType<PrintStatus>;
}
enum PrintStatus {
INITIAL,
PREPARING,
GENERATING_DATA,
SENDING_DATA,
PENDING,
PENDING_ISSUE,
PRINTING,
FINISHED,
FINISHED_ABORTED,
}
export namespace ProgressBarOrientation {
export const $gtype: GObject.GType<ProgressBarOrientation>;
}
enum ProgressBarOrientation {
LEFT_TO_RIGHT,
RIGHT_TO_LEFT,
BOTTOM_TO_TOP,
TOP_TO_BOTTOM,
}
export namespace ProgressBarStyle {
export const $gtype: GObject.GType<ProgressBarStyle>;
}
enum ProgressBarStyle {
CONTINUOUS,
DISCRETE,
}
export namespace RcTokenType {
export const $gtype: GObject.GType<RcTokenType>;
}
enum RcTokenType {
INVALID,
INCLUDE,
NORMAL,
ACTIVE,
PRELIGHT,
SELECTED,
INSENSITIVE,
FG,
BG,
TEXT,
BASE,
XTHICKNESS,
YTHICKNESS,
FONT,
FONTSET,
FONT_NAME,
BG_PIXMAP,
PIXMAP_PATH,
STYLE,
BINDING,
BIND,
WIDGET,
WIDGET_CLASS,
CLASS,
LOWEST,
GTK,
APPLICATION,
THEME,
RC,
HIGHEST,
ENGINE,
MODULE_PATH,
IM_MODULE_PATH,
IM_MODULE_FILE,
STOCK,
LTR,
RTL,
COLOR,
UNBIND,
LAST,
}
class RecentChooserError extends GLib.Error {
static $gtype: GObject.GType<RecentChooserError>;
// Static fields
static NOT_FOUND: number;
static INVALID_URI: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* Error codes for GtkRecentManager operations
*/
class RecentManagerError extends GLib.Error {
static $gtype: GObject.GType<RecentManagerError>;
// Static fields
/**
* the URI specified does not exists in
* the recently used resources list.
*/
static NOT_FOUND: number;
/**
* the URI specified is not valid.
*/
static INVALID_URI: number;
/**
* the supplied string is not
* UTF-8 encoded.
*/
static INVALID_ENCODING: number;
/**
* no application has registered
* the specified item.
*/
static NOT_REGISTERED: number;
/**
* failure while reading the recently used
* resources file.
*/
static READ: number;
/**
* failure while writing the recently used
* resources file.
*/
static WRITE: number;
/**
* unspecified error.
*/
static UNKNOWN: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* Used to specify the sorting method to be applyed to the recently
* used resource list.
*/
/**
* Used to specify the sorting method to be applyed to the recently
* used resource list.
*/
export namespace RecentSortType {
export const $gtype: GObject.GType<RecentSortType>;
}
enum RecentSortType {
/**
* Do not sort the returned list of recently used
* resources.
*/
NONE,
/**
* Sort the returned list with the most recently used
* items first.
*/
MRU,
/**
* Sort the returned list with the least recently used
* items first.
*/
LRU,
/**
* Sort the returned list using a custom sorting
* function passed using gtk_recent_manager_set_sort_func().
*/
CUSTOM,
}
export namespace ReliefStyle {
export const $gtype: GObject.GType<ReliefStyle>;
}
enum ReliefStyle {
NORMAL,
HALF,
NONE,
}
export namespace ResizeMode {
export const $gtype: GObject.GType<ResizeMode>;
}
enum ResizeMode {
PARENT,
QUEUE,
IMMEDIATE,
}
export namespace ResponseType {
export const $gtype: GObject.GType<ResponseType>;
}
enum ResponseType {
NONE,
REJECT,
ACCEPT,
DELETE_EVENT,
OK,
CANCEL,
CLOSE,
YES,
NO,
APPLY,
HELP,
}
export namespace ScrollStep {
export const $gtype: GObject.GType<ScrollStep>;
}
enum ScrollStep {
STEPS,
PAGES,
ENDS,
HORIZONTAL_STEPS,
HORIZONTAL_PAGES,
HORIZONTAL_ENDS,
}
export namespace ScrollType {
export const $gtype: GObject.GType<ScrollType>;
}
enum ScrollType {
NONE,
JUMP,
STEP_BACKWARD,
STEP_FORWARD,
PAGE_BACKWARD,
PAGE_FORWARD,
STEP_UP,
STEP_DOWN,
PAGE_UP,
PAGE_DOWN,
STEP_LEFT,
STEP_RIGHT,
PAGE_LEFT,
PAGE_RIGHT,
START,
END,
}
export namespace SelectionMode {
export const $gtype: GObject.GType<SelectionMode>;
}
enum SelectionMode {
NONE,
SINGLE,
BROWSE,
MULTIPLE,
EXTENDED,
}
export namespace SensitivityType {
export const $gtype: GObject.GType<SensitivityType>;
}
enum SensitivityType {
AUTO,
ON,
OFF,
}
export namespace ShadowType {
export const $gtype: GObject.GType<ShadowType>;
}
enum ShadowType {
NONE,
IN,
OUT,
ETCHED_IN,
ETCHED_OUT,
}
export namespace SideType {
export const $gtype: GObject.GType<SideType>;
}
enum SideType {
TOP,
BOTTOM,
LEFT,
RIGHT,
}
/**
* The mode of the size group determines the directions in which the size
* group affects the requested sizes of its component widgets.
*/
/**
* The mode of the size group determines the directions in which the size
* group affects the requested sizes of its component widgets.
*/
export namespace SizeGroupMode {
export const $gtype: GObject.GType<SizeGroupMode>;
}
enum SizeGroupMode {
/**
* group has no effect
*/
NONE,
/**
* group affects horizontal requisition
*/
HORIZONTAL,
/**
* group affects vertical requisition
*/
VERTICAL,
/**
* group affects both horizontal and vertical requisition
*/
BOTH,
}
export namespace SortType {
export const $gtype: GObject.GType<SortType>;
}
enum SortType {
ASCENDING,
DESCENDING,
}
export namespace SpinButtonUpdatePolicy {
export const $gtype: GObject.GType<SpinButtonUpdatePolicy>;
}
enum SpinButtonUpdatePolicy {
ALWAYS,
IF_VALID,
}
export namespace SpinType {
export const $gtype: GObject.GType<SpinType>;
}
enum SpinType {
STEP_FORWARD,
STEP_BACKWARD,
PAGE_FORWARD,
PAGE_BACKWARD,
HOME,
END,
USER_DEFINED,
}
export namespace StateType {
export const $gtype: GObject.GType<StateType>;
}
enum StateType {
NORMAL,
ACTIVE,
PRELIGHT,
SELECTED,
INSENSITIVE,
}
export namespace SubmenuDirection {
export const $gtype: GObject.GType<SubmenuDirection>;
}
enum SubmenuDirection {
LEFT,
RIGHT,
}
export namespace SubmenuPlacement {
export const $gtype: GObject.GType<SubmenuPlacement>;
}
enum SubmenuPlacement {
TOP_BOTTOM,
LEFT_RIGHT,
}
export namespace TextBufferTargetInfo {
export const $gtype: GObject.GType<TextBufferTargetInfo>;
}
enum TextBufferTargetInfo {
BUFFER_CONTENTS,
RICH_TEXT,
TEXT,
}
export namespace TextDirection {
export const $gtype: GObject.GType<TextDirection>;
}
enum TextDirection {
NONE,
LTR,
RTL,
}
export namespace TextWindowType {
export const $gtype: GObject.GType<TextWindowType>;
}
enum TextWindowType {
PRIVATE,
WIDGET,
TEXT,
LEFT,
RIGHT,
TOP,
BOTTOM,
}
export namespace ToolbarChildType {
export const $gtype: GObject.GType<ToolbarChildType>;
}
enum ToolbarChildType {
SPACE,
BUTTON,
TOGGLEBUTTON,
RADIOBUTTON,
WIDGET,
}
export namespace ToolbarSpaceStyle {
export const $gtype: GObject.GType<ToolbarSpaceStyle>;
}
enum ToolbarSpaceStyle {
EMPTY,
LINE,
}
export namespace ToolbarStyle {
export const $gtype: GObject.GType<ToolbarStyle>;
}
enum ToolbarStyle {
ICONS,
TEXT,
BOTH,
BOTH_HORIZ,
}
export namespace TreeViewColumnSizing {
export const $gtype: GObject.GType<TreeViewColumnSizing>;
}
enum TreeViewColumnSizing {
GROW_ONLY,
AUTOSIZE,
FIXED,
}
export namespace TreeViewDropPosition {
export const $gtype: GObject.GType<TreeViewDropPosition>;
}
enum TreeViewDropPosition {
BEFORE,
AFTER,
INTO_OR_BEFORE,
INTO_OR_AFTER,
}
export namespace TreeViewGridLines {
export const $gtype: GObject.GType<TreeViewGridLines>;
}
enum TreeViewGridLines {
NONE,
HORIZONTAL,
VERTICAL,
BOTH,
}
export namespace TreeViewMode {
export const $gtype: GObject.GType<TreeViewMode>;
}
enum TreeViewMode {
LINE,
ITEM,
}
export namespace Unit {
export const $gtype: GObject.GType<Unit>;
}
enum Unit {
PIXEL,
POINTS,
INCH,
MM,
}
export namespace UpdateType {
export const $gtype: GObject.GType<UpdateType>;
}
enum UpdateType {
CONTINUOUS,
DISCONTINUOUS,
DELAYED,
}
export namespace Visibility {
export const $gtype: GObject.GType<Visibility>;
}
enum Visibility {
NONE,
PARTIAL,
FULL,
}
export namespace WidgetHelpType {
export const $gtype: GObject.GType<WidgetHelpType>;
}
enum WidgetHelpType {
TOOLTIP,
WHATS_THIS,
}
export namespace WindowPosition {
export const $gtype: GObject.GType<WindowPosition>;
}
enum WindowPosition {
NONE,
CENTER,
MOUSE,
CENTER_ALWAYS,
CENTER_ON_PARENT,
}
export namespace WindowType {
export const $gtype: GObject.GType<WindowType>;
}
enum WindowType {
TOPLEVEL,
POPUP,
}
export namespace WrapMode {
export const $gtype: GObject.GType<WrapMode>;
}
enum WrapMode {
NONE,
CHAR,
WORD,
WORD_CHAR,
}
const ARG_READWRITE: number;
const BINARY_AGE: number;
const BUTTONBOX_DEFAULT: number;
const INPUT_ERROR: number;
const INTERFACE_AGE: number;
const MAJOR_VERSION: number;
const MAX_COMPOSE_LEN: number;
const MICRO_VERSION: number;
const MINOR_VERSION: number;
const NO_TEXT_INPUT_MOD_MASK: number;
const PAPER_NAME_A3: string;
const PAPER_NAME_A4: string;
const PAPER_NAME_A5: string;
const PAPER_NAME_B5: string;
const PAPER_NAME_EXECUTIVE: string;
const PAPER_NAME_LEGAL: string;
const PAPER_NAME_LETTER: string;
const PARAM_READABLE: number;
const PARAM_READWRITE: number;
const PARAM_WRITABLE: number;
const PATH_PRIO_MASK: number;
const PRINT_SETTINGS_COLLATE: string;
const PRINT_SETTINGS_DEFAULT_SOURCE: string;
const PRINT_SETTINGS_DITHER: string;
const PRINT_SETTINGS_DUPLEX: string;
const PRINT_SETTINGS_FINISHINGS: string;
const PRINT_SETTINGS_MEDIA_TYPE: string;
const PRINT_SETTINGS_NUMBER_UP: string;
const PRINT_SETTINGS_NUMBER_UP_LAYOUT: string;
const PRINT_SETTINGS_N_COPIES: string;
const PRINT_SETTINGS_ORIENTATION: string;
const PRINT_SETTINGS_OUTPUT_BIN: string;
const PRINT_SETTINGS_OUTPUT_FILE_FORMAT: string;
const PRINT_SETTINGS_OUTPUT_URI: string;
const PRINT_SETTINGS_PAGE_RANGES: string;
const PRINT_SETTINGS_PAGE_SET: string;
const PRINT_SETTINGS_PAPER_FORMAT: string;
const PRINT_SETTINGS_PAPER_HEIGHT: string;
const PRINT_SETTINGS_PAPER_WIDTH: string;
const PRINT_SETTINGS_PRINTER: string;
const PRINT_SETTINGS_PRINTER_LPI: string;
const PRINT_SETTINGS_PRINT_PAGES: string;
const PRINT_SETTINGS_QUALITY: string;
const PRINT_SETTINGS_RESOLUTION: string;
const PRINT_SETTINGS_RESOLUTION_X: string;
const PRINT_SETTINGS_RESOLUTION_Y: string;
const PRINT_SETTINGS_REVERSE: string;
const PRINT_SETTINGS_SCALE: string;
const PRINT_SETTINGS_USE_COLOR: string;
const PRINT_SETTINGS_WIN32_DRIVER_EXTRA: string;
const PRINT_SETTINGS_WIN32_DRIVER_VERSION: string;
const PRIORITY_REDRAW: number;
const PRIORITY_RESIZE: number;
/**
* The "About" item.
* <inlinegraphic fileref="help-about.png" format="PNG"></inlinegraphic>
*/
const STOCK_ABOUT: string;
/**
* The "Add" item.
* <inlinegraphic fileref="list-add.png" format="PNG"></inlinegraphic>
*/
const STOCK_ADD: string;
/**
* The "Apply" item.
* <inlinegraphic fileref="gtk-apply.png" format="PNG"></inlinegraphic>
*/
const STOCK_APPLY: string;
/**
* The "Bold" item.
* <inlinegraphic fileref="format-text-bold.png" format="PNG"></inlinegraphic>
*/
const STOCK_BOLD: string;
/**
* The "Cancel" item.
* <inlinegraphic fileref="gtk-cancel.png" format="PNG"></inlinegraphic>
*/
const STOCK_CANCEL: string;
/**
* The "Caps Lock Warning" icon.
* <inlinegraphic fileref="gtk-caps-lock-warning.png" format="PNG"></inlinegraphic>
*/
const STOCK_CAPS_LOCK_WARNING: string;
/**
* The "CD-Rom" item.
* <inlinegraphic fileref="media-optical.png" format="PNG"></inlinegraphic>
*/
const STOCK_CDROM: string;
/**
* The "Clear" item.
* <inlinegraphic fileref="edit-clear.png" format="PNG"></inlinegraphic>
*/
const STOCK_CLEAR: string;
/**
* The "Close" item.
* <inlinegraphic fileref="window-close.png" format="PNG"></inlinegraphic>
*/
const STOCK_CLOSE: string;
/**
* The "Color Picker" item.
* <inlinegraphic fileref="gtk-color-picker.png" format="PNG"></inlinegraphic>
*/
const STOCK_COLOR_PICKER: string;
/**
* The "Connect" icon.
* <inlinegraphic fileref="gtk-connect.png" format="PNG"></inlinegraphic>
*/
const STOCK_CONNECT: string;
/**
* The "Convert" item.
* <inlinegraphic fileref="gtk-convert.png" format="PNG"></inlinegraphic>
*/
const STOCK_CONVERT: string;
/**
* The "Copy" item.
* <inlinegraphic fileref="edit-copy.png" format="PNG"></inlinegraphic>
*/
const STOCK_COPY: string;
/**
* The "Cut" item.
* <inlinegraphic fileref="edit-cut.png" format="PNG"></inlinegraphic>
*/
const STOCK_CUT: string;
/**
* The "Delete" item.
* <inlinegraphic fileref="edit-delete.png" format="PNG"></inlinegraphic>
*/
const STOCK_DELETE: string;
/**
* The "Authentication" item.
* <inlinegraphic fileref="dialog-password.png" format="PNG"></inlinegraphic>
*/
const STOCK_DIALOG_AUTHENTICATION: string;
/**
* The "Error" item.
* <inlinegraphic fileref="dialog-error.png" format="PNG"></inlinegraphic>
*/
const STOCK_DIALOG_ERROR: string;
/**
* The "Information" item.
* <inlinegraphic fileref="dialog-information.png" format="PNG"></inlinegraphic>
*/
const STOCK_DIALOG_INFO: string;
/**
* The "Question" item.
* <inlinegraphic fileref="dialog-question.png" format="PNG"></inlinegraphic>
*/
const STOCK_DIALOG_QUESTION: string;
/**
* The "Warning" item.
* <inlinegraphic fileref="dialog-warning.png" format="PNG"></inlinegraphic>
*/
const STOCK_DIALOG_WARNING: string;
/**
* The "Directory" icon.
* <inlinegraphic fileref="folder.png" format="PNG"></inlinegraphic>
*/
const STOCK_DIRECTORY: string;
/**
* The "Discard" item.
*/
const STOCK_DISCARD: string;
/**
* The "Disconnect" icon.
* <inlinegraphic fileref="gtk-disconnect.png" format="PNG"></inlinegraphic>
*/
const STOCK_DISCONNECT: string;
/**
* The "Drag-And-Drop" icon.
* <inlinegraphic fileref="gtk-dnd.png" format="PNG"></inlinegraphic>
*/
const STOCK_DND: string;
/**
* The "Drag-And-Drop multiple" icon.
* <inlinegraphic fileref="gtk-dnd-multiple.png" format="PNG"></inlinegraphic>
*/
const STOCK_DND_MULTIPLE: string;
/**
* The "Edit" item.
* <inlinegraphic fileref="gtk-edit.png" format="PNG"></inlinegraphic>
*/
const STOCK_EDIT: string;
/**
* The "Execute" item.
* <inlinegraphic fileref="system-run.png" format="PNG"></inlinegraphic>
*/
const STOCK_EXECUTE: string;
/**
* The "File" icon.
* <inlinegraphic fileref="document-x-generic.png" format="PNG"></inlinegraphic>
*/
const STOCK_FILE: string;
/**
* The "Find" item.
* <inlinegraphic fileref="edit-find.png" format="PNG"></inlinegraphic>
*/
const STOCK_FIND: string;
/**
* The "Find and Replace" item.
* <inlinegraphic fileref="edit-find-replace.png" format="PNG"></inlinegraphic>
*/
const STOCK_FIND_AND_REPLACE: string;
/**
* The "Floppy" item.
* <inlinegraphic fileref="media-floppy.png" format="PNG"></inlinegraphic>
*/
const STOCK_FLOPPY: string;
/**
* The "Fullscreen" item.
* <inlinegraphic fileref="view-fullscreen.png" format="PNG"></inlinegraphic>
*/
const STOCK_FULLSCREEN: string;
/**
* The "Bottom" item.
* <inlinegraphic fileref="go-bottom.png" format="PNG"></inlinegraphic>
*/
const STOCK_GOTO_BOTTOM: string;
/**
* The "First" item.
* <inlinegraphic fileref="go-first-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="go-first-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_GOTO_FIRST: string;
/**
* The "Last" item.
* <inlinegraphic fileref="go-last-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="go-last-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_GOTO_LAST: string;
/**
* The "Top" item.
* <inlinegraphic fileref="go-top.png" format="PNG"></inlinegraphic>
*/
const STOCK_GOTO_TOP: string;
/**
* The "Back" item.
* <inlinegraphic fileref="go-previous-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="go-previous-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_GO_BACK: string;
/**
* The "Down" item.
* <inlinegraphic fileref="go-down.png" format="PNG"></inlinegraphic>
*/
const STOCK_GO_DOWN: string;
/**
* The "Forward" item.
* <inlinegraphic fileref="go-next-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="go-next-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_GO_FORWARD: string;
/**
* The "Up" item.
* <inlinegraphic fileref="go-up.png" format="PNG"></inlinegraphic>
*/
const STOCK_GO_UP: string;
/**
* The "Harddisk" item.
* <inlinegraphic fileref="drive-harddisk.png" format="PNG"></inlinegraphic>
*/
const STOCK_HARDDISK: string;
/**
* The "Help" item.
* <inlinegraphic fileref="help-contents.png" format="PNG"></inlinegraphic>
*/
const STOCK_HELP: string;
/**
* The "Home" item.
* <inlinegraphic fileref="go-home.png" format="PNG"></inlinegraphic>
*/
const STOCK_HOME: string;
/**
* The "Indent" item.
* <inlinegraphic fileref="gtk-indent-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="gtk-indent-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_INDENT: string;
/**
* The "Index" item.
* <inlinegraphic fileref="gtk-index.png" format="PNG"></inlinegraphic>
*/
const STOCK_INDEX: string;
/**
* The "Info" item.
* <inlinegraphic fileref="dialog-information.png" format="PNG"></inlinegraphic>
*/
const STOCK_INFO: string;
/**
* The "Italic" item.
* <inlinegraphic fileref="format-text-italic.png" format="PNG"></inlinegraphic>
*/
const STOCK_ITALIC: string;
/**
* The "Jump to" item.
* <inlinegraphic fileref="go-jump-ltr.png" format="PNG"></inlinegraphic>
* RTL-variant
* <inlinegraphic fileref="go-jump-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_JUMP_TO: string;
/**
* The "Center" item.
* <inlinegraphic fileref="format-justify-center.png" format="PNG"></inlinegraphic>
*/
const STOCK_JUSTIFY_CENTER: string;
/**
* The "Fill" item.
* <inlinegraphic fileref="format-justify-fill.png" format="PNG"></inlinegraphic>
*/
const STOCK_JUSTIFY_FILL: string;
/**
* The "Left" item.
* <inlinegraphic fileref="format-justify-left.png" format="PNG"></inlinegraphic>
*/
const STOCK_JUSTIFY_LEFT: string;
/**
* The "Right" item.
* <inlinegraphic fileref="format-justify-right.png" format="PNG"></inlinegraphic>
*/
const STOCK_JUSTIFY_RIGHT: string;
/**
* The "Leave Fullscreen" item.
* <inlinegraphic fileref="view-restore.png" format="PNG"></inlinegraphic>
*/
const STOCK_LEAVE_FULLSCREEN: string;
/**
* The "Media Forward" item.
* <inlinegraphic fileref="media-seek-forward-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="media-seek-forward-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_FORWARD: string;
/**
* The "Media Next" item.
* <inlinegraphic fileref="media-skip-forward-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="media-skip-forward-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_NEXT: string;
/**
* The "Media Pause" item.
* <inlinegraphic fileref="media-playback-pause.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_PAUSE: string;
/**
* The "Media Play" item.
* <inlinegraphic fileref="media-playback-start-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="media-playback-start-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_PLAY: string;
/**
* The "Media Previous" item.
* <inlinegraphic fileref="media-skip-backward-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="media-skip-backward-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_PREVIOUS: string;
/**
* The "Media Record" item.
* <inlinegraphic fileref="media-record.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_RECORD: string;
/**
* The "Media Rewind" item.
* <inlinegraphic fileref="media-seek-backward-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="media-seek-backward-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_REWIND: string;
/**
* The "Media Stop" item.
* <inlinegraphic fileref="media-playback-stop.png" format="PNG"></inlinegraphic>
*/
const STOCK_MEDIA_STOP: string;
/**
* The "Missing image" icon.
* <inlinegraphic fileref="image-missing.png" format="PNG"></inlinegraphic>
*/
const STOCK_MISSING_IMAGE: string;
/**
* The "Network" item.
* <inlinegraphic fileref="network-idle.png" format="PNG"></inlinegraphic>
*/
const STOCK_NETWORK: string;
/**
* The "New" item.
* <inlinegraphic fileref="document-new.png" format="PNG"></inlinegraphic>
*/
const STOCK_NEW: string;
/**
* The "No" item.
* <inlinegraphic fileref="gtk-no.png" format="PNG"></inlinegraphic>
*/
const STOCK_NO: string;
/**
* The "OK" item.
* <inlinegraphic fileref="gtk-ok.png" format="PNG"></inlinegraphic>
*/
const STOCK_OK: string;
/**
* The "Open" item.
* <inlinegraphic fileref="document-open.png" format="PNG"></inlinegraphic>
*/
const STOCK_OPEN: string;
/**
* The "Landscape Orientation" item.
* <inlinegraphic fileref="gtk-orientation-landscape.png" format="PNG"></inlinegraphic>
*/
const STOCK_ORIENTATION_LANDSCAPE: string;
/**
* The "Portrait Orientation" item.
* <inlinegraphic fileref="gtk-orientation-portrait.png" format="PNG"></inlinegraphic>
*/
const STOCK_ORIENTATION_PORTRAIT: string;
/**
* The "Reverse Landscape Orientation" item.
* <inlinegraphic fileref="gtk-orientation-reverse-landscape.png" format="PNG"></inlinegraphic>
*/
const STOCK_ORIENTATION_REVERSE_LANDSCAPE: string;
/**
* The "Reverse Portrait Orientation" item.
* <inlinegraphic fileref="gtk-orientation-reverse-portrait.png" format="PNG"></inlinegraphic>
*/
const STOCK_ORIENTATION_REVERSE_PORTRAIT: string;
/**
* The "Page Setup" item.
* <inlinegraphic fileref="gtk-page-setup.png" format="PNG"></inlinegraphic>
*/
const STOCK_PAGE_SETUP: string;
/**
* The "Paste" item.
* <inlinegraphic fileref="edit-paste.png" format="PNG"></inlinegraphic>
*/
const STOCK_PASTE: string;
/**
* The "Preferences" item.
* <inlinegraphic fileref="gtk-preferences.png" format="PNG"></inlinegraphic>
*/
const STOCK_PREFERENCES: string;
/**
* The "Print" item.
* <inlinegraphic fileref="document-print.png" format="PNG"></inlinegraphic>
*/
const STOCK_PRINT: string;
/**
* The "Print Error" icon.
* <inlinegraphic fileref="printer-error.png" format="PNG"></inlinegraphic>
*/
const STOCK_PRINT_ERROR: string;
/**
* The "Print Paused" icon.
* <inlinegraphic fileref="printer-paused.png" format="PNG"></inlinegraphic>
*/
const STOCK_PRINT_PAUSED: string;
/**
* The "Print Preview" item.
* <inlinegraphic fileref="document-print-preview.png" format="PNG"></inlinegraphic>
*/
const STOCK_PRINT_PREVIEW: string;
/**
* The "Print Report" icon.
* <inlinegraphic fileref="printer-info.png" format="PNG"></inlinegraphic>
*/
const STOCK_PRINT_REPORT: string;
/**
* The "Print Warning" icon.
* <inlinegraphic fileref="printer-warning.png" format="PNG"></inlinegraphic>
*/
const STOCK_PRINT_WARNING: string;
/**
* The "Properties" item.
* <inlinegraphic fileref="document-properties.png" format="PNG"></inlinegraphic>
*/
const STOCK_PROPERTIES: string;
/**
* The "Quit" item.
* <inlinegraphic fileref="application-exit.png" format="PNG"></inlinegraphic>
*/
const STOCK_QUIT: string;
/**
* The "Redo" item.
* <inlinegraphic fileref="edit-redo-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="edit-redo-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_REDO: string;
/**
* The "Refresh" item.
* <inlinegraphic fileref="view-refresh.png" format="PNG"></inlinegraphic>
*/
const STOCK_REFRESH: string;
/**
* The "Remove" item.
* <inlinegraphic fileref="list-remove.png" format="PNG"></inlinegraphic>
*/
const STOCK_REMOVE: string;
/**
* The "Revert" item.
* <inlinegraphic fileref="document-revert-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="document-revert-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_REVERT_TO_SAVED: string;
/**
* The "Save" item.
* <inlinegraphic fileref="document-save.png" format="PNG"></inlinegraphic>
*/
const STOCK_SAVE: string;
/**
* The "Save As" item.
* <inlinegraphic fileref="document-save-as.png" format="PNG"></inlinegraphic>
*/
const STOCK_SAVE_AS: string;
/**
* The "Select All" item.
* <inlinegraphic fileref="edit-select-all.png" format="PNG"></inlinegraphic>
*/
const STOCK_SELECT_ALL: string;
/**
* The "Color" item.
* <inlinegraphic fileref="gtk-select-color.png" format="PNG"></inlinegraphic>
*/
const STOCK_SELECT_COLOR: string;
/**
* The "Font" item.
* <inlinegraphic fileref="gtk-font.png" format="PNG"></inlinegraphic>
*/
const STOCK_SELECT_FONT: string;
/**
* The "Ascending" item.
* <inlinegraphic fileref="view-sort-ascending.png" format="PNG"></inlinegraphic>
*/
const STOCK_SORT_ASCENDING: string;
/**
* The "Descending" item.
* <inlinegraphic fileref="view-sort-descending.png" format="PNG"></inlinegraphic>
*/
const STOCK_SORT_DESCENDING: string;
/**
* The "Spell Check" item.
* <inlinegraphic fileref="tools-check-spelling.png" format="PNG"></inlinegraphic>
*/
const STOCK_SPELL_CHECK: string;
/**
* The "Stop" item.
* <inlinegraphic fileref="process-stop.png" format="PNG"></inlinegraphic>
*/
const STOCK_STOP: string;
/**
* The "Strikethrough" item.
* <inlinegraphic fileref="format-text-strikethrough.png" format="PNG"></inlinegraphic>
*/
const STOCK_STRIKETHROUGH: string;
/**
* The "Undelete" item.
* <inlinegraphic fileref="gtk-undelete-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="gtk-undelete-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_UNDELETE: string;
/**
* The "Underline" item.
* <inlinegraphic fileref="format-text-underline.png" format="PNG"></inlinegraphic>
*/
const STOCK_UNDERLINE: string;
/**
* The "Undo" item.
* <inlinegraphic fileref="edit-undo-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="edit-undo-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_UNDO: string;
/**
* The "Unindent" item.
* <inlinegraphic fileref="format-indent-less-ltr.png" format="PNG"></inlinegraphic>
* RTL variant
* <inlinegraphic fileref="format-indent-less-rtl.png" format="PNG"></inlinegraphic>
*/
const STOCK_UNINDENT: string;
/**
* The "Yes" item.
* <inlinegraphic fileref="gtk-yes.png" format="PNG"></inlinegraphic>
*/
const STOCK_YES: string;
/**
* The "Zoom 100%" item.
* <inlinegraphic fileref="zoom-original.png" format="PNG"></inlinegraphic>
*/
const STOCK_ZOOM_100: string;
/**
* The "Zoom to Fit" item.
* <inlinegraphic fileref="zoom-fit-best.png" format="PNG"></inlinegraphic>
*/
const STOCK_ZOOM_FIT: string;
/**
* The "Zoom In" item.
* <inlinegraphic fileref="zoom-in.png" format="PNG"></inlinegraphic>
*/
const STOCK_ZOOM_IN: string;
/**
* The "Zoom Out" item.
* <inlinegraphic fileref="zoom-out.png" format="PNG"></inlinegraphic>
*/
const STOCK_ZOOM_OUT: string;
const TEXT_VIEW_PRIORITY_VALIDATE: number;
const TOGGLE_GROUP_MOD_MASK: number;
const TYPE_FUNDAMENTAL_LAST: number;
/**
* Finds the first accelerator in any #GtkAccelGroup attached
* to `object` that matches `accel_key` and `accel_mods,` and
* activates that accelerator.
* @param object the #GObject, usually a #GtkWindow, on which to activate the accelerator.
* @param accel_key accelerator keyval from a key event
* @param accel_mods keyboard state mask from a key event
* @returns %TRUE if an accelerator was activated and handled this keypress
*/
function accel_groups_activate(
object: GObject.Object,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Gets a list of all accel groups which are attached to `object`.
* @param object a #GObject, usually a #GtkWindow
* @returns a list of all accel groups which are attached to @object
*/
function accel_groups_from_object(object: GObject.Object): AccelGroup[];
/**
* Gets the value set by gtk_accelerator_set_default_mod_mask().
* @returns the default accelerator modifier mask
*/
function accelerator_get_default_mod_mask(): number;
/**
* Converts an accelerator keyval and modifier mask into a string
* which can be used to represent the accelerator to the user.
* @param accelerator_key accelerator keyval
* @param accelerator_mods accelerator modifier mask
* @returns a newly-allocated string representing the accelerator.
*/
function accelerator_get_label(accelerator_key: number, accelerator_mods: Gdk.ModifierType | null): string;
/**
* Converts an accelerator keyval and modifier mask
* into a string parseable by gtk_accelerator_parse().
* For example, if you pass in #GDK_q and #GDK_CONTROL_MASK,
* this function returns "&lt;Control&gt;q".
*
* If you need to display accelerators in the user interface,
* see gtk_accelerator_get_label().
* @param accelerator_key accelerator keyval
* @param accelerator_mods accelerator modifier mask
* @returns a newly-allocated accelerator name
*/
function accelerator_name(accelerator_key: number, accelerator_mods: Gdk.ModifierType | null): string;
/**
* Parses a string representing an accelerator. The
* format looks like "&lt;Control&gt;a" or "&lt;Shift&gt;&lt;Alt&gt;F1" or
* "&lt;Release&gt;z" (the last one is for key release).
* The parser is fairly liberal and allows lower or upper case,
* and also abbreviations such as "&lt;Ctl&gt;" and "&lt;Ctrl&gt;".
* Key names are parsed using gdk_keyval_from_name(). For character keys the
* name is not the symbol, but the lowercase name, e.g. one would use
* "&lt;Ctrl&gt;minus" instead of "&lt;Ctrl&gt;-".
*
* If the parse fails, `accelerator_key` and `accelerator_mods` will
* be set to 0 (zero).
* @param accelerator string representing an accelerator
*/
function accelerator_parse(accelerator: string): [number, Gdk.ModifierType | null];
/**
* Sets the modifiers that will be considered significant for keyboard
* accelerators. The default mod mask is #GDK_CONTROL_MASK |
* #GDK_SHIFT_MASK | #GDK_MOD1_MASK | #GDK_SUPER_MASK |
* #GDK_HYPER_MASK | #GDK_META_MASK, that is, Control, Shift, Alt,
* Super, Hyper and Meta. Other modifiers will by default be ignored
* by #GtkAccelGroup.
* You must include at least the three modifiers Control, Shift
* and Alt in any value you pass to this function.
*
* The default mod mask should be changed on application startup,
* before using any accelerator groups.
* @param default_mod_mask accelerator modifier mask
*/
function accelerator_set_default_mod_mask(default_mod_mask: Gdk.ModifierType | null): void;
/**
* Determines whether a given keyval and modifier mask constitute
* a valid keyboard accelerator. For example, the #GDK_a keyval
* plus #GDK_CONTROL_MASK is valid - this is a "Ctrl+a" accelerator.
* But, you can't, for instance, use the #GDK_Control_L keyval
* as an accelerator.
* @param keyval a GDK keyval
* @param modifiers modifier mask
* @returns %TRUE if the accelerator is valid
*/
function accelerator_valid(keyval: number, modifiers: Gdk.ModifierType | null): boolean;
/**
* Returns %TRUE if dialogs are expected to use an alternative
* button order on the screen `screen`. See
* gtk_dialog_set_alternative_button_order() for more details
* about alternative button order.
*
* If you need to use this function, you should probably connect
* to the ::notify:gtk-alternative-button-order signal on the
* #GtkSettings object associated to `screen,` in order to be
* notified if the button order setting changes.
* @param screen a #GdkScreen, or %NULL to use the default screen
* @returns Whether the alternative button order should be used
*/
function alternative_dialog_button_order(screen?: Gdk.Screen | null): boolean;
/**
* Override or install a new key binding for `keyval` with `modifiers` on
* `binding_set`.
* @param binding_set a #GtkBindingSet to add a signal to
* @param keyval key value
* @param modifiers key modifier
* @param signal_name signal name to be bound
* @param binding_args list of #GtkBindingArg signal arguments
*/
function binding_entry_add_signall(
binding_set: BindingSet,
keyval: number,
modifiers: Gdk.ModifierType | null,
signal_name: string,
binding_args: BindingArg[],
): void;
/**
* Clears a binding entry.
* @param binding_set binding set to clear an entry of
* @param keyval key value of binding to clear
* @param modifiers key modifier of binding to clear
*/
function binding_entry_clear(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType | null): void;
/**
* Remove a binding previously installed via
* gtk_binding_entry_add_signal() on `binding_set`.
* @param binding_set a #GtkBindingSet to remove an entry of
* @param keyval key value of binding to remove
* @param modifiers key modifier of binding to remove
*/
function binding_entry_remove(
binding_set: BindingSet,
keyval: number,
modifiers: Gdk.ModifierType | null,
): void;
/**
* Install a binding on `binding_set` which causes key lookups
* to be aborted, to prevent bindings from lower priority sets
* to be activated.
* @param binding_set a #GtkBindingSet to skip an entry of
* @param keyval key value of binding to skip
* @param modifiers key modifier of binding to skip
*/
function binding_entry_skip(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType | null): void;
/**
* Parse a binding entry from a gtkrc file.
* @param scanner GtkRC scanner
* @returns expected token upon errors, %G_TOKEN_NONE on success.
*/
function binding_parse_binding(scanner: GLib.Scanner): number;
/**
* Find a binding set by its globally unique name. The `set_name` can
* either be a name used for gtk_binding_set_new() or the type name of
* a class used in gtk_binding_set_by_class().
* @param set_name unique binding set name
* @returns %NULL or the specified binding set
*/
function binding_set_find(set_name: string): BindingSet;
/**
* Find a key binding matching `keyval` and `modifiers` and activate the
* binding on `object`.
* @param object object to activate when binding found
* @param keyval key value of the binding
* @param modifiers key modifier of the binding
* @returns %TRUE if a binding was found and activated
*/
function bindings_activate(object: Object, keyval: number, modifiers: Gdk.ModifierType | null): boolean;
/**
* Looks up key bindings for `object` to find one matching
* `event,` and if one was found, activate it.
* @param object a #GtkObject (generally must be a widget)
* @param event a #GdkEventKey
* @returns %TRUE if a matching key binding was found
*/
function bindings_activate_event(object: Object, event: Gdk.EventKey): boolean;
function builder_error_quark(): GLib.Quark;
/**
* Checks that the GTK+ library in use is compatible with the
* given version. Generally you would pass in the constants
* #GTK_MAJOR_VERSION, #GTK_MINOR_VERSION, #GTK_MICRO_VERSION
* as the three arguments to this function; that produces
* a check that the library in use is compatible with
* the version of GTK+ the application or module was compiled
* against.
*
* Compatibility is defined by two things: first the version
* of the running library is newer than the version
* `required_major`.required_minor.`required_micro`. Second
* the running library must be binary compatible with the
* version `required_major`.required_minor.`required_micro`
* (same major version.)
*
* This function is primarily for GTK+ modules; the module
* can call this function to check that it wasn't loaded
* into an incompatible version of GTK+. However, such a
* a check isn't completely reliable, since the module may be
* linked against an old version of GTK+ and calling the
* old version of gtk_check_version(), but still get loaded
* into an application using a newer version of GTK+.
* @param required_major the required major version.
* @param required_minor the required minor version.
* @param required_micro the required micro version.
* @returns %NULL if the GTK+ library is compatible with the given version, or a string describing the version mismatch. The returned string is owned by GTK+ and should not be modified or freed.
*/
function check_version(required_major: number, required_minor: number, required_micro: number): string;
function ctree_node_get_type(): GObject.GType;
/**
* Prevents gtk_init(), gtk_init_check(), gtk_init_with_args() and
* gtk_parse_args() from automatically
* calling <literal>setlocale (LC_ALL, "")</literal>. You would
* want to use this function if you wanted to set the locale for
* your program to something other than the user's locale, or if
* you wanted to set different values for different locale categories.
*
* Most programs should not need to call this function.
*/
function disable_setlocale(): void;
/**
* Initiates a drag on the source side. The function
* only needs to be used when the application is
* starting drags itself, and is not needed when
* gtk_drag_source_set() is used.
*
* The `event` is used to retrieve the timestamp that will be used internally to
* grab the pointer. If `event` is #NULL, then GDK_CURRENT_TIME will be used.
* However, you should try to pass a real event in all cases, since that can be
* used by GTK+ to get information about the start position of the drag, for
* example if the `event` is a GDK_MOTION_NOTIFY.
*
* Generally there are three cases when you want to start a drag by hand by calling
* this function:
*
* 1. During a button-press-event handler, if you want to start a drag immediately
* when the user presses the mouse button. Pass the `event` that you have in your
* button-press-event handler.
*
* 2. During a motion-notify-event handler, if you want to start a drag when the mouse
* moves past a certain threshold distance after a button-press. Pass the `event` that you
* have in your motion-notify-event handler.
*
* 3. During a timeout handler, if you want to start a drag after the mouse
* button is held down for some time. Try to save the last event that you got
* from the mouse, using gdk_event_copy(), and pass it to this function
* (remember to free the event with gdk_event_free() when you are done). If you
* can really not pass a real event, pass #NULL instead.
* @param widget the source widget.
* @param targets The targets (data formats) in which the source can provide the data.
* @param actions A bitmask of the allowed drag actions for this drag.
* @param button The button the user clicked to start the drag.
* @param event The event that triggered the start of the drag.
* @returns the context for this drag.
*/
function drag_begin(
widget: Widget,
targets: TargetList,
actions: Gdk.DragAction | null,
button: number,
event: Gdk.Event,
): Gdk.DragContext;
/**
* Checks to see if a mouse drag starting at (`start_x,` `start_y)` and ending
* at (`current_x,` `current_y)` has passed the GTK+ drag threshold, and thus
* should trigger the beginning of a drag-and-drop operation.
* @param widget a #GtkWidget
* @param start_x X coordinate of start of drag
* @param start_y Y coordinate of start of drag
* @param current_x current X coordinate
* @param current_y current Y coordinate
* @returns %TRUE if the drag threshold has been passed.
*/
function drag_check_threshold(
widget: Widget,
start_x: number,
start_y: number,
current_x: number,
current_y: number,
): boolean;
/**
* Add the image targets supported by #GtkSelection to
* the target list of the drag destination. The targets
* are added with `info` = 0. If you need another value,
* use gtk_target_list_add_image_targets() and
* gtk_drag_dest_set_target_list().
* @param widget a #GtkWidget that's a drag destination
*/
function drag_dest_add_image_targets(widget: Widget): void;
/**
* Add the text targets supported by #GtkSelection to
* the target list of the drag destination. The targets
* are added with `info` = 0. If you need another value,
* use gtk_target_list_add_text_targets() and
* gtk_drag_dest_set_target_list().
* @param widget a #GtkWidget that's a drag destination
*/
function drag_dest_add_text_targets(widget: Widget): void;
/**
* Add the URI targets supported by #GtkSelection to
* the target list of the drag destination. The targets
* are added with `info` = 0. If you need another value,
* use gtk_target_list_add_uri_targets() and
* gtk_drag_dest_set_target_list().
* @param widget a #GtkWidget that's a drag destination
*/
function drag_dest_add_uri_targets(widget: Widget): void;
function drag_dest_find_target(
widget: Widget,
context: Gdk.DragContext,
target_list?: TargetList | null,
): Gdk.Atom;
/**
* Returns the list of targets this widget can accept from
* drag-and-drop.
* @param widget a #GtkWidget
* @returns the #GtkTargetList, or %NULL if none
*/
function drag_dest_get_target_list(widget: Widget): TargetList;
/**
* Returns whether the widget has been configured to always
* emit ::drag-motion signals.
* @param widget a #GtkWidget that's a drag destination
* @returns %TRUE if the widget always emits ::drag-motion events
*/
function drag_dest_get_track_motion(widget: Widget): boolean;
/**
* Sets a widget as a potential drop destination, and adds default behaviors.
*
* The default behaviors listed in `flags` have an effect similar
* to installing default handlers for the widget's drag-and-drop signals
* (#GtkWidget:drag-motion, #GtkWidget:drag-drop, ...). They all exist
* for convenience. When passing #GTK_DEST_DEFAULT_ALL for instance it is
* sufficient to connect to the widget's #GtkWidget::drag-data-received
* signal to get primitive, but consistent drag-and-drop support.
*
* Things become more complicated when you try to preview the dragged data,
* as described in the documentation for #GtkWidget:drag-motion. The default
* behaviors described by `flags` make some assumptions, that can conflict
* with your own signal handlers. For instance #GTK_DEST_DEFAULT_DROP causes
* invokations of gdk_drag_status() in the context of #GtkWidget:drag-motion,
* and invokations of gtk_drag_finish() in #GtkWidget:drag-data-received.
* Especially the later is dramatic, when your own #GtkWidget:drag-motion
* handler calls gtk_drag_get_data() to inspect the dragged data.
*
* There's no way to set a default action here, you can use the
* #GtkWidget:drag-motion callback for that. Here's an example which selects
* the action to use depending on whether the control key is pressed or not:
*
* ```
* static void
* drag_motion (GtkWidget *widget,
* GdkDragContext *context,
* gint x,
* gint y,
* guint time)
* {
* GdkModifierType mask;
*
* gdk_window_get_pointer (gtk_widget_get_window (widget),
* NULL, NULL, &mask);
* if (mask & GDK_CONTROL_MASK)
* gdk_drag_status (context, GDK_ACTION_COPY, time);
* else
* gdk_drag_status (context, GDK_ACTION_MOVE, time);
* }
* ```
*
* @param widget a #GtkWidget
* @param flags which types of default drag behavior to use
* @param targets a pointer to an array of #GtkTargetEntry<!-- -->s indicating the drop types that this @widget will accept, or %NULL. Later you can access the list with gtk_drag_dest_get_target_list() and gtk_drag_dest_find_target().
* @param actions a bitmask of possible actions for a drop onto this @widget.
*/
function drag_dest_set(
widget: Widget,
flags: DestDefaults | null,
targets: TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
function drag_dest_set_proxy(
widget: Widget,
proxy_window: Gdk.Window,
protocol: Gdk.DragProtocol | null,
use_coordinates: boolean,
): void;
/**
* Sets the target types that this widget can accept from drag-and-drop.
* The widget must first be made into a drag destination with
* gtk_drag_dest_set().
* @param widget a #GtkWidget that's a drag destination
* @param target_list list of droppable targets, or %NULL for none
*/
function drag_dest_set_target_list(widget: Widget, target_list?: TargetList | null): void;
/**
* Tells the widget to emit ::drag-motion and ::drag-leave
* events regardless of the targets and the %GTK_DEST_DEFAULT_MOTION
* flag.
*
* This may be used when a widget wants to do generic
* actions regardless of the targets that the source offers.
* @param widget a #GtkWidget that's a drag destination
* @param track_motion whether to accept all targets
*/
function drag_dest_set_track_motion(widget: Widget, track_motion: boolean): void;
function drag_dest_unset(widget: Widget): void;
function drag_finish(context: Gdk.DragContext, success: boolean, del: boolean, time_: number): void;
function drag_get_data(widget: Widget, context: Gdk.DragContext, target: Gdk.Atom, time_: number): void;
/**
* Determines the source widget for a drag.
* @param context a (destination side) drag context
* @returns if the drag is occurring within a single application, a pointer to the source widget. Otherwise, %NULL.
*/
function drag_get_source_widget(context: Gdk.DragContext): Widget;
function drag_highlight(widget: Widget): void;
/**
* Changes the default drag icon. GTK+ retains references for the
* arguments, and will release them when they are no longer needed.
* @param colormap the colormap of the icon
* @param pixmap the image data for the icon
* @param mask the transparency mask for an image, or %NULL
* @param hot_x The X offset within @widget of the hotspot.
* @param hot_y The Y offset within @widget of the hotspot.
*/
function drag_set_default_icon(
colormap: Gdk.Colormap,
pixmap: Gdk.Pixmap,
mask: Gdk.Bitmap | null,
hot_x: number,
hot_y: number,
): void;
/**
* Sets the icon for a particular drag to the default
* icon.
* @param context the context for a drag. (This must be called with a context for the source side of a drag)
*/
function drag_set_icon_default(context: Gdk.DragContext): void;
/**
* Sets the icon for a given drag from a named themed icon. See
* the docs for #GtkIconTheme for more details. Note that the
* size of the icon depends on the icon theme (the icon is
* loaded at the symbolic size #GTK_ICON_SIZE_DND), thus
* `hot_x` and `hot_y` have to be used with care.
* @param context the context for a drag. (This must be called with a context for the source side of a drag)
* @param icon_name name of icon to use
* @param hot_x the X offset of the hotspot within the icon
* @param hot_y the Y offset of the hotspot within the icon
*/
function drag_set_icon_name(context: Gdk.DragContext, icon_name: string, hot_x: number, hot_y: number): void;
/**
* Sets `pixbuf` as the icon for a given drag.
* @param context the context for a drag. (This must be called with a context for the source side of a drag)
* @param pixbuf the #GdkPixbuf to use as the drag icon.
* @param hot_x the X offset within @widget of the hotspot.
* @param hot_y the Y offset within @widget of the hotspot.
*/
function drag_set_icon_pixbuf(
context: Gdk.DragContext,
pixbuf: GdkPixbuf.Pixbuf,
hot_x: number,
hot_y: number,
): void;
/**
* Sets `pixmap` as the icon for a given drag. GTK+ retains
* references for the arguments, and will release them when
* they are no longer needed. In general, gtk_drag_set_icon_pixbuf()
* will be more convenient to use.
* @param context the context for a drag. (This must be called with a context for the source side of a drag)
* @param colormap the colormap of the icon
* @param pixmap the image data for the icon
* @param mask the transparency mask for the icon or %NULL for none.
* @param hot_x the X offset within @pixmap of the hotspot.
* @param hot_y the Y offset within @pixmap of the hotspot.
*/
function drag_set_icon_pixmap(
context: Gdk.DragContext,
colormap: Gdk.Colormap,
pixmap: Gdk.Pixmap,
mask: Gdk.Bitmap | null,
hot_x: number,
hot_y: number,
): void;
/**
* Sets the icon for a given drag from a stock ID.
* @param context the context for a drag. (This must be called with a context for the source side of a drag)
* @param stock_id the ID of the stock icon to use for the drag.
* @param hot_x the X offset within the icon of the hotspot.
* @param hot_y the Y offset within the icon of the hotspot.
*/
function drag_set_icon_stock(context: Gdk.DragContext, stock_id: string, hot_x: number, hot_y: number): void;
/**
* Changes the icon for a widget to a given widget. GTK+
* will not destroy the icon, so if you don't want
* it to persist, you should connect to the "drag-end"
* signal and destroy it yourself.
* @param context the context for a drag. (This must be called with a context for the source side of a drag)
* @param widget a toplevel window to use as an icon.
* @param hot_x the X offset within @widget of the hotspot.
* @param hot_y the Y offset within @widget of the hotspot.
*/
function drag_set_icon_widget(context: Gdk.DragContext, widget: Widget, hot_x: number, hot_y: number): void;
/**
* Add the writable image targets supported by #GtkSelection to
* the target list of the drag source. The targets
* are added with `info` = 0. If you need another value,
* use gtk_target_list_add_image_targets() and
* gtk_drag_source_set_target_list().
* @param widget a #GtkWidget that's is a drag source
*/
function drag_source_add_image_targets(widget: Widget): void;
/**
* Add the text targets supported by #GtkSelection to
* the target list of the drag source. The targets
* are added with `info` = 0. If you need another value,
* use gtk_target_list_add_text_targets() and
* gtk_drag_source_set_target_list().
* @param widget a #GtkWidget that's is a drag source
*/
function drag_source_add_text_targets(widget: Widget): void;
/**
* Add the URI targets supported by #GtkSelection to
* the target list of the drag source. The targets
* are added with `info` = 0. If you need another value,
* use gtk_target_list_add_uri_targets() and
* gtk_drag_source_set_target_list().
* @param widget a #GtkWidget that's is a drag source
*/
function drag_source_add_uri_targets(widget: Widget): void;
/**
* Gets the list of targets this widget can provide for
* drag-and-drop.
* @param widget a #GtkWidget
* @returns the #GtkTargetList, or %NULL if none
*/
function drag_source_get_target_list(widget: Widget): TargetList;
/**
* Sets up a widget so that GTK+ will start a drag operation when the user
* clicks and drags on the widget. The widget must have a window.
* @param widget a #GtkWidget
* @param start_button_mask the bitmask of buttons that can start the drag
* @param targets the table of targets that the drag will support, may be %NULL
* @param actions the bitmask of possible actions for a drag from this widget
*/
function drag_source_set(
widget: Widget,
start_button_mask: Gdk.ModifierType | null,
targets: TargetEntry[] | null,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon that will be used for drags from a particular widget
* from a pixmap/mask. GTK+ retains references for the arguments, and
* will release them when they are no longer needed.
* Use gtk_drag_source_set_icon_pixbuf() instead.
* @param widget a #GtkWidget
* @param colormap the colormap of the icon
* @param pixmap the image data for the icon
* @param mask the transparency mask for an image.
*/
function drag_source_set_icon(
widget: Widget,
colormap: Gdk.Colormap,
pixmap: Gdk.Pixmap,
mask?: Gdk.Bitmap | null,
): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a themed icon. See the docs for #GtkIconTheme for more details.
* @param widget a #GtkWidget
* @param icon_name name of icon to use
*/
function drag_source_set_icon_name(widget: Widget, icon_name: string): void;
/**
* Sets the icon that will be used for drags from a particular widget
* from a #GdkPixbuf. GTK+ retains a reference for `pixbuf` and will
* release it when it is no longer needed.
* @param widget a #GtkWidget
* @param pixbuf the #GdkPixbuf for the drag icon
*/
function drag_source_set_icon_pixbuf(widget: Widget, pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon that will be used for drags from a particular source
* to a stock icon.
* @param widget a #GtkWidget
* @param stock_id the ID of the stock icon to use
*/
function drag_source_set_icon_stock(widget: Widget, stock_id: string): void;
/**
* Changes the target types that this widget offers for drag-and-drop.
* The widget must first be made into a drag source with
* gtk_drag_source_set().
* @param widget a #GtkWidget that's a drag source
* @param target_list list of draggable targets, or %NULL for none
*/
function drag_source_set_target_list(widget: Widget, target_list?: TargetList | null): void;
function drag_source_unset(widget: Widget): void;
function drag_unhighlight(widget: Widget): void;
/**
* Draws an arrow in the given rectangle on `window` using the given
* parameters. `arrow_type` determines the direction of the arrow.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param arrow_type the type of arrow to draw
* @param fill %TRUE if the arrow tip should be filled
* @param x x origin of the rectangle to draw the arrow in
* @param y y origin of the rectangle to draw the arrow in
* @param width width of the rectangle to draw the arrow in
* @param height height of the rectangle to draw the arrow in
*/
function draw_arrow(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
arrow_type: ArrowType | null,
fill: boolean,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a box on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param x x origin of the box
* @param y y origin of the box
* @param width the width of the box
* @param height the height of the box
*/
function draw_box(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a box in `window` using the given style and state and shadow type,
* leaving a gap in one side.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param x x origin of the rectangle
* @param y y origin of the rectangle
* @param width width of the rectangle
* @param height width of the rectangle
* @param gap_side side in which to leave the gap
* @param gap_x starting position of the gap
* @param gap_width width of the gap
*/
function draw_box_gap(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType | null,
gap_x: number,
gap_width: number,
): void;
/**
* Draws a check button indicator in the given rectangle on `window` with
* the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param x x origin of the rectangle to draw the check in
* @param y y origin of the rectangle to draw the check in
* @param width the width of the rectangle to draw the check in
* @param height the height of the rectangle to draw the check in
*/
function draw_check(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a diamond in the given rectangle on `window` using the given
* parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param x x origin of the rectangle to draw the diamond in
* @param y y origin of the rectangle to draw the diamond in
* @param width width of the rectangle to draw the diamond in
* @param height height of the rectangle to draw the diamond in
*/
function draw_diamond(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws an expander as used in #GtkTreeView.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param x the x position to draw the expander at
* @param y the y position to draw the expander at
* @param expander_style the style to draw the expander in
*/
function draw_expander(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
x: number,
y: number,
expander_style: ExpanderStyle | null,
): void;
/**
* Draws an extension, i.e. a notebook tab.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param x x origin of the extension
* @param y y origin of the extension
* @param width width of the extension
* @param height width of the extension
* @param gap_side the side on to which the extension is attached
*/
function draw_extension(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType | null,
): void;
/**
* Draws a flat box on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param x x origin of the box
* @param y y origin of the box
* @param width the width of the box
* @param height the height of the box
*/
function draw_flat_box(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a focus indicator around the given rectangle on `window` using the
* given style.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param x the x origin of the rectangle around which to draw a focus indicator
* @param y the y origin of the rectangle around which to draw a focus indicator
* @param width the width of the rectangle around which to draw a focus indicator
* @param height the height of the rectangle around which to draw a focus indicator
*/
function draw_focus(
style: Style,
window: Gdk.Window,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a handle as used in #GtkHandleBox and #GtkPaned.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param x x origin of the handle
* @param y y origin of the handle
* @param width with of the handle
* @param height height of the handle
* @param orientation the orientation of the handle
*/
function draw_handle(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
orientation: Orientation | null,
): void;
/**
* Draws a horizontal line from (`x1`, `y)` to (`x2`, `y)` in `window`
* using the given style and state.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param x1 the starting x coordinate
* @param x2 the ending x coordinate
* @param y the y coordinate
*/
function draw_hline(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
x1: number,
x2: number,
y: number,
): void;
/**
* Draws a text caret on `drawable` at `location`. This is not a style function
* but merely a convenience function for drawing the standard cursor shape.
* @param widget a #GtkWidget
* @param drawable a #GdkDrawable
* @param area rectangle to which the output is clipped, or %NULL if the output should not be clipped
* @param location location where to draw the cursor (@location->width is ignored)
* @param is_primary if the cursor should be the primary cursor color.
* @param direction whether the cursor is left-to-right or right-to-left. Should never be #GTK_TEXT_DIR_NONE
* @param draw_arrow %TRUE to draw a directional arrow on the cursor. Should be %FALSE unless the cursor is split.
*/
function draw_insertion_cursor(
widget: Widget,
drawable: Gdk.Drawable,
area: Gdk.Rectangle | null,
location: Gdk.Rectangle,
is_primary: boolean,
direction: TextDirection | null,
draw_arrow: boolean,
): void;
/**
* Draws a layout on `window` using the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param use_text whether to use the text or foreground graphics context of @style
* @param x x origin
* @param y y origin
* @param layout the layout to draw
*/
function draw_layout(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
use_text: boolean,
x: number,
y: number,
layout: Pango.Layout,
): void;
/**
* Draws a radio button indicator in the given rectangle on `window` with
* the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param x x origin of the rectangle to draw the option in
* @param y y origin of the rectangle to draw the option in
* @param width the width of the rectangle to draw the option in
* @param height the height of the rectangle to draw the option in
*/
function draw_option(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a polygon on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param points an array of #GdkPoint<!-- -->s
* @param npoints length of @points
* @param fill %TRUE if the polygon should be filled
*/
function draw_polygon(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
points: Gdk.Point,
npoints: number,
fill: boolean,
): void;
/**
* Draws a resize grip in the given rectangle on `window` using the given
* parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param edge the edge in which to draw the resize grip
* @param x the x origin of the rectangle in which to draw the resize grip
* @param y the y origin of the rectangle in which to draw the resize grip
* @param width the width of the rectangle in which to draw the resize grip
* @param height the height of the rectangle in which to draw the resize grip
*/
function draw_resize_grip(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
edge: Gdk.WindowEdge | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a shadow around the given rectangle in `window`
* using the given style and state and shadow type.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param x x origin of the rectangle
* @param y y origin of the rectangle
* @param width width of the rectangle
* @param height width of the rectangle
*/
function draw_shadow(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a shadow around the given rectangle in `window`
* using the given style and state and shadow type, leaving a
* gap in one side.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param x x origin of the rectangle
* @param y y origin of the rectangle
* @param width width of the rectangle
* @param height width of the rectangle
* @param gap_side side in which to leave the gap
* @param gap_x starting position of the gap
* @param gap_width width of the gap
*/
function draw_shadow_gap(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType | null,
gap_x: number,
gap_width: number,
): void;
/**
* Draws a slider in the given rectangle on `window` using the
* given style and orientation.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type a shadow
* @param x the x origin of the rectangle in which to draw a slider
* @param y the y origin of the rectangle in which to draw a slider
* @param width the width of the rectangle in which to draw a slider
* @param height the height of the rectangle in which to draw a slider
* @param orientation the orientation to be used
*/
function draw_slider(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
orientation: Orientation | null,
): void;
/**
* Draws a text string on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param x x origin
* @param y y origin
* @param string the string to draw
*/
function draw_string(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
x: number,
y: number,
string: string,
): void;
/**
* Draws an option menu tab (i.e. the up and down pointing arrows)
* in the given rectangle on `window` using the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param x x origin of the rectangle to draw the tab in
* @param y y origin of the rectangle to draw the tab in
* @param width the width of the rectangle to draw the tab in
* @param height the height of the rectangle to draw the tab in
*/
function draw_tab(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a vertical line from (`x,` `y1`_) to (`x,` `y2`_) in `window`
* using the given style and state.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param y1_ the starting y coordinate
* @param y2_ the ending y coordinate
* @param x the x coordinate
*/
function draw_vline(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
y1_: number,
y2_: number,
x: number,
): void;
function events_pending(): boolean;
function exit(error_code: number): void;
function __false(): boolean;
/**
* Registers an error quark for #GtkFileChooser if necessary.
* @returns The error quark used for #GtkFileChooser errors.
*/
function file_chooser_error_quark(): GLib.Quark;
function gc_release(gc: Gdk.GC): void;
/**
* Obtains a copy of the event currently being processed by GTK+. For
* example, if you get a "clicked" signal from #GtkButton, the current
* event will be the #GdkEventButton that triggered the "clicked"
* signal. The returned event must be freed with gdk_event_free().
* If there is no current event, the function returns %NULL.
* @returns a copy of the current event, or %NULL if no current event.
*/
function get_current_event(): Gdk.Event;
/**
* If there is a current event and it has a state field, place
* that state field in `state` and return %TRUE, otherwise return
* %FALSE.
* @returns %TRUE if there was a current event and it had a state field
*/
function get_current_event_state(): [boolean, Gdk.ModifierType];
/**
* If there is a current event and it has a timestamp, return that
* timestamp, otherwise return %GDK_CURRENT_TIME.
* @returns the timestamp from the current event, or %GDK_CURRENT_TIME.
*/
function get_current_event_time(): number;
/**
* Returns the #PangoLanguage for the default language currently in
* effect. (Note that this can change over the life of an
* application.) The default language is derived from the current
* locale. It determines, for example, whether GTK+ uses the
* right-to-left or left-to-right text direction.
*
* This function is equivalent to pango_language_get_default(). See
* that function for details.
* @returns the default language as a #PangoLanguage, must not be freed
*/
function get_default_language(): Pango.Language;
/**
* If `event` is %NULL or the event was not associated with any widget,
* returns %NULL, otherwise returns the widget that received the event
* originally.
* @param event a #GdkEvent
* @returns the widget that originally received @event, or %NULL
*/
function get_event_widget(event: Gdk.Event): Widget;
/**
* Returns a #GOptionGroup for the commandline arguments recognized
* by GTK+ and GDK. You should add this group to your #GOptionContext
* with g_option_context_add_group(), if you are using
* g_option_context_parse() to parse your commandline arguments.
* @param open_default_display whether to open the default display when parsing the commandline arguments
* @returns a #GOptionGroup for the commandline arguments recognized by GTK+
*/
function get_option_group(open_default_display: boolean): GLib.OptionGroup;
function grab_add(widget: Widget): void;
/**
* Queries the current grab of the default window group.
* @returns The widget which currently has the grab or %NULL if no grab is active
*/
function grab_get_current(): Widget;
function grab_remove(widget: Widget): void;
/**
* Looks up the icon size associated with `name`.
* @param name the name to look up.
* @returns the icon size
*/
function icon_size_from_name(name: string): number;
/**
* Gets the canonical name of the given icon size. The returned string
* is statically allocated and should not be freed.
* @param size a #GtkIconSize.
* @returns the name of the given icon size.
*/
function icon_size_get_name(size: number): string;
/**
* Obtains the pixel size of a semantic icon size, possibly
* modified by user preferences for the default #GtkSettings.
* (See gtk_icon_size_lookup_for_settings().)
* Normally `size` would be
* #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function
* isn't normally needed, gtk_widget_render_icon() is the usual
* way to get an icon for rendering, then just look at the size of
* the rendered pixbuf. The rendered pixbuf may not even correspond to
* the width/height returned by gtk_icon_size_lookup(), because themes
* are free to render the pixbuf however they like, including changing
* the usual size.
* @param size an icon size
* @returns %TRUE if @size was a valid size
*/
function icon_size_lookup(size: number): [boolean, number, number];
/**
* Obtains the pixel size of a semantic icon size, possibly
* modified by user preferences for a particular
* #GtkSettings. Normally `size` would be
* #GTK_ICON_SIZE_MENU, #GTK_ICON_SIZE_BUTTON, etc. This function
* isn't normally needed, gtk_widget_render_icon() is the usual
* way to get an icon for rendering, then just look at the size of
* the rendered pixbuf. The rendered pixbuf may not even correspond to
* the width/height returned by gtk_icon_size_lookup(), because themes
* are free to render the pixbuf however they like, including changing
* the usual size.
* @param settings a #GtkSettings object, used to determine which set of user preferences to used.
* @param size an icon size
* @returns %TRUE if @size was a valid size
*/
function icon_size_lookup_for_settings(settings: Settings, size: number): [boolean, number, number];
/**
* Registers a new icon size, along the same lines as #GTK_ICON_SIZE_MENU,
* etc. Returns the integer value for the size.
* @param name name of the icon size
* @param width the icon width
* @param height the icon height
* @returns integer value representing the size
*/
function icon_size_register(name: string, width: number, height: number): number;
/**
* Registers `alias` as another name for `target`.
* So calling gtk_icon_size_from_name() with `alias` as argument
* will return `target`.
* @param alias an alias for @target
* @param target an existing icon size
*/
function icon_size_register_alias(alias: string, target: number): void;
function icon_theme_error_quark(): GLib.Quark;
function idle_remove(idle_handler_id: number): void;
function idle_remove_by_data(data?: any | null): void;
/**
* Call this function before using any other GTK+ functions in your GUI
* applications. It will initialize everything needed to operate the
* toolkit and parses some standard command line options.
*
* `argc` and `argv` are adjusted accordingly so your own code will
* never see those standard arguments.
*
* Note that there are some alternative ways to initialize GTK+:
* if you are calling gtk_parse_args(), gtk_init_check(),
* gtk_init_with_args() or g_option_context_parse() with
* the option group returned by gtk_get_option_group(),
* you <emphasis>don't</emphasis> have to call gtk_init().
*
* <note><para>
* This function will terminate your program if it was unable to
* initialize the windowing system for some reason. If you want
* your program to fall back to a textual interface you want to
* call gtk_init_check() instead.
* </para></note>
*
* <note><para>
* Since 2.18, GTK+ calls <literal>signal (SIGPIPE, SIG_IGN)</literal>
* during initialization, to ignore SIGPIPE signals, since these are
* almost never wanted in graphical applications. If you do need to
* handle SIGPIPE for some reason, reset the handler after gtk_init(),
* but notice that other libraries (e.g. libdbus or gvfs) might do
* similar things.
* </para></note>
* @param argv Address of the <parameter>argv</parameter> parameter of main(). Any options understood by GTK+ are stripped before return.
*/
function init(argv?: string[] | null): string[] | null;
/**
* This function does the same work as gtk_init() with only
* a single change: It does not terminate the program if the GUI can't be
* initialized. Instead it returns %FALSE on failure.
*
* This way the application can fall back to some other means of communication
* with the user - for example a curses or command line interface.
* @param argv Address of the <parameter>argv</parameter> parameter of main(). Any parameters understood by gtk_init() are stripped before return.
* @returns %TRUE if the GUI has been successfully initialized, %FALSE otherwise.
*/
function init_check(argv?: string[] | null): [boolean, string[] | null];
/**
* This function does the same work as gtk_init_check().
* Additionally, it allows you to add your own commandline options,
* and it automatically generates nicely formatted
* <option>--help</option> output. Note that your program will
* be terminated after writing out the help output.
* @param argv a pointer to the array of command line arguments.
* @param parameter_string a string which is displayed in the first line of <option>--help</option> output, after <literal><replaceable>programname</replaceable> [OPTION...]</literal>
* @param entries a %NULL-terminated array of #GOptionEntry<!-- -->s describing the options of your program
* @param translation_domain a translation domain to use for translating the <option>--help</option> output for the options in @entries and the @parameter_string with gettext(), or %NULL
* @returns %TRUE if the GUI has been successfully initialized, %FALSE otherwise.
*/
function init_with_args(
argv: string[],
parameter_string: string,
entries: GLib.OptionEntry[],
translation_domain: string,
): [boolean, string[]];
function input_remove(input_handler_id: number): void;
function key_snooper_remove(snooper_handler_id: number): void;
function main(): void;
function main_do_event(event: Gdk.Event): void;
function main_iteration(): boolean;
function main_iteration_do(blocking: boolean): boolean;
function main_level(): number;
function main_quit(): void;
function marshal_BOOLEAN__POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_BOOLEAN__POINTER_INT_INT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_BOOLEAN__POINTER_INT_INT_UINT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_BOOLEAN__POINTER_POINTER_INT_INT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_BOOLEAN__POINTER_STRING_STRING_POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_BOOLEAN__VOID(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_ENUM__ENUM(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_INT__POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_INT__POINTER_CHAR_CHAR(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__ENUM_FLOAT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__ENUM_FLOAT_BOOLEAN(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__INT_INT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__INT_INT_POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_INT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_INT_INT_POINTER_UINT_UINT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_POINTER_POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_POINTER_UINT_UINT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_STRING_STRING(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_UINT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_UINT_ENUM(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__POINTER_UINT_UINT(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__STRING_INT_POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__UINT_POINTER_UINT_ENUM_ENUM_POINTER(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__UINT_POINTER_UINT_UINT_ENUM(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
function marshal_VOID__UINT_STRING(
closure: GObject.Closure,
return_value: GObject.Value | any,
n_param_values: number,
param_values: GObject.Value | any,
invocation_hint?: any | null,
marshal_data?: any | null,
): void;
/**
* Draws an arrow in the given rectangle on `window` using the given
* parameters. `arrow_type` determines the direction of the arrow.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param arrow_type the type of arrow to draw
* @param fill %TRUE if the arrow tip should be filled
* @param x x origin of the rectangle to draw the arrow in
* @param y y origin of the rectangle to draw the arrow in
* @param width width of the rectangle to draw the arrow in
* @param height height of the rectangle to draw the arrow in
*/
function paint_arrow(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
arrow_type: ArrowType | null,
fill: boolean,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a box on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the box
* @param y y origin of the box
* @param width the width of the box
* @param height the height of the box
*/
function paint_box(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a box in `window` using the given style and state and shadow type,
* leaving a gap in one side.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the rectangle
* @param y y origin of the rectangle
* @param width width of the rectangle
* @param height width of the rectangle
* @param gap_side side in which to leave the gap
* @param gap_x starting position of the gap
* @param gap_width width of the gap
*/
function paint_box_gap(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType | null,
gap_x: number,
gap_width: number,
): void;
/**
* Draws a check button indicator in the given rectangle on `window` with
* the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the rectangle to draw the check in
* @param y y origin of the rectangle to draw the check in
* @param width the width of the rectangle to draw the check in
* @param height the height of the rectangle to draw the check in
*/
function paint_check(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a diamond in the given rectangle on `window` using the given
* parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the rectangle to draw the diamond in
* @param y y origin of the rectangle to draw the diamond in
* @param width width of the rectangle to draw the diamond in
* @param height height of the rectangle to draw the diamond in
*/
function paint_diamond(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws an expander as used in #GtkTreeView. `x` and `y` specify the
* center the expander. The size of the expander is determined by the
* "expander-size" style property of `widget`. (If widget is not
* specified or doesn't have an "expander-size" property, an
* unspecified default size will be used, since the caller doesn't
* have sufficient information to position the expander, this is
* likely not useful.) The expander is expander_size pixels tall
* in the collapsed position and expander_size pixels wide in the
* expanded position.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x the x position to draw the expander at
* @param y the y position to draw the expander at
* @param expander_style the style to draw the expander in; determines whether the expander is collapsed, expanded, or in an intermediate state.
*/
function paint_expander(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
expander_style: ExpanderStyle | null,
): void;
/**
* Draws an extension, i.e. a notebook tab.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the extension
* @param y y origin of the extension
* @param width width of the extension
* @param height width of the extension
* @param gap_side the side on to which the extension is attached
*/
function paint_extension(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType | null,
): void;
/**
* Draws a flat box on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the box
* @param y y origin of the box
* @param width the width of the box
* @param height the height of the box
*/
function paint_flat_box(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a focus indicator around the given rectangle on `window` using the
* given style.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x the x origin of the rectangle around which to draw a focus indicator
* @param y the y origin of the rectangle around which to draw a focus indicator
* @param width the width of the rectangle around which to draw a focus indicator
* @param height the height of the rectangle around which to draw a focus indicator
*/
function paint_focus(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a handle as used in #GtkHandleBox and #GtkPaned.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the handle
* @param y y origin of the handle
* @param width with of the handle
* @param height height of the handle
* @param orientation the orientation of the handle
*/
function paint_handle(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
orientation: Orientation | null,
): void;
/**
* Draws a horizontal line from (`x1`, `y)` to (`x2`, `y)` in `window`
* using the given style and state.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param area rectangle to which the output is clipped, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x1 the starting x coordinate
* @param x2 the ending x coordinate
* @param y the y coordinate
*/
function paint_hline(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x1: number,
x2: number,
y: number,
): void;
/**
* Draws a layout on `window` using the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param use_text whether to use the text or foreground graphics context of @style
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin
* @param y y origin
* @param layout the layout to draw
*/
function paint_layout(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
use_text: boolean,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
layout: Pango.Layout,
): void;
/**
* Draws a radio button indicator in the given rectangle on `window` with
* the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the rectangle to draw the option in
* @param y y origin of the rectangle to draw the option in
* @param width the width of the rectangle to draw the option in
* @param height the height of the rectangle to draw the option in
*/
function paint_option(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a polygon on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param points an array of #GdkPoint<!-- -->s
* @param n_points length of @points
* @param fill %TRUE if the polygon should be filled
*/
function paint_polygon(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
points: Gdk.Point,
n_points: number,
fill: boolean,
): void;
/**
* Draws a resize grip in the given rectangle on `window` using the given
* parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param edge the edge in which to draw the resize grip
* @param x the x origin of the rectangle in which to draw the resize grip
* @param y the y origin of the rectangle in which to draw the resize grip
* @param width the width of the rectangle in which to draw the resize grip
* @param height the height of the rectangle in which to draw the resize grip
*/
function paint_resize_grip(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
edge: Gdk.WindowEdge | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a shadow around the given rectangle in `window`
* using the given style and state and shadow type.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param area clip rectangle or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the rectangle
* @param y y origin of the rectangle
* @param width width of the rectangle
* @param height width of the rectangle
*/
function paint_shadow(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a shadow around the given rectangle in `window`
* using the given style and state and shadow type, leaving a
* gap in one side.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the rectangle
* @param y y origin of the rectangle
* @param width width of the rectangle
* @param height width of the rectangle
* @param gap_side side in which to leave the gap
* @param gap_x starting position of the gap
* @param gap_width width of the gap
*/
function paint_shadow_gap(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType | null,
gap_x: number,
gap_width: number,
): void;
/**
* Draws a slider in the given rectangle on `window` using the
* given style and orientation.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type a shadow
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x the x origin of the rectangle in which to draw a slider
* @param y the y origin of the rectangle in which to draw a slider
* @param width the width of the rectangle in which to draw a slider
* @param height the height of the rectangle in which to draw a slider
* @param orientation the orientation to be used
*/
function paint_slider(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
orientation: Orientation | null,
): void;
/**
* Draws a spinner on `window` using the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget (may be %NULL)
* @param detail a style detail (may be %NULL)
* @param step the nth step, a value between 0 and #GtkSpinner:num-steps
* @param x the x origin of the rectangle in which to draw the spinner
* @param y the y origin of the rectangle in which to draw the spinner
* @param width the width of the rectangle in which to draw the spinner
* @param height the height of the rectangle in which to draw the spinner
*/
function paint_spinner(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
step: number,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a text string on `window` with the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin
* @param y y origin
* @param string the string to draw
*/
function paint_string(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
string: string,
): void;
/**
* Draws an option menu tab (i.e. the up and down pointing arrows)
* in the given rectangle on `window` using the given parameters.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param shadow_type the type of shadow to draw
* @param area clip rectangle, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param x x origin of the rectangle to draw the tab in
* @param y y origin of the rectangle to draw the tab in
* @param width the width of the rectangle to draw the tab in
* @param height the height of the rectangle to draw the tab in
*/
function paint_tab(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
shadow_type: ShadowType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Draws a vertical line from (`x,` `y1`_) to (`x,` `y2`_) in `window`
* using the given style and state.
* @param style a #GtkStyle
* @param window a #GdkWindow
* @param state_type a state
* @param area rectangle to which the output is clipped, or %NULL if the output should not be clipped
* @param widget the widget
* @param detail a style detail
* @param y1_ the starting y coordinate
* @param y2_ the ending y coordinate
* @param x the x coordinate
*/
function paint_vline(
style: Style,
window: Gdk.Window,
state_type: StateType | null,
area: Gdk.Rectangle | null,
widget: Widget | null,
detail: string | null,
y1_: number,
y2_: number,
x: number,
): void;
/**
* Returns the name of the default paper size, which
* depends on the current locale.
* @returns the name of the default paper size. The string is owned by GTK+ and should not be modified.
*/
function paper_size_get_default(): string;
/**
* Creates a list of known paper sizes.
* @param include_custom whether to include custom paper sizes as defined in the page setup dialog
* @returns a newly allocated list of newly allocated #GtkPaperSize objects
*/
function paper_size_get_paper_sizes(include_custom: boolean): PaperSize[];
/**
* Parses command line arguments, and initializes global
* attributes of GTK+, but does not actually open a connection
* to a display. (See gdk_display_open(), gdk_get_display_arg_name())
*
* Any arguments used by GTK+ or GDK are removed from the array and
* `argc` and `argv` are updated accordingly.
*
* There is no need to call this function explicitely if you are using
* gtk_init(), or gtk_init_check().
* @param argv a pointer to the array of command line arguments
* @returns %TRUE if initialization succeeded, otherwise %FALSE.
*/
function parse_args(argv: string[]): [boolean, string[]];
/**
* Registers an error quark for #GtkPrintOperation if necessary.
* @returns The error quark used for #GtkPrintOperation errors.
*/
function print_error_quark(): GLib.Quark;
/**
* Runs a page setup dialog, letting the user modify the values from
* `page_setup`. If the user cancels the dialog, the returned #GtkPageSetup
* is identical to the passed in `page_setup,` otherwise it contains the
* modifications done in the dialog.
*
* Note that this function may use a recursive mainloop to show the page
* setup dialog. See gtk_print_run_page_setup_dialog_async() if this is
* a problem.
* @param parent transient parent
* @param page_setup an existing #GtkPageSetup
* @param settings a #GtkPrintSettings
* @returns a new #GtkPageSetup
*/
function print_run_page_setup_dialog(
parent: Window | null,
page_setup: PageSetup | null,
settings: PrintSettings,
): PageSetup;
/**
* Sends an event to a widget, propagating the event to parent widgets
* if the event remains unhandled. Events received by GTK+ from GDK
* normally begin in gtk_main_do_event(). Depending on the type of
* event, existence of modal dialogs, grabs, etc., the event may be
* propagated; if so, this function is used. gtk_propagate_event()
* calls gtk_widget_event() on each widget it decides to send the
* event to. So gtk_widget_event() is the lowest-level function; it
* simply emits the "event" and possibly an event-specific signal on a
* widget. gtk_propagate_event() is a bit higher-level, and
* gtk_main_do_event() is the highest level.
*
* All that said, you most likely don't want to use any of these
* functions; synthesizing events is rarely needed. Consider asking on
* the mailing list for better ways to achieve your goals. For
* example, use gdk_window_invalidate_rect() or
* gtk_widget_queue_draw() instead of making up expose events.
* @param widget a #GtkWidget
* @param event an event
*/
function propagate_event(widget: Widget, event: Gdk.Event): void;
function quit_add_destroy(main_level: number, object: Object): void;
function quit_remove(quit_handler_id: number): void;
function quit_remove_by_data(data?: any | null): void;
function rc_add_class_style(rc_style: RcStyle, pattern: string): void;
/**
* Adds a file to the list of files to be parsed at the
* end of gtk_init().
* @param filename the pathname to the file. If @filename is not absolute, it is searched in the current directory.
*/
function rc_add_default_file(filename: string): void;
function rc_add_widget_class_style(rc_style: RcStyle, pattern: string): void;
function rc_add_widget_name_style(rc_style: RcStyle, pattern: string): void;
/**
* Searches for a theme engine in the GTK+ search path. This function
* is not useful for applications and should not be used.
* @param module_file name of a theme engine
* @returns The filename, if found (must be freed with g_free()), otherwise %NULL.
*/
function rc_find_module_in_path(module_file: string): string;
/**
* Looks up a file in pixmap path for the specified #GtkSettings.
* If the file is not found, it outputs a warning message using
* g_warning() and returns %NULL.
* @param settings a #GtkSettings
* @param scanner Scanner used to get line number information for the warning message, or %NULL
* @param pixmap_file name of the pixmap file to locate.
* @returns the filename.
*/
function rc_find_pixmap_in_path(settings: Settings, scanner: GLib.Scanner, pixmap_file: string): string;
/**
* Retrieves the current list of RC files that will be parsed
* at the end of gtk_init().
* @returns A %NULL-terminated array of filenames. This memory is owned by GTK+ and must not be freed by the application. If you want to store this information, you should make a copy.
*/
function rc_get_default_files(): string[];
/**
* Obtains the path to the IM modules file. See the documentation
* of the <link linkend="im-module-file"><envar>GTK_IM_MODULE_FILE</envar></link>
* environment variable for more details.
* @returns a newly-allocated string containing the name of the file listing the IM modules available for loading
*/
function rc_get_im_module_file(): string;
/**
* Obtains the path in which to look for IM modules. See the documentation
* of the <link linkend="im-module-path"><envar>GTK_PATH</envar></link>
* environment variable for more details about looking up modules. This
* function is useful solely for utilities supplied with GTK+ and should
* not be used by applications under normal circumstances.
* @returns a newly-allocated string containing the path in which to look for IM modules.
*/
function rc_get_im_module_path(): string;
/**
* Returns a directory in which GTK+ looks for theme engines.
* For full information about the search for theme engines,
* see the docs for <envar>GTK_PATH</envar> in
* <xref linkend="gtk-running"/>.
* @returns the directory. (Must be freed with g_free())
*/
function rc_get_module_dir(): string;
/**
* Finds all matching RC styles for a given widget,
* composites them together, and then creates a
* #GtkStyle representing the composite appearance.
* (GTK+ actually keeps a cache of previously
* created styles, so a new style may not be
* created.)
* @param widget a #GtkWidget
* @returns the resulting style. No refcount is added to the returned style, so if you want to save this style around, you should add a reference yourself.
*/
function rc_get_style(widget: Widget): Style;
/**
* Creates up a #GtkStyle from styles defined in a RC file by providing
* the raw components used in matching. This function may be useful
* when creating pseudo-widgets that should be themed like widgets but
* don't actually have corresponding GTK+ widgets. An example of this
* would be items inside a GNOME canvas widget.
*
* The action of gtk_rc_get_style() is similar to:
*
* ```
* gtk_widget_path (widget, NULL, &path, NULL);
* gtk_widget_class_path (widget, NULL, &class_path, NULL);
* gtk_rc_get_style_by_paths (gtk_widget_get_settings (widget),
* path, class_path,
* G_OBJECT_TYPE (widget));
* ```
*
* @param settings a #GtkSettings object
* @param widget_path the widget path to use when looking up the style, or %NULL if no matching against the widget path should be done
* @param class_path the class path to use when looking up the style, or %NULL if no matching against the class path should be done.
* @param type a type that will be used along with parent types of this type when matching against class styles, or #G_TYPE_NONE
* @returns A style created by matching with the supplied paths, or %NULL if nothing matching was specified and the default style should be used. The returned value is owned by GTK+ as part of an internal cache, so you must call g_object_ref() on the returned value if you want to keep a reference to it.
*/
function rc_get_style_by_paths(
settings: Settings,
widget_path: string | null,
class_path: string | null,
type: GObject.GType,
): Style;
function rc_get_theme_dir(): string;
function rc_parse(filename: string): void;
/**
* Parses a color in the <link linkend="color=format">format</link> expected
* in a RC file.
*
* Note that theme engines should use gtk_rc_parse_color_full() in
* order to support symbolic colors.
* @param scanner a #GScanner
* @returns %G_TOKEN_NONE if parsing succeeded, otherwise the token that was expected but not found
*/
function rc_parse_color(scanner: GLib.Scanner): [number, Gdk.Color];
/**
* Parses a color in the <link linkend="color=format">format</link> expected
* in a RC file. If `style` is not %NULL, it will be consulted to resolve
* references to symbolic colors.
* @param scanner a #GScanner
* @param style a #GtkRcStyle, or %NULL
* @returns %G_TOKEN_NONE if parsing succeeded, otherwise the token that was expected but not found
*/
function rc_parse_color_full(scanner: GLib.Scanner, style: RcStyle | null): [number, Gdk.Color];
function rc_parse_priority(scanner: GLib.Scanner, priority: PathPriorityType | null): number;
function rc_parse_state(scanner: GLib.Scanner, state: StateType | null): number;
function rc_parse_string(rc_string: string): void;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses
* borders in the form
* <literal>"{ left, right, top, bottom }"</literal> for integers
* %left, %right, %top and %bottom.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold boxed values.
* @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GtkBorder.
*/
function rc_property_parse_border(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses a
* color given either by its name or in the form
* <literal>{ red, green, blue }</literal> where %red, %green and
* %blue are integers between 0 and 65535 or floating-point numbers
* between 0 and 1.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold #GdkColor values.
* @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GdkColor.
*/
function rc_property_parse_color(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses a single
* enumeration value.
*
* The enumeration value can be specified by its name, its nickname or
* its numeric value. For consistency with flags parsing, the value
* may be surrounded by parentheses.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold enum values.
* @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GEnumValue.
*/
function rc_property_parse_enum(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses flags.
*
* Flags can be specified by their name, their nickname or
* numerically. Multiple flags can be specified in the form
* <literal>"( flag1 | flag2 | ... )"</literal>.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold flags values.
* @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting flags value.
*/
function rc_property_parse_flags(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses a
* requisition in the form
* <literal>"{ width, height }"</literal> for integers %width and %height.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold boxed values.
* @returns %TRUE if @gstring could be parsed and @property_value has been set to the resulting #GtkRequisition.
*/
function rc_property_parse_requisition(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* If the modification time on any previously read file for the
* default #GtkSettings has changed, discard all style information
* and then reread all previously read RC files.
* @returns %TRUE if the files were reread.
*/
function rc_reparse_all(): boolean;
/**
* If the modification time on any previously read file
* for the given #GtkSettings has changed, discard all style information
* and then reread all previously read RC files.
* @param settings a #GtkSettings
* @param force_load load whether or not anything changed
* @returns %TRUE if the files were reread.
*/
function rc_reparse_all_for_settings(settings: Settings, force_load: boolean): boolean;
/**
* This function recomputes the styles for all widgets that use a
* particular #GtkSettings object. (There is one #GtkSettings object
* per #GdkScreen, see gtk_settings_get_for_screen()); It is useful
* when some global parameter has changed that affects the appearance
* of all widgets, because when a widget gets a new style, it will
* both redraw and recompute any cached information about its
* appearance. As an example, it is used when the default font size
* set by the operating system changes. Note that this function
* doesn't affect widgets that have a style set explicitely on them
* with gtk_widget_set_style().
* @param settings a #GtkSettings
*/
function rc_reset_styles(settings: Settings): void;
/**
* Sets the list of files that GTK+ will read at the
* end of gtk_init().
* @param filenames A %NULL-terminated list of filenames.
*/
function rc_set_default_files(filenames: string): void;
function recent_chooser_error_quark(): GLib.Quark;
function recent_manager_error_quark(): GLib.Quark;
/**
* Converts a color from RGB space to HSV.
* Input values must be in the [0.0, 1.0] range;
* output values will be in the same range.
* @param r Red
* @param g Green
* @param b Blue
*/
function rgb_to_hsv(r: number, g: number, b: number): [number, number, number];
/**
* Appends a specified target to the list of supported targets for a
* given widget and selection.
* @param widget a #GtkTarget
* @param selection the selection
* @param target target to add.
* @param info A unsigned integer which will be passed back to the application.
*/
function selection_add_target(widget: Widget, selection: Gdk.Atom, target: Gdk.Atom, info: number): void;
/**
* Prepends a table of targets to the list of supported targets
* for a given widget and selection.
* @param widget a #GtkWidget
* @param selection the selection
* @param targets a table of targets to add
*/
function selection_add_targets(widget: Widget, selection: Gdk.Atom, targets: TargetEntry[]): void;
/**
* The default handler for the #GtkWidget::selection-clear-event
* signal.
* @param widget a #GtkWidget
* @param event the event
* @returns %TRUE if the event was handled, otherwise false
*/
function selection_clear(widget: Widget, event: Gdk.EventSelection): boolean;
/**
* Remove all targets registered for the given selection for the
* widget.
* @param widget a #GtkWidget
* @param selection an atom representing a selection
*/
function selection_clear_targets(widget: Widget, selection: Gdk.Atom): void;
/**
* Requests the contents of a selection. When received,
* a "selection-received" signal will be generated.
* @param widget The widget which acts as requestor
* @param selection Which selection to get
* @param target Form of information desired (e.g., STRING)
* @param time_ Time of request (usually of triggering event) In emergency, you could use #GDK_CURRENT_TIME
* @returns %TRUE if requested succeeded. %FALSE if we could not process request. (e.g., there was already a request in process for this widget).
*/
function selection_convert(widget: Widget, selection: Gdk.Atom, target: Gdk.Atom, time_: number): boolean;
/**
* Claims ownership of a given selection for a particular widget,
* or, if `widget` is %NULL, release ownership of the selection.
* @param widget a #GtkWidget, or %NULL.
* @param selection an interned atom representing the selection to claim
* @param time_ timestamp with which to claim the selection
* @returns %TRUE if the operation succeeded
*/
function selection_owner_set(widget: Widget | null, selection: Gdk.Atom, time_: number): boolean;
/**
* Claim ownership of a given selection for a particular widget, or,
* if `widget` is %NULL, release ownership of the selection.
* @param display the #Gdkdisplay where the selection is set
* @param widget new selection owner (a #GdkWidget), or %NULL.
* @param selection an interned atom representing the selection to claim.
* @param time_ timestamp with which to claim the selection
* @returns TRUE if the operation succeeded
*/
function selection_owner_set_for_display(
display: Gdk.Display,
widget: Widget | null,
selection: Gdk.Atom,
time_: number,
): boolean;
/**
* Removes all handlers and unsets ownership of all
* selections for a widget. Called when widget is being
* destroyed. This function will not generally be
* called by applications.
* @param widget a #GtkWidget
*/
function selection_remove_all(widget: Widget): void;
/**
* Initializes internationalization support for GTK+. gtk_init()
* automatically does this, so there is typically no point
* in calling this function.
*
* If you are calling this function because you changed the locale
* after GTK+ is was initialized, then calling this function
* may help a bit. (Note, however, that changing the locale
* after GTK+ is initialized may produce inconsistent results and
* is not really supported.)
*
* In detail - sets the current locale according to the
* program environment. This is the same as calling the C library function
* <literal>setlocale (LC_ALL, "")</literal> but also takes care of the
* locale specific setup of the windowing system used by GDK.
* @returns a string corresponding to the locale set, typically in the form lang_COUNTRY, where lang is an ISO-639 language code, and COUNTRY is an ISO-3166 country code. On Unix, this form matches the result of the setlocale(); it is also used on other machines, such as Windows, where the C library returns a different result. The string is owned by GTK+ and should not be modified or freed.
*/
function set_locale(): string;
/**
* This is a convenience function for launching the default application
* to show the uri. The uri must be of a form understood by GIO (i.e. you
* need to install gvfs to get support for uri schemes such as http://
* or ftp://, as only local files are handled by GIO itself).
* Typical examples are
* <simplelist>
* <member><filename>file:///home/gnome/pict.jpg</filename></member>
* <member><filename>http://www.gnome.org</filename></member>
* <member><filename>mailto:me&commat;gnome.org</filename></member>
* </simplelist>
* Ideally the timestamp is taken from the event triggering
* the gtk_show_uri() call. If timestamp is not known you can take
* %GDK_CURRENT_TIME.
*
* This function can be used as a replacement for gnome_vfs_url_show()
* and gnome_url_show().
* @param screen screen to show the uri on or %NULL for the default screen
* @param uri the uri to show
* @param timestamp a timestamp to prevent focus stealing.
* @returns %TRUE on success, %FALSE on error.
*/
function show_uri(screen: Gdk.Screen | null, uri: string, timestamp: number): boolean;
function signal_emit_stop_by_name(object: Object, name: string): void;
function signal_emitv(object: Object, signal_id: number, args: Arg): void;
function signal_emitv_by_name(object: Object, name: string, args: Arg): void;
function signal_newv(
name: string,
signal_flags: SignalRunType | null,
object_type: GObject.GType,
function_offset: number,
marshaller: GObject.SignalCMarshaller,
return_val: GObject.GType,
n_args: number,
args: GObject.GType,
): number;
/**
* Registers each of the stock items in `items`. If an item already
* exists with the same stock ID as one of the `items,` the old item
* gets replaced. The stock items are copied, so GTK+ does not hold
* any pointer into `items` and `items` can be freed. Use
* gtk_stock_add_static() if `items` is persistent and GTK+ need not
* copy the array.
* @param items a #GtkStockItem or array of items
*/
function stock_add(items: StockItem[]): void;
/**
* Same as gtk_stock_add(), but doesn't copy `items,` so
* `items` must persist until application exit.
* @param items a #GtkStockItem or array of #GtkStockItem
*/
function stock_add_static(items: StockItem[]): void;
/**
* Retrieves a list of all known stock IDs added to a #GtkIconFactory
* or registered with gtk_stock_add(). The list must be freed with g_slist_free(),
* and each string in the list must be freed with g_free().
* @returns a list of known stock IDs
*/
function stock_list_ids(): string[];
/**
* Fills `item` with the registered values for `stock_id,` returning %TRUE
* if `stock_id` was known.
* @param stock_id a stock item name
* @returns %TRUE if @item was initialized
*/
function stock_lookup(stock_id: string): [boolean, StockItem];
/**
* Sets a function to be used for translating the `label` of
* a stock item.
*
* If no function is registered for a translation domain,
* g_dgettext() is used.
*
* The function is used for all stock items whose
* `translation_domain` matches `domain`. Note that it is possible
* to use strings different from the actual gettext translation domain
* of your application for this, as long as your #GtkTranslateFunc uses
* the correct domain when calling dgettext(). This can be useful, e.g.
* when dealing with message contexts:
*
*
* ```
* GtkStockItem items[] = {
* { MY_ITEM1, NC_("odd items", "Item 1"), 0, 0, "odd-item-domain" },
* { MY_ITEM2, NC_("even items", "Item 2"), 0, 0, "even-item-domain" },
* };
*
* gchar *
* my_translate_func (const gchar *msgid,
* gpointer data)
* {
* gchar *msgctxt = data;
*
* return (gchar*)g_dpgettext2 (GETTEXT_PACKAGE, msgctxt, msgid);
* }
*
* /&ast; ... &ast;/
*
* gtk_stock_add (items, G_N_ELEMENTS (items));
* gtk_stock_set_translate_func ("odd-item-domain", my_translate_func, "odd items");
* gtk_stock_set_translate_func ("even-item-domain", my_translate_func, "even items");
* ```
*
* @param domain the translation domain for which @func shall be used
* @param func a #GtkTranslateFunc
*/
function stock_set_translate_func(domain: string, func: TranslateFunc): void;
/**
* This function frees a target table as returned by
* gtk_target_table_new_from_list()
* @param targets a #GtkTargetEntry array
*/
function target_table_free(targets: TargetEntry[]): void;
/**
* This function creates an #GtkTargetEntry array that contains the
* same targets as the passed %list. The returned table is newly
* allocated and should be freed using gtk_target_table_free() when no
* longer needed.
* @param list a #GtkTargetList
* @returns the new table.
*/
function target_table_new_from_list(list: TargetList): TargetEntry[];
/**
* Determines if any of the targets in `targets` can be used to
* provide a #GdkPixbuf.
* @param targets an array of #GdkAtom<!-- -->s
* @param writable whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format
* @returns %TRUE if @targets include a suitable target for images, otherwise %FALSE.
*/
function targets_include_image(targets: Gdk.Atom[], writable: boolean): boolean;
/**
* Determines if any of the targets in `targets` can be used to
* provide rich text.
* @param targets an array of #GdkAtom<!-- -->s
* @param buffer a #GtkTextBuffer
* @returns %TRUE if @targets include a suitable target for rich text, otherwise %FALSE.
*/
function targets_include_rich_text(targets: Gdk.Atom[], buffer: TextBuffer): boolean;
/**
* Determines if any of the targets in `targets` can be used to
* provide text.
* @param targets an array of #GdkAtom<!-- -->s
* @returns %TRUE if @targets include a suitable target for text, otherwise %FALSE.
*/
function targets_include_text(targets: Gdk.Atom[]): boolean;
/**
* Determines if any of the targets in `targets` can be used to
* provide an uri list.
* @param targets an array of #GdkAtom<!-- -->s
* @returns %TRUE if @targets include a suitable target for uri lists, otherwise %FALSE.
*/
function targets_include_uri(targets: Gdk.Atom[]): boolean;
/**
* Create a simple window with window title `window_title` and
* text contents `dialog_text`.
* The window will quit any running gtk_main()-loop when destroyed, and it
* will automatically be destroyed upon test function teardown.
* @param window_title Title of the window to be displayed.
* @param dialog_text Text inside the window to be displayed.
* @returns a widget pointer to the newly created GtkWindow.
*/
function test_create_simple_window(window_title: string, dialog_text: string): Widget;
/**
* This function will search `widget` and all its descendants for a GtkLabel
* widget with a text string matching `label_pattern`.
* The `label_pattern` may contain asterisks '*' and question marks '?' as
* placeholders, g_pattern_match() is used for the matching.
* Note that locales other than "C" tend to alter (translate" label strings,
* so this function is genrally only useful in test programs with
* predetermined locales, see gtk_test_init() for more details.
* @param widget Valid label or container widget.
* @param label_pattern Shell-glob pattern to match a label string.
* @returns a GtkLabel widget if any is found.
*/
function test_find_label(widget: Widget, label_pattern: string): Widget;
/**
* This function will search siblings of `base_widget` and siblings of its
* ancestors for all widgets matching `widget_type`.
* Of the matching widgets, the one that is geometrically closest to
* `base_widget` will be returned.
* The general purpose of this function is to find the most likely "action"
* widget, relative to another labeling widget. Such as finding a
* button or text entry widget, given it's corresponding label widget.
* @param base_widget Valid widget, part of a widget hierarchy
* @param widget_type Type of a aearched for sibling widget
* @returns a widget of type @widget_type if any is found.
*/
function test_find_sibling(base_widget: Widget, widget_type: GObject.GType): Widget;
/**
* This function will search the descendants of `widget` for a widget
* of type `widget_type` that has a label matching `label_pattern` next
* to it. This is most useful for automated GUI testing, e.g. to find
* the "OK" button in a dialog and synthesize clicks on it.
* However see gtk_test_find_label(), gtk_test_find_sibling() and
* gtk_test_widget_click() for possible caveats involving the search of
* such widgets and synthesizing widget events.
* @param widget Container widget, usually a GtkWindow.
* @param label_pattern Shell-glob pattern to match a label string.
* @param widget_type Type of a aearched for label sibling widget.
* @returns a valid widget if any is found or %NULL.
*/
function test_find_widget(widget: Widget, label_pattern: string, widget_type: GObject.GType): Widget;
/**
* Return the type ids that have been registered after
* calling gtk_test_register_all_types().
* @returns 0-terminated array of type ids
*/
function test_list_all_types(): GObject.GType[];
/**
* Force registration of all core Gtk+ and Gdk object types.
* This allowes to refer to any of those object types via
* g_type_from_name() after calling this function.
*/
function test_register_all_types(): void;
/**
* Retrive the literal adjustment value for GtkRange based
* widgets and spin buttons. Note that the value returned by
* this function is anything between the lower and upper bounds
* of the adjustment belonging to `widget,` and is not a percentage
* as passed in to gtk_test_slider_set_perc().
* @param widget valid widget pointer.
* @returns adjustment->value for an adjustment belonging to @widget.
*/
function test_slider_get_value(widget: Widget): number;
/**
* This function will adjust the slider position of all GtkRange
* based widgets, such as scrollbars or scales, it'll also adjust
* spin buttons. The adjustment value of these widgets is set to
* a value between the lower and upper limits, according to the
* `percentage` argument.
* @param widget valid widget pointer.
* @param percentage value between 0 and 100.
*/
function test_slider_set_perc(widget: Widget, percentage: number): void;
/**
* This function will generate a `button` click in the upwards or downwards
* spin button arrow areas, usually leading to an increase or decrease of
* spin button's value.
* @param spinner valid GtkSpinButton widget.
* @param button Number of the pointer button for the event, usually 1, 2 or 3.
* @param upwards %TRUE for upwards arrow click, %FALSE for downwards arrow click.
* @returns wether all actions neccessary for the button click simulation were carried out successfully.
*/
function test_spin_button_click(spinner: SpinButton, button: number, upwards: boolean): boolean;
/**
* Retrive the text string of `widget` if it is a GtkLabel,
* GtkEditable (entry and text widgets) or GtkTextView.
* @param widget valid widget pointer.
* @returns new 0-terminated C string, needs to be released with g_free().
*/
function test_text_get(widget: Widget): string;
/**
* Set the text string of `widget` to `string` if it is a GtkLabel,
* GtkEditable (entry and text widgets) or GtkTextView.
* @param widget valid widget pointer.
* @param string a 0-terminated C string
*/
function test_text_set(widget: Widget, string: string): void;
/**
* This function will generate a `button` click (button press and button
* release event) in the middle of the first GdkWindow found that belongs
* to `widget`.
* For %GTK_NO_WINDOW widgets like GtkButton, this will often be an
* input-only event window. For other widgets, this is usually widget->window.
* Certain caveats should be considered when using this function, in
* particular because the mouse pointer is warped to the button click
* location, see gdk_test_simulate_button() for details.
* @param widget Widget to generate a button click on.
* @param button Number of the pointer button for the event, usually 1, 2 or 3.
* @param modifiers Keyboard modifiers the event is setup with.
* @returns wether all actions neccessary for the button click simulation were carried out successfully.
*/
function test_widget_click(widget: Widget, button: number, modifiers: Gdk.ModifierType | null): boolean;
/**
* This function will generate keyboard press and release events in
* the middle of the first GdkWindow found that belongs to `widget`.
* For %GTK_NO_WINDOW widgets like GtkButton, this will often be an
* input-only event window. For other widgets, this is usually widget->window.
* Certain caveats should be considered when using this function, in
* particular because the mouse pointer is warped to the key press
* location, see gdk_test_simulate_key() for details.
* @param widget Widget to generate a key press and release on.
* @param keyval A Gdk keyboard value.
* @param modifiers Keyboard modifiers the event is setup with.
* @returns wether all actions neccessary for the key event simulation were carried out successfully.
*/
function test_widget_send_key(widget: Widget, keyval: number, modifiers: Gdk.ModifierType | null): boolean;
function text_anchored_child_set_layout(child: Widget, layout: TextLayout): void;
function timeout_remove(timeout_handler_id: number): void;
/**
* Obtains a `tree_model` and `path` from selection data of target type
* %GTK_TREE_MODEL_ROW. Normally called from a drag_data_received handler.
* This function can only be used if `selection_data` originates from the same
* process that's calling this function, because a pointer to the tree model
* is being passed around. If you aren't in the same process, then you'll
* get memory corruption. In the #GtkTreeDragDest drag_data_received handler,
* you can assume that selection data of type %GTK_TREE_MODEL_ROW is
* in from the current process. The returned path must be freed with
* gtk_tree_path_free().
* @param selection_data a #GtkSelectionData
* @returns %TRUE if @selection_data had target type %GTK_TREE_MODEL_ROW and is otherwise valid
*/
function tree_get_row_drag_data(selection_data: SelectionData): [boolean, TreeModel, TreePath];
/**
* Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
* know that the model emitted the "row_deleted" signal.
* @param proxy A #GObject
* @param path The path position that was deleted
*/
function tree_row_reference_deleted(proxy: GObject.Object, path: TreePath): void;
/**
* Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
* know that the model emitted the "row_inserted" signal.
* @param proxy A #GObject
* @param path The row position that was inserted
*/
function tree_row_reference_inserted(proxy: GObject.Object, path: TreePath): void;
/**
* Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
* know that the model emitted the "rows_reordered" signal.
* @param proxy A #GObject
* @param path The parent path of the reordered signal
* @param iter The iter pointing to the parent of the reordered
* @param new_order The new order of rows
*/
function tree_row_reference_reordered(
proxy: GObject.Object,
path: TreePath,
iter: TreeIter,
new_order: number,
): void;
/**
* Sets selection data of target type %GTK_TREE_MODEL_ROW. Normally used
* in a drag_data_get handler.
* @param selection_data some #GtkSelectionData
* @param tree_model a #GtkTreeModel
* @param path a row in @tree_model
* @returns %TRUE if the #GtkSelectionData had the proper target type to allow us to set a tree row
*/
function tree_set_row_drag_data(selection_data: SelectionData, tree_model: TreeModel, path: TreePath): boolean;
function __true(): boolean;
/**
* Returns a pointer pointing to the class of `type` or %NULL if there
* was any trouble identifying `type`. Initializes the class if
* necessary.
* @param type a #GtkType.
* @returns pointer to the class.
*/
function type_class(type: Type): any | null;
function type_init(debug_flags: GObject.TypeDebugFlags | null): void;
function type_new(type: Type): any | null;
function type_unique(parent_type: Type, gtkinfo: TypeInfo): Type;
interface AboutDialogActivateLinkFunc {
(about: AboutDialog, link_: string, data?: any | null): void;
}
interface AccelGroupActivate<A = GObject.Object> {
(accel_group: AccelGroup, acceleratable: A, keyval: number, modifier: Gdk.ModifierType): boolean;
}
interface AccelGroupFindFunc {
(key: AccelKey, closure: GObject.Closure, data?: any | null): boolean;
}
interface AccelMapForeach {
(
data: any | null,
accel_path: string,
accel_key: number,
accel_mods: Gdk.ModifierType,
changed: boolean,
): void;
}
interface AssistantPageFunc {
(current_page: number, data?: any | null): number;
}
interface BuilderConnectFunc<A = GObject.Object, B = GObject.Object> {
(
builder: Builder,
object: A,
signal_name: string,
handler_name: string,
connect_object: B,
flags: GObject.ConnectFlags,
): void;
}
interface CListCompareFunc {
(clist: CList, ptr1?: any | null, ptr2?: any | null): number;
}
interface CTreeCompareDragFunc {
(ctree: CTree, source_node: CTreeNode, new_parent: CTreeNode, new_sibling: CTreeNode): boolean;
}
interface CTreeFunc {
(ctree: CTree, node: CTreeNode, data?: any | null): void;
}
interface CTreeGNodeFunc {
(ctree: CTree, depth: number, gnode: GLib.Node, cnode: CTreeNode, data?: any | null): boolean;
}
interface CalendarDetailFunc {
(calendar: Calendar, year: number, month: number, day: number): string;
}
interface Callback {
(widget: Widget, data?: any | null): void;
}
interface CallbackMarshal {
(object: Object, data: any | null, n_args: number, args: Arg): void;
}
interface CellLayoutDataFunc {
(
cell_layout: CellLayout,
cell: CellRenderer,
tree_model: TreeModel,
iter: TreeIter,
data?: any | null,
): void;
}
interface ClipboardClearFunc {
(clipboard: Clipboard, user_data_or_owner?: any | null): void;
}
interface ClipboardGetFunc {
(clipboard: Clipboard, selection_data: SelectionData, info: number, user_data_or_owner?: any | null): void;
}
interface ClipboardImageReceivedFunc {
(clipboard: Clipboard, pixbuf: GdkPixbuf.Pixbuf, data?: any | null): void;
}
interface ClipboardReceivedFunc {
(clipboard: Clipboard, selection_data: SelectionData, data?: any | null): void;
}
interface ClipboardRichTextReceivedFunc {
(clipboard: Clipboard, format: Gdk.Atom, text: number, length: number, data?: any | null): void;
}
interface ClipboardTargetsReceivedFunc {
(clipboard: Clipboard, atoms: Gdk.Atom, n_atoms: number, data?: any | null): void;
}
interface ClipboardTextReceivedFunc {
(clipboard: Clipboard, text: string, data?: any | null): void;
}
interface ClipboardURIReceivedFunc {
(clipboard: Clipboard, uris: string, data?: any | null): void;
}
interface ColorSelectionChangePaletteFunc {
(colors: Gdk.Color, n_colors: number): void;
}
interface ColorSelectionChangePaletteWithScreenFunc {
(screen: Gdk.Screen, colors: Gdk.Color, n_colors: number): void;
}
interface DestroyNotify {
(data?: any | null): void;
}
interface EntryCompletionMatchFunc {
(completion: EntryCompletion, key: string, iter: TreeIter): boolean;
}
interface FileFilterFunc {
(filter_info: FileFilterInfo, data?: any | null): boolean;
}
interface Function {
(data?: any | null): boolean;
}
interface IconViewForeachFunc {
(icon_view: IconView, path: TreePath, data?: any | null): void;
}
interface ItemFactoryCallback {
(): void;
}
interface ItemFactoryCallback1 {
(callback_data: any | null, callback_action: number, widget: Widget): void;
}
interface ItemFactoryCallback2 {
(widget: Widget, callback_data: any | null, callback_action: number): void;
}
interface KeySnoopFunc {
(grab_widget: Widget, event: Gdk.EventKey, func_data?: any | null): number;
}
interface LinkButtonUriFunc {
(button: LinkButton, link_: string): void;
}
interface MenuCallback {
(widget: Widget): void;
}
interface MenuDetachFunc {
(attach_widget: Widget, menu: Menu): void;
}
interface MenuPositionFunc {
(menu: Menu, x: number, y: number, push_in: boolean): void;
}
interface ModuleDisplayInitFunc {
(display: Gdk.Display): void;
}
interface ModuleInitFunc {
(argc: number, argv: string): void;
}
interface PageSetupDoneFunc {
(page_setup: PageSetup, data?: any | null): void;
}
interface PrintFunc {
(func_data: any | null, str: string): void;
}
interface PrintSettingsFunc {
(key: string, value: string): void;
}
interface RcPropertyParser {
(pspec: GObject.ParamSpec, rc_string: GLib.String, property_value: GObject.Value | any): boolean;
}
interface RecentFilterFunc {
(filter_info: RecentFilterInfo): boolean;
}
interface RecentSortFunc {
(a: RecentInfo, b: RecentInfo): number;
}
interface SignalFunc {
(): void;
}
interface TextBufferDeserializeFunc {
(
register_buffer: TextBuffer,
content_buffer: TextBuffer,
iter: TextIter,
data: number,
length: number,
create_tags: boolean,
): boolean;
}
interface TextBufferSerializeFunc {
(
register_buffer: TextBuffer,
content_buffer: TextBuffer,
start: TextIter,
end: TextIter,
length: number,
): number;
}
interface TextCharPredicate {
(ch: number): boolean;
}
interface TextFunction {
(editable: OldEditable, time_: number): void;
}
interface TextTagTableForeach {
(tag: TextTag, data?: any | null): void;
}
interface TranslateFunc {
(path: string, func_data?: any | null): string;
}
interface TreeCellDataFunc {
(
tree_column: TreeViewColumn,
cell: CellRenderer,
tree_model: TreeModel,
iter: TreeIter,
data?: any | null,
): void;
}
interface TreeDestroyCountFunc {
(tree_view: TreeView, path: TreePath, children: number): void;
}
interface TreeIterCompareFunc {
(model: TreeModel, a: TreeIter, b: TreeIter): number;
}
interface TreeModelFilterModifyFunc {
(model: TreeModel, iter: TreeIter, value: GObject.Value | any, column: number, data?: any | null): void;
}
interface TreeModelFilterVisibleFunc {
(model: TreeModel, iter: TreeIter, data?: any | null): boolean;
}
interface TreeModelForeachFunc {
(model: TreeModel, path: TreePath, iter: TreeIter, data?: any | null): boolean;
}
interface TreeSelectionForeachFunc {
(model: TreeModel, path: TreePath, iter: TreeIter, data?: any | null): void;
}
interface TreeSelectionFunc {
(
selection: TreeSelection,
model: TreeModel,
path: TreePath,
path_currently_selected: boolean,
data?: any | null,
): boolean;
}
interface TreeViewColumnDropFunc {
(
tree_view: TreeView,
column: TreeViewColumn,
prev_column: TreeViewColumn,
next_column: TreeViewColumn,
data?: any | null,
): boolean;
}
interface TreeViewMappingFunc {
(tree_view: TreeView, path: TreePath): void;
}
interface TreeViewRowSeparatorFunc {
(model: TreeModel, iter: TreeIter, data?: any | null): boolean;
}
interface TreeViewSearchEqualFunc {
(model: TreeModel, column: number, key: string, iter: TreeIter, search_data?: any | null): boolean;
}
interface TreeViewSearchPositionFunc {
(tree_view: TreeView, search_dialog: Widget): void;
}
interface WindowKeysForeachFunc {
(
window: Window,
keyval: number,
modifiers: Gdk.ModifierType,
is_mnemonic: boolean,
data?: any | null,
): void;
}
export namespace AccelFlags {
export const $gtype: GObject.GType<AccelFlags>;
}
enum AccelFlags {
VISIBLE,
LOCKED,
MASK,
}
export namespace ArgFlags {
export const $gtype: GObject.GType<ArgFlags>;
}
enum ArgFlags {
READABLE,
WRITABLE,
CONSTRUCT,
CONSTRUCT_ONLY,
CHILD_ARG,
}
export namespace AttachOptions {
export const $gtype: GObject.GType<AttachOptions>;
}
enum AttachOptions {
EXPAND,
SHRINK,
FILL,
}
export namespace ButtonAction {
export const $gtype: GObject.GType<ButtonAction>;
}
enum ButtonAction {
IGNORED,
SELECTS,
DRAGS,
EXPANDS,
}
/**
* These options can be used to influence the display and behaviour of a #GtkCalendar.
*/
/**
* These options can be used to influence the display and behaviour of a #GtkCalendar.
*/
export namespace CalendarDisplayOptions {
export const $gtype: GObject.GType<CalendarDisplayOptions>;
}
enum CalendarDisplayOptions {
/**
* Specifies that the month and year should be displayed.
*/
SHOW_HEADING,
/**
* Specifies that three letter day descriptions should be present.
*/
SHOW_DAY_NAMES,
/**
* Prevents the user from switching months with the calendar.
*/
NO_MONTH_CHANGE,
/**
* Displays each week numbers of the current year, down the
* left side of the calendar.
*/
SHOW_WEEK_NUMBERS,
/**
* Since GTK+ 2.4, this option is deprecated and ignored by GTK+.
* The information on which day the calendar week starts is derived from the locale.
*/
WEEK_START_MONDAY,
/**
* Just show an indicator, not the full details
* text when details are provided. See gtk_calendar_set_detail_func().
*/
SHOW_DETAILS,
}
export namespace CellRendererState {
export const $gtype: GObject.GType<CellRendererState>;
}
enum CellRendererState {
SELECTED,
PRELIT,
INSENSITIVE,
SORTED,
FOCUSED,
}
export namespace DebugFlag {
export const $gtype: GObject.GType<DebugFlag>;
}
enum DebugFlag {
MISC,
PLUGSOCKET,
TEXT,
TREE,
UPDATES,
KEYBINDINGS,
MULTIHEAD,
MODULES,
GEOMETRY,
ICONTHEME,
PRINTING,
BUILDER,
}
export namespace DestDefaults {
export const $gtype: GObject.GType<DestDefaults>;
}
enum DestDefaults {
MOTION,
HIGHLIGHT,
DROP,
ALL,
}
export namespace DialogFlags {
export const $gtype: GObject.GType<DialogFlags>;
}
enum DialogFlags {
MODAL,
DESTROY_WITH_PARENT,
NO_SEPARATOR,
}
export namespace FileFilterFlags {
export const $gtype: GObject.GType<FileFilterFlags>;
}
enum FileFilterFlags {
FILENAME,
URI,
DISPLAY_NAME,
MIME_TYPE,
}
/**
* Used to specify options for gtk_icon_theme_lookup_icon()
*/
/**
* Used to specify options for gtk_icon_theme_lookup_icon()
*/
export namespace IconLookupFlags {
export const $gtype: GObject.GType<IconLookupFlags>;
}
enum IconLookupFlags {
/**
* Never return SVG icons, even if gdk-pixbuf
* supports them. Cannot be used together with %GTK_ICON_LOOKUP_FORCE_SVG.
*/
NO_SVG,
/**
* Return SVG icons, even if gdk-pixbuf
* doesn't support them.
* Cannot be used together with %GTK_ICON_LOOKUP_NO_SVG.
*/
FORCE_SVG,
/**
* When passed to
* gtk_icon_theme_lookup_icon() includes builtin icons
* as well as files. For a builtin icon, gtk_icon_info_get_filename()
* returns %NULL and you need to call gtk_icon_info_get_builtin_pixbuf().
*/
USE_BUILTIN,
/**
* Try to shorten icon name at '-'
* characters before looking at inherited themes. For more general
* fallback, see gtk_icon_theme_choose_icon(). Since 2.12.
*/
GENERIC_FALLBACK,
/**
* Always return the icon scaled to the
* requested size. Since 2.14.
*/
FORCE_SIZE,
}
export namespace ObjectFlags {
export const $gtype: GObject.GType<ObjectFlags>;
}
enum ObjectFlags {
IN_DESTRUCTION,
FLOATING,
RESERVED_1,
RESERVED_2,
}
export namespace PrivateFlags {
export const $gtype: GObject.GType<PrivateFlags>;
}
enum PrivateFlags {
USER_STYLE,
RESIZE_PENDING,
HAS_POINTER,
SHADOWED,
HAS_SHAPE_MASK,
IN_REPARENT,
DIRECTION_SET,
DIRECTION_LTR,
ANCHORED,
CHILD_VISIBLE,
REDRAW_ON_ALLOC,
ALLOC_NEEDED,
REQUEST_NEEDED,
}
export namespace RcFlags {
export const $gtype: GObject.GType<RcFlags>;
}
enum RcFlags {
FG,
BG,
TEXT,
BASE,
}
export namespace RecentFilterFlags {
export const $gtype: GObject.GType<RecentFilterFlags>;
}
enum RecentFilterFlags {
URI,
DISPLAY_NAME,
MIME_TYPE,
APPLICATION,
GROUP,
AGE,
}
export namespace SignalRunType {
export const $gtype: GObject.GType<SignalRunType>;
}
enum SignalRunType {
FIRST,
LAST,
BOTH,
NO_RECURSE,
ACTION,
NO_HOOKS,
}
export namespace TargetFlags {
export const $gtype: GObject.GType<TargetFlags>;
}
enum TargetFlags {
SAME_APP,
SAME_WIDGET,
OTHER_APP,
OTHER_WIDGET,
}
export namespace TextSearchFlags {
export const $gtype: GObject.GType<TextSearchFlags>;
}
enum TextSearchFlags {
VISIBLE_ONLY,
TEXT_ONLY,
}
/**
* Flags used to specify the supported drag targets.
*/
/**
* Flags used to specify the supported drag targets.
*/
export namespace ToolPaletteDragTargets {
export const $gtype: GObject.GType<ToolPaletteDragTargets>;
}
enum ToolPaletteDragTargets {
/**
* Support drag of items.
*/
ITEMS,
/**
* Support drag of groups.
*/
GROUPS,
}
export namespace TreeModelFlags {
export const $gtype: GObject.GType<TreeModelFlags>;
}
enum TreeModelFlags {
ITERS_PERSIST,
LIST_ONLY,
}
export namespace UIManagerItemType {
export const $gtype: GObject.GType<UIManagerItemType>;
}
enum UIManagerItemType {
AUTO,
MENUBAR,
MENU,
TOOLBAR,
PLACEHOLDER,
POPUP,
MENUITEM,
TOOLITEM,
SEPARATOR,
ACCELERATOR,
POPUP_WITH_ACCELS,
}
/**
* Tells about certain properties of the widget.
*/
/**
* Tells about certain properties of the widget.
*/
export namespace WidgetFlags {
export const $gtype: GObject.GType<WidgetFlags>;
}
enum WidgetFlags {
/**
* widgets without a real parent, as there are #GtkWindow<!-- -->s and
* #GtkMenu<!-- -->s have this flag set throughout their lifetime.
* Toplevel widgets always contain their own #GdkWindow.
*/
TOPLEVEL,
/**
* Indicative for a widget that does not provide its own #GdkWindow.
* Visible action (e.g. drawing) is performed on the parent's #GdkWindow.
*/
NO_WINDOW,
/**
* Set by gtk_widget_realize(), unset by gtk_widget_unrealize().
* A realized widget has an associated #GdkWindow.
*/
REALIZED,
/**
* Set by gtk_widget_map(), unset by gtk_widget_unmap().
* Only realized widgets can be mapped. It means that gdk_window_show()
* has been called on the widgets window(s).
*/
MAPPED,
/**
* Set by gtk_widget_show(), unset by gtk_widget_hide(). Implies that a
* widget will be mapped as soon as its parent is mapped.
*/
VISIBLE,
/**
* Set and unset by gtk_widget_set_sensitive().
* The sensitivity of a widget determines whether it will receive
* certain events (e.g. button or key presses). One premise for
* the widget's sensitivity is to have this flag set.
*/
SENSITIVE,
/**
* Set and unset by gtk_widget_set_sensitive() operations on the
* parents of the widget.
* This is the second premise for the widget's sensitivity. Once
* it has %GTK_SENSITIVE and %GTK_PARENT_SENSITIVE set, its state is
* effectively sensitive. This is expressed (and can be examined) by
* the #GTK_WIDGET_IS_SENSITIVE macro.
*/
PARENT_SENSITIVE,
/**
* Determines whether a widget is able to handle focus grabs.
*/
CAN_FOCUS,
/**
* Set by gtk_widget_grab_focus() for widgets that also
* have %GTK_CAN_FOCUS set. The flag will be unset once another widget
* grabs the focus.
*/
HAS_FOCUS,
/**
* The widget is allowed to receive the default action via
* gtk_widget_grab_default() and will reserve space to draw the default if possible
*/
CAN_DEFAULT,
/**
* The widget currently is receiving the default action and
* should be drawn appropriately if possible
*/
HAS_DEFAULT,
/**
* Set by gtk_grab_add(), unset by gtk_grab_remove(). It means that the
* widget is in the grab_widgets stack, and will be the preferred one for
* receiving events other than ones of cosmetic value.
*/
HAS_GRAB,
/**
* Indicates that the widget's style has been looked up through the rc
* mechanism. It does not imply that the widget actually had a style
* defined through the rc mechanism.
*/
RC_STYLE,
/**
* Indicates that the widget is a composite child of its parent; see
* gtk_widget_push_composite_child(), gtk_widget_pop_composite_child().
*/
COMPOSITE_CHILD,
/**
* Unused since before GTK+ 1.2, will be removed in a future version.
*/
NO_REPARENT,
/**
* Set and unset by gtk_widget_set_app_paintable().
* Must be set on widgets whose window the application directly draws on,
* in order to keep GTK+ from overwriting the drawn stuff. See
* <xref linkend="app-paintable-widgets"/> for a detailed
* description of this flag.
*/
APP_PAINTABLE,
/**
* The widget when focused will receive the default action and have
* %GTK_HAS_DEFAULT set even if there is a different widget set as default.
*/
RECEIVES_DEFAULT,
/**
* Set and unset by gtk_widget_set_double_buffered().
* Indicates that exposes done on the widget should be
* double-buffered. See <xref linkend="double-buffering"/> for a
* detailed discussion of how double-buffering works in GTK+ and
* why you may want to disable it for special cases.
*/
DOUBLE_BUFFERED,
NO_SHOW_ALL,
}
namespace AboutDialog {
// Signal callback interfaces
interface ActivateLink {
(uri: string): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
artists: string[];
authors: string[];
comments: string;
copyright: string;
documenters: string[];
license: string;
logo: GdkPixbuf.Pixbuf;
logo_icon_name: string;
logoIconName: string;
program_name: string;
programName: string;
translator_credits: string;
translatorCredits: string;
version: string;
website: string;
website_label: string;
websiteLabel: string;
wrap_license: boolean;
wrapLicense: boolean;
}
}
/**
* The #GtkAboutDialog offers a simple way to display information about
* a program like its logo, name, copyright, website and license. It is
* also possible to give credits to the authors, documenters, translators
* and artists who have worked on the program. An about dialog is typically
* opened when the user selects the <literal>About</literal> option from
* the <literal>Help</literal> menu. All parts of the dialog are optional.
*
* About dialog often contain links and email addresses. #GtkAboutDialog
* supports this by offering global hooks, which are called when the user
* clicks on a link or email address, see gtk_about_dialog_set_email_hook()
* and gtk_about_dialog_set_url_hook(). Email addresses in the
* authors, documenters and artists properties are recognized by looking for
* <literal>&lt;user`<`!-- -->host&gt;</literal>, URLs are
* recognized by looking for <literal>http://url</literal>, with
* <literal>url</literal> extending to the next space, tab or line break.
*
* <para id="gtk-about-dialog-hook-setup">
* Since 2.18 #GtkAboutDialog provides default website and email hooks that
* use gtk_show_uri().
* </para>
*
* If you want provide your own hooks overriding the default ones, it is
* important to do so before setting the website and email URL properties,
* like this:
* <informalexample><programlisting>
* gtk_about_dialog_set_url_hook (GTK_ABOUT_DIALOG (dialog), launch_url, NULL, NULL);
* gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (dialog), app_url);
* </programlisting></informalexample>
* To disable the default hooks, you can pass %NULL as the hook func. Then,
* the #GtkAboutDialog widget will not display the website or the
* email addresses as clickable.
*
* To make constructing a #GtkAboutDialog as convenient as possible, you can
* use the function gtk_show_about_dialog() which constructs and shows a dialog
* and keeps it around so that it can be shown again.
*
* Note that GTK+ sets a default title of <literal>_("About &percnt;s")</literal>
* on the dialog window (where &percnt;s is replaced by the name of the
* application, but in order to ensure proper translation of the title,
* applications should set the title property explicitly when constructing
* a #GtkAboutDialog, as shown in the following example:
* <informalexample><programlisting>
* gtk_show_about_dialog (NULL,
* "program-name", "ExampleCode",
* "logo", example_logo,
* "title" _("About ExampleCode"),
* NULL);
* </programlisting></informalexample>
* Note that prior to GTK+ 2.12, the #GtkAboutDialog:program-name property
* was called "name". This was changed to avoid the conflict with the
* #GtkWidget:name property.
*/
class AboutDialog extends Dialog implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<AboutDialog>;
// Properties
/**
* The people who contributed artwork to the program, as a %NULL-terminated
* array of strings. Each string may contain email addresses and URLs, which
* will be displayed as links, see the introduction for more details.
*/
get artists(): string[];
set artists(val: string[]);
/**
* The authors of the program, as a %NULL-terminated array of strings.
* Each string may contain email addresses and URLs, which will be displayed
* as links, see the introduction for more details.
*/
get authors(): string[];
set authors(val: string[]);
/**
* Comments about the program. This string is displayed in a label
* in the main dialog, thus it should be a short explanation of
* the main purpose of the program, not a detailed list of features.
*/
get comments(): string;
set comments(val: string);
/**
* Copyright information for the program.
*/
get copyright(): string;
set copyright(val: string);
/**
* The people documenting the program, as a %NULL-terminated array of strings.
* Each string may contain email addresses and URLs, which will be displayed
* as links, see the introduction for more details.
*/
get documenters(): string[];
set documenters(val: string[]);
/**
* The license of the program. This string is displayed in a
* text view in a secondary dialog, therefore it is fine to use
* a long multi-paragraph text. Note that the text is only wrapped
* in the text view if the "wrap-license" property is set to %TRUE;
* otherwise the text itself must contain the intended linebreaks.
*/
get license(): string;
set license(val: string);
/**
* A logo for the about box. If this is not set, it defaults to
* gtk_window_get_default_icon_list().
*/
get logo(): GdkPixbuf.Pixbuf;
set logo(val: GdkPixbuf.Pixbuf);
/**
* A named icon to use as the logo for the about box. This property
* overrides the #GtkAboutDialog:logo property.
*/
get logo_icon_name(): string;
set logo_icon_name(val: string);
/**
* A named icon to use as the logo for the about box. This property
* overrides the #GtkAboutDialog:logo property.
*/
get logoIconName(): string;
set logoIconName(val: string);
/**
* The name of the program.
* If this is not set, it defaults to g_get_application_name().
*/
get program_name(): string;
set program_name(val: string);
/**
* The name of the program.
* If this is not set, it defaults to g_get_application_name().
*/
get programName(): string;
set programName(val: string);
/**
* Credits to the translators. This string should be marked as translatable.
* The string may contain email addresses and URLs, which will be displayed
* as links, see the introduction for more details.
*/
get translator_credits(): string;
set translator_credits(val: string);
/**
* Credits to the translators. This string should be marked as translatable.
* The string may contain email addresses and URLs, which will be displayed
* as links, see the introduction for more details.
*/
get translatorCredits(): string;
set translatorCredits(val: string);
/**
* The version of the program.
*/
get version(): string;
set version(val: string);
/**
* The URL for the link to the website of the program.
* This should be a string starting with "http://.
*/
get website(): string;
set website(val: string);
/**
* The label for the link to the website of the program. If this is not set,
* it defaults to the URL specified in the #GtkAboutDialog:website property.
*/
get website_label(): string;
set website_label(val: string);
/**
* The label for the link to the website of the program. If this is not set,
* it defaults to the URL specified in the #GtkAboutDialog:website property.
*/
get websiteLabel(): string;
set websiteLabel(val: string);
/**
* Whether to wrap the text in the license dialog.
*/
get wrap_license(): boolean;
set wrap_license(val: boolean);
/**
* Whether to wrap the text in the license dialog.
*/
get wrapLicense(): boolean;
set wrapLicense(val: boolean);
// Constructors
constructor(properties?: Partial<AboutDialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): AboutDialog;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate-link', callback: (_source: this, uri: string) => boolean): number;
connect_after(signal: 'activate-link', callback: (_source: this, uri: string) => boolean): number;
emit(signal: 'activate-link', uri: string): void;
// Virtual methods
vfunc_activate_link(uri: string): boolean;
// Methods
/**
* Returns the string which are displayed in the artists tab
* of the secondary credits dialog.
* @returns A %NULL-terminated string array containing the artists. The array is owned by the about dialog and must not be modified.
*/
get_artists(): string[];
/**
* Returns the string which are displayed in the authors tab
* of the secondary credits dialog.
* @returns A %NULL-terminated string array containing the authors. The array is owned by the about dialog and must not be modified.
*/
get_authors(): string[];
/**
* Returns the comments string.
* @returns The comments. The string is owned by the about dialog and must not be modified.
*/
get_comments(): string;
/**
* Returns the copyright string.
* @returns The copyright string. The string is owned by the about dialog and must not be modified.
*/
get_copyright(): string;
/**
* Returns the string which are displayed in the documenters
* tab of the secondary credits dialog.
* @returns A %NULL-terminated string array containing the documenters. The array is owned by the about dialog and must not be modified.
*/
get_documenters(): string[];
/**
* Returns the license information.
* @returns The license information. The string is owned by the about dialog and must not be modified.
*/
get_license(): string;
/**
* Returns the pixbuf displayed as logo in the about dialog.
* @returns the pixbuf displayed as logo. The pixbuf is owned by the about dialog. If you want to keep a reference to it, you have to call g_object_ref() on it.
*/
get_logo(): GdkPixbuf.Pixbuf;
/**
* Returns the icon name displayed as logo in the about dialog.
* @returns the icon name displayed as logo. The string is owned by the dialog. If you want to keep a reference to it, you have to call g_strdup() on it.
*/
get_logo_icon_name(): string;
/**
* Returns the program name displayed in the about dialog.
* @returns The program name. The string is owned by the about dialog and must not be modified.
*/
get_name(): string;
/**
* Returns the program name displayed in the about dialog.
* @returns The program name. The string is owned by the about dialog and must not be modified.
*/
get_program_name(): string;
/**
* Returns the translator credits string which is displayed
* in the translators tab of the secondary credits dialog.
* @returns The translator credits string. The string is owned by the about dialog and must not be modified.
*/
get_translator_credits(): string;
/**
* Returns the version string.
* @returns The version string. The string is owned by the about dialog and must not be modified.
*/
get_version(): string;
/**
* Returns the website URL.
* @returns The website URL. The string is owned by the about dialog and must not be modified.
*/
get_website(): string;
/**
* Returns the label used for the website link.
* @returns The label used for the website link. The string is owned by the about dialog and must not be modified.
*/
get_website_label(): string;
/**
* Returns whether the license text in `about` is
* automatically wrapped.
* @returns %TRUE if the license text is wrapped
*/
get_wrap_license(): boolean;
/**
* Sets the strings which are displayed in the artists tab
* of the secondary credits dialog.
* @param artists a %NULL-terminated array of strings
*/
set_artists(artists: string): void;
/**
* Sets the strings which are displayed in the authors tab
* of the secondary credits dialog.
* @param authors a %NULL-terminated array of strings
*/
set_authors(authors: string): void;
/**
* Sets the comments string to display in the about dialog.
* This should be a short string of one or two lines.
* @param comments a comments string
*/
set_comments(comments?: string | null): void;
/**
* Sets the copyright string to display in the about dialog.
* This should be a short string of one or two lines.
* @param copyright the copyright string
*/
set_copyright(copyright?: string | null): void;
/**
* Sets the strings which are displayed in the documenters tab
* of the secondary credits dialog.
* @param documenters a %NULL-terminated array of strings
*/
set_documenters(documenters: string): void;
/**
* Sets the license information to be displayed in the secondary
* license dialog. If `license` is %NULL, the license button is
* hidden.
* @param license the license information or %NULL
*/
set_license(license?: string | null): void;
/**
* Sets the pixbuf to be displayed as logo in the about dialog.
* If it is %NULL, the default window icon set with
* gtk_window_set_default_icon() will be used.
* @param logo a #GdkPixbuf, or %NULL
*/
set_logo(logo?: GdkPixbuf.Pixbuf | null): void;
/**
* Sets the pixbuf to be displayed as logo in the about dialog.
* If it is %NULL, the default window icon set with
* gtk_window_set_default_icon() will be used.
* @param icon_name an icon name, or %NULL
*/
set_logo_icon_name(icon_name?: string | null): void;
/**
* Sets the name to display in the about dialog.
* If this is not set, it defaults to g_get_application_name().
* @param name the program name
*/
set_name(name?: string | null): void;
// Conflicted with Gtk.Widget.set_name
set_name(...args: never[]): any;
/**
* Sets the name to display in the about dialog.
* If this is not set, it defaults to g_get_application_name().
* @param name the program name
*/
set_program_name(name: string): void;
/**
* Sets the translator credits string which is displayed in
* the translators tab of the secondary credits dialog.
*
* The intended use for this string is to display the translator
* of the language which is currently used in the user interface.
* Using gettext(), a simple way to achieve that is to mark the
* string for translation:
*
* ```
* gtk_about_dialog_set_translator_credits (about, _("translator-credits"));
* ```
*
* It is a good idea to use the customary msgid "translator-credits" for this
* purpose, since translators will already know the purpose of that msgid, and
* since #GtkAboutDialog will detect if "translator-credits" is untranslated
* and hide the tab.
* @param translator_credits the translator credits
*/
set_translator_credits(translator_credits?: string | null): void;
/**
* Sets the version string to display in the about dialog.
* @param version the version string
*/
set_version(version?: string | null): void;
/**
* Sets the URL to use for the website link.
*
* Note that that the hook functions need to be set up
* before calling this function.
* @param website a URL string starting with "http://"
*/
set_website(website?: string | null): void;
/**
* Sets the label to be used for the website link.
* It defaults to the website URL.
* @param website_label the label used for the website link
*/
set_website_label(website_label: string): void;
/**
* Sets whether the license text in `about` is
* automatically wrapped.
* @param wrap_license whether to wrap the license
*/
set_wrap_license(wrap_license: boolean): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace AccelGroup {
// Signal callback interfaces
interface AccelActivate {
(acceleratable: GObject.Object, keyval: number, modifier: Gdk.ModifierType): boolean;
}
interface AccelChanged {
(keyval: number, modifier: Gdk.ModifierType, accel_closure: GObject.Closure): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
is_locked: boolean;
isLocked: boolean;
modifier_mask: Gdk.ModifierType;
modifierMask: Gdk.ModifierType;
}
}
/**
* A #GtkAccelGroup represents a group of keyboard accelerators,
* typically attached to a toplevel #GtkWindow (with
* gtk_window_add_accel_group()). Usually you won't need to create a
* #GtkAccelGroup directly; instead, when using #GtkItemFactory, GTK+
* automatically sets up the accelerators for your menus in the item
* factory's #GtkAccelGroup.
*
*
* Note that <firstterm>accelerators</firstterm> are different from
* <firstterm>mnemonics</firstterm>. Accelerators are shortcuts for
* activating a menu item; they appear alongside the menu item they're a
* shortcut for. For example "Ctrl+Q" might appear alongside the "Quit"
* menu item. Mnemonics are shortcuts for GUI elements such as text
* entries or buttons; they appear as underlined characters. See
* gtk_label_new_with_mnemonic(). Menu items can have both accelerators
* and mnemonics, of course.
*/
class AccelGroup extends GObject.Object {
static $gtype: GObject.GType<AccelGroup>;
// Properties
get is_locked(): boolean;
get isLocked(): boolean;
get modifier_mask(): Gdk.ModifierType;
get modifierMask(): Gdk.ModifierType;
// Fields
lock_count: number;
acceleratables: any[];
n_accels: number;
// Constructors
constructor(properties?: Partial<AccelGroup.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): AccelGroup;
// Signals
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect_after(
signal: 'accel-activate',
callback: (
_source: this,
acceleratable: GObject.Object,
keyval: number,
modifier: Gdk.ModifierType,
) => boolean,
): number;
emit(
signal: 'accel-activate',
acceleratable: GObject.Object,
keyval: number,
modifier: Gdk.ModifierType,
): void;
connect_after(
signal: 'accel-changed',
callback: (
_source: this,
keyval: number,
modifier: Gdk.ModifierType,
accel_closure: GObject.Closure,
) => void,
): number;
emit(
signal: 'accel-changed',
keyval: number,
modifier: Gdk.ModifierType,
accel_closure: GObject.Closure,
): void;
// Static methods
/**
* Finds the #GtkAccelGroup to which `closure` is connected;
* see gtk_accel_group_connect().
* @param closure a #GClosure
*/
static from_accel_closure(closure: GObject.Closure): AccelGroup;
// Virtual methods
vfunc_accel_changed(keyval: number, modifier: Gdk.ModifierType, accel_closure: GObject.Closure): void;
// Methods
/**
* Finds the first accelerator in `accel_group`
* that matches `accel_key` and `accel_mods,` and
* activates it.
* @param accel_quark the quark for the accelerator name
* @param acceleratable the #GObject, usually a #GtkWindow, on which to activate the accelerator.
* @param accel_key accelerator keyval from a key event
* @param accel_mods keyboard state mask from a key event
* @returns %TRUE if an accelerator was activated and handled this keypress
*/
activate(
accel_quark: GLib.Quark,
acceleratable: GObject.Object,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
): boolean;
/**
* Installs an accelerator in this group. When `accel_group` is being activated
* in response to a call to gtk_accel_groups_activate(), `closure` will be
* invoked if the `accel_key` and `accel_mods` from gtk_accel_groups_activate()
* match those of this connection.
*
* The signature used for the `closure` is that of #GtkAccelGroupActivate.
*
* Note that, due to implementation details, a single closure can only be
* connected to one accelerator group.
* @param accel_key key value of the accelerator
* @param accel_mods modifier combination of the accelerator
* @param accel_flags a flag mask to configure this accelerator
* @param closure closure to be executed upon accelerator activation
*/
connect(
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
closure: GObject.Closure,
): void;
connect(...args: never[]): any;
/**
* Installs an accelerator in this group, using an accelerator path to look
* up the appropriate key and modifiers (see gtk_accel_map_add_entry()).
* When `accel_group` is being activated in response to a call to
* gtk_accel_groups_activate(), `closure` will be invoked if the `accel_key` and
* `accel_mods` from gtk_accel_groups_activate() match the key and modifiers
* for the path.
*
* The signature used for the `closure` is that of #GtkAccelGroupActivate.
*
* Note that `accel_path` string will be stored in a #GQuark. Therefore, if you
* pass a static string, you can save some memory by interning it first with
* g_intern_static_string().
* @param accel_path path used for determining key and modifiers.
* @param closure closure to be executed upon accelerator activation
*/
connect_by_path(accel_path: string, closure: GObject.Closure): void;
/**
* Removes an accelerator previously installed through
* gtk_accel_group_connect().
*
* Since 2.20 `closure` can be %NULL.
* @param closure the closure to remove from this accelerator group, or %NULL to remove all closures
* @returns %TRUE if the closure was found and got disconnected
*/
disconnect(closure?: GObject.Closure | null): boolean;
// Conflicted with GObject.Object.disconnect
disconnect(...args: never[]): any;
/**
* Removes an accelerator previously installed through
* gtk_accel_group_connect().
* @param accel_key key value of the accelerator
* @param accel_mods modifier combination of the accelerator
* @returns %TRUE if there was an accelerator which could be removed, %FALSE otherwise
*/
disconnect_key(accel_key: number, accel_mods: Gdk.ModifierType | null): boolean;
/**
* Locks are added and removed using gtk_accel_group_lock() and
* gtk_accel_group_unlock().
* @returns %TRUE if there are 1 or more locks on the @accel_group, %FALSE otherwise.
*/
get_is_locked(): boolean;
/**
* Gets a #GdkModifierType representing the mask for this
* `accel_group`. For example, #GDK_CONTROL_MASK, #GDK_SHIFT_MASK, etc.
* @returns the modifier mask for this accel group.
*/
get_modifier_mask(): Gdk.ModifierType;
/**
* Locks the given accelerator group.
*
* Locking an acelerator group prevents the accelerators contained
* within it to be changed during runtime. Refer to
* gtk_accel_map_change_entry() about runtime accelerator changes.
*
* If called more than once, `accel_group` remains locked until
* gtk_accel_group_unlock() has been called an equivalent number
* of times.
*/
lock(): void;
/**
* Undoes the last call to gtk_accel_group_lock() on this `accel_group`.
*/
unlock(): void;
}
namespace AccelLabel {
// Constructor properties interface
interface ConstructorProps
extends Label.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
accel_closure: GObject.Closure;
accelClosure: GObject.Closure;
accel_widget: Widget;
accelWidget: Widget;
}
}
/**
* The #GtkAccelLabel widget is a subclass of #GtkLabel that also displays an
* accelerator key on the right of the label text, e.g. 'Ctl+S'.
* It is commonly used in menus to show the keyboard short-cuts for commands.
*
* The accelerator key to display is not set explicitly.
* Instead, the #GtkAccelLabel displays the accelerators which have been added to
* a particular widget. This widget is set by calling
* gtk_accel_label_set_accel_widget().
*
* For example, a #GtkMenuItem widget may have an accelerator added to emit the
* "activate" signal when the 'Ctl+S' key combination is pressed.
* A #GtkAccelLabel is created and added to the #GtkMenuItem, and
* gtk_accel_label_set_accel_widget() is called with the #GtkMenuItem as the
* second argument. The #GtkAccelLabel will now display 'Ctl+S' after its label.
*
* Note that creating a #GtkMenuItem with gtk_menu_item_new_with_label() (or
* one of the similar functions for #GtkCheckMenuItem and #GtkRadioMenuItem)
* automatically adds a #GtkAccelLabel to the #GtkMenuItem and calls
* gtk_accel_label_set_accel_widget() to set it up for you.
*
* A #GtkAccelLabel will only display accelerators which have %GTK_ACCEL_VISIBLE
* set (see #GtkAccelFlags).
* A #GtkAccelLabel can display multiple accelerators and even signal names,
* though it is almost always used to display just one accelerator key.
* <example>
* <title>Creating a simple menu item with an accelerator key.</title>
* <programlisting>
* GtkWidget *save_item;
* GtkAccelGroup *accel_group;
*
* /<!---->* Create a GtkAccelGroup and add it to the window. *<!---->/
* accel_group = gtk_accel_group_new (<!-- -->);
* gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
*
* /<!---->* Create the menu item using the convenience function. *<!---->/
* save_item = gtk_menu_item_new_with_label ("Save");
* gtk_widget_show (save_item);
* gtk_container_add (GTK_CONTAINER (menu), save_item);
*
* /<!---->* Now add the accelerator to the GtkMenuItem. Note that since we called
* gtk_menu_item_new_with_label(<!-- -->) to create the GtkMenuItem the
* GtkAccelLabel is automatically set up to display the GtkMenuItem
* accelerators. We just need to make sure we use GTK_ACCEL_VISIBLE here. *<!---->/
* gtk_widget_add_accelerator (save_item, "activate", accel_group,
* GDK_s, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
* </programlisting>
* </example>
*/
class AccelLabel extends Label implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<AccelLabel>;
// Properties
get accel_closure(): GObject.Closure;
set accel_closure(val: GObject.Closure);
get accelClosure(): GObject.Closure;
set accelClosure(val: GObject.Closure);
get accel_widget(): Widget;
set accel_widget(val: Widget);
get accelWidget(): Widget;
set accelWidget(val: Widget);
// Fields
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
label: Label;
gtk_reserved: number;
accel_padding: number;
accel_group: AccelGroup;
accel_string: string;
accel_string_width: number;
// Constructors
constructor(properties?: Partial<AccelLabel.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](string: string): AccelLabel;
// Methods
/**
* Fetches the widget monitored by this accelerator label. See
* gtk_accel_label_set_accel_widget().
* @returns the object monitored by the accelerator label, or %NULL.
*/
get_accel_widget(): Widget;
/**
* Returns the width needed to display the accelerator key(s).
* This is used by menus to align all of the #GtkMenuItem widgets, and shouldn't
* be needed by applications.
* @returns the width needed to display the accelerator key(s).
*/
get_accel_width(): number;
/**
* Recreates the string representing the accelerator keys.
* This should not be needed since the string is automatically updated whenever
* accelerators are added or removed from the associated widget.
* @returns always returns %FALSE.
*/
refetch(): boolean;
/**
* Sets the closure to be monitored by this accelerator label. The closure
* must be connected to an accelerator group; see gtk_accel_group_connect().
* @param accel_closure the closure to monitor for accelerator changes.
*/
set_accel_closure(accel_closure: GObject.Closure): void;
/**
* Sets the widget to be monitored by this accelerator label.
* @param accel_widget the widget to be monitored.
*/
set_accel_widget(accel_widget: Widget): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace AccelMap {
// Signal callback interfaces
interface Changed {
(accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class AccelMap extends GObject.Object {
static $gtype: GObject.GType<AccelMap>;
// Constructors
constructor(properties?: Partial<AccelMap.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'changed',
callback: (_source: this, accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType) => void,
): number;
connect_after(
signal: 'changed',
callback: (_source: this, accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType) => void,
): number;
emit(signal: 'changed', accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType): void;
// Static methods
/**
* Registers a new accelerator with the global accelerator map.
* This function should only be called once per `accel_path`
* with the canonical `accel_key` and `accel_mods` for this path.
* To change the accelerator during runtime programatically, use
* gtk_accel_map_change_entry().
* The accelerator path must consist of "&lt;WINDOWTYPE&gt;/Category1/Category2/.../Action",
* where &lt;WINDOWTYPE&gt; should be a unique application-specific identifier, that
* corresponds to the kind of window the accelerator is being used in, e.g. "Gimp-Image",
* "Abiword-Document" or "Gnumeric-Settings".
* The Category1/.../Action portion is most appropriately chosen by the action the
* accelerator triggers, i.e. for accelerators on menu items, choose the item's menu path,
* e.g. "File/Save As", "Image/View/Zoom" or "Edit/Select All".
* So a full valid accelerator path may look like:
* "&lt;Gimp-Toolbox&gt;/File/Dialogs/Tool Options...".
*
* Note that `accel_path` string will be stored in a #GQuark. Therefore, if you
* pass a static string, you can save some memory by interning it first with
* g_intern_static_string().
* @param accel_path valid accelerator path
* @param accel_key the accelerator key
* @param accel_mods the accelerator modifiers
*/
static add_entry(accel_path: string, accel_key: number, accel_mods: Gdk.ModifierType): void;
/**
* Adds a filter to the global list of accel path filters.
*
* Accel map entries whose accel path matches one of the filters
* are skipped by gtk_accel_map_foreach().
*
* This function is intended for GTK+ modules that create their own
* menus, but don't want them to be saved into the applications accelerator
* map dump.
* @param filter_pattern a pattern (see #GPatternSpec)
*/
static add_filter(filter_pattern: string): void;
/**
* Changes the `accel_key` and `accel_mods` currently associated with `accel_path`.
* Due to conflicts with other accelerators, a change may not always be possible,
* `replace` indicates whether other accelerators may be deleted to resolve such
* conflicts. A change will only occur if all conflicts could be resolved (which
* might not be the case if conflicting accelerators are locked). Successful
* changes are indicated by a %TRUE return value.
*
* Note that `accel_path` string will be stored in a #GQuark. Therefore, if you
* pass a static string, you can save some memory by interning it first with
* g_intern_static_string().
* @param accel_path a valid accelerator path
* @param accel_key the new accelerator key
* @param accel_mods the new accelerator modifiers
* @param replace %TRUE if other accelerators may be deleted upon conflicts
*/
static change_entry(
accel_path: string,
accel_key: number,
accel_mods: Gdk.ModifierType,
replace: boolean,
): boolean;
/**
* Parses a file previously saved with gtk_accel_map_save() for
* accelerator specifications, and propagates them accordingly.
* @param file_name a file containing accelerator specifications, in the GLib file name encoding
*/
static load(file_name: string): void;
/**
* Filedescriptor variant of gtk_accel_map_load().
*
* Note that the file descriptor will not be closed by this function.
* @param fd a valid readable file descriptor
*/
static load_fd(fd: number): void;
/**
* #GScanner variant of gtk_accel_map_load().
* @param scanner a #GScanner which has already been provided with an input file
*/
static load_scanner(scanner: GLib.Scanner): void;
/**
* Locks the given accelerator path. If the accelerator map doesn't yet contain
* an entry for `accel_path,` a new one is created.
*
* Locking an accelerator path prevents its accelerator from being changed
* during runtime. A locked accelerator path can be unlocked by
* gtk_accel_map_unlock_path(). Refer to gtk_accel_map_change_entry()
* for information about runtime accelerator changes.
*
* If called more than once, `accel_path` remains locked until
* gtk_accel_map_unlock_path() has been called an equivalent number
* of times.
*
* Note that locking of individual accelerator paths is independent from
* locking the #GtkAccelGroup containing them. For runtime accelerator
* changes to be possible both the accelerator path and its #GtkAccelGroup
* have to be unlocked.
* @param accel_path a valid accelerator path
*/
static lock_path(accel_path: string): void;
/**
* Looks up the accelerator entry for `accel_path` and fills in `key`.
* @param accel_path a valid accelerator path
* @param key the accelerator key to be filled in (optional)
*/
static lookup_entry(accel_path: string, key: AccelKey): boolean;
/**
* Saves current accelerator specifications (accelerator path, key
* and modifiers) to `file_name`.
* The file is written in a format suitable to be read back in by
* gtk_accel_map_load().
* @param file_name the name of the file to contain accelerator specifications, in the GLib file name encoding
*/
static save(file_name: string): void;
/**
* Filedescriptor variant of gtk_accel_map_save().
*
* Note that the file descriptor will not be closed by this function.
* @param fd a valid writable file descriptor
*/
static save_fd(fd: number): void;
/**
* Undoes the last call to gtk_accel_map_lock_path() on this `accel_path`.
* Refer to gtk_accel_map_lock_path() for information about accelerator path locking.
* @param accel_path a valid accelerator path
*/
static unlock_path(accel_path: string): void;
}
namespace Accessible {
// Constructor properties interface
interface ConstructorProps extends Atk.Object.ConstructorProps {}
}
class Accessible extends Atk.Object {
static $gtype: GObject.GType<Accessible>;
// Fields
widget: Widget;
// Constructors
constructor(properties?: Partial<Accessible.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Virtual methods
/**
* This function specifies the callback function to be called when the widget
* corresponding to a GtkAccessible is destroyed.
*/
vfunc_connect_widget_destroyed(): void;
// Methods
/**
* This function specifies the callback function to be called when the widget
* corresponding to a GtkAccessible is destroyed.
*/
connect_widget_destroyed(): void;
/**
* Gets the #GtkWidget corresponding to the #GtkAccessible. The returned widget
* does not have a reference added, so you do not need to unref it.
* @returns pointer to the #GtkWidget corresponding to the #GtkAccessible, or %NULL.
*/
get_widget(): Widget;
/**
* Sets the #GtkWidget corresponding to the #GtkAccessible.
* @param widget a #GtkWidget
*/
set_widget(widget: Widget): void;
}
namespace Action {
// Signal callback interfaces
interface Activate {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps {
action_group: ActionGroup;
actionGroup: ActionGroup;
always_show_image: boolean;
alwaysShowImage: boolean;
gicon: Gio.Icon;
hide_if_empty: boolean;
hideIfEmpty: boolean;
icon_name: string;
iconName: string;
is_important: boolean;
isImportant: boolean;
label: string;
name: string;
sensitive: boolean;
short_label: string;
shortLabel: string;
stock_id: string;
stockId: string;
tooltip: string;
visible: boolean;
visible_horizontal: boolean;
visibleHorizontal: boolean;
visible_overflown: boolean;
visibleOverflown: boolean;
visible_vertical: boolean;
visibleVertical: boolean;
}
}
/**
* Actions represent operations that the user can be perform, along with
* some information how it should be presented in the interface. Each action
* provides methods to create icons, menu items and toolbar items
* representing itself.
*
* As well as the callback that is called when the action gets activated,
* the following also gets associated with the action:
* <itemizedlist>
* <listitem><para>a name (not translated, for path lookup)</para></listitem>
* <listitem><para>a label (translated, for display)</para></listitem>
* <listitem><para>an accelerator</para></listitem>
* <listitem><para>whether label indicates a stock id</para></listitem>
* <listitem><para>a tooltip (optional, translated)</para></listitem>
* <listitem><para>a toolbar label (optional, shorter than label)</para></listitem>
* </itemizedlist>
* The action will also have some state information:
* <itemizedlist>
* <listitem><para>visible (shown/hidden)</para></listitem>
* <listitem><para>sensitive (enabled/disabled)</para></listitem>
* </itemizedlist>
* Apart from regular actions, there are <link linkend="GtkToggleAction">toggle
* actions</link>, which can be toggled between two states and <link
* linkend="GtkRadioAction">radio actions</link>, of which only one in a group
* can be in the "active" state. Other actions can be implemented as #GtkAction
* subclasses.
*
* Each action can have one or more proxy menu item, toolbar button or
* other proxy widgets. Proxies mirror the state of the action (text
* label, tooltip, icon, visible, sensitive, etc), and should change when
* the action's state changes. When the proxy is activated, it should
* activate its action.
*/
class Action extends GObject.Object implements Buildable {
static $gtype: GObject.GType<Action>;
// Properties
get action_group(): ActionGroup;
set action_group(val: ActionGroup);
get actionGroup(): ActionGroup;
set actionGroup(val: ActionGroup);
/**
* If %TRUE, the action's menu item proxies will ignore the #GtkSettings:gtk-menu-images
* setting and always show their image, if available.
*
* Use this property if the menu item would be useless or hard to use
* without their image.
*/
get always_show_image(): boolean;
set always_show_image(val: boolean);
/**
* If %TRUE, the action's menu item proxies will ignore the #GtkSettings:gtk-menu-images
* setting and always show their image, if available.
*
* Use this property if the menu item would be useless or hard to use
* without their image.
*/
get alwaysShowImage(): boolean;
set alwaysShowImage(val: boolean);
/**
* The #GIcon displayed in the #GtkAction.
*
* Note that the stock icon is preferred, if the #GtkAction:stock-id
* property holds the id of an existing stock icon.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get gicon(): Gio.Icon;
set gicon(val: Gio.Icon);
get hide_if_empty(): boolean;
set hide_if_empty(val: boolean);
get hideIfEmpty(): boolean;
set hideIfEmpty(val: boolean);
/**
* The name of the icon from the icon theme.
*
* Note that the stock icon is preferred, if the #GtkAction:stock-id
* property holds the id of an existing stock icon, and the #GIcon is
* preferred if the #GtkAction:gicon property is set.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of the icon from the icon theme.
*
* Note that the stock icon is preferred, if the #GtkAction:stock-id
* property holds the id of an existing stock icon, and the #GIcon is
* preferred if the #GtkAction:gicon property is set.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get iconName(): string;
set iconName(val: string);
get is_important(): boolean;
set is_important(val: boolean);
get isImportant(): boolean;
set isImportant(val: boolean);
/**
* The label used for menu items and buttons that activate
* this action. If the label is %NULL, GTK+ uses the stock
* label specified via the stock-id property.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get label(): string;
set label(val: string);
get name(): string;
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* A shorter label that may be used on toolbar buttons.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get short_label(): string;
set short_label(val: string);
/**
* A shorter label that may be used on toolbar buttons.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get shortLabel(): string;
set shortLabel(val: string);
/**
* The stock icon displayed in widgets representing this action.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get stock_id(): string;
set stock_id(val: string);
/**
* The stock icon displayed in widgets representing this action.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get stockId(): string;
set stockId(val: string);
get tooltip(): string;
set tooltip(val: string);
get visible(): boolean;
set visible(val: boolean);
get visible_horizontal(): boolean;
set visible_horizontal(val: boolean);
get visibleHorizontal(): boolean;
set visibleHorizontal(val: boolean);
/**
* When %TRUE, toolitem proxies for this action are represented in the
* toolbar overflow menu.
*/
get visible_overflown(): boolean;
set visible_overflown(val: boolean);
/**
* When %TRUE, toolitem proxies for this action are represented in the
* toolbar overflow menu.
*/
get visibleOverflown(): boolean;
set visibleOverflown(val: boolean);
get visible_vertical(): boolean;
set visible_vertical(val: boolean);
get visibleVertical(): boolean;
set visibleVertical(val: boolean);
// Fields
object: GObject.Object;
// Constructors
constructor(properties?: Partial<Action.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string, label: string | null, tooltip: string | null, stock_id: string): Action;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate', callback: (_source: this) => void): number;
connect_after(signal: 'activate', callback: (_source: this) => void): number;
emit(signal: 'activate'): void;
// Virtual methods
/**
* Emits the "activate" signal on the specified action, if it isn't
* insensitive. This gets called by the proxy widgets when they get
* activated.
*
* It can also be used to manually activate an action.
*/
vfunc_activate(): void;
/**
* Connects a widget to an action object as a proxy. Synchronises
* various properties of the action with the widget (such as label
* text, icon, tooltip, etc), and attaches a callback so that the
* action gets activated when the proxy widget does.
*
* If the widget is already connected to an action, it is disconnected
* first.
* @param proxy the proxy widget
*/
vfunc_connect_proxy(proxy: Widget): void;
/**
* If `action` provides a #GtkMenu widget as a submenu for the menu
* item or the toolbar item it creates, this function returns an
* instance of that menu.
*/
vfunc_create_menu(): Widget;
/**
* Creates a menu item widget that proxies for the given action.
*/
vfunc_create_menu_item(): Widget;
/**
* Creates a toolbar item widget that proxies for the given action.
*/
vfunc_create_tool_item(): Widget;
/**
* Disconnects a proxy widget from an action.
* Does <emphasis>not</emphasis> destroy the widget, however.
* @param proxy the proxy widget
*/
vfunc_disconnect_proxy(proxy: Widget): void;
// Methods
/**
* Emits the "activate" signal on the specified action, if it isn't
* insensitive. This gets called by the proxy widgets when they get
* activated.
*
* It can also be used to manually activate an action.
*/
activate(): void;
/**
* Disable activation signals from the action
*
* This is needed when updating the state of your proxy
* #GtkActivatable widget could result in calling gtk_action_activate(),
* this is a convenience function to avoid recursing in those
* cases (updating toggle state for instance).
*/
block_activate(): void;
/**
* Disables calls to the gtk_action_activate()
* function by signals on the given proxy widget. This is used to
* break notification loops for things like check or radio actions.
*
* This function is intended for use by action implementations.
* @param proxy a proxy widget
*/
block_activate_from(proxy: Widget): void;
/**
* Installs the accelerator for `action` if `action` has an
* accel path and group. See gtk_action_set_accel_path() and
* gtk_action_set_accel_group()
*
* Since multiple proxies may independently trigger the installation
* of the accelerator, the `action` counts the number of times this
* function has been called and doesn't remove the accelerator until
* gtk_action_disconnect_accelerator() has been called as many times.
*/
connect_accelerator(): void;
/**
* Connects a widget to an action object as a proxy. Synchronises
* various properties of the action with the widget (such as label
* text, icon, tooltip, etc), and attaches a callback so that the
* action gets activated when the proxy widget does.
*
* If the widget is already connected to an action, it is disconnected
* first.
* @param proxy the proxy widget
*/
connect_proxy(proxy: Widget): void;
/**
* This function is intended for use by action implementations to
* create icons displayed in the proxy widgets.
* @param icon_size the size of the icon that should be created.
* @returns a widget that displays the icon for this action.
*/
create_icon(icon_size: number): Widget;
/**
* If `action` provides a #GtkMenu widget as a submenu for the menu
* item or the toolbar item it creates, this function returns an
* instance of that menu.
* @returns the menu item provided by the action, or %NULL.
*/
create_menu(): Widget;
/**
* Creates a menu item widget that proxies for the given action.
* @returns a menu item connected to the action.
*/
create_menu_item(): Widget;
/**
* Creates a toolbar item widget that proxies for the given action.
* @returns a toolbar item connected to the action.
*/
create_tool_item(): Widget;
/**
* Undoes the effect of one call to gtk_action_connect_accelerator().
*/
disconnect_accelerator(): void;
/**
* Disconnects a proxy widget from an action.
* Does <emphasis>not</emphasis> destroy the widget, however.
* @param proxy the proxy widget
*/
disconnect_proxy(proxy: Widget): void;
/**
* Returns the accel closure for this action.
* @returns the accel closure for this action. The returned closure is owned by GTK+ and must not be unreffed or modified.
*/
get_accel_closure(): GObject.Closure;
/**
* Returns the accel path for this action.
* @returns the accel path for this action, or %NULL if none is set. The returned string is owned by GTK+ and must not be freed or modified.
*/
get_accel_path(): string;
/**
* Returns whether `action<`!-- -->'s menu item proxies will ignore the
* #GtkSettings:gtk-menu-images setting and always show their image,
* if available.
* @returns %TRUE if the menu item proxies will always show their image
*/
get_always_show_image(): boolean;
/**
* Gets the gicon of `action`.
* @returns The action's #GIcon if one is set.
*/
get_gicon(): Gio.Icon;
/**
* Gets the icon name of `action`.
* @returns the icon name
*/
get_icon_name(): string;
/**
* Checks whether `action` is important or not
* @returns whether @action is important
*/
get_is_important(): boolean;
/**
* Gets the label text of `action`.
* @returns the label text
*/
get_label(): string;
/**
* Returns the name of the action.
* @returns the name of the action. The string belongs to GTK+ and should not be freed.
*/
get_name(): string;
/**
* Returns the proxy widgets for an action.
* See also gtk_widget_get_action().
* @returns a #GSList of proxy widgets. The list is owned by GTK+ and must not be modified.
*/
get_proxies(): Widget[];
/**
* Returns whether the action itself is sensitive. Note that this doesn't
* necessarily mean effective sensitivity. See gtk_action_is_sensitive()
* for that.
* @returns %TRUE if the action itself is sensitive.
*/
get_sensitive(): boolean;
/**
* Gets the short label text of `action`.
* @returns the short label text.
*/
get_short_label(): string;
/**
* Gets the stock id of `action`.
* @returns the stock id
*/
get_stock_id(): string;
/**
* Gets the tooltip text of `action`.
* @returns the tooltip text
*/
get_tooltip(): string;
/**
* Returns whether the action itself is visible. Note that this doesn't
* necessarily mean effective visibility. See gtk_action_is_sensitive()
* for that.
* @returns %TRUE if the action itself is visible.
*/
get_visible(): boolean;
/**
* Checks whether `action` is visible when horizontal
* @returns whether @action is visible when horizontal
*/
get_visible_horizontal(): boolean;
/**
* Checks whether `action` is visible when horizontal
* @returns whether @action is visible when horizontal
*/
get_visible_vertical(): boolean;
/**
* Returns whether the action is effectively sensitive.
* @returns %TRUE if the action and its associated action group are both sensitive.
*/
is_sensitive(): boolean;
/**
* Returns whether the action is effectively visible.
* @returns %TRUE if the action and its associated action group are both visible.
*/
is_visible(): boolean;
/**
* Sets the #GtkAccelGroup in which the accelerator for this action
* will be installed.
* @param accel_group a #GtkAccelGroup or %NULL
*/
set_accel_group(accel_group?: AccelGroup | null): void;
/**
* Sets the accel path for this action. All proxy widgets associated
* with the action will have this accel path, so that their
* accelerators are consistent.
*
* Note that `accel_path` string will be stored in a #GQuark. Therefore, if you
* pass a static string, you can save some memory by interning it first with
* g_intern_static_string().
* @param accel_path the accelerator path
*/
set_accel_path(accel_path: string): void;
/**
* Sets whether `action<`!-- -->'s menu item proxies will ignore the
* #GtkSettings:gtk-menu-images setting and always show their image, if available.
*
* Use this if the menu item would be useless or hard to use
* without their image.
* @param always_show %TRUE if menuitem proxies should always show their image
*/
set_always_show_image(always_show: boolean): void;
/**
* Sets the icon of `action`.
* @param icon the #GIcon to set
*/
set_gicon(icon: Gio.Icon): void;
/**
* Sets the icon name on `action`
* @param icon_name the icon name to set
*/
set_icon_name(icon_name: string): void;
/**
* Sets whether the action is important, this attribute is used
* primarily by toolbar items to decide whether to show a label
* or not.
* @param is_important %TRUE to make the action important
*/
set_is_important(is_important: boolean): void;
/**
* Sets the label of `action`.
* @param label the label text to set
*/
set_label(label: string): void;
/**
* Sets the ::sensitive property of the action to `sensitive`. Note that
* this doesn't necessarily mean effective sensitivity. See
* gtk_action_is_sensitive()
* for that.
* @param sensitive %TRUE to make the action sensitive
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets a shorter label text on `action`.
* @param short_label the label text to set
*/
set_short_label(short_label: string): void;
/**
* Sets the stock id on `action`
* @param stock_id the stock id
*/
set_stock_id(stock_id: string): void;
/**
* Sets the tooltip text on `action`
* @param tooltip the tooltip text
*/
set_tooltip(tooltip: string): void;
/**
* Sets the ::visible property of the action to `visible`. Note that
* this doesn't necessarily mean effective visibility. See
* gtk_action_is_visible()
* for that.
* @param visible %TRUE to make the action visible
*/
set_visible(visible: boolean): void;
/**
* Sets whether `action` is visible when horizontal
* @param visible_horizontal whether the action is visible horizontally
*/
set_visible_horizontal(visible_horizontal: boolean): void;
/**
* Sets whether `action` is visible when vertical
* @param visible_vertical whether the action is visible vertically
*/
set_visible_vertical(visible_vertical: boolean): void;
/**
* Reenable activation signals from the action
*/
unblock_activate(): void;
/**
* Re-enables calls to the gtk_action_activate()
* function by signals on the given proxy widget. This undoes the
* blocking done by gtk_action_block_activate_from().
*
* This function is intended for use by action implementations.
* @param proxy a proxy widget
*/
unblock_activate_from(proxy: Widget): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ActionGroup {
// Signal callback interfaces
interface ConnectProxy {
(action: Action, proxy: Widget): void;
}
interface DisconnectProxy {
(action: Action, proxy: Widget): void;
}
interface PostActivate {
(action: Action): void;
}
interface PreActivate {
(action: Action): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps {
name: string;
sensitive: boolean;
visible: boolean;
}
}
class ActionGroup extends GObject.Object implements Buildable {
static $gtype: GObject.GType<ActionGroup>;
// Properties
get name(): string;
get sensitive(): boolean;
set sensitive(val: boolean);
get visible(): boolean;
set visible(val: boolean);
// Constructors
constructor(properties?: Partial<ActionGroup.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string): ActionGroup;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'connect-proxy', callback: (_source: this, action: Action, proxy: Widget) => void): number;
connect_after(
signal: 'connect-proxy',
callback: (_source: this, action: Action, proxy: Widget) => void,
): number;
emit(signal: 'connect-proxy', action: Action, proxy: Widget): void;
connect(
signal: 'disconnect-proxy',
callback: (_source: this, action: Action, proxy: Widget) => void,
): number;
connect_after(
signal: 'disconnect-proxy',
callback: (_source: this, action: Action, proxy: Widget) => void,
): number;
emit(signal: 'disconnect-proxy', action: Action, proxy: Widget): void;
connect(signal: 'post-activate', callback: (_source: this, action: Action) => void): number;
connect_after(signal: 'post-activate', callback: (_source: this, action: Action) => void): number;
emit(signal: 'post-activate', action: Action): void;
connect(signal: 'pre-activate', callback: (_source: this, action: Action) => void): number;
connect_after(signal: 'pre-activate', callback: (_source: this, action: Action) => void): number;
emit(signal: 'pre-activate', action: Action): void;
// Virtual methods
/**
* Looks up an action in the action group by name.
* @param action_name the name of the action
*/
vfunc_get_action(action_name: string): Action;
// Methods
/**
* Adds an action object to the action group. Note that this function
* does not set up the accel path of the action, which can lead to problems
* if a user tries to modify the accelerator of a menuitem associated with
* the action. Therefore you must either set the accel path yourself with
* gtk_action_set_accel_path(), or use
* <literal>gtk_action_group_add_action_with_accel (..., NULL)</literal>.
* @param action an action
*/
add_action(action: Action): void;
/**
* Adds an action object to the action group and sets up the accelerator.
*
* If `accelerator` is %NULL, attempts to use the accelerator associated
* with the stock_id of the action.
*
* Accel paths are set to
* <literal>&lt;Actions&gt;/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.
* @param action the action to add
* @param accelerator the accelerator for the action, in the format understood by gtk_accelerator_parse(), or "" for no accelerator, or %NULL to use the stock accelerator
*/
add_action_with_accel(action: Action, accelerator?: string | null): void;
/**
* This is a convenience function to create a number of actions and add them
* to the action group.
*
* The "activate" signals of the actions are connected to the callbacks and
* their accel paths are set to
* <literal>&lt;Actions&gt;/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.
* @param entries an array of action descriptions
* @param n_entries the number of entries
* @param user_data data to pass to the action callbacks
*/
add_actions(entries: ActionEntry, n_entries: number, user_data?: any | null): void;
/**
* This variant of gtk_action_group_add_actions() adds a #GDestroyNotify
* callback for `user_data`.
* @param entries an array of action descriptions
* @param n_entries the number of entries
* @param user_data data to pass to the action callbacks
*/
add_actions_full(entries: ActionEntry, n_entries: number, user_data?: any | null): void;
/**
* This variant of gtk_action_group_add_radio_actions() adds a
* #GDestroyNotify callback for `user_data`.
* @param entries an array of radio action descriptions
* @param n_entries the number of entries
* @param value the value of the action to activate initially, or -1 if no action should be activated
* @param on_change the callback to connect to the changed signal
*/
add_radio_actions_full(
entries: RadioActionEntry,
n_entries: number,
value: number,
on_change: GObject.Callback,
): void;
/**
* This is a convenience function to create a number of toggle actions and add them
* to the action group.
*
* The "activate" signals of the actions are connected to the callbacks and
* their accel paths are set to
* <literal>&lt;Actions&gt;/<replaceable>group-name</replaceable>/<replaceable>action-name</replaceable></literal>.
* @param entries an array of toggle action descriptions
* @param n_entries the number of entries
* @param user_data data to pass to the action callbacks
*/
add_toggle_actions(entries: ToggleActionEntry, n_entries: number, user_data?: any | null): void;
/**
* This variant of gtk_action_group_add_toggle_actions() adds a
* #GDestroyNotify callback for `user_data`.
* @param entries an array of toggle action descriptions
* @param n_entries the number of entries
* @param user_data data to pass to the action callbacks
*/
add_toggle_actions_full(entries: ToggleActionEntry, n_entries: number, user_data?: any | null): void;
/**
* Looks up an action in the action group by name.
* @param action_name the name of the action
* @returns the action, or %NULL if no action by that name exists
*/
get_action(action_name: string): Action;
/**
* Gets the name of the action group.
* @returns the name of the action group.
*/
get_name(): string;
/**
* Returns %TRUE if the group is sensitive. The constituent actions
* can only be logically sensitive (see gtk_action_is_sensitive()) if
* they are sensitive (see gtk_action_get_sensitive()) and their group
* is sensitive.
* @returns %TRUE if the group is sensitive.
*/
get_sensitive(): boolean;
/**
* Returns %TRUE if the group is visible. The constituent actions
* can only be logically visible (see gtk_action_is_visible()) if
* they are visible (see gtk_action_get_visible()) and their group
* is visible.
* @returns %TRUE if the group is visible.
*/
get_visible(): boolean;
/**
* Lists the actions in the action group.
* @returns an allocated list of the action objects in the action group
*/
list_actions(): Action[];
/**
* Removes an action object from the action group.
* @param action an action
*/
remove_action(action: Action): void;
/**
* Changes the sensitivity of `action_group`
* @param sensitive new sensitivity
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets a function to be used for translating the `label` and `tooltip` of
* #GtkActionGroupEntry<!-- -->s added by gtk_action_group_add_actions().
*
* If you're using gettext(), it is enough to set the translation domain
* with gtk_action_group_set_translation_domain().
* @param func a #GtkTranslateFunc
*/
set_translate_func(func: TranslateFunc): void;
/**
* Sets the translation domain and uses g_dgettext() for translating the
* `label` and `tooltip` of #GtkActionEntry<!-- -->s added by
* gtk_action_group_add_actions().
*
* If you're not using gettext() for localization, see
* gtk_action_group_set_translate_func().
* @param domain the translation domain to use for g_dgettext() calls
*/
set_translation_domain(domain: string): void;
/**
* Changes the visible of `action_group`.
* @param visible new visiblity
*/
set_visible(visible: boolean): void;
/**
* Translates a string using the specified translate_func(). This
* is mainly intended for language bindings.
* @param string a string
* @returns the translation of @string
*/
translate_string(string: string): string;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Adjustment {
// Signal callback interfaces
interface Changed {
(): void;
}
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
lower: number;
page_increment: number;
pageIncrement: number;
page_size: number;
pageSize: number;
step_increment: number;
stepIncrement: number;
upper: number;
value: number;
}
}
class Adjustment extends Object {
static $gtype: GObject.GType<Adjustment>;
// Properties
/**
* The minimum value of the adjustment.
*/
get lower(): number;
set lower(val: number);
/**
* The page increment of the adjustment.
*/
get page_increment(): number;
set page_increment(val: number);
/**
* The page increment of the adjustment.
*/
get pageIncrement(): number;
set pageIncrement(val: number);
/**
* The page size of the adjustment.
* Note that the page-size is irrelevant and should be set to zero
* if the adjustment is used for a simple scalar value, e.g. in a
* #GtkSpinButton.
*/
get page_size(): number;
set page_size(val: number);
/**
* The page size of the adjustment.
* Note that the page-size is irrelevant and should be set to zero
* if the adjustment is used for a simple scalar value, e.g. in a
* #GtkSpinButton.
*/
get pageSize(): number;
set pageSize(val: number);
/**
* The step increment of the adjustment.
*/
get step_increment(): number;
set step_increment(val: number);
/**
* The step increment of the adjustment.
*/
get stepIncrement(): number;
set stepIncrement(val: number);
/**
* The maximum value of the adjustment.
* Note that values will be restricted by
* <literal>upper - page-size</literal> if the page-size
* property is nonzero.
*/
get upper(): number;
set upper(val: number);
/**
* The value of the adjustment.
*/
get value(): number;
set value(val: number);
// Constructors
constructor(properties?: Partial<Adjustment.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
value: number,
lower: number,
upper: number,
step_increment: number,
page_increment: number,
page_size: number,
): Adjustment;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
// Virtual methods
vfunc_changed(): void;
vfunc_value_changed(): void;
// Methods
changed(): void;
clamp_page(lower: number, upper: number): void;
/**
* Sets all properties of the adjustment at once.
*
* Use this function to avoid multiple emissions of the "changed"
* signal. See gtk_adjustment_set_lower() for an alternative way
* of compressing multiple emissions of "changed" into one.
* @param value the new value
* @param lower the new minimum value
* @param upper the new maximum value
* @param step_increment the new step increment
* @param page_increment the new page increment
* @param page_size the new page size
*/
configure(
value: number,
lower: number,
upper: number,
step_increment: number,
page_increment: number,
page_size: number,
): void;
/**
* Retrieves the minimum value of the adjustment.
* @returns The current minimum value of the adjustment.
*/
get_lower(): number;
/**
* Retrieves the page increment of the adjustment.
* @returns The current page increment of the adjustment.
*/
get_page_increment(): number;
/**
* Retrieves the page size of the adjustment.
* @returns The current page size of the adjustment.
*/
get_page_size(): number;
/**
* Retrieves the step increment of the adjustment.
* @returns The current step increment of the adjustment.
*/
get_step_increment(): number;
/**
* Retrieves the maximum value of the adjustment.
* @returns The current maximum value of the adjustment.
*/
get_upper(): number;
/**
* Gets the current value of the adjustment. See
* gtk_adjustment_set_value ().
* @returns The current value of the adjustment.
*/
get_value(): number;
/**
* Sets the minimum value of the adjustment.
*
* When setting multiple adjustment properties via their individual
* setters, multiple "changed" signals will be emitted. However, since
* the emission of the "changed" signal is tied to the emission of the
* "GObject::notify" signals of the changed properties, it's possible
* to compress the "changed" signals into one by calling
* g_object_freeze_notify() and g_object_thaw_notify() around the
* calls to the individual setters.
*
* Alternatively, using a single g_object_set() for all the properties
* to change, or using gtk_adjustment_configure() has the same effect
* of compressing "changed" emissions.
* @param lower the new minimum value
*/
set_lower(lower: number): void;
/**
* Sets the page increment of the adjustment.
*
* See gtk_adjustment_set_lower() about how to compress multiple
* emissions of the "changed" signal when setting multiple adjustment
* properties.
* @param page_increment the new page increment
*/
set_page_increment(page_increment: number): void;
/**
* Sets the page size of the adjustment.
*
* See gtk_adjustment_set_lower() about how to compress multiple
* emissions of the "changed" signal when setting multiple adjustment
* properties.
* @param page_size the new page size
*/
set_page_size(page_size: number): void;
/**
* Sets the step increment of the adjustment.
*
* See gtk_adjustment_set_lower() about how to compress multiple
* emissions of the "changed" signal when setting multiple adjustment
* properties.
* @param step_increment the new step increment
*/
set_step_increment(step_increment: number): void;
/**
* Sets the maximum value of the adjustment.
*
* Note that values will be restricted by
* <literal>upper - page-size</literal> if the page-size
* property is nonzero.
*
* See gtk_adjustment_set_lower() about how to compress multiple
* emissions of the "changed" signal when setting multiple adjustment
* properties.
* @param upper the new maximum value
*/
set_upper(upper: number): void;
set_value(value: number): void;
value_changed(): void;
}
namespace Alignment {
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
bottom_padding: number;
bottomPadding: number;
left_padding: number;
leftPadding: number;
right_padding: number;
rightPadding: number;
top_padding: number;
topPadding: number;
xalign: number;
xscale: number;
yalign: number;
yscale: number;
}
}
/**
* The #GtkAlignment widget controls the alignment and size of its child widget.
* It has four settings: xscale, yscale, xalign, and yalign.
*
* The scale settings are used to specify how much the child widget should
* expand to fill the space allocated to the #GtkAlignment.
* The values can range from 0 (meaning the child doesn't expand at all) to
* 1 (meaning the child expands to fill all of the available space).
*
* The align settings are used to place the child widget within the available
* area. The values range from 0 (top or left) to 1 (bottom or right).
* Of course, if the scale settings are both set to 1, the alignment settings
* have no effect.
*/
class Alignment extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Alignment>;
// Properties
/**
* The padding to insert at the bottom of the widget.
*/
get bottom_padding(): number;
set bottom_padding(val: number);
/**
* The padding to insert at the bottom of the widget.
*/
get bottomPadding(): number;
set bottomPadding(val: number);
/**
* The padding to insert at the left of the widget.
*/
get left_padding(): number;
set left_padding(val: number);
/**
* The padding to insert at the left of the widget.
*/
get leftPadding(): number;
set leftPadding(val: number);
/**
* The padding to insert at the right of the widget.
*/
get right_padding(): number;
set right_padding(val: number);
/**
* The padding to insert at the right of the widget.
*/
get rightPadding(): number;
set rightPadding(val: number);
/**
* The padding to insert at the top of the widget.
*/
get top_padding(): number;
set top_padding(val: number);
/**
* The padding to insert at the top of the widget.
*/
get topPadding(): number;
set topPadding(val: number);
get xalign(): number;
set xalign(val: number);
get xscale(): number;
set xscale(val: number);
get yalign(): number;
set yalign(val: number);
get yscale(): number;
set yscale(val: number);
// Fields
bin: Bin;
// Constructors
constructor(properties?: Partial<Alignment.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](xalign: number, yalign: number, xscale: number, yscale: number): Alignment;
// Methods
/**
* Gets the padding on the different sides of the widget.
* See gtk_alignment_set_padding ().
*/
get_padding(): [number, number, number, number];
/**
* Sets the #GtkAlignment values.
* @param xalign the horizontal alignment of the child widget, from 0 (left) to 1 (right).
* @param yalign the vertical alignment of the child widget, from 0 (top) to 1 (bottom).
* @param xscale the amount that the child widget expands horizontally to fill up unused space, from 0 to 1. A value of 0 indicates that the child widget should never expand. A value of 1 indicates that the child widget will expand to fill all of the space allocated for the #GtkAlignment.
* @param yscale the amount that the child widget expands vertically to fill up unused space, from 0 to 1. The values are similar to @xscale.
*/
set(xalign: number, yalign: number, xscale: number, yscale: number): void;
// Conflicted with GObject.Object.set
set(...args: never[]): any;
/**
* Sets the padding on the different sides of the widget.
* The padding adds blank space to the sides of the widget. For instance,
* this can be used to indent the child widget towards the right by adding
* padding on the left.
* @param padding_top the padding at the top of the widget
* @param padding_bottom the padding at the bottom of the widget
* @param padding_left the padding at the left of the widget
* @param padding_right the padding at the right of the widget.
*/
set_padding(padding_top: number, padding_bottom: number, padding_left: number, padding_right: number): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Arrow {
// Constructor properties interface
interface ConstructorProps
extends Misc.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
arrow_type: ArrowType;
arrowType: ArrowType;
shadow_type: ShadowType;
shadowType: ShadowType;
}
}
/**
* GtkArrow should be used to draw simple arrows that need to point in
* one of the four cardinal directions (up, down, left, or right). The
* style of the arrow can be one of shadow in, shadow out, etched in, or
* etched out. Note that these directions and style types may be
* ammended in versions of GTK+ to come.
*
* GtkArrow will fill any space alloted to it, but since it is inherited
* from #GtkMisc, it can be padded and/or aligned, to fill exactly the
* space the programmer desires.
*
* Arrows are created with a call to gtk_arrow_new(). The direction or
* style of an arrow can be changed after creation by using gtk_arrow_set().
*/
class Arrow extends Misc implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Arrow>;
// Properties
get arrow_type(): ArrowType;
set arrow_type(val: ArrowType);
get arrowType(): ArrowType;
set arrowType(val: ArrowType);
get shadow_type(): ShadowType;
set shadow_type(val: ShadowType);
get shadowType(): ShadowType;
set shadowType(val: ShadowType);
// Fields
misc: Misc;
// Constructors
constructor(properties?: Partial<Arrow.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](arrow_type: ArrowType, shadow_type: ShadowType): Arrow;
// Methods
/**
* Sets the direction and style of the #GtkArrow, `arrow`.
* @param arrow_type a valid #GtkArrowType.
* @param shadow_type a valid #GtkShadowType.
*/
set(arrow_type: ArrowType | null, shadow_type: ShadowType | null): void;
// Conflicted with GObject.Object.set
set(...args: never[]): any;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace AspectFrame {
// Constructor properties interface
interface ConstructorProps
extends Frame.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
obey_child: boolean;
obeyChild: boolean;
ratio: number;
xalign: number;
yalign: number;
}
}
/**
* The #GtkAspectFrame is useful when you want
* pack a widget so that it can resize but always retains
* the same aspect ratio. For instance, one might be
* drawing a small preview of a larger image. #GtkAspectFrame
* derives from #GtkFrame, so it can draw a label and
* a frame around the child. The frame will be
* "shrink-wrapped" to the size of the child.
*/
class AspectFrame extends Frame implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<AspectFrame>;
// Properties
get obey_child(): boolean;
set obey_child(val: boolean);
get obeyChild(): boolean;
set obeyChild(val: boolean);
get ratio(): number;
set ratio(val: number);
get xalign(): number;
set xalign(val: number);
get yalign(): number;
set yalign(val: number);
// Fields
frame: Frame;
center_allocation: Allocation;
// Constructors
constructor(properties?: Partial<AspectFrame.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
label: string,
xalign: number,
yalign: number,
ratio: number,
obey_child: boolean,
): AspectFrame;
// Conflicted with Gtk.Frame.new
static ['new'](...args: never[]): any;
// Methods
/**
* Set parameters for an existing #GtkAspectFrame.
* @param xalign Horizontal alignment of the child within the allocation of the #GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
* @param yalign Vertical alignment of the child within the allocation of the #GtkAspectFrame. This ranges from 0.0 (left aligned) to 1.0 (right aligned)
* @param ratio The desired aspect ratio.
* @param obey_child If %TRUE, @ratio is ignored, and the aspect ratio is taken from the requistion of the child.
*/
set(xalign: number, yalign: number, ratio: number, obey_child: boolean): void;
// Conflicted with GObject.Object.set
set(...args: never[]): any;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Assistant {
// Signal callback interfaces
interface Apply {
(): void;
}
interface Cancel {
(): void;
}
interface Close {
(): void;
}
interface Prepare {
(page: Widget): void;
}
// Constructor properties interface
interface ConstructorProps
extends Window.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
/**
* A #GtkAssistant is a widget used to represent a generally complex
* operation splitted in several steps, guiding the user through its pages
* and controlling the page flow to collect the necessary data.
*
* <refsect2 id="GtkAssistant-BUILDER-UI">
* <title>GtkAssistant as GtkBuildable</title>
* <para>
* The GtkAssistant implementation of the GtkBuildable interface exposes the
* `action_area` as internal children with the name "action_area".
*
* To add pages to an assistant in GtkBuilder, simply add it as a
* &lt;child&gt; to the GtkAssistant object, and set its child properties
* as necessary.
* </para>
* </refsect2>
*/
class Assistant extends Window implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Assistant>;
// Fields
cancel: Widget;
forward: Widget;
back: Widget;
apply: Widget;
close: Widget;
last: Widget;
// Constructors
constructor(properties?: Partial<Assistant.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Assistant;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'apply', callback: (_source: this) => void): number;
connect_after(signal: 'apply', callback: (_source: this) => void): number;
emit(signal: 'apply'): void;
connect(signal: 'cancel', callback: (_source: this) => void): number;
connect_after(signal: 'cancel', callback: (_source: this) => void): number;
emit(signal: 'cancel'): void;
connect(signal: 'close', callback: (_source: this) => void): number;
connect_after(signal: 'close', callback: (_source: this) => void): number;
emit(signal: 'close'): void;
connect(signal: 'prepare', callback: (_source: this, page: Widget) => void): number;
connect_after(signal: 'prepare', callback: (_source: this, page: Widget) => void): number;
emit(signal: 'prepare', page: Widget): void;
// Virtual methods
vfunc_apply(): void;
vfunc_cancel(): void;
vfunc_close(): void;
vfunc_prepare(page: Widget): void;
// Methods
/**
* Adds a widget to the action area of a #GtkAssistant.
* @param child a #GtkWidget
*/
add_action_widget(child: Widget): void;
/**
* Appends a page to the `assistant`.
* @param page a #GtkWidget
* @returns the index (starting at 0) of the inserted page
*/
append_page(page: Widget): number;
/**
* Erases the visited page history so the back button is not
* shown on the current page, and removes the cancel button
* from subsequent pages.
*
* Use this when the information provided up to the current
* page is hereafter deemed permanent and cannot be modified
* or undone. For example, showing a progress page to track
* a long-running, unreversible operation after the user has
* clicked apply on a confirmation page.
*/
commit(): void;
/**
* Returns the page number of the current page
* @returns The index (starting from 0) of the current page in the @assistant, if the @assistant has no pages, -1 will be returned
*/
get_current_page(): number;
/**
* Returns the number of pages in the `assistant`
* @returns The number of pages in the @assistant.
*/
get_n_pages(): number;
/**
* Returns the child widget contained in page number `page_num`.
* @param page_num The index of a page in the @assistant, or -1 to get the last page;
* @returns The child widget, or %NULL if @page_num is out of bounds.
*/
get_nth_page(page_num: number): Widget;
/**
* Gets whether `page` is complete.
* @param page a page of @assistant
* @returns %TRUE if @page is complete.
*/
get_page_complete(page: Widget): boolean;
/**
* Gets the header image for `page`.
* @param page a page of @assistant
* @returns the header image for @page, or %NULL if there's no header image for the page.
*/
get_page_header_image(page: Widget): GdkPixbuf.Pixbuf;
/**
* Gets the header image for `page`.
* @param page a page of @assistant
* @returns the side image for @page, or %NULL if there's no side image for the page.
*/
get_page_side_image(page: Widget): GdkPixbuf.Pixbuf;
/**
* Gets the title for `page`.
* @param page a page of @assistant
* @returns the title for @page.
*/
get_page_title(page: Widget): string;
/**
* Gets the page type of `page`.
* @param page a page of @assistant
* @returns the page type of @page.
*/
get_page_type(page: Widget): AssistantPageType;
/**
* Inserts a page in the `assistant` at a given position.
* @param page a #GtkWidget
* @param position the index (starting at 0) at which to insert the page, or -1 to append the page to the @assistant
* @returns the index (starting from 0) of the inserted page
*/
insert_page(page: Widget, position: number): number;
/**
* Prepends a page to the `assistant`.
* @param page a #GtkWidget
* @returns the index (starting at 0) of the inserted page
*/
prepend_page(page: Widget): number;
/**
* Removes a widget from the action area of a #GtkAssistant.
* @param child a #GtkWidget
*/
remove_action_widget(child: Widget): void;
/**
* Switches the page to `page_num`. Note that this will only be necessary
* in custom buttons, as the `assistant` flow can be set with
* gtk_assistant_set_forward_page_func().
* @param page_num index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the @assistant, nothing will be done.
*/
set_current_page(page_num: number): void;
/**
* Sets the page forwarding function to be `page_func,` this function will
* be used to determine what will be the next page when the user presses
* the forward button. Setting `page_func` to %NULL will make the assistant
* to use the default forward function, which just goes to the next visible
* page.
* @param page_func the #GtkAssistantPageFunc, or %NULL to use the default one
*/
set_forward_page_func(page_func?: AssistantPageFunc | null): void;
/**
* Sets whether `page` contents are complete. This will make
* `assistant` update the buttons state to be able to continue the task.
* @param page a page of @assistant
* @param complete the completeness status of the page
*/
set_page_complete(page: Widget, complete: boolean): void;
/**
* Sets a header image for `page`. This image is displayed in the header
* area of the assistant when `page` is the current page.
* @param page a page of @assistant
* @param pixbuf the new header image @page
*/
set_page_header_image(page: Widget, pixbuf?: GdkPixbuf.Pixbuf | null): void;
/**
* Sets a header image for `page`. This image is displayed in the side
* area of the assistant when `page` is the current page.
* @param page a page of @assistant
* @param pixbuf the new header image @page
*/
set_page_side_image(page: Widget, pixbuf?: GdkPixbuf.Pixbuf | null): void;
/**
* Sets a title for `page`. The title is displayed in the header
* area of the assistant when `page` is the current page.
* @param page a page of @assistant
* @param title the new title for @page
*/
set_page_title(page: Widget, title: string): void;
/**
* Sets the page type for `page`. The page type determines the page
* behavior in the `assistant`.
* @param page a page of @assistant
* @param type the new type for @page
*/
set_page_type(page: Widget, type: AssistantPageType | null): void;
/**
* Forces `assistant` to recompute the buttons state.
*
* GTK+ automatically takes care of this in most situations,
* e.g. when the user goes to a different page, or when the
* visibility or completeness of a page changes.
*
* One situation where it can be necessary to call this
* function is when changing a value on the current page
* affects the future page flow of the assistant.
*/
update_buttons_state(): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Bin {
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
/**
* The #GtkBin widget is a container with just one child.
* It is not very useful itself, but it is useful for deriving subclasses,
* since it provides common code needed for handling a single child widget.
*
* Many GTK+ widgets are subclasses of #GtkBin, including #GtkWindow,
* #GtkButton, #GtkFrame, #GtkHandleBox or #GtkScrolledWindow.
*/
abstract class Bin extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Bin>;
// Fields
container: Container;
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
child: Widget;
// Constructors
constructor(properties?: Partial<Bin.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the child of the #GtkBin, or %NULL if the bin contains
* no child widget. The returned widget does not have a reference
* added, so you do not need to unref it.
* @returns pointer to child of the #GtkBin
*/
get_child(): Widget;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Box {
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
homogeneous: boolean;
spacing: number;
}
}
abstract class Box extends Container implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Box>;
// Properties
get homogeneous(): boolean;
set homogeneous(val: boolean);
get spacing(): number;
set spacing(val: number);
// Fields
container: Container;
children: any[];
// Constructors
constructor(properties?: Partial<Box.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Returns whether the box is homogeneous (all children are the
* same size). See gtk_box_set_homogeneous().
* @returns %TRUE if the box is homogeneous.
*/
get_homogeneous(): boolean;
/**
* Gets the value set by gtk_box_set_spacing().
* @returns spacing between children
*/
get_spacing(): number;
/**
* Adds `child` to `box,` packed with reference to the end of `box`.
* The `child` is packed after (away from end of) any other child
* packed with reference to the end of `box`.
* @param child the #GtkWidget to be added to @box
* @param expand %TRUE if the new child is to be given extra space allocated to @box. The extra space will be divided evenly between all children of @box that use this option
* @param fill %TRUE if space given to @child by the @expand option is actually allocated to @child, rather than just padding it. This parameter has no effect if @expand is set to %FALSE. A child is always allocated the full height of a #GtkHBox and the full width of a #GtkVBox. This option affects the other dimension
* @param padding extra space in pixels to put between this child and its neighbors, over and above the global amount specified by #GtkBox:spacing property. If @child is a widget at one of the reference ends of @box, then @padding pixels are also put between @child and the reference edge of @box
*/
pack_end(child: Widget, expand: boolean, fill: boolean, padding: number): void;
/**
* Adds `widget` to `box,` packed with reference to the end of `box`.
* The child is packed after any other child packed with reference
* to the start of `box`.
*
* Parameters for how to pack the child `widget,` #GtkBox:expand,
* #GtkBox:fill and #GtkBox:padding, are given their default
* values, %TRUE, %TRUE, and 0, respectively.
* @param widget the #GtkWidget to be added to @box
*/
pack_end_defaults(widget: Widget): void;
/**
* Adds `child` to `box,` packed with reference to the start of `box`.
* The `child` is packed after any other child packed with reference
* to the start of `box`.
* @param child the #GtkWidget to be added to @box
* @param expand %TRUE if the new child is to be given extra space allocated to @box. The extra space will be divided evenly between all children of @box that use this option
* @param fill %TRUE if space given to @child by the @expand option is actually allocated to @child, rather than just padding it. This parameter has no effect if @expand is set to %FALSE. A child is always allocated the full height of a #GtkHBox and the full width of a #GtkVBox. This option affects the other dimension
* @param padding extra space in pixels to put between this child and its neighbors, over and above the global amount specified by #GtkBox:spacing property. If @child is a widget at one of the reference ends of @box, then @padding pixels are also put between @child and the reference edge of @box
*/
pack_start(child: Widget, expand: boolean, fill: boolean, padding: number): void;
/**
* Adds `widget` to `box,` packed with reference to the start of `box`.
* The child is packed after any other child packed with reference
* to the start of `box`.
*
* Parameters for how to pack the child `widget,` #GtkBox:expand,
* #GtkBox:fill and #GtkBox:padding, are given their default
* values, %TRUE, %TRUE, and 0, respectively.
* @param widget the #GtkWidget to be added to @box
*/
pack_start_defaults(widget: Widget): void;
/**
* Obtains information about how `child` is packed into `box`.
* @param child the #GtkWidget of the child to query
* @param expand pointer to return location for #GtkBox:expand child property
* @param fill pointer to return location for #GtkBox:fill child property
* @param padding pointer to return location for #GtkBox:padding child property
* @param pack_type pointer to return location for #GtkBox:pack-type child property
*/
query_child_packing(
child: Widget,
expand: boolean,
fill: boolean,
padding: number,
pack_type: PackType | null,
): void;
/**
* Moves `child` to a new `position` in the list of `box` children.
* The list is the <structfield>children</structfield> field of
* #GtkBox-struct, and contains both widgets packed #GTK_PACK_START
* as well as widgets packed #GTK_PACK_END, in the order that these
* widgets were added to `box`.
*
* A widget's position in the `box` children list determines where
* the widget is packed into `box`. A child widget at some position
* in the list will be packed just after all other widgets of the
* same packing type that appear earlier in the list.
* @param child the #GtkWidget to move
* @param position the new position for @child in the list of children of @box, starting from 0. If negative, indicates the end of the list
*/
reorder_child(child: Widget, position: number): void;
/**
* Sets the way `child` is packed into `box`.
* @param child the #GtkWidget of the child to set
* @param expand the new value of the #GtkBox:expand child property
* @param fill the new value of the #GtkBox:fill child property
* @param padding the new value of the #GtkBox:padding child property
* @param pack_type the new value of the #GtkBox:pack-type child property
*/
set_child_packing(
child: Widget,
expand: boolean,
fill: boolean,
padding: number,
pack_type: PackType | null,
): void;
/**
* Sets the #GtkBox:homogeneous property of `box,` controlling
* whether or not all children of `box` are given equal space
* in the box.
* @param homogeneous a boolean value, %TRUE to create equal allotments, %FALSE for variable allotments
*/
set_homogeneous(homogeneous: boolean): void;
/**
* Sets the #GtkBox:spacing property of `box,` which is the
* number of pixels to place between children of `box`.
* @param spacing the number of pixels to put between children
*/
set_spacing(spacing: number): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Builder {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
translation_domain: string;
translationDomain: string;
}
}
class Builder extends GObject.Object {
static $gtype: GObject.GType<Builder>;
// Properties
/**
* The translation domain used when translating property values that
* have been marked as translatable in interface descriptions.
* If the translation domain is %NULL, #GtkBuilder uses gettext(),
* otherwise g_dgettext().
*/
get translation_domain(): string;
set translation_domain(val: string);
/**
* The translation domain used when translating property values that
* have been marked as translatable in interface descriptions.
* If the translation domain is %NULL, #GtkBuilder uses gettext(),
* otherwise g_dgettext().
*/
get translationDomain(): string;
set translationDomain(val: string);
// Constructors
constructor(properties?: Partial<Builder.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Builder;
// Virtual methods
/**
* Looks up a type by name, using the virtual function that
* #GtkBuilder has for that purpose. This is mainly used when
* implementing the #GtkBuildable interface on a type.
* @param type_name type name to lookup
*/
vfunc_get_type_from_name(type_name: string): GObject.GType;
// Methods
/**
* Parses a file containing a <link linkend="BUILDER-UI">GtkBuilder
* UI definition</link> and merges it with the current contents of `builder`.
*
* Upon errors 0 will be returned and `error` will be assigned a
* #GError from the #GTK_BUILDER_ERROR, #G_MARKUP_ERROR or #G_FILE_ERROR
* domain.
* @param filename the name of the file to parse
* @returns A positive value on success, 0 if an error occurred
*/
add_from_file(filename: string): number;
/**
* Parses a string containing a <link linkend="BUILDER-UI">GtkBuilder
* UI definition</link> and merges it with the current contents of `builder`.
*
* Upon errors 0 will be returned and `error` will be assigned a
* #GError from the #GTK_BUILDER_ERROR or #G_MARKUP_ERROR domain.
* @param buffer the string to parse
* @param length the length of @buffer (may be -1 if @buffer is nul-terminated)
* @returns A positive value on success, 0 if an error occurred
*/
add_from_string(buffer: string, length: number): number;
/**
* Parses a file containing a <link linkend="BUILDER-UI">GtkBuilder
* UI definition</link> building only the requested objects and merges
* them with the current contents of `builder`.
*
* Upon errors 0 will be returned and `error` will be assigned a
* #GError from the #GTK_BUILDER_ERROR, #G_MARKUP_ERROR or #G_FILE_ERROR
* domain.
*
* <note><para>
* If you are adding an object that depends on an object that is not
* its child (for instance a #GtkTreeView that depends on its
* #GtkTreeModel), you have to explicitely list all of them in `object_ids`.
* </para></note>
* @param filename the name of the file to parse
* @param object_ids nul-terminated array of objects to build
* @returns A positive value on success, 0 if an error occurred
*/
add_objects_from_file(filename: string, object_ids: string): number;
/**
* Parses a string containing a <link linkend="BUILDER-UI">GtkBuilder
* UI definition</link> building only the requested objects and merges
* them with the current contents of `builder`.
*
* Upon errors 0 will be returned and `error` will be assigned a
* #GError from the #GTK_BUILDER_ERROR or #G_MARKUP_ERROR domain.
*
* <note><para>
* If you are adding an object that depends on an object that is not
* its child (for instance a #GtkTreeView that depends on its
* #GtkTreeModel), you have to explicitely list all of them in `object_ids`.
* </para></note>
* @param buffer the string to parse
* @param length the length of @buffer (may be -1 if @buffer is nul-terminated)
* @param object_ids nul-terminated array of objects to build
* @returns A positive value on success, 0 if an error occurred
*/
add_objects_from_string(buffer: string, length: number, object_ids: string): number;
/**
* This method is a simpler variation of gtk_builder_connect_signals_full().
* It uses #GModule's introspective features (by opening the module %NULL)
* to look at the application's symbol table. From here it tries to match
* the signal handler names given in the interface description with
* symbols in the application and connects the signals.
*
* Note that this function will not work correctly if #GModule is not
* supported on the platform.
*
* When compiling applications for Windows, you must declare signal callbacks
* with #G_MODULE_EXPORT, or they will not be put in the symbol table.
* On Linux and Unices, this is not necessary; applications should instead
* be compiled with the -Wl,--export-dynamic CFLAGS, and linked against
* gmodule-export-2.0.
* @param user_data a pointer to a structure sent in as user data to all signals
*/
connect_signals(user_data?: any | null): void;
/**
* This function can be thought of the interpreted language binding
* version of gtk_builder_connect_signals(), except that it does not
* require GModule to function correctly.
* @param func the function used to connect the signals
*/
connect_signals_full(func: BuilderConnectFunc): void;
/**
* Gets the object named `name`. Note that this function does not
* increment the reference count of the returned object.
* @param name name of object to get
* @returns the object named @name or %NULL if it could not be found in the object tree.
*/
get_object<T = GObject.Object>(name: string): T;
/**
* Gets all objects that have been constructed by `builder`. Note that
* this function does not increment the reference counts of the returned
* objects.
* @returns a newly-allocated #GSList containing all the objects constructed by the #GtkBuilder instance. It should be freed by g_slist_free()
*/
get_objects(): GObject.Object[];
/**
* Gets the translation domain of `builder`.
* @returns the translation domain. This string is owned by the builder object and must not be modified or freed.
*/
get_translation_domain(): string;
/**
* Looks up a type by name, using the virtual function that
* #GtkBuilder has for that purpose. This is mainly used when
* implementing the #GtkBuildable interface on a type.
* @param type_name type name to lookup
* @returns the #GType found for @type_name or #G_TYPE_INVALID if no type was found
*/
get_type_from_name(type_name: string): GObject.GType;
/**
* Sets the translation domain of `builder`.
* See #GtkBuilder:translation-domain.
* @param domain the translation domain or %NULL
*/
set_translation_domain(domain?: string | null): void;
/**
* This function demarshals a value from a string. This function
* calls g_value_init() on the `value` argument, so it need not be
* initialised beforehand.
*
* This function can handle char, uchar, boolean, int, uint, long,
* ulong, enum, flags, float, double, string, #GdkColor and
* #GtkAdjustment type values. Support for #GtkWidget type values is
* still to come.
*
* Upon errors %FALSE will be returned and `error` will be assigned a
* #GError from the #GTK_BUILDER_ERROR domain.
* @param pspec the #GParamSpec for the property
* @param string the string representation of the value
* @returns %TRUE on success
*/
value_from_string(pspec: GObject.ParamSpec, string: string): [boolean, unknown];
/**
* Like gtk_builder_value_from_string(), this function demarshals
* a value from a string, but takes a #GType instead of #GParamSpec.
* This function calls g_value_init() on the `value` argument, so it
* need not be initialised beforehand.
*
* Upon errors %FALSE will be returned and `error` will be assigned a
* #GError from the #GTK_BUILDER_ERROR domain.
* @param type the #GType of the value
* @param string the string representation of the value
* @returns %TRUE on success
*/
value_from_string_type(type: GObject.GType, string: string): [boolean, unknown];
}
namespace Button {
// Signal callback interfaces
interface Activate {
(): void;
}
interface Clicked {
(): void;
}
interface Enter {
(): void;
}
interface Leave {
(): void;
}
interface Pressed {
(): void;
}
interface Released {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
focus_on_click: boolean;
focusOnClick: boolean;
image: Widget;
image_position: PositionType;
imagePosition: PositionType;
label: string;
relief: ReliefStyle;
use_stock: boolean;
useStock: boolean;
use_underline: boolean;
useUnderline: boolean;
xalign: number;
yalign: number;
}
}
class Button extends Bin implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<Button>;
// Properties
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
get image(): Widget;
set image(val: Widget);
/**
* The position of the image relative to the text inside the button.
*/
get image_position(): PositionType;
set image_position(val: PositionType);
/**
* The position of the image relative to the text inside the button.
*/
get imagePosition(): PositionType;
set imagePosition(val: PositionType);
get label(): string;
set label(val: string);
get relief(): ReliefStyle;
set relief(val: ReliefStyle);
get use_stock(): boolean;
set use_stock(val: boolean);
get useStock(): boolean;
set useStock(val: boolean);
get use_underline(): boolean;
set use_underline(val: boolean);
get useUnderline(): boolean;
set useUnderline(val: boolean);
/**
* If the child of the button is a #GtkMisc or #GtkAlignment, this property
* can be used to control it's horizontal alignment. 0.0 is left aligned,
* 1.0 is right aligned.
*/
get xalign(): number;
set xalign(val: number);
/**
* If the child of the button is a #GtkMisc or #GtkAlignment, this property
* can be used to control it's vertical alignment. 0.0 is top aligned,
* 1.0 is bottom aligned.
*/
get yalign(): number;
set yalign(val: number);
// Fields
bin: Bin;
event_window: Gdk.Window;
label_text: string;
activate_timeout: number;
constructed: number;
in_button: number;
button_down: number;
depressed: number;
depress_on_activate: number;
// Constructors
constructor(properties?: Partial<Button.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Button;
static new_from_stock(stock_id: string): Button;
static new_with_label(label: string): Button;
static new_with_mnemonic(label: string): Button;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate', callback: (_source: this) => void): number;
connect_after(signal: 'activate', callback: (_source: this) => void): number;
emit(signal: 'activate'): void;
connect(signal: 'clicked', callback: (_source: this) => void): number;
connect_after(signal: 'clicked', callback: (_source: this) => void): number;
emit(signal: 'clicked'): void;
connect(signal: 'enter', callback: (_source: this) => void): number;
connect_after(signal: 'enter', callback: (_source: this) => void): number;
emit(signal: 'enter'): void;
connect(signal: 'leave', callback: (_source: this) => void): number;
connect_after(signal: 'leave', callback: (_source: this) => void): number;
emit(signal: 'leave'): void;
connect(signal: 'pressed', callback: (_source: this) => void): number;
connect_after(signal: 'pressed', callback: (_source: this) => void): number;
emit(signal: 'pressed'): void;
connect(signal: 'released', callback: (_source: this) => void): number;
connect_after(signal: 'released', callback: (_source: this) => void): number;
emit(signal: 'released'): void;
// Virtual methods
vfunc_activate(): void;
vfunc_clicked(): void;
vfunc_enter(): void;
vfunc_leave(): void;
vfunc_pressed(): void;
vfunc_released(): void;
// Methods
clicked(): void;
enter(): void;
/**
* Gets the alignment of the child in the button.
*/
get_alignment(): [number, number];
/**
* Returns the button's event window if it is realized, %NULL otherwise.
* This function should be rarely needed.
* @returns @button's event window.
*/
get_event_window(): Gdk.Window;
/**
* Returns whether the button grabs focus when it is clicked with the mouse.
* See gtk_button_set_focus_on_click().
* @returns %TRUE if the button grabs focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Gets the widget that is currenty set as the image of `button`.
* This may have been explicitly set by gtk_button_set_image()
* or constructed by gtk_button_new_from_stock().
* @returns a #GtkWidget or %NULL in case there is no image
*/
get_image(): Widget;
/**
* Gets the position of the image relative to the text
* inside the button.
* @returns the position
*/
get_image_position(): PositionType;
/**
* Fetches the text from the label of the button, as set by
* gtk_button_set_label(). If the label text has not
* been set the return value will be %NULL. This will be the
* case if you create an empty button with gtk_button_new() to
* use as a container.
* @returns The text of the label widget. This string is owned by the widget and must not be modified or freed.
*/
get_label(): string;
get_relief(): ReliefStyle;
/**
* Returns whether the button label is a stock item.
* @returns %TRUE if the button label is used to select a stock item instead of being used directly as the label text.
*/
get_use_stock(): boolean;
/**
* Returns whether an embedded underline in the button label indicates a
* mnemonic. See gtk_button_set_use_underline ().
* @returns %TRUE if an embedded underline in the button label indicates the mnemonic accelerator keys.
*/
get_use_underline(): boolean;
leave(): void;
pressed(): void;
released(): void;
/**
* Sets the alignment of the child. This property has no effect unless
* the child is a #GtkMisc or a #GtkAligment.
* @param xalign the horizontal position of the child, 0.0 is left aligned, 1.0 is right aligned
* @param yalign the vertical position of the child, 0.0 is top aligned, 1.0 is bottom aligned
*/
set_alignment(xalign: number, yalign: number): void;
/**
* Sets whether the button will 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 button grabs focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Set the image of `button` to the given widget. Note that
* it depends on the #GtkSettings:gtk-button-images setting whether the
* image will be displayed or not, you don't have to call
* gtk_widget_show() on `image` yourself.
* @param image a widget to set as the image for the button
*/
set_image(image: Widget): void;
/**
* Sets the position of the image relative to the text
* inside the button.
* @param position the position
*/
set_image_position(position: PositionType | null): void;
/**
* Sets the text of the label of the button to `str`. This text is
* also used to select the stock item if gtk_button_set_use_stock()
* is used.
*
* This will also clear any previously set labels.
* @param label a string
*/
set_label(label: string): void;
set_relief(newstyle: ReliefStyle | null): void;
/**
* If %TRUE, the label set on the button is used as a
* stock id to select the stock item for the button.
* @param use_stock %TRUE if the button should use a stock item
*/
set_use_stock(use_stock: boolean): void;
/**
* If true, an underline in the text of the button label indicates
* the next character should be used for the mnemonic accelerator key.
* @param use_underline %TRUE if underlines in the text indicate mnemonics
*/
set_use_underline(use_underline: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ButtonBox {
// Constructor properties interface
interface ConstructorProps
extends Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
layout_style: ButtonBoxStyle;
layoutStyle: ButtonBoxStyle;
}
}
abstract class ButtonBox extends Box implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<ButtonBox>;
// Properties
get layout_style(): ButtonBoxStyle;
set layout_style(val: ButtonBoxStyle);
get layoutStyle(): ButtonBoxStyle;
set layoutStyle(val: ButtonBoxStyle);
// Fields
box: Box;
child_min_width: number;
child_min_height: number;
child_ipad_x: number;
child_ipad_y: number;
// Constructors
constructor(properties?: Partial<ButtonBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_child_ipadding(ipad_x: number, ipad_y: number): void;
/**
* Returns whether `child` should appear in a secondary group of children.
* @param child a child of @widget
* @returns whether @child should appear in a secondary group of children.
*/
get_child_secondary(child: Widget): boolean;
get_child_size(min_width: number, min_height: number): void;
get_layout(): ButtonBoxStyle;
set_child_ipadding(ipad_x: number, ipad_y: number): void;
/**
* Sets whether `child` should appear in a secondary group of children.
* A typical use of a secondary child is the help button in a dialog.
*
* This group appears after the other children if the style
* is %GTK_BUTTONBOX_START, %GTK_BUTTONBOX_SPREAD or
* %GTK_BUTTONBOX_EDGE, and before the other children if the style
* is %GTK_BUTTONBOX_END. For horizontal button boxes, the definition
* of before/after depends on direction of the widget (see
* gtk_widget_set_direction()). If the style is %GTK_BUTTONBOX_START
* or %GTK_BUTTONBOX_END, then the secondary children are aligned at
* the other end of the button box from the main children. For the
* other styles, they appear immediately next to the main children.
* @param child a child of @widget
* @param is_secondary if %TRUE, the @child appears in a secondary group of the button box.
*/
set_child_secondary(child: Widget, is_secondary: boolean): void;
set_child_size(min_width: number, min_height: number): void;
set_layout(layout_style: ButtonBoxStyle | null): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace CList {
// Signal callback interfaces
interface AbortColumnResize {
(): void;
}
interface ClickColumn {
(object: number): void;
}
interface EndSelection {
(): void;
}
interface ExtendSelection {
(object: ScrollType, p0: number, p1: boolean): void;
}
interface ResizeColumn {
(object: number, p0: number): void;
}
interface RowMove {
(object: number, p0: number): void;
}
interface ScrollHorizontal {
(object: ScrollType, p0: number): void;
}
interface ScrollVertical {
(object: ScrollType, p0: number): void;
}
interface SelectAll {
(): void;
}
interface SelectRow {
(object: number, p0: number, p1: Gdk.Event): void;
}
interface SetScrollAdjustments {
(object: Adjustment, p0: Adjustment): void;
}
interface StartSelection {
(): void;
}
interface ToggleAddMode {
(): void;
}
interface ToggleFocusRow {
(): void;
}
interface UndoSelection {
(): void;
}
interface UnselectAll {
(): void;
}
interface UnselectRow {
(object: number, p0: number, p1: Gdk.Event): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
n_columns: number;
nColumns: number;
reorderable: boolean;
row_height: number;
rowHeight: number;
selection_mode: SelectionMode;
selectionMode: SelectionMode;
shadow_type: ShadowType;
shadowType: ShadowType;
sort_type: SortType;
sortType: SortType;
titles_active: boolean;
titlesActive: boolean;
use_drag_icons: boolean;
useDragIcons: boolean;
}
}
class CList extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<CList>;
// Properties
get n_columns(): number;
get nColumns(): number;
get reorderable(): boolean;
set reorderable(val: boolean);
get row_height(): number;
set row_height(val: number);
get rowHeight(): number;
set rowHeight(val: number);
get selection_mode(): SelectionMode;
set selection_mode(val: SelectionMode);
get selectionMode(): SelectionMode;
set selectionMode(val: SelectionMode);
get shadow_type(): ShadowType;
set shadow_type(val: ShadowType);
get shadowType(): ShadowType;
set shadowType(val: ShadowType);
get sort_type(): SortType;
set sort_type(val: SortType);
get sortType(): SortType;
set sortType(val: SortType);
get titles_active(): boolean;
set titles_active(val: boolean);
get titlesActive(): boolean;
set titlesActive(val: boolean);
get use_drag_icons(): boolean;
set use_drag_icons(val: boolean);
get useDragIcons(): boolean;
set useDragIcons(val: boolean);
// Fields
container: Container;
flags: number;
reserved1: any;
reserved2: any;
freeze_count: number;
internal_allocation: Gdk.Rectangle;
rows: number;
row_list: any[];
row_list_end: any[];
columns: number;
column_title_area: Gdk.Rectangle;
title_window: Gdk.Window;
clist_window: Gdk.Window;
clist_window_width: number;
clist_window_height: number;
hoffset: number;
voffset: number;
selection: any[];
selection_end: any[];
undo_unselection: any[];
undo_anchor: number;
button_actions: Uint8Array;
drag_button: number;
click_cell: CListCellInfo;
hadjustment: Adjustment;
vadjustment: Adjustment;
xor_gc: Gdk.GC;
fg_gc: Gdk.GC;
bg_gc: Gdk.GC;
x_drag: number;
focus_row: number;
focus_header_column: number;
anchor: number;
anchor_state: StateType;
drag_pos: number;
htimer: number;
vtimer: number;
compare: CListCompareFunc;
sort_column: number;
drag_highlight_row: number;
drag_highlight_pos: CListDragPos;
// Constructors
constructor(properties?: Partial<CList.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](columns: number): CList;
static new_with_titles(columns: number, titles: string): CList;
// 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: 'abort-column-resize', callback: (_source: this) => void): number;
connect_after(signal: 'abort-column-resize', callback: (_source: this) => void): number;
emit(signal: 'abort-column-resize'): void;
connect(signal: 'click-column', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'click-column', callback: (_source: this, object: number) => void): number;
emit(signal: 'click-column', object: number): void;
connect(signal: 'end-selection', callback: (_source: this) => void): number;
connect_after(signal: 'end-selection', callback: (_source: this) => void): number;
emit(signal: 'end-selection'): void;
connect(
signal: 'extend-selection',
callback: (_source: this, object: ScrollType, p0: number, p1: boolean) => void,
): number;
connect_after(
signal: 'extend-selection',
callback: (_source: this, object: ScrollType, p0: number, p1: boolean) => void,
): number;
emit(signal: 'extend-selection', object: ScrollType, p0: number, p1: boolean): void;
connect(signal: 'resize-column', callback: (_source: this, object: number, p0: number) => void): number;
connect_after(
signal: 'resize-column',
callback: (_source: this, object: number, p0: number) => void,
): number;
emit(signal: 'resize-column', object: number, p0: number): void;
connect(signal: 'row-move', callback: (_source: this, object: number, p0: number) => void): number;
connect_after(signal: 'row-move', callback: (_source: this, object: number, p0: number) => void): number;
emit(signal: 'row-move', object: number, p0: number): void;
connect(
signal: 'scroll-horizontal',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
connect_after(
signal: 'scroll-horizontal',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
emit(signal: 'scroll-horizontal', object: ScrollType, p0: number): void;
connect(
signal: 'scroll-vertical',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
connect_after(
signal: 'scroll-vertical',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
emit(signal: 'scroll-vertical', object: ScrollType, p0: number): void;
connect(signal: 'select-all', callback: (_source: this) => void): number;
connect_after(signal: 'select-all', callback: (_source: this) => void): number;
emit(signal: 'select-all'): void;
connect(
signal: 'select-row',
callback: (_source: this, object: number, p0: number, p1: Gdk.Event) => void,
): number;
connect_after(
signal: 'select-row',
callback: (_source: this, object: number, p0: number, p1: Gdk.Event) => void,
): number;
emit(signal: 'select-row', object: number, p0: number, p1: Gdk.Event): void;
connect(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
connect_after(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
emit(signal: 'set-scroll-adjustments', object: Adjustment, p0: Adjustment): void;
connect(signal: 'start-selection', callback: (_source: this) => void): number;
connect_after(signal: 'start-selection', callback: (_source: this) => void): number;
emit(signal: 'start-selection'): void;
connect(signal: 'toggle-add-mode', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-add-mode', callback: (_source: this) => void): number;
emit(signal: 'toggle-add-mode'): void;
connect(signal: 'toggle-focus-row', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-focus-row', callback: (_source: this) => void): number;
emit(signal: 'toggle-focus-row'): void;
connect(signal: 'undo-selection', callback: (_source: this) => void): number;
connect_after(signal: 'undo-selection', callback: (_source: this) => void): number;
emit(signal: 'undo-selection'): void;
connect(signal: 'unselect-all', callback: (_source: this) => void): number;
connect_after(signal: 'unselect-all', callback: (_source: this) => void): number;
emit(signal: 'unselect-all'): void;
connect(
signal: 'unselect-row',
callback: (_source: this, object: number, p0: number, p1: Gdk.Event) => void,
): number;
connect_after(
signal: 'unselect-row',
callback: (_source: this, object: number, p0: number, p1: Gdk.Event) => void,
): number;
emit(signal: 'unselect-row', object: number, p0: number, p1: Gdk.Event): void;
// Virtual methods
vfunc_abort_column_resize(): void;
vfunc_cell_size_request(clist_row: CListRow, column: number, requisition: Requisition): void;
vfunc_clear(): void;
vfunc_click_column(column: number): void;
vfunc_draw_drag_highlight(target_row: CListRow, target_row_number: number, drag_pos: CListDragPos): void;
vfunc_draw_row(area: Gdk.Rectangle, row: number, clist_row: CListRow): void;
vfunc_end_selection(): void;
vfunc_extend_selection(scroll_type: ScrollType, position: number, auto_start_selection: boolean): void;
vfunc_fake_unselect_all(row: number): void;
vfunc_insert_row(row: number, text: string): number;
vfunc_refresh(): void;
vfunc_remove_row(row: number): void;
vfunc_resize_column(column: number, width: number): void;
vfunc_resync_selection(event: Gdk.Event): void;
vfunc_row_move(source_row: number, dest_row: number): void;
vfunc_scroll_horizontal(scroll_type: ScrollType, position: number): void;
vfunc_scroll_vertical(scroll_type: ScrollType, position: number): void;
vfunc_select_all(): void;
vfunc_select_row(row: number, column: number, event: Gdk.Event): void;
vfunc_set_cell_contents(
clist_row: CListRow,
column: number,
type: CellType,
text: string,
spacing: number,
pixmap: Gdk.Pixmap,
mask: Gdk.Bitmap,
): void;
vfunc_set_scroll_adjustments(hadjustment: Adjustment, vadjustment: Adjustment): void;
vfunc_sort_list(): void;
vfunc_start_selection(): void;
vfunc_toggle_add_mode(): void;
vfunc_toggle_focus_row(): void;
vfunc_undo_selection(): void;
vfunc_unselect_all(): void;
vfunc_unselect_row(row: number, column: number, event: Gdk.Event): void;
// Methods
append(text: string): number;
clear(): void;
column_title_active(column: number): void;
column_title_passive(column: number): void;
column_titles_active(): void;
column_titles_hide(): void;
column_titles_passive(): void;
column_titles_show(): void;
columns_autosize(): number;
find_row_from_data(data?: any | null): number;
freeze(): void;
get_cell_type(row: number, column: number): CellType;
get_column_title(column: number): string;
get_pixmap(row: number, column: number, pixmap: Gdk.Pixmap, mask: Gdk.Bitmap): number;
get_pixtext(
row: number,
column: number,
text: string,
spacing: number,
pixmap: Gdk.Pixmap,
mask: Gdk.Bitmap,
): number;
get_row_data(row: number): any | null;
get_selectable(row: number): boolean;
get_selection_info(x: number, y: number, row: number, column: number): number;
get_text(row: number, column: number, text: string): number;
insert(row: number, text: string): number;
moveto(row: number, column: number, row_align: number, col_align: number): void;
optimal_column_width(column: number): number;
prepend(text: string): number;
remove(row: number): void;
// Conflicted with Gtk.Container.remove
remove(...args: never[]): any;
row_is_visible(row: number): Visibility;
row_move(source_row: number, dest_row: number): void;
select_all(): void;
select_row(row: number, column: number): void;
set_auto_sort(auto_sort: boolean): void;
set_background(row: number, color: Gdk.Color): void;
set_button_actions(button: number, button_actions: number): void;
set_cell_style(row: number, column: number, style: Style): void;
set_column_auto_resize(column: number, auto_resize: boolean): void;
set_column_justification(column: number, justification: Justification | null): void;
set_column_max_width(column: number, max_width: number): void;
set_column_min_width(column: number, min_width: number): void;
set_column_resizeable(column: number, resizeable: boolean): void;
set_column_title(column: number, title: string): void;
set_column_visibility(column: number, visible: boolean): void;
set_column_widget(column: number, widget: Widget): void;
set_column_width(column: number, width: number): void;
set_foreground(row: number, color: Gdk.Color): void;
set_hadjustment(adjustment: Adjustment): void;
set_pixmap(row: number, column: number, pixmap: Gdk.Pixmap, mask?: Gdk.Bitmap | null): void;
set_pixtext(
row: number,
column: number,
text: string,
spacing: number,
pixmap: Gdk.Pixmap,
mask: Gdk.Bitmap,
): void;
set_reorderable(reorderable: boolean): void;
set_row_data(row: number, data?: any | null): void;
set_row_data_full(row: number, data?: any | null): void;
set_row_height(height: number): void;
set_row_style(row: number, style: Style): void;
set_selectable(row: number, selectable: boolean): void;
set_selection_mode(mode: SelectionMode | null): void;
set_shadow_type(type: ShadowType | null): void;
set_shift(row: number, column: number, vertical: number, horizontal: number): void;
set_sort_column(column: number): void;
set_sort_type(sort_type: SortType | null): void;
set_text(row: number, column: number, text: string): void;
set_use_drag_icons(use_icons: boolean): void;
set_vadjustment(adjustment: Adjustment): void;
sort(): void;
swap_rows(row1: number, row2: number): void;
thaw(): void;
undo_selection(): void;
unselect_all(): void;
unselect_row(row: number, column: 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 CTree {
// Signal callback interfaces
interface ChangeFocusRowExpansion {
(object: CTreeExpansionType): void;
}
interface TreeCollapse {
(object: unknown): void;
}
interface TreeExpand {
(object: unknown): void;
}
interface TreeMove {
(object: unknown, p0: unknown, p1: unknown): void;
}
interface TreeSelectRow {
(object: unknown, p0: number): void;
}
interface TreeUnselectRow {
(object: unknown, p0: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends CList.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
expander_style: CTreeExpanderStyle;
expanderStyle: CTreeExpanderStyle;
indent: number;
line_style: CTreeLineStyle;
lineStyle: CTreeLineStyle;
n_columns: number;
nColumns: number;
show_stub: boolean;
showStub: boolean;
spacing: number;
tree_column: number;
treeColumn: number;
}
}
class CTree extends CList implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<CTree>;
// Properties
get expander_style(): CTreeExpanderStyle;
set expander_style(val: CTreeExpanderStyle);
get expanderStyle(): CTreeExpanderStyle;
set expanderStyle(val: CTreeExpanderStyle);
get indent(): number;
set indent(val: number);
get line_style(): CTreeLineStyle;
set line_style(val: CTreeLineStyle);
get lineStyle(): CTreeLineStyle;
set lineStyle(val: CTreeLineStyle);
get n_columns(): number;
get nColumns(): number;
get show_stub(): boolean;
set show_stub(val: boolean);
get showStub(): boolean;
set showStub(val: boolean);
get spacing(): number;
set spacing(val: number);
get tree_column(): number;
get treeColumn(): number;
// Fields
clist: CList;
lines_gc: Gdk.GC;
tree_indent: number;
tree_spacing: number;
drag_compare: CTreeCompareDragFunc;
// Constructors
constructor(properties?: Partial<CTree.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](columns: number, tree_column: number): CTree;
// Conflicted with Gtk.CList.new
static ['new'](...args: never[]): any;
static new_with_titles(columns: number, tree_column: number, titles: string): CTree;
// Conflicted with Gtk.CList.new_with_titles
static new_with_titles(...args: never[]): any;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'change-focus-row-expansion',
callback: (_source: this, object: CTreeExpansionType) => void,
): number;
connect_after(
signal: 'change-focus-row-expansion',
callback: (_source: this, object: CTreeExpansionType) => void,
): number;
emit(signal: 'change-focus-row-expansion', object: CTreeExpansionType): void;
connect(signal: 'tree-collapse', callback: (_source: this, object: unknown) => void): number;
connect_after(signal: 'tree-collapse', callback: (_source: this, object: unknown) => void): number;
emit(signal: 'tree-collapse', object: unknown): void;
connect(signal: 'tree-expand', callback: (_source: this, object: unknown) => void): number;
connect_after(signal: 'tree-expand', callback: (_source: this, object: unknown) => void): number;
emit(signal: 'tree-expand', object: unknown): void;
connect(
signal: 'tree-move',
callback: (_source: this, object: unknown, p0: unknown, p1: unknown) => void,
): number;
connect_after(
signal: 'tree-move',
callback: (_source: this, object: unknown, p0: unknown, p1: unknown) => void,
): number;
emit(signal: 'tree-move', object: unknown, p0: unknown, p1: unknown): void;
connect(signal: 'tree-select-row', callback: (_source: this, object: unknown, p0: number) => void): number;
connect_after(
signal: 'tree-select-row',
callback: (_source: this, object: unknown, p0: number) => void,
): number;
emit(signal: 'tree-select-row', object: unknown, p0: number): void;
connect(
signal: 'tree-unselect-row',
callback: (_source: this, object: unknown, p0: number) => void,
): number;
connect_after(
signal: 'tree-unselect-row',
callback: (_source: this, object: unknown, p0: number) => void,
): number;
emit(signal: 'tree-unselect-row', object: unknown, p0: number): void;
// Virtual methods
vfunc_change_focus_row_expansion(action: CTreeExpansionType): void;
vfunc_tree_collapse(node: CTreeNode): void;
vfunc_tree_expand(node: CTreeNode): void;
vfunc_tree_move(node: CTreeNode, new_parent: CTreeNode, new_sibling: CTreeNode): void;
vfunc_tree_select_row(row: CTreeNode, column: number): void;
vfunc_tree_unselect_row(row: CTreeNode, column: number): void;
// Methods
collapse(node: CTreeNode): void;
collapse_recursive(node: CTreeNode): void;
collapse_to_depth(node: CTreeNode, depth: number): void;
expand(node: CTreeNode): void;
expand_recursive(node: CTreeNode): void;
expand_to_depth(node: CTreeNode, depth: number): void;
find(node: CTreeNode, child: CTreeNode): boolean;
get_node_info(
node: CTreeNode,
text: string,
spacing: number,
pixmap_closed: Gdk.Pixmap,
mask_closed: Gdk.Bitmap,
pixmap_opened: Gdk.Pixmap,
mask_opened: Gdk.Bitmap,
is_leaf: boolean,
expanded: boolean,
): boolean;
is_ancestor(node: CTreeNode, child: CTreeNode): boolean;
// Conflicted with Gtk.Widget.is_ancestor
is_ancestor(...args: never[]): any;
is_hot_spot(x: number, y: number): boolean;
is_viewable(node: CTreeNode): boolean;
move(node: CTreeNode, new_parent?: CTreeNode | null, new_sibling?: CTreeNode | null): void;
node_get_cell_type(node: CTreeNode, column: number): CellType;
node_get_pixmap(node: CTreeNode, column: number, pixmap: Gdk.Pixmap, mask: Gdk.Bitmap): boolean;
node_get_pixtext(
node: CTreeNode,
column: number,
text: string,
spacing: number,
pixmap: Gdk.Pixmap,
mask: Gdk.Bitmap,
): boolean;
node_get_row_data(node: CTreeNode): any | null;
node_get_selectable(node: CTreeNode): boolean;
node_get_text(node: CTreeNode, column: number, text: string): boolean;
node_is_visible(node: CTreeNode): Visibility;
node_moveto(node: CTreeNode, column: number, row_align: number, col_align: number): void;
node_set_background(node: CTreeNode, color: Gdk.Color): void;
node_set_cell_style(node: CTreeNode, column: number, style: Style): void;
node_set_foreground(node: CTreeNode, color: Gdk.Color): void;
node_set_pixmap(node: CTreeNode, column: number, pixmap: Gdk.Pixmap, mask?: Gdk.Bitmap | null): void;
node_set_pixtext(
node: CTreeNode,
column: number,
text: string,
spacing: number,
pixmap: Gdk.Pixmap,
mask?: Gdk.Bitmap | null,
): void;
node_set_row_data(node: CTreeNode, data?: any | null): void;
node_set_row_data_full(node: CTreeNode, data?: any | null): void;
node_set_row_style(node: CTreeNode, style: Style): void;
node_set_selectable(node: CTreeNode, selectable: boolean): void;
node_set_shift(node: CTreeNode, column: number, vertical: number, horizontal: number): void;
node_set_text(node: CTreeNode, column: number, text: string): void;
real_select_recursive(node: CTreeNode, state: number): void;
remove_node(node: CTreeNode): void;
select(node: CTreeNode): void;
select_recursive(node: CTreeNode): void;
set_expander_style(expander_style: CTreeExpanderStyle | null): void;
set_indent(indent: number): void;
set_line_style(line_style: CTreeLineStyle | null): void;
set_node_info(
node: CTreeNode,
text: string,
spacing: number,
pixmap_closed: Gdk.Pixmap | null,
mask_closed: Gdk.Bitmap | null,
pixmap_opened: Gdk.Pixmap | null,
mask_opened: Gdk.Bitmap | null,
is_leaf: boolean,
expanded: boolean,
): void;
set_show_stub(show_stub: boolean): void;
set_spacing(spacing: number): void;
sort_node(node: CTreeNode): void;
sort_recursive(node: CTreeNode): void;
toggle_expansion(node: CTreeNode): void;
toggle_expansion_recursive(node: CTreeNode): void;
unselect(node: CTreeNode): void;
unselect_recursive(node: CTreeNode): 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 Calendar {
// Signal callback interfaces
interface DaySelected {
(): void;
}
interface DaySelectedDoubleClick {
(): void;
}
interface MonthChanged {
(): void;
}
interface NextMonth {
(): void;
}
interface NextYear {
(): void;
}
interface PrevMonth {
(): void;
}
interface PrevYear {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
day: number;
detail_height_rows: number;
detailHeightRows: number;
detail_width_chars: number;
detailWidthChars: number;
month: number;
no_month_change: boolean;
noMonthChange: boolean;
show_day_names: boolean;
showDayNames: boolean;
show_details: boolean;
showDetails: boolean;
show_heading: boolean;
showHeading: boolean;
show_week_numbers: boolean;
showWeekNumbers: boolean;
year: number;
}
}
class Calendar extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Calendar>;
// Properties
/**
* The selected day (as a number between 1 and 31, or 0
* to unselect the currently selected day).
* This property gets initially set to the current day.
*/
get day(): number;
set day(val: number);
/**
* Height of a detail cell, in rows.
* A value of 0 allows any width. See gtk_calendar_set_detail_func().
*/
get detail_height_rows(): number;
set detail_height_rows(val: number);
/**
* Height of a detail cell, in rows.
* A value of 0 allows any width. See gtk_calendar_set_detail_func().
*/
get detailHeightRows(): number;
set detailHeightRows(val: number);
/**
* Width of a detail cell, in characters.
* A value of 0 allows any width. See gtk_calendar_set_detail_func().
*/
get detail_width_chars(): number;
set detail_width_chars(val: number);
/**
* Width of a detail cell, in characters.
* A value of 0 allows any width. See gtk_calendar_set_detail_func().
*/
get detailWidthChars(): number;
set detailWidthChars(val: number);
/**
* The selected month (as a number between 0 and 11).
* This property gets initially set to the current month.
*/
get month(): number;
set month(val: number);
/**
* Determines whether the selected month can be changed.
*/
get no_month_change(): boolean;
set no_month_change(val: boolean);
/**
* Determines whether the selected month can be changed.
*/
get noMonthChange(): boolean;
set noMonthChange(val: boolean);
/**
* Determines whether day names are displayed.
*/
get show_day_names(): boolean;
set show_day_names(val: boolean);
/**
* Determines whether day names are displayed.
*/
get showDayNames(): boolean;
set showDayNames(val: boolean);
/**
* Determines whether details are shown directly in the widget, or if they are
* available only as tooltip. When this property is set days with details are
* marked.
*/
get show_details(): boolean;
set show_details(val: boolean);
/**
* Determines whether details are shown directly in the widget, or if they are
* available only as tooltip. When this property is set days with details are
* marked.
*/
get showDetails(): boolean;
set showDetails(val: boolean);
/**
* Determines whether a heading is displayed.
*/
get show_heading(): boolean;
set show_heading(val: boolean);
/**
* Determines whether a heading is displayed.
*/
get showHeading(): boolean;
set showHeading(val: boolean);
/**
* Determines whether week numbers are displayed.
*/
get show_week_numbers(): boolean;
set show_week_numbers(val: boolean);
/**
* Determines whether week numbers are displayed.
*/
get showWeekNumbers(): boolean;
set showWeekNumbers(val: boolean);
/**
* The selected year.
* This property gets initially set to the current year.
*/
get year(): number;
set year(val: number);
// Fields
widget: Widget;
header_style: Style;
label_style: Style;
selected_day: number;
day_month: number[];
num_marked_dates: number;
marked_date: number[];
display_flags: CalendarDisplayOptions;
marked_date_color: Gdk.Color[];
gc: Gdk.GC;
xor_gc: Gdk.GC;
focus_row: number;
focus_col: number;
highlight_row: number;
highlight_col: number;
grow_space: number[];
// Constructors
constructor(properties?: Partial<Calendar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Calendar;
// 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: 'day-selected', callback: (_source: this) => void): number;
connect_after(signal: 'day-selected', callback: (_source: this) => void): number;
emit(signal: 'day-selected'): void;
connect(signal: 'day-selected-double-click', callback: (_source: this) => void): number;
connect_after(signal: 'day-selected-double-click', callback: (_source: this) => void): number;
emit(signal: 'day-selected-double-click'): void;
connect(signal: 'month-changed', callback: (_source: this) => void): number;
connect_after(signal: 'month-changed', callback: (_source: this) => void): number;
emit(signal: 'month-changed'): void;
connect(signal: 'next-month', callback: (_source: this) => void): number;
connect_after(signal: 'next-month', callback: (_source: this) => void): number;
emit(signal: 'next-month'): void;
connect(signal: 'next-year', callback: (_source: this) => void): number;
connect_after(signal: 'next-year', callback: (_source: this) => void): number;
emit(signal: 'next-year'): void;
connect(signal: 'prev-month', callback: (_source: this) => void): number;
connect_after(signal: 'prev-month', callback: (_source: this) => void): number;
emit(signal: 'prev-month'): void;
connect(signal: 'prev-year', callback: (_source: this) => void): number;
connect_after(signal: 'prev-year', callback: (_source: this) => void): number;
emit(signal: 'prev-year'): void;
// Virtual methods
vfunc_day_selected(): void;
vfunc_day_selected_double_click(): void;
vfunc_month_changed(): void;
vfunc_next_month(): void;
vfunc_next_year(): void;
vfunc_prev_month(): void;
vfunc_prev_year(): void;
// Methods
/**
* Remove all visual markers.
*/
clear_marks(): void;
/**
* Sets display options (whether to display the heading and the month headings).
* @param flags the display options to set.
*/
display_options(flags: CalendarDisplayOptions | null): void;
/**
* Does nothing. Previously locked the display of the calendar until
* it was thawed with gtk_calendar_thaw().
*/
freeze(): void;
/**
* Obtains the selected date from a #GtkCalendar.
*/
get_date(): [number, number, number];
/**
* Queries the height of detail cells, in rows.
* See #GtkCalendar:detail-width-chars.
* @returns The height of detail cells, in rows.
*/
get_detail_height_rows(): number;
/**
* Queries the width of detail cells, in characters.
* See #GtkCalendar:detail-width-chars.
* @returns The width of detail cells, in characters.
*/
get_detail_width_chars(): number;
/**
* Returns the current display options of `calendar`.
* @returns the display options.
*/
get_display_options(): CalendarDisplayOptions;
/**
* Places a visual marker on a particular day.
*
* Note that this function always returns %TRUE, and you should
* ignore the return value. In GTK+ 3, this function will not
* return a value.
* @param day the day number to mark between 1 and 31.
* @returns %TRUE, always
*/
mark_day(day: number): boolean;
/**
* Selects a day from the current month.
* @param day the day number between 1 and 31, or 0 to unselect the currently selected day.
*/
select_day(day: number): void;
/**
* Shifts the calendar to a different month.
*
* Note that this function always returns %TRUE, and you should
* ignore the return value. In GTK+ 3, this function will not
* return a value.
* @param month a month number between 0 and 11.
* @param year the year the month is in.
* @returns %TRUE, always
*/
select_month(month: number, year: number): boolean;
/**
* Installs a function which provides Pango markup with detail information
* for each day. Examples for such details are holidays or appointments. That
* information is shown below each day when #GtkCalendar:show-details is set.
* A tooltip containing with full detail information is provided, if the entire
* text should not fit into the details area, or if #GtkCalendar:show-details
* is not set.
*
* The size of the details area can be restricted by setting the
* #GtkCalendar:detail-width-chars and #GtkCalendar:detail-height-rows
* properties.
* @param func a function providing details for each day.
*/
set_detail_func(func: CalendarDetailFunc): void;
/**
* Updates the height of detail cells.
* See #GtkCalendar:detail-height-rows.
* @param rows detail height in rows.
*/
set_detail_height_rows(rows: number): void;
/**
* Updates the width of detail cells.
* See #GtkCalendar:detail-width-chars.
* @param chars detail width in characters.
*/
set_detail_width_chars(chars: number): void;
/**
* Sets display options (whether to display the heading and the month
* headings).
* @param flags the display options to set
*/
set_display_options(flags: CalendarDisplayOptions | null): void;
/**
* Does nothing. Previously defrosted a calendar; all the changes made
* since the last gtk_calendar_freeze() were displayed.
*/
thaw(): void;
/**
* Removes the visual marker from a particular day.
*
* Note that this function always returns %TRUE, and you should
* ignore the return value. In GTK+ 3, this function will not
* return a value.
* @param day the day number to unmark between 1 and 31.
* @returns %TRUE, always
*/
unmark_day(day: number): boolean;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace CellRenderer {
// Signal callback interfaces
interface EditingCanceled {
(): void;
}
interface EditingStarted {
(editable: CellEditable, path: string): void;
}
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {
cell_background: string;
cellBackground: string;
cell_background_gdk: Gdk.Color;
cellBackgroundGdk: Gdk.Color;
cell_background_set: boolean;
cellBackgroundSet: boolean;
editing: boolean;
height: number;
is_expanded: boolean;
isExpanded: boolean;
is_expander: boolean;
isExpander: boolean;
mode: CellRendererMode;
sensitive: boolean;
visible: boolean;
width: number;
xalign: number;
xpad: number;
yalign: number;
ypad: number;
}
}
abstract class CellRenderer extends Object {
static $gtype: GObject.GType<CellRenderer>;
// Properties
set cell_background(val: string);
set cellBackground(val: string);
get cell_background_gdk(): Gdk.Color;
set cell_background_gdk(val: Gdk.Color);
get cellBackgroundGdk(): Gdk.Color;
set cellBackgroundGdk(val: Gdk.Color);
get cell_background_set(): boolean;
set cell_background_set(val: boolean);
get cellBackgroundSet(): boolean;
set cellBackgroundSet(val: boolean);
get editing(): boolean;
get height(): number;
set height(val: number);
get is_expanded(): boolean;
set is_expanded(val: boolean);
get isExpanded(): boolean;
set isExpanded(val: boolean);
get is_expander(): boolean;
set is_expander(val: boolean);
get isExpander(): boolean;
set isExpander(val: boolean);
get mode(): CellRendererMode;
set mode(val: CellRendererMode);
get sensitive(): boolean;
set sensitive(val: boolean);
get visible(): boolean;
set visible(val: boolean);
get width(): number;
set width(val: number);
get xalign(): number;
set xalign(val: number);
get xpad(): number;
set xpad(val: number);
get yalign(): number;
set yalign(val: number);
get ypad(): number;
set ypad(val: number);
// Constructors
constructor(properties?: Partial<CellRenderer.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'editing-canceled', callback: (_source: this) => void): number;
connect_after(signal: 'editing-canceled', callback: (_source: this) => void): number;
emit(signal: 'editing-canceled'): void;
connect(
signal: 'editing-started',
callback: (_source: this, editable: CellEditable, path: string) => void,
): number;
connect_after(
signal: 'editing-started',
callback: (_source: this, editable: CellEditable, path: string) => void,
): number;
emit(signal: 'editing-started', editable: CellEditable, path: string): void;
// Virtual methods
/**
* Passes an activate event to the cell renderer for possible processing.
* Some cell renderers may use events; for example, #GtkCellRendererToggle
* toggles when it gets a mouse click.
* @param event a #GdkEvent
* @param widget widget that received the event
* @param path widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath
* @param background_area background area as passed to gtk_cell_renderer_render()
* @param cell_area cell area as passed to gtk_cell_renderer_render()
* @param flags render flags
*/
vfunc_activate(
event: Gdk.Event,
widget: Widget,
path: string,
background_area: Gdk.Rectangle,
cell_area: Gdk.Rectangle,
flags: CellRendererState,
): boolean;
/**
* Causes the cell renderer to emit the #GtkCellRenderer::editing-canceled
* signal.
*
* This function is for use only by implementations of cell renderers that
* need to notify the client program that an editing process was canceled
* and the changes were not committed.
*/
vfunc_editing_canceled(): void;
vfunc_editing_started(editable: CellEditable, path: string): void;
/**
* Obtains the width and height needed to render the cell. Used by view
* widgets to determine the appropriate size for the cell_area passed to
* gtk_cell_renderer_render(). If `cell_area` is not %NULL, fills in the
* x and y offsets (if set) of the cell relative to this location.
*
* Please note that the values set in `width` and `height,` as well as those
* in `x_offset` and `y_offset` are inclusive of the xpad and ypad properties.
* @param widget the widget the renderer is rendering to
* @param cell_area The area a cell will be allocated, or %NULL
*/
vfunc_get_size(widget: Widget, cell_area: Gdk.Rectangle | null): [number, number, number, number];
/**
* Invokes the virtual render function of the #GtkCellRenderer. The three
* passed-in rectangles are areas of `window`. Most renderers will draw within
* `cell_area;` the xalign, yalign, xpad, and ypad fields of the #GtkCellRenderer
* should be honored with respect to `cell_area`. `background_area` includes the
* blank space around the cell, and also the area containing the tree expander;
* so the `background_area` rectangles for all cells tile to cover the entire
* `window`. `expose_area` is a clip rectangle.
* @param window a #GdkDrawable to draw to
* @param widget the widget owning @window
* @param background_area entire cell area (including tree expanders and maybe padding on the sides)
* @param cell_area area normally rendered by a cell renderer
* @param expose_area area that actually needs updating
* @param flags flags that affect rendering
*/
vfunc_render(
window: Gdk.Drawable,
widget: Widget,
background_area: Gdk.Rectangle,
cell_area: Gdk.Rectangle,
expose_area: Gdk.Rectangle,
flags: CellRendererState,
): void;
/**
* Passes an activate event to the cell renderer for possible processing.
* @param event a #GdkEvent
* @param widget widget that received the event
* @param path widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath
* @param background_area background area as passed to gtk_cell_renderer_render()
* @param cell_area cell area as passed to gtk_cell_renderer_render()
* @param flags render flags
*/
vfunc_start_editing(
event: Gdk.Event,
widget: Widget,
path: string,
background_area: Gdk.Rectangle,
cell_area: Gdk.Rectangle,
flags: CellRendererState,
): CellEditable;
// Methods
/**
* Passes an activate event to the cell renderer for possible processing.
* Some cell renderers may use events; for example, #GtkCellRendererToggle
* toggles when it gets a mouse click.
* @param event a #GdkEvent
* @param widget widget that received the event
* @param path widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath
* @param background_area background area as passed to gtk_cell_renderer_render()
* @param cell_area cell area as passed to gtk_cell_renderer_render()
* @param flags render flags
* @returns %TRUE if the event was consumed/handled
*/
activate(
event: Gdk.Event,
widget: Widget,
path: string,
background_area: Gdk.Rectangle,
cell_area: Gdk.Rectangle,
flags: CellRendererState | null,
): boolean;
/**
* Causes the cell renderer to emit the #GtkCellRenderer::editing-canceled
* signal.
*
* This function is for use only by implementations of cell renderers that
* need to notify the client program that an editing process was canceled
* and the changes were not committed.
*/
editing_canceled(): void;
/**
* Fills in `xalign` and `yalign` with the appropriate values of `cell`.
*/
get_alignment(): [number, number];
/**
* Fills in `width` and `height` with the appropriate size of `cell`.
*/
get_fixed_size(): [number, number];
/**
* Fills in `xpad` and `ypad` with the appropriate values of `cell`.
*/
get_padding(): [number, number];
/**
* Returns the cell renderer's sensitivity.
* @returns %TRUE if the cell renderer is sensitive
*/
get_sensitive(): boolean;
/**
* Obtains the width and height needed to render the cell. Used by view
* widgets to determine the appropriate size for the cell_area passed to
* gtk_cell_renderer_render(). If `cell_area` is not %NULL, fills in the
* x and y offsets (if set) of the cell relative to this location.
*
* Please note that the values set in `width` and `height,` as well as those
* in `x_offset` and `y_offset` are inclusive of the xpad and ypad properties.
* @param widget the widget the renderer is rendering to
* @param cell_area The area a cell will be allocated, or %NULL
*/
get_size(widget: Widget, cell_area: Gdk.Rectangle | null): [number, number, number, number];
/**
* Returns the cell renderer's visibility.
* @returns %TRUE if the cell renderer is visible
*/
get_visible(): boolean;
/**
* Invokes the virtual render function of the #GtkCellRenderer. The three
* passed-in rectangles are areas of `window`. Most renderers will draw within
* `cell_area;` the xalign, yalign, xpad, and ypad fields of the #GtkCellRenderer
* should be honored with respect to `cell_area`. `background_area` includes the
* blank space around the cell, and also the area containing the tree expander;
* so the `background_area` rectangles for all cells tile to cover the entire
* `window`. `expose_area` is a clip rectangle.
* @param window a #GdkDrawable to draw to
* @param widget the widget owning @window
* @param background_area entire cell area (including tree expanders and maybe padding on the sides)
* @param cell_area area normally rendered by a cell renderer
* @param expose_area area that actually needs updating
* @param flags flags that affect rendering
*/
render(
window: Gdk.Window,
widget: Widget,
background_area: Gdk.Rectangle,
cell_area: Gdk.Rectangle,
expose_area: Gdk.Rectangle,
flags: CellRendererState | null,
): void;
/**
* Sets the renderer's alignment within its available space.
* @param xalign the x alignment of the cell renderer
* @param yalign the y alignment of the cell renderer
*/
set_alignment(xalign: number, yalign: number): void;
/**
* Sets the renderer size to be explicit, independent of the properties set.
* @param width the width of the cell renderer, or -1
* @param height the height of the cell renderer, or -1
*/
set_fixed_size(width: number, height: number): void;
/**
* Sets the renderer's padding.
* @param xpad the x padding of the cell renderer
* @param ypad the y padding of the cell renderer
*/
set_padding(xpad: number, ypad: number): void;
/**
* Sets the cell renderer's sensitivity.
* @param sensitive the sensitivity of the cell
*/
set_sensitive(sensitive: boolean): void;
/**
* Sets the cell renderer's visibility.
* @param visible the visibility of the cell
*/
set_visible(visible: boolean): void;
/**
* Passes an activate event to the cell renderer for possible processing.
* @param event a #GdkEvent
* @param widget widget that received the event
* @param path widget-dependent string representation of the event location; e.g. for #GtkTreeView, a string representation of #GtkTreePath
* @param background_area background area as passed to gtk_cell_renderer_render()
* @param cell_area cell area as passed to gtk_cell_renderer_render()
* @param flags render flags
* @returns A new #GtkCellEditable, or %NULL
*/
start_editing(
event: Gdk.Event,
widget: Widget,
path: string,
background_area: Gdk.Rectangle,
cell_area: Gdk.Rectangle,
flags: CellRendererState | null,
): CellEditable;
/**
* Informs the cell renderer that the editing is stopped.
* If `canceled` is %TRUE, the cell renderer will emit the
* #GtkCellRenderer::editing-canceled signal.
*
* This function should be called by cell renderer implementations
* in response to the #GtkCellEditable::editing-done signal of
* #GtkCellEditable.
* @param canceled %TRUE if the editing has been canceled
*/
stop_editing(canceled: boolean): void;
}
namespace CellRendererAccel {
// Signal callback interfaces
interface AccelCleared {
(path_string: string): void;
}
interface AccelEdited {
(path_string: string, accel_key: number, accel_mods: Gdk.ModifierType, hardware_keycode: number): void;
}
// Constructor properties interface
interface ConstructorProps extends CellRendererText.ConstructorProps {
accel_key: number;
accelKey: number;
accel_mode: CellRendererAccelMode;
accelMode: CellRendererAccelMode;
accel_mods: Gdk.ModifierType;
accelMods: Gdk.ModifierType;
keycode: number;
}
}
class CellRendererAccel extends CellRendererText {
static $gtype: GObject.GType<CellRendererAccel>;
// Properties
/**
* The keyval of the accelerator.
*/
get accel_key(): number;
set accel_key(val: number);
/**
* The keyval of the accelerator.
*/
get accelKey(): number;
set accelKey(val: number);
/**
* Determines if the edited accelerators are GTK+ accelerators. If
* they are, consumed modifiers are suppressed, only accelerators
* accepted by GTK+ are allowed, and the accelerators are rendered
* in the same way as they are in menus.
*/
get accel_mode(): CellRendererAccelMode;
set accel_mode(val: CellRendererAccelMode);
/**
* Determines if the edited accelerators are GTK+ accelerators. If
* they are, consumed modifiers are suppressed, only accelerators
* accepted by GTK+ are allowed, and the accelerators are rendered
* in the same way as they are in menus.
*/
get accelMode(): CellRendererAccelMode;
set accelMode(val: CellRendererAccelMode);
/**
* The modifier mask of the accelerator.
*/
get accel_mods(): Gdk.ModifierType;
set accel_mods(val: Gdk.ModifierType);
/**
* The modifier mask of the accelerator.
*/
get accelMods(): Gdk.ModifierType;
set accelMods(val: Gdk.ModifierType);
/**
* The hardware keycode of the accelerator. Note that the hardware keycode is
* only relevant if the key does not have a keyval. Normally, the keyboard
* configuration should assign keyvals to all keys.
*/
get keycode(): number;
set keycode(val: number);
// Constructors
constructor(properties?: Partial<CellRendererAccel.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererAccel;
// 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: 'accel-cleared', callback: (_source: this, path_string: string) => void): number;
connect_after(signal: 'accel-cleared', callback: (_source: this, path_string: string) => void): number;
emit(signal: 'accel-cleared', path_string: string): void;
connect(
signal: 'accel-edited',
callback: (
_source: this,
path_string: string,
accel_key: number,
accel_mods: Gdk.ModifierType,
hardware_keycode: number,
) => void,
): number;
connect_after(
signal: 'accel-edited',
callback: (
_source: this,
path_string: string,
accel_key: number,
accel_mods: Gdk.ModifierType,
hardware_keycode: number,
) => void,
): number;
emit(
signal: 'accel-edited',
path_string: string,
accel_key: number,
accel_mods: Gdk.ModifierType,
hardware_keycode: number,
): void;
// Virtual methods
vfunc_accel_cleared(path_string: string): void;
vfunc_accel_edited(
path_string: string,
accel_key: number,
accel_mods: Gdk.ModifierType,
hardware_keycode: number,
): void;
}
namespace CellRendererCombo {
// Signal callback interfaces
interface Changed {
(path_string: string, new_iter: TreeIter): void;
}
// Constructor properties interface
interface ConstructorProps extends CellRendererText.ConstructorProps {
has_entry: boolean;
hasEntry: boolean;
model: TreeModel;
text_column: number;
textColumn: number;
}
}
class CellRendererCombo extends CellRendererText {
static $gtype: GObject.GType<CellRendererCombo>;
// Properties
/**
* If %TRUE, the cell renderer will include an entry and allow to enter
* values other than the ones in the popup list.
*/
get has_entry(): boolean;
set has_entry(val: boolean);
/**
* If %TRUE, the cell renderer will include an entry and allow to enter
* values other than the ones in the popup list.
*/
get hasEntry(): boolean;
set hasEntry(val: boolean);
/**
* Holds a tree model containing the possible values for the combo box.
* Use the text_column property to specify the column holding the values.
*/
get model(): TreeModel;
set model(val: TreeModel);
/**
* Specifies the model column which holds the possible values for the
* combo box.
*
* Note that this refers to the model specified in the model property,
* <emphasis>not</emphasis> the model backing the tree view to which
* this cell renderer is attached.
*
* #GtkCellRendererCombo automatically adds a text cell renderer for
* this column to its combo box.
*/
get text_column(): number;
set text_column(val: number);
/**
* Specifies the model column which holds the possible values for the
* combo box.
*
* Note that this refers to the model specified in the model property,
* <emphasis>not</emphasis> the model backing the tree view to which
* this cell renderer is attached.
*
* #GtkCellRendererCombo automatically adds a text cell renderer for
* this column to its combo box.
*/
get textColumn(): number;
set textColumn(val: number);
// Constructors
constructor(properties?: Partial<CellRendererCombo.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererCombo;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'changed',
callback: (_source: this, path_string: string, new_iter: TreeIter) => void,
): number;
connect_after(
signal: 'changed',
callback: (_source: this, path_string: string, new_iter: TreeIter) => void,
): number;
emit(signal: 'changed', path_string: string, new_iter: TreeIter): void;
}
namespace CellRendererPixbuf {
// Constructor properties interface
interface ConstructorProps extends CellRenderer.ConstructorProps {
follow_state: boolean;
followState: boolean;
gicon: Gio.Icon;
icon_name: string;
iconName: string;
pixbuf: GdkPixbuf.Pixbuf;
pixbuf_expander_closed: GdkPixbuf.Pixbuf;
pixbufExpanderClosed: GdkPixbuf.Pixbuf;
pixbuf_expander_open: GdkPixbuf.Pixbuf;
pixbufExpanderOpen: GdkPixbuf.Pixbuf;
stock_detail: string;
stockDetail: string;
stock_id: string;
stockId: string;
stock_size: number;
stockSize: number;
}
}
class CellRendererPixbuf extends CellRenderer {
static $gtype: GObject.GType<CellRendererPixbuf>;
// Properties
/**
* Specifies whether the rendered pixbuf should be colorized
* according to the #GtkCellRendererState.
*/
get follow_state(): boolean;
set follow_state(val: boolean);
/**
* Specifies whether the rendered pixbuf should be colorized
* according to the #GtkCellRendererState.
*/
get followState(): boolean;
set followState(val: boolean);
/**
* The GIcon representing the icon to display.
* If the icon theme is changed, the image will be updated
* automatically.
*/
get gicon(): Gio.Icon;
set gicon(val: Gio.Icon);
/**
* The name of the themed icon to display.
* This property only has an effect if not overridden by "stock_id"
* or "pixbuf" properties.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of the themed icon to display.
* This property only has an effect if not overridden by "stock_id"
* or "pixbuf" properties.
*/
get iconName(): string;
set iconName(val: string);
get pixbuf(): GdkPixbuf.Pixbuf;
set pixbuf(val: GdkPixbuf.Pixbuf);
get pixbuf_expander_closed(): GdkPixbuf.Pixbuf;
set pixbuf_expander_closed(val: GdkPixbuf.Pixbuf);
get pixbufExpanderClosed(): GdkPixbuf.Pixbuf;
set pixbufExpanderClosed(val: GdkPixbuf.Pixbuf);
get pixbuf_expander_open(): GdkPixbuf.Pixbuf;
set pixbuf_expander_open(val: GdkPixbuf.Pixbuf);
get pixbufExpanderOpen(): GdkPixbuf.Pixbuf;
set pixbufExpanderOpen(val: GdkPixbuf.Pixbuf);
get stock_detail(): string;
set stock_detail(val: string);
get stockDetail(): string;
set stockDetail(val: string);
get stock_id(): string;
set stock_id(val: string);
get stockId(): string;
set stockId(val: string);
get stock_size(): number;
set stock_size(val: number);
get stockSize(): number;
set stockSize(val: number);
// Constructors
constructor(properties?: Partial<CellRendererPixbuf.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererPixbuf;
}
namespace CellRendererProgress {
// Constructor properties interface
interface ConstructorProps extends CellRenderer.ConstructorProps {
orientation: ProgressBarOrientation;
pulse: number;
text: string;
text_xalign: number;
textXalign: number;
text_yalign: number;
textYalign: number;
value: number;
}
}
class CellRendererProgress extends CellRenderer {
static $gtype: GObject.GType<CellRendererProgress>;
// Properties
/**
* The "orientation" property controls the direction and growth
* direction of the progress bar (left-to-right, right-to-left,
* top-to-bottom or bottom-to-top).
*/
get orientation(): ProgressBarOrientation;
set orientation(val: ProgressBarOrientation);
/**
* Setting this to a non-negative value causes the cell renderer to
* enter "activity mode", where a block bounces back and forth to
* indicate that some progress is made, without specifying exactly how
* much.
*
* Each increment of the property causes the block to move by a little
* bit.
*
* To indicate that the activity has not started yet, set the property
* to zero. To indicate completion, set the property to %G_MAXINT.
*/
get pulse(): number;
set pulse(val: number);
/**
* The "text" property determines the label which will be drawn
* over the progress bar. Setting this property to %NULL causes the default
* label to be displayed. Setting this property to an empty string causes
* no label to be displayed.
*/
get text(): string;
set text(val: string);
/**
* The "text-xalign" property controls the horizontal alignment of the
* text in the progress bar. Valid values range from 0 (left) to 1
* (right). Reserved for RTL layouts.
*/
get text_xalign(): number;
set text_xalign(val: number);
/**
* The "text-xalign" property controls the horizontal alignment of the
* text in the progress bar. Valid values range from 0 (left) to 1
* (right). Reserved for RTL layouts.
*/
get textXalign(): number;
set textXalign(val: number);
/**
* The "text-yalign" property controls the vertical alignment of the
* text in the progress bar. Valid values range from 0 (top) to 1
* (bottom).
*/
get text_yalign(): number;
set text_yalign(val: number);
/**
* The "text-yalign" property controls the vertical alignment of the
* text in the progress bar. Valid values range from 0 (top) to 1
* (bottom).
*/
get textYalign(): number;
set textYalign(val: number);
/**
* The "value" property determines the percentage to which the
* progress bar will be "filled in".
*/
get value(): number;
set value(val: number);
// Constructors
constructor(properties?: Partial<CellRendererProgress.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererProgress;
}
namespace CellRendererSpin {
// Constructor properties interface
interface ConstructorProps extends CellRendererText.ConstructorProps {
adjustment: Adjustment;
climb_rate: number;
climbRate: number;
digits: number;
}
}
class CellRendererSpin extends CellRendererText {
static $gtype: GObject.GType<CellRendererSpin>;
// Properties
/**
* The adjustment that holds the value of the spinbutton.
* This must be non-%NULL for the cell renderer to be editable.
*/
get adjustment(): Adjustment;
set adjustment(val: Adjustment);
/**
* The acceleration rate when you hold down a button.
*/
get climb_rate(): number;
set climb_rate(val: number);
/**
* The acceleration rate when you hold down a button.
*/
get climbRate(): number;
set climbRate(val: number);
/**
* The number of decimal places to display.
*/
get digits(): number;
set digits(val: number);
// Constructors
constructor(properties?: Partial<CellRendererSpin.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererSpin;
}
namespace CellRendererSpinner {
// Constructor properties interface
interface ConstructorProps extends CellRenderer.ConstructorProps {
active: boolean;
pulse: number;
size: IconSize;
}
}
/**
* GtkCellRendererSpinner renders a spinning animation in a cell, very
* similar to #GtkSpinner. It can often be used as an alternative
* to a #GtkCellRendererProgress for displaying indefinite activity,
* instead of actual progress.
*
* To start the animation in a cell, set the #GtkCellRendererSpinner:active
* property to %TRUE and increment the #GtkCellRendererSpinner:pulse property
* at regular intervals. The usual way to set the cell renderer properties
* for each cell is to bind them to columns in your tree model using e.g.
* gtk_tree_view_column_add_attribute().
*/
class CellRendererSpinner extends CellRenderer {
static $gtype: GObject.GType<CellRendererSpinner>;
// Properties
get active(): boolean;
set active(val: boolean);
/**
* Pulse of the spinner. Increment this value to draw the next frame of the
* spinner animation. Usually, you would update this value in a timeout.
*
* The #GtkSpinner widget draws one full cycle of the animation per second by default.
* You can learn about the number of frames used by the theme
* by looking at the #GtkSpinner:num-steps style property and the duration
* of the cycle by looking at #GtkSpinner:cycle-duration.
*/
get pulse(): number;
set pulse(val: number);
/**
* The #GtkIconSize value that specifies the size of the rendered spinner.
*/
get size(): IconSize;
set size(val: IconSize);
// Constructors
constructor(properties?: Partial<CellRendererSpinner.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererSpinner;
}
namespace CellRendererText {
// Signal callback interfaces
interface Edited {
(path: string, new_text: string): void;
}
// Constructor properties interface
interface ConstructorProps extends CellRenderer.ConstructorProps {
align_set: boolean;
alignSet: boolean;
alignment: Pango.Alignment;
attributes: Pango.AttrList;
background: string;
background_gdk: Gdk.Color;
backgroundGdk: Gdk.Color;
background_set: boolean;
backgroundSet: boolean;
editable: boolean;
editable_set: boolean;
editableSet: boolean;
ellipsize: Pango.EllipsizeMode;
ellipsize_set: boolean;
ellipsizeSet: boolean;
family: string;
family_set: boolean;
familySet: boolean;
font: string;
font_desc: Pango.FontDescription;
fontDesc: Pango.FontDescription;
foreground: string;
foreground_gdk: Gdk.Color;
foregroundGdk: Gdk.Color;
foreground_set: boolean;
foregroundSet: boolean;
language: string;
language_set: boolean;
languageSet: boolean;
markup: string;
rise: number;
rise_set: boolean;
riseSet: boolean;
scale: number;
scale_set: boolean;
scaleSet: boolean;
single_paragraph_mode: boolean;
singleParagraphMode: boolean;
size: number;
size_points: number;
sizePoints: number;
size_set: boolean;
sizeSet: boolean;
stretch: Pango.Stretch;
stretch_set: boolean;
stretchSet: boolean;
strikethrough: boolean;
strikethrough_set: boolean;
strikethroughSet: boolean;
style: Pango.Style;
style_set: boolean;
styleSet: boolean;
text: string;
underline: Pango.Underline;
underline_set: boolean;
underlineSet: boolean;
variant: Pango.Variant;
variant_set: boolean;
variantSet: boolean;
weight: number;
weight_set: boolean;
weightSet: boolean;
width_chars: number;
widthChars: number;
wrap_mode: Pango.WrapMode;
wrapMode: Pango.WrapMode;
wrap_width: number;
wrapWidth: number;
}
}
class CellRendererText extends CellRenderer {
static $gtype: GObject.GType<CellRendererText>;
// Properties
get align_set(): boolean;
set align_set(val: boolean);
get alignSet(): boolean;
set alignSet(val: boolean);
/**
* Specifies how to align the lines of text with respect to each other.
*
* Note that this property describes how to align the lines of text in
* case there are several of them. The "xalign" property of #GtkCellRenderer,
* on the other hand, sets the horizontal alignment of the whole text.
*/
get alignment(): Pango.Alignment;
set alignment(val: Pango.Alignment);
get attributes(): Pango.AttrList;
set attributes(val: Pango.AttrList);
set background(val: string);
get background_gdk(): Gdk.Color;
set background_gdk(val: Gdk.Color);
get backgroundGdk(): Gdk.Color;
set backgroundGdk(val: Gdk.Color);
get background_set(): boolean;
set background_set(val: boolean);
get backgroundSet(): boolean;
set backgroundSet(val: boolean);
get editable(): boolean;
set editable(val: boolean);
get editable_set(): boolean;
set editable_set(val: boolean);
get editableSet(): boolean;
set editableSet(val: boolean);
/**
* Specifies the preferred place to ellipsize the string, if the cell renderer
* does not have enough room to display the entire string. Setting it to
* %PANGO_ELLIPSIZE_NONE turns off ellipsizing. See the wrap-width property
* for another way of making the text fit into a given width.
*/
get ellipsize(): Pango.EllipsizeMode;
set ellipsize(val: Pango.EllipsizeMode);
get ellipsize_set(): boolean;
set ellipsize_set(val: boolean);
get ellipsizeSet(): boolean;
set ellipsizeSet(val: boolean);
get family(): string;
set family(val: string);
get family_set(): boolean;
set family_set(val: boolean);
get familySet(): boolean;
set familySet(val: boolean);
get font(): string;
set font(val: string);
get font_desc(): Pango.FontDescription;
set font_desc(val: Pango.FontDescription);
get fontDesc(): Pango.FontDescription;
set fontDesc(val: Pango.FontDescription);
set foreground(val: string);
get foreground_gdk(): Gdk.Color;
set foreground_gdk(val: Gdk.Color);
get foregroundGdk(): Gdk.Color;
set foregroundGdk(val: Gdk.Color);
get foreground_set(): boolean;
set foreground_set(val: boolean);
get foregroundSet(): boolean;
set foregroundSet(val: boolean);
get language(): string;
set language(val: string);
get language_set(): boolean;
set language_set(val: boolean);
get languageSet(): boolean;
set languageSet(val: boolean);
set markup(val: string);
get rise(): number;
set rise(val: number);
get rise_set(): boolean;
set rise_set(val: boolean);
get riseSet(): boolean;
set riseSet(val: boolean);
get scale(): number;
set scale(val: number);
get scale_set(): boolean;
set scale_set(val: boolean);
get scaleSet(): boolean;
set scaleSet(val: boolean);
get single_paragraph_mode(): boolean;
set single_paragraph_mode(val: boolean);
get singleParagraphMode(): boolean;
set singleParagraphMode(val: boolean);
get size(): number;
set size(val: number);
get size_points(): number;
set size_points(val: number);
get sizePoints(): number;
set sizePoints(val: number);
get size_set(): boolean;
set size_set(val: boolean);
get sizeSet(): boolean;
set sizeSet(val: boolean);
get stretch(): Pango.Stretch;
set stretch(val: Pango.Stretch);
get stretch_set(): boolean;
set stretch_set(val: boolean);
get stretchSet(): boolean;
set stretchSet(val: boolean);
get strikethrough(): boolean;
set strikethrough(val: boolean);
get strikethrough_set(): boolean;
set strikethrough_set(val: boolean);
get strikethroughSet(): boolean;
set strikethroughSet(val: boolean);
get style(): Pango.Style;
set style(val: Pango.Style);
get style_set(): boolean;
set style_set(val: boolean);
get styleSet(): boolean;
set styleSet(val: boolean);
get text(): string;
set text(val: string);
get underline(): Pango.Underline;
set underline(val: Pango.Underline);
get underline_set(): boolean;
set underline_set(val: boolean);
get underlineSet(): boolean;
set underlineSet(val: boolean);
get variant(): Pango.Variant;
set variant(val: Pango.Variant);
get variant_set(): boolean;
set variant_set(val: boolean);
get variantSet(): boolean;
set variantSet(val: boolean);
get weight(): number;
set weight(val: number);
get weight_set(): boolean;
set weight_set(val: boolean);
get weightSet(): boolean;
set weightSet(val: boolean);
/**
* The desired width of the cell, in characters. If this property is set to
* -1, the width will be calculated automatically, otherwise the cell will
* request either 3 characters or the property value, whichever is greater.
*/
get width_chars(): number;
set width_chars(val: number);
/**
* The desired width of the cell, in characters. If this property is set to
* -1, the width will be calculated automatically, otherwise the cell will
* request either 3 characters or the property value, whichever is greater.
*/
get widthChars(): number;
set widthChars(val: number);
/**
* Specifies how to break the string into multiple lines, if the cell
* renderer does not have enough room to display the entire string.
* This property has no effect unless the wrap-width property is set.
*/
get wrap_mode(): Pango.WrapMode;
set wrap_mode(val: Pango.WrapMode);
/**
* Specifies how to break the string into multiple lines, if the cell
* renderer does not have enough room to display the entire string.
* This property has no effect unless the wrap-width property is set.
*/
get wrapMode(): Pango.WrapMode;
set wrapMode(val: Pango.WrapMode);
/**
* Specifies the width at which the text is wrapped. The wrap-mode property can
* be used to influence at what character positions the line breaks can be placed.
* Setting wrap-width to -1 turns wrapping off.
*/
get wrap_width(): number;
set wrap_width(val: number);
/**
* Specifies the width at which the text is wrapped. The wrap-mode property can
* be used to influence at what character positions the line breaks can be placed.
* Setting wrap-width to -1 turns wrapping off.
*/
get wrapWidth(): number;
set wrapWidth(val: number);
// Constructors
constructor(properties?: Partial<CellRendererText.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererText;
// 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: 'edited', callback: (_source: this, path: string, new_text: string) => void): number;
connect_after(signal: 'edited', callback: (_source: this, path: string, new_text: string) => void): number;
emit(signal: 'edited', path: string, new_text: string): void;
// Virtual methods
vfunc_edited(path: string, new_text: string): void;
// Methods
/**
* Sets the height of a renderer to explicitly be determined by the "font" and
* "y_pad" property set on it. Further changes in these properties do not
* affect the height, so they must be accompanied by a subsequent call to this
* function. Using this function is unflexible, and should really only be used
* if calculating the size of a cell is too slow (ie, a massive number of cells
* displayed). If `number_of_rows` is -1, then the fixed height is unset, and
* the height is determined by the properties again.
* @param number_of_rows Number of rows of text each cell renderer is allocated, or -1
*/
set_fixed_height_from_font(number_of_rows: number): void;
}
namespace CellRendererToggle {
// Signal callback interfaces
interface Toggled {
(path: string): void;
}
// Constructor properties interface
interface ConstructorProps extends CellRenderer.ConstructorProps {
activatable: boolean;
active: boolean;
inconsistent: boolean;
indicator_size: number;
indicatorSize: number;
radio: boolean;
}
}
class CellRendererToggle extends CellRenderer {
static $gtype: GObject.GType<CellRendererToggle>;
// Properties
get activatable(): boolean;
set activatable(val: boolean);
get active(): boolean;
set active(val: boolean);
get inconsistent(): boolean;
set inconsistent(val: boolean);
get indicator_size(): number;
set indicator_size(val: number);
get indicatorSize(): number;
set indicatorSize(val: number);
get radio(): boolean;
set radio(val: boolean);
// Constructors
constructor(properties?: Partial<CellRendererToggle.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellRendererToggle;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'toggled', callback: (_source: this, path: string) => void): number;
connect_after(signal: 'toggled', callback: (_source: this, path: string) => void): number;
emit(signal: 'toggled', path: string): void;
// Virtual methods
vfunc_toggled(path: string): void;
// Methods
/**
* Returns whether the cell renderer is activatable. See
* gtk_cell_renderer_toggle_set_activatable().
* @returns %TRUE if the cell renderer is activatable.
*/
get_activatable(): boolean;
/**
* Returns whether the cell renderer is active. See
* gtk_cell_renderer_toggle_set_active().
* @returns %TRUE if the cell renderer is active.
*/
get_active(): boolean;
/**
* Returns whether we're rendering radio toggles rather than checkboxes.
* @returns %TRUE if we're rendering radio toggles rather than checkboxes
*/
get_radio(): boolean;
/**
* Makes the cell renderer activatable.
* @param setting the value to set.
*/
set_activatable(setting: boolean): void;
/**
* Activates or deactivates a cell renderer.
* @param setting the value to set.
*/
set_active(setting: boolean): void;
/**
* If `radio` is %TRUE, the cell renderer renders a radio toggle
* (i.e. a toggle in a group of mutually-exclusive toggles).
* If %FALSE, it renders a check toggle (a standalone boolean option).
* This can be set globally for the cell renderer, or changed just
* before rendering each cell in the model (for #GtkTreeView, you set
* up a per-row setting using #GtkTreeViewColumn to associate model
* columns with cell renderer properties).
* @param radio %TRUE to make the toggle look like a radio button
*/
set_radio(radio: boolean): void;
}
namespace CellView {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
CellLayout.ConstructorProps {
background: string;
background_gdk: Gdk.Color;
backgroundGdk: Gdk.Color;
background_set: boolean;
backgroundSet: boolean;
model: TreeModel;
}
}
class CellView extends Widget implements Atk.ImplementorIface, Buildable, CellLayout {
static $gtype: GObject.GType<CellView>;
// Properties
set background(val: string);
get background_gdk(): Gdk.Color;
set background_gdk(val: Gdk.Color);
get backgroundGdk(): Gdk.Color;
set backgroundGdk(val: Gdk.Color);
get background_set(): boolean;
set background_set(val: boolean);
get backgroundSet(): boolean;
set backgroundSet(val: boolean);
/**
* The model for cell view
*
* since 2.10
*/
get model(): TreeModel;
set model(val: TreeModel);
// Constructors
constructor(properties?: Partial<CellView.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CellView;
static new_with_markup(markup: string): CellView;
static new_with_pixbuf(pixbuf: GdkPixbuf.Pixbuf): CellView;
static new_with_text(text: string): CellView;
// Methods
/**
* Returns a #GtkTreePath referring to the currently
* displayed row. If no row is currently displayed,
* %NULL is returned.
* @returns the currently displayed row or %NULL
*/
get_displayed_row(): TreePath;
/**
* Returns the model for `cell_view`. If no model is used %NULL is
* returned.
* @returns a #GtkTreeModel used or %NULL
*/
get_model(): TreeModel;
/**
* Sets `requisition` to the size needed by `cell_view` to display
* the model row pointed to by `path`.
* @param path a #GtkTreePath
* @returns %TRUE
*/
get_size_of_row(path: TreePath): [boolean, Requisition];
/**
* Sets the background color of `view`.
* @param color the new background color
*/
set_background_color(color: Gdk.Color): void;
/**
* Sets the row of the model that is currently displayed
* by the #GtkCellView. If the path is unset, then the
* contents of the cellview "stick" at their last value;
* this is not normally a desired result, but may be
* a needed intermediate state if say, the model for
* the #GtkCellView becomes temporarily empty.
* @param path a #GtkTreePath or %NULL to unset.
*/
set_displayed_row(path?: TreePath | null): void;
/**
* Sets the model for `cell_view`. If `cell_view` already has a model
* set, it will remove it before setting the new model. If `model` is
* %NULL, then it will unset the old model.
* @param model a #GtkTreeModel
*/
set_model(model?: TreeModel | null): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): 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 CheckButton {
// Constructor properties interface
interface ConstructorProps
extends ToggleButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {}
}
class CheckButton extends ToggleButton implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<CheckButton>;
// Fields
toggle_button: ToggleButton;
// Constructors
constructor(properties?: Partial<CheckButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CheckButton;
static new_with_label(label: string): CheckButton;
static new_with_mnemonic(label: string): CheckButton;
// Virtual methods
vfunc_draw_indicator(area: Gdk.Rectangle): 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 CheckMenuItem {
// Signal callback interfaces
interface Toggled {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends MenuItem.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
active: boolean;
draw_as_radio: boolean;
drawAsRadio: boolean;
inconsistent: boolean;
}
}
class CheckMenuItem extends MenuItem implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<CheckMenuItem>;
// Properties
get active(): boolean;
set active(val: boolean);
get draw_as_radio(): boolean;
set draw_as_radio(val: boolean);
get drawAsRadio(): boolean;
set drawAsRadio(val: boolean);
get inconsistent(): boolean;
set inconsistent(val: boolean);
// Fields
menu_item: MenuItem;
always_show_toggle: number;
// Constructors
constructor(properties?: Partial<CheckMenuItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CheckMenuItem;
static new_with_label(label: string): CheckMenuItem;
static new_with_mnemonic(label: string): CheckMenuItem;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'toggled', callback: (_source: this) => void): number;
connect_after(signal: 'toggled', callback: (_source: this) => void): number;
emit(signal: 'toggled'): void;
// Virtual methods
vfunc_draw_indicator(area: Gdk.Rectangle): void;
vfunc_toggled(): void;
// Methods
/**
* Returns whether the check menu item is active. See
* gtk_check_menu_item_set_active ().
* @returns %TRUE if the menu item is checked.
*/
get_active(): boolean;
/**
* Returns whether `check_menu_item` looks like a #GtkRadioMenuItem
* @returns Whether @check_menu_item looks like a #GtkRadioMenuItem
*/
get_draw_as_radio(): boolean;
/**
* Retrieves the value set by gtk_check_menu_item_set_inconsistent().
* @returns %TRUE if inconsistent
*/
get_inconsistent(): boolean;
set_active(is_active: boolean): void;
/**
* Sets whether `check_menu_item` is drawn like a #GtkRadioMenuItem
* @param draw_as_radio whether @check_menu_item is drawn like a #GtkRadioMenuItem
*/
set_draw_as_radio(draw_as_radio: boolean): void;
/**
* If the user has selected a range of elements (such as some text or
* spreadsheet cells) that are affected by a boolean setting, and the
* current values in that range are inconsistent, you may want to
* display the check in an "in between" state. This function turns on
* "in between" display. Normally you would turn off the inconsistent
* state again if the user explicitly selects a setting. This has to be
* done manually, gtk_check_menu_item_set_inconsistent() only affects
* visual appearance, it doesn't affect the semantics of the widget.
* @param setting %TRUE to display an "inconsistent" third state check
*/
set_inconsistent(setting: boolean): void;
set_show_toggle(always: boolean): void;
toggled(): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Clipboard {
// Signal callback interfaces
interface OwnerChange {
(event: Gdk.Event): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class Clipboard extends GObject.Object {
static $gtype: GObject.GType<Clipboard>;
// Constructors
constructor(properties?: Partial<Clipboard.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'owner-change', callback: (_source: this, event: Gdk.Event) => void): number;
connect_after(signal: 'owner-change', callback: (_source: this, event: Gdk.Event) => void): number;
emit(signal: 'owner-change', event: Gdk.Event): void;
// Static methods
/**
* Returns the clipboard object for the given selection.
* See gtk_clipboard_get_for_display() for complete details.
* @param selection a #GdkAtom which identifies the clipboard to use
*/
static get(selection: Gdk.Atom): Clipboard;
/**
* Returns the clipboard object for the given selection.
* Cut/copy/paste menu items and keyboard shortcuts should use
* the default clipboard, returned by passing %GDK_SELECTION_CLIPBOARD for `selection`.
* (%GDK_NONE is supported as a synonym for GDK_SELECTION_CLIPBOARD
* for backwards compatibility reasons.)
* The currently-selected object or text should be provided on the clipboard
* identified by #GDK_SELECTION_PRIMARY. Cut/copy/paste menu items
* conceptually copy the contents of the #GDK_SELECTION_PRIMARY clipboard
* to the default clipboard, i.e. they copy the selection to what the
* user sees as the clipboard.
*
* (Passing #GDK_NONE is the same as using <literal>gdk_atom_intern
* ("CLIPBOARD", FALSE)</literal>. See <ulink
* url="http://www.freedesktop.org/Standards/clipboards-spec">
* http://www.freedesktop.org/Standards/clipboards-spec</ulink>
* for a detailed discussion of the "CLIPBOARD" vs. "PRIMARY"
* selections under the X window system. On Win32 the
* #GDK_SELECTION_PRIMARY clipboard is essentially ignored.)
*
* It's possible to have arbitrary named clipboards; if you do invent
* new clipboards, you should prefix the selection name with an
* underscore (because the ICCCM requires that nonstandard atoms are
* underscore-prefixed), and namespace it as well. For example,
* if your application called "Foo" has a special-purpose
* clipboard, you might call it "_FOO_SPECIAL_CLIPBOARD".
* @param display the display for which the clipboard is to be retrieved or created
* @param selection a #GdkAtom which identifies the clipboard to use.
*/
static get_for_display(display: Gdk.Display, selection: Gdk.Atom): Clipboard;
// Methods
/**
* Clears the contents of the clipboard. Generally this should only
* be called between the time you call gtk_clipboard_set_with_owner()
* or gtk_clipboard_set_with_data(),
* and when the `clear_func` you supplied is called. Otherwise, the
* clipboard may be owned by someone else.
*/
clear(): void;
/**
* Gets the #GdkDisplay associated with `clipboard`
* @returns the #GdkDisplay associated with @clipboard
*/
get_display(): Gdk.Display;
/**
* If the clipboard contents callbacks were set with
* gtk_clipboard_set_with_owner(), and the gtk_clipboard_set_with_data() or
* gtk_clipboard_clear() has not subsequently called, returns the owner set
* by gtk_clipboard_set_with_owner().
* @returns the owner of the clipboard, if any; otherwise %NULL.
*/
get_owner<T = GObject.Object>(): T;
/**
* Hints that the clipboard data should be stored somewhere when the
* application exits or when gtk_clipboard_store () is called.
*
* This value is reset when the clipboard owner changes.
* Where the clipboard data is stored is platform dependent,
* see gdk_display_store_clipboard () for more information.
* @param targets array containing information about which forms should be stored or %NULL to indicate that all forms should be stored.
*/
set_can_store(targets?: TargetEntry[] | null): void;
/**
* Sets the contents of the clipboard to the given #GdkPixbuf.
* GTK+ will take responsibility for responding for requests
* for the image, and for converting the image into the
* requested format.
* @param pixbuf a #GdkPixbuf
*/
set_image(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the contents of the clipboard to the given UTF-8 string. GTK+ will
* make a copy of the text and take responsibility for responding
* for requests for the text, and for converting the text into
* the requested format.
* @param text a UTF-8 string.
* @param len length of @text, in bytes, or -1, in which case the length will be determined with <function>strlen()</function>.
*/
set_text(text: string, len: number): void;
/**
* Stores the current clipboard data somewhere so that it will stay
* around after the application has quit.
*/
store(): void;
/**
* Requests the contents of the clipboard using the given target.
* This function waits for the data to be received using the main
* loop, so events, timeouts, etc, may be dispatched during the wait.
* @param target an atom representing the form into which the clipboard owner should convert the selection.
* @returns a newly-allocated #GtkSelectionData object or %NULL if retrieving the given target failed. If non-%NULL, this value must be freed with gtk_selection_data_free() when you are finished with it.
*/
wait_for_contents(target: Gdk.Atom): SelectionData;
/**
* Requests the contents of the clipboard as image and converts
* the result to a #GdkPixbuf. This function waits for
* the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
* @returns a newly-allocated #GdkPixbuf object which must be disposed with g_object_unref(), or %NULL if retrieving the selection data failed. (This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into an image.)
*/
wait_for_image(): GdkPixbuf.Pixbuf;
/**
* Requests the contents of the clipboard as rich text. This function
* waits for the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
* @param buffer a #GtkTextBuffer
* @param format return location for the format of the returned data
* @returns a newly-allocated binary block of data which must be freed with g_free(), or %NULL if retrieving the selection data failed. (This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into text form.)
*/
wait_for_rich_text(buffer: TextBuffer, format: Gdk.Atom): Uint8Array;
/**
* Returns a list of targets that are present on the clipboard, or %NULL
* if there aren't any targets available. The returned list must be
* freed with g_free().
* This function waits for the data to be received using the main
* loop, so events, timeouts, etc, may be dispatched during the wait.
* @returns %TRUE if any targets are present on the clipboard, otherwise %FALSE.
*/
wait_for_targets(): [boolean, Gdk.Atom[]];
/**
* Requests the contents of the clipboard as text and converts
* the result to UTF-8 if necessary. This function waits for
* the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
* @returns a newly-allocated UTF-8 string which must be freed with g_free(), or %NULL if retrieving the selection data failed. (This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into text form.)
*/
wait_for_text(): string;
/**
* Requests the contents of the clipboard as URIs. This function waits
* for the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
* @returns a newly-allocated %NULL-terminated array of strings which must be freed with g_strfreev(), or %NULL if retrieving the selection data failed. (This could happen for various reasons, in particular if the clipboard was empty or if the contents of the clipboard could not be converted into URI form.)
*/
wait_for_uris(): string[];
/**
* Test to see if there is an image available to be pasted
* This is done by requesting the TARGETS atom and checking
* if it contains any of the supported image targets. This function
* waits for the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
*
* This function is a little faster than calling
* gtk_clipboard_wait_for_image() since it doesn't need to retrieve
* the actual image data.
* @returns %TRUE is there is an image available, %FALSE otherwise.
*/
wait_is_image_available(): boolean;
/**
* Test to see if there is rich text available to be pasted
* This is done by requesting the TARGETS atom and checking
* if it contains any of the supported rich text targets. This function
* waits for the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
*
* This function is a little faster than calling
* gtk_clipboard_wait_for_rich_text() since it doesn't need to retrieve
* the actual text.
* @param buffer a #GtkTextBuffer
* @returns %TRUE is there is rich text available, %FALSE otherwise.
*/
wait_is_rich_text_available(buffer: TextBuffer): boolean;
/**
* Checks if a clipboard supports pasting data of a given type. This
* function can be used to determine if a "Paste" menu item should be
* insensitive or not.
*
* If you want to see if there's text available on the clipboard, use
* gtk_clipboard_wait_is_text_available () instead.
* @param target A #GdkAtom indicating which target to look for.
* @returns %TRUE if the target is available, %FALSE otherwise.
*/
wait_is_target_available(target: Gdk.Atom): boolean;
/**
* Test to see if there is text available to be pasted
* This is done by requesting the TARGETS atom and checking
* if it contains any of the supported text targets. This function
* waits for the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
*
* This function is a little faster than calling
* gtk_clipboard_wait_for_text() since it doesn't need to retrieve
* the actual text.
* @returns %TRUE is there is text available, %FALSE otherwise.
*/
wait_is_text_available(): boolean;
/**
* Test to see if there is a list of URIs available to be pasted
* This is done by requesting the TARGETS atom and checking
* if it contains the URI targets. This function
* waits for the data to be received using the main loop, so events,
* timeouts, etc, may be dispatched during the wait.
*
* This function is a little faster than calling
* gtk_clipboard_wait_for_uris() since it doesn't need to retrieve
* the actual URI data.
* @returns %TRUE is there is an URI list available, %FALSE otherwise.
*/
wait_is_uris_available(): boolean;
}
namespace ColorButton {
// Signal callback interfaces
interface ColorSet {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
alpha: number;
color: Gdk.Color;
title: string;
use_alpha: boolean;
useAlpha: boolean;
}
}
class ColorButton extends Button implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<ColorButton>;
// Properties
/**
* The selected opacity value (0 fully transparent, 65535 fully opaque).
*/
get alpha(): number;
set alpha(val: number);
/**
* The selected color.
*/
get color(): Gdk.Color;
set color(val: Gdk.Color);
/**
* The title of the color selection dialog
*/
get title(): string;
set title(val: string);
/**
* If this property is set to %TRUE, the color swatch on the button is rendered against a
* checkerboard background to show its opacity and the opacity slider is displayed in the
* color selection dialog.
*/
get use_alpha(): boolean;
set use_alpha(val: boolean);
/**
* If this property is set to %TRUE, the color swatch on the button is rendered against a
* checkerboard background to show its opacity and the opacity slider is displayed in the
* color selection dialog.
*/
get useAlpha(): boolean;
set useAlpha(val: boolean);
// Fields
button: Button;
// Constructors
constructor(properties?: Partial<ColorButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ColorButton;
static new_with_color(color: Gdk.Color): ColorButton;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'color-set', callback: (_source: this) => void): number;
connect_after(signal: 'color-set', callback: (_source: this) => void): number;
emit(signal: 'color-set'): void;
// Virtual methods
vfunc_color_set(): void;
// Methods
/**
* Returns the current alpha value.
* @returns an integer between 0 and 65535.
*/
get_alpha(): number;
/**
* Sets `color` to be the current color in the #GtkColorButton widget.
*/
get_color(): Gdk.Color;
/**
* Gets the title of the color selection dialog.
* @returns An internal string, do not free the return value
*/
get_title(): string;
/**
* Does the color selection dialog use the alpha channel?
* @returns %TRUE if the color sample uses alpha channel, %FALSE if not.
*/
get_use_alpha(): boolean;
/**
* Sets the current opacity to be `alpha`.
* @param alpha an integer between 0 and 65535.
*/
set_alpha(alpha: number): void;
/**
* Sets the current color to be `color`.
* @param color A #GdkColor to set the current color with.
*/
set_color(color: Gdk.Color): void;
/**
* Sets the title for the color selection dialog.
* @param title String containing new window title.
*/
set_title(title: string): void;
/**
* Sets whether or not the color button should use the alpha channel.
* @param use_alpha %TRUE if color button should use alpha channel, %FALSE if not.
*/
set_use_alpha(use_alpha: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ColorSelection {
// Signal callback interfaces
interface ColorChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends VBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
current_alpha: number;
currentAlpha: number;
current_color: Gdk.Color;
currentColor: Gdk.Color;
has_opacity_control: boolean;
hasOpacityControl: boolean;
has_palette: boolean;
hasPalette: boolean;
}
}
class ColorSelection extends VBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<ColorSelection>;
// Properties
get current_alpha(): number;
set current_alpha(val: number);
get currentAlpha(): number;
set currentAlpha(val: number);
get current_color(): Gdk.Color;
set current_color(val: Gdk.Color);
get currentColor(): Gdk.Color;
set currentColor(val: Gdk.Color);
get has_opacity_control(): boolean;
set has_opacity_control(val: boolean);
get hasOpacityControl(): boolean;
set hasOpacityControl(val: boolean);
get has_palette(): boolean;
set has_palette(val: boolean);
get hasPalette(): boolean;
set hasPalette(val: boolean);
// Fields
private_data: any;
// Constructors
constructor(properties?: Partial<ColorSelection.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ColorSelection;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'color-changed', callback: (_source: this) => void): number;
connect_after(signal: 'color-changed', callback: (_source: this) => void): number;
emit(signal: 'color-changed'): void;
// Static methods
/**
* Parses a color palette string; the string is a colon-separated
* list of color names readable by gdk_color_parse().
* @param str a string encoding a color palette.
*/
static palette_from_string(str: string): [boolean, Gdk.Color[]];
/**
* Encodes a palette as a string, useful for persistent storage.
* @param colors an array of colors.
*/
static palette_to_string(colors: Gdk.Color[]): string;
// Virtual methods
vfunc_color_changed(): void;
// Methods
/**
* Sets `color` to be the current color in the GtkColorSelection widget.
* @param color an array of 4 #gdouble to fill in with the current color.
*/
get_color(color: number): void;
/**
* Returns the current alpha value.
* @returns an integer between 0 and 65535.
*/
get_current_alpha(): number;
/**
* Sets `color` to be the current color in the GtkColorSelection widget.
*/
get_current_color(): Gdk.Color;
/**
* Determines whether the colorsel has an opacity control.
* @returns %TRUE if the @colorsel has an opacity control. %FALSE if it does't.
*/
get_has_opacity_control(): boolean;
/**
* Determines whether the color selector has a color palette.
* @returns %TRUE if the selector has a palette. %FALSE if it hasn't.
*/
get_has_palette(): boolean;
/**
* Returns the previous alpha value.
* @returns an integer between 0 and 65535.
*/
get_previous_alpha(): number;
/**
* Fills `color` in with the original color value.
*/
get_previous_color(): Gdk.Color;
/**
* Gets the current state of the `colorsel`.
* @returns %TRUE if the user is currently dragging a color around, and %FALSE if the selection has stopped.
*/
is_adjusting(): boolean;
/**
* Sets the current color to be `color`. The first time this is called, it will
* also set the original color to be `color` too.
* @param color an array of 4 doubles specifying the red, green, blue and opacity to set the current color to.
*/
set_color(color: number): void;
/**
* Sets the current opacity to be `alpha`. The first time this is called, it will
* also set the original opacity to be `alpha` too.
* @param alpha an integer between 0 and 65535.
*/
set_current_alpha(alpha: number): void;
/**
* Sets the current color to be `color`. The first time this is called, it will
* also set the original color to be `color` too.
* @param color A #GdkColor to set the current color with.
*/
set_current_color(color: Gdk.Color): void;
/**
* Sets the `colorsel` to use or not use opacity.
* @param has_opacity %TRUE if @colorsel can set the opacity, %FALSE otherwise.
*/
set_has_opacity_control(has_opacity: boolean): void;
/**
* Shows and hides the palette based upon the value of `has_palette`.
* @param has_palette %TRUE if palette is to be visible, %FALSE otherwise.
*/
set_has_palette(has_palette: boolean): void;
/**
* Sets the 'previous' alpha to be `alpha`. This function should be called with
* some hesitations, as it might seem confusing to have that alpha change.
* @param alpha an integer between 0 and 65535.
*/
set_previous_alpha(alpha: number): void;
/**
* Sets the 'previous' color to be `color`. This function should be called with
* some hesitations, as it might seem confusing to have that color change.
* Calling gtk_color_selection_set_current_color() will also set this color the first
* time it is called.
* @param color a #GdkColor to set the previous color with.
*/
set_previous_color(color: Gdk.Color): void;
set_update_policy(policy: UpdateType | 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 ColorSelectionDialog {
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
cancel_button: Widget;
cancelButton: Widget;
color_selection: Widget;
colorSelection: Widget;
help_button: Widget;
helpButton: Widget;
ok_button: Widget;
okButton: Widget;
}
}
class ColorSelectionDialog extends Dialog implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<ColorSelectionDialog>;
// Properties
get cancel_button(): Widget;
get cancelButton(): Widget;
get color_selection(): Widget;
get colorSelection(): Widget;
get help_button(): Widget;
get helpButton(): Widget;
get ok_button(): Widget;
get okButton(): Widget;
// Fields
colorsel: Widget;
// Constructors
constructor(properties?: Partial<ColorSelectionDialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title: string): ColorSelectionDialog;
// Conflicted with Gtk.Dialog.new
static ['new'](...args: never[]): any;
// Methods
/**
* Retrieves the #GtkColorSelection widget embedded in the dialog.
* @returns the embedded #GtkColorSelection
*/
get_color_selection(): Widget;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Combo {
// Constructor properties interface
interface ConstructorProps
extends HBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
allow_empty: boolean;
allowEmpty: boolean;
case_sensitive: boolean;
caseSensitive: boolean;
enable_arrow_keys: boolean;
enableArrowKeys: boolean;
enable_arrows_always: boolean;
enableArrowsAlways: boolean;
value_in_list: boolean;
valueInList: boolean;
}
}
class Combo extends HBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Combo>;
// Properties
get allow_empty(): boolean;
set allow_empty(val: boolean);
get allowEmpty(): boolean;
set allowEmpty(val: boolean);
get case_sensitive(): boolean;
set case_sensitive(val: boolean);
get caseSensitive(): boolean;
set caseSensitive(val: boolean);
get enable_arrow_keys(): boolean;
set enable_arrow_keys(val: boolean);
get enableArrowKeys(): boolean;
set enableArrowKeys(val: boolean);
get enable_arrows_always(): boolean;
set enable_arrows_always(val: boolean);
get enableArrowsAlways(): boolean;
set enableArrowsAlways(val: boolean);
get value_in_list(): boolean;
set value_in_list(val: boolean);
get valueInList(): boolean;
set valueInList(val: boolean);
// Fields
hbox: HBox;
entry: Widget;
list: Widget;
// Constructors
constructor(properties?: Partial<Combo.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Combo;
// Methods
disable_activate(): void;
set_case_sensitive(val: boolean): void;
set_item_string(item: Item, item_value: string): void;
set_use_arrows(val: boolean): void;
set_use_arrows_always(val: boolean): void;
set_value_in_list(val: boolean, ok_if_empty: 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 ComboBox {
// Signal callback interfaces
interface Changed {
(): void;
}
interface MoveActive {
(scroll_type: ScrollType): void;
}
interface Popdown {
(): boolean;
}
interface Popup {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
CellEditable.ConstructorProps,
CellLayout.ConstructorProps {
active: number;
add_tearoffs: boolean;
addTearoffs: boolean;
button_sensitivity: SensitivityType;
buttonSensitivity: SensitivityType;
column_span_column: number;
columnSpanColumn: number;
entry_text_column: number;
entryTextColumn: number;
focus_on_click: boolean;
focusOnClick: boolean;
has_entry: boolean;
hasEntry: boolean;
has_frame: boolean;
hasFrame: boolean;
model: TreeModel;
popup_shown: boolean;
popupShown: boolean;
row_span_column: number;
rowSpanColumn: number;
tearoff_title: string;
tearoffTitle: string;
wrap_width: number;
wrapWidth: number;
}
}
/**
* A GtkComboBox is a widget that allows the user to choose from a list of
* valid choices. The GtkComboBox displays the selected choice. When
* activated, the GtkComboBox displays a popup which allows the user to
* make a new choice. The style in which the selected value is displayed,
* and the style of the popup is determined by the current theme. It may
* be similar to a Windows-style combo box.
*
* The GtkComboBox uses the model-view pattern; the list of valid choices
* is specified in the form of a tree model, and the display of the choices
* can be adapted to the data in the model by using cell renderers, as you
* would in a tree view. This is possible since GtkComboBox implements the
* #GtkCellLayout interface. The tree model holding the valid choices is
* not restricted to a flat list, it can be a real tree, and the popup will
* reflect the tree structure.
*
* To allow the user to enter values not in the model, the 'has-entry'
* property allows the GtkComboBox to contain a #GtkEntry. This entry
* can be accessed by calling gtk_bin_get_child() on the combo box.
*
* For a simple list of textual choices, the model-view API of GtkComboBox
* can be a bit overwhelming. In this case, #GtkComboBoxText offers a
* simple alternative. Both GtkComboBox and #GtkComboBoxText can contain
* an entry.
*/
class ComboBox extends Bin implements Atk.ImplementorIface, Buildable, CellEditable, CellLayout {
static $gtype: GObject.GType<ComboBox>;
// Properties
/**
* The item which is currently active. If the model is a non-flat treemodel,
* and the active item is not an immediate child of the root of the tree,
* this property has the value
* <literal>gtk_tree_path_get_indices (path)[0]</literal>,
* where <literal>path</literal> is the #GtkTreePath of the active item.
*/
get active(): number;
set active(val: number);
/**
* The add-tearoffs property controls whether generated menus
* have tearoff menu items.
*
* Note that this only affects menu style combo boxes.
*/
get add_tearoffs(): boolean;
set add_tearoffs(val: boolean);
/**
* The add-tearoffs property controls whether generated menus
* have tearoff menu items.
*
* Note that this only affects menu style combo boxes.
*/
get addTearoffs(): boolean;
set addTearoffs(val: boolean);
/**
* Whether the dropdown button is sensitive when
* the model is empty.
*/
get button_sensitivity(): SensitivityType;
set button_sensitivity(val: SensitivityType);
/**
* Whether the dropdown button is sensitive when
* the model is empty.
*/
get buttonSensitivity(): SensitivityType;
set buttonSensitivity(val: SensitivityType);
/**
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many columns that item will span in the popup.
* Therefore, values in this column must be greater than zero, and the sum of
* an items column position + span should not exceed #GtkComboBox:wrap-width.
*/
get column_span_column(): number;
set column_span_column(val: number);
/**
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many columns that item will span in the popup.
* Therefore, values in this column must be greater than zero, and the sum of
* an items column position + span should not exceed #GtkComboBox:wrap-width.
*/
get columnSpanColumn(): number;
set columnSpanColumn(val: number);
/**
* The column in the combo box's model to associate with strings from the entry
* if the combo was created with #GtkComboBox:has-entry = %TRUE.
*/
get entry_text_column(): number;
set entry_text_column(val: number);
/**
* The column in the combo box's model to associate with strings from the entry
* if the combo was created with #GtkComboBox:has-entry = %TRUE.
*/
get entryTextColumn(): number;
set entryTextColumn(val: number);
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* Whether the combo box has an entry.
*/
get has_entry(): boolean;
/**
* Whether the combo box has an entry.
*/
get hasEntry(): boolean;
/**
* The has-frame property controls whether a frame
* is drawn around the entry.
*/
get has_frame(): boolean;
set has_frame(val: boolean);
/**
* The has-frame property controls whether a frame
* is drawn around the entry.
*/
get hasFrame(): boolean;
set hasFrame(val: boolean);
/**
* The model from which the combo box takes the values shown
* in the list.
*/
get model(): TreeModel;
set model(val: TreeModel);
/**
* Whether the combo boxes dropdown is popped up.
* Note that this property is mainly useful, because
* it allows you to connect to notify::popup-shown.
*/
get popup_shown(): boolean;
/**
* Whether the combo boxes dropdown is popped up.
* Note that this property is mainly useful, because
* it allows you to connect to notify::popup-shown.
*/
get popupShown(): boolean;
/**
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many rows that item will span in the popup. Therefore,
* values in this column must be greater than zero.
*/
get row_span_column(): number;
set row_span_column(val: number);
/**
* If this is set to a non-negative value, it must be the index of a column
* of type %G_TYPE_INT in the model. The value in that column for each item
* will determine how many rows that item will span in the popup. Therefore,
* values in this column must be greater than zero.
*/
get rowSpanColumn(): number;
set rowSpanColumn(val: number);
/**
* A title that may be displayed by the window manager
* when the popup is torn-off.
*/
get tearoff_title(): string;
set tearoff_title(val: string);
/**
* A title that may be displayed by the window manager
* when the popup is torn-off.
*/
get tearoffTitle(): string;
set tearoffTitle(val: string);
/**
* If wrap-width is set to a positive value, items in the popup will be laid
* out along multiple columns, starting a new row on reaching the wrap width.
*/
get wrap_width(): number;
set wrap_width(val: number);
/**
* If wrap-width is set to a positive value, items in the popup will be laid
* out along multiple columns, starting a new row on reaching the wrap width.
*/
get wrapWidth(): number;
set wrapWidth(val: number);
// Constructors
constructor(properties?: Partial<ComboBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ComboBox;
static new_text(): ComboBox;
static new_with_entry(): ComboBox;
static new_with_model(model: TreeModel): ComboBox;
static new_with_model_and_entry(model: TreeModel): ComboBox;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'move-active', callback: (_source: this, scroll_type: ScrollType) => void): number;
connect_after(signal: 'move-active', callback: (_source: this, scroll_type: ScrollType) => void): number;
emit(signal: 'move-active', scroll_type: ScrollType): void;
connect(signal: 'popdown', callback: (_source: this) => boolean): number;
connect_after(signal: 'popdown', callback: (_source: this) => boolean): number;
emit(signal: 'popdown'): void;
connect(signal: 'popup', callback: (_source: this) => void): number;
connect_after(signal: 'popup', callback: (_source: this) => void): number;
emit(signal: 'popup'): void;
// Virtual methods
vfunc_changed(): void;
/**
* Returns the currently active string in `combo_box` or %NULL if none
* is selected. Note that you can only use this function with combo
* boxes constructed with gtk_combo_box_new_text() and with
* #GtkComboBoxEntry<!-- -->s.
*/
vfunc_get_active_text(): string;
// Methods
/**
* Appends `string` to the list of strings stored in `combo_box`. Note that
* you can only use this function with combo boxes constructed with
* gtk_combo_box_new_text().
* @param text A string
*/
append_text(text: string): void;
/**
* Returns the index of the currently active item, or -1 if there's no
* active item. If the model is a non-flat treemodel, and the active item
* is not an immediate child of the root of the tree, this function returns
* <literal>gtk_tree_path_get_indices (path)[0]</literal>, where
* <literal>path</literal> is the #GtkTreePath of the active item.
* @returns An integer which is the index of the currently active item, or -1 if there's no active item.
*/
get_active(): number;
/**
* Sets `iter` to point to the currently active item, if any item is active.
* Otherwise, `iter` is left unchanged.
* @returns %TRUE if @iter was set, %FALSE otherwise
*/
get_active_iter(): [boolean, TreeIter];
/**
* Returns the currently active string in `combo_box` or %NULL if none
* is selected. Note that you can only use this function with combo
* boxes constructed with gtk_combo_box_new_text() and with
* #GtkComboBoxEntry<!-- -->s.
* @returns a newly allocated string containing the currently active text. Must be freed with g_free().
*/
get_active_text(): string;
/**
* Gets the current value of the :add-tearoffs property.
* @returns the current value of the :add-tearoffs property.
*/
get_add_tearoffs(): boolean;
/**
* Returns whether the combo box sets the dropdown button
* sensitive or not when there are no items in the model.
* @returns %GTK_SENSITIVITY_ON if the dropdown button is sensitive when the model is empty, %GTK_SENSITIVITY_OFF if the button is always insensitive or %GTK_SENSITIVITY_AUTO if it is only sensitive as long as the model has one item to be selected.
*/
get_button_sensitivity(): SensitivityType;
/**
* Returns the column with column span information for `combo_box`.
* @returns the column span column.
*/
get_column_span_column(): number;
/**
* Returns the column which `combo_box` is using to get the strings
* from to display in the internal entry.
* @returns A column in the data source model of @combo_box.
*/
get_entry_text_column(): number;
/**
* Returns whether the combo box grabs focus when it is clicked
* with the mouse. See gtk_combo_box_set_focus_on_click().
* @returns %TRUE if the combo box grabs focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Returns whether the combo box has an entry.
* @returns whether there is an entry in @combo_box.
*/
get_has_entry(): boolean;
/**
* Returns the #GtkTreeModel which is acting as data source for `combo_box`.
* @returns A #GtkTreeModel which was passed during construction.
*/
get_model(): TreeModel;
/**
* Gets the accessible object corresponding to the combo box's popup.
*
* This function is mostly intended for use by accessibility technologies;
* applications should have little use for it.
* @returns the accessible object corresponding to the combo box's popup.
*/
get_popup_accessible(): Atk.Object;
/**
* Returns the column with row span information for `combo_box`.
* @returns the row span column.
*/
get_row_span_column(): number;
/**
* Gets the current title of the menu in tearoff mode. See
* gtk_combo_box_set_add_tearoffs().
* @returns the menu's title in tearoff mode. This is an internal copy of the string which must not be freed.
*/
get_title(): string;
/**
* Returns the wrap width which is used to determine the number of columns
* for the popup menu. If the wrap width is larger than 1, the combo box
* is in table mode.
* @returns the wrap width.
*/
get_wrap_width(): number;
/**
* Inserts `string` at `position` in the list of strings stored in `combo_box`.
* Note that you can only use this function with combo boxes constructed
* with gtk_combo_box_new_text().
* @param position An index to insert @text
* @param text A string
*/
insert_text(position: number, text: string): void;
/**
* Hides the menu or dropdown list of `combo_box`.
*
* This function is mostly intended for use by accessibility technologies;
* applications should have little use for it.
*/
popdown(): void;
/**
* Pops up the menu or dropdown list of `combo_box`.
*
* This function is mostly intended for use by accessibility technologies;
* applications should have little use for it.
*/
popup(): void;
/**
* Prepends `string` to the list of strings stored in `combo_box`. Note that
* you can only use this function with combo boxes constructed with
* gtk_combo_box_new_text().
* @param text A string
*/
prepend_text(text: string): void;
/**
* Removes the string at `position` from `combo_box`. Note that you can only use
* this function with combo boxes constructed with gtk_combo_box_new_text().
* @param position Index of the item to remove
*/
remove_text(position: number): void;
/**
* Sets the active item of `combo_box` to be the item at `index`.
* @param index_ An index in the model passed during construction, or -1 to have no active item
*/
set_active(index_: number): void;
/**
* Sets the current active item to be the one referenced by `iter,` or
* unsets the active item if `iter` is %NULL.
* @param iter The #GtkTreeIter, or %NULL
*/
set_active_iter(iter?: TreeIter | null): void;
/**
* Sets whether the popup menu should have a tearoff
* menu item.
* @param add_tearoffs %TRUE to add tearoff menu items
*/
set_add_tearoffs(add_tearoffs: boolean): void;
/**
* Sets whether the dropdown button of the combo box should be
* always sensitive (%GTK_SENSITIVITY_ON), never sensitive (%GTK_SENSITIVITY_OFF)
* or only if there is at least one item to display (%GTK_SENSITIVITY_AUTO).
* @param sensitivity specify the sensitivity of the dropdown button
*/
set_button_sensitivity(sensitivity: SensitivityType | null): void;
/**
* Sets the column with column span information for `combo_box` to be
* `column_span`. The column span column contains integers which indicate
* how many columns an item should span.
* @param column_span A column in the model passed during construction
*/
set_column_span_column(column_span: number): void;
/**
* Sets the model column which `combo_box` should use to get strings from
* to be `text_column`. The column `text_column` in the model of `combo_box`
* must be of type %G_TYPE_STRING.
*
* This is only relevant if `combo_box` has been created with
* #GtkComboBox:has-entry as %TRUE.
* @param text_column A column in @model to get the strings from for the internal entry
*/
set_entry_text_column(text_column: number): void;
/**
* Sets whether the combo box will 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 combo box grabs focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Sets the model used by `combo_box` to be `model`. Will unset a previously set
* model (if applicable). If model is %NULL, then it will unset the model.
*
* Note that this function does not clear the cell renderers, you have to
* call gtk_cell_layout_clear() yourself if you need to set up different
* cell renderers for the new model.
* @param model A #GtkTreeModel
*/
set_model(model?: TreeModel | null): void;
/**
* Sets the row separator function, which is used to determine
* whether a row should be drawn as a separator. If the row separator
* function is %NULL, no separators are drawn. This is the default value.
* @param func a #GtkTreeViewRowSeparatorFunc
* @param destroy destroy notifier for @data, or %NULL
*/
set_row_separator_func(func: TreeViewRowSeparatorFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the column with row span information for `combo_box` to be `row_span`.
* The row span column contains integers which indicate how many rows
* an item should span.
* @param row_span A column in the model passed during construction.
*/
set_row_span_column(row_span: number): void;
/**
* Sets the menu's title in tearoff mode.
* @param title a title for the menu in tearoff mode
*/
set_title(title: string): void;
/**
* Sets the wrap width of `combo_box` to be `width`. The wrap width is basically
* the preferred number of columns when you want the popup to be layed out
* in a table.
* @param width Preferred number of columns
*/
set_wrap_width(width: number): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace ComboBoxEntry {
// Constructor properties interface
interface ConstructorProps
extends ComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
CellEditable.ConstructorProps,
CellLayout.ConstructorProps {
text_column: number;
textColumn: number;
}
}
class ComboBoxEntry extends ComboBox implements Atk.ImplementorIface, Buildable, CellEditable, CellLayout {
static $gtype: GObject.GType<ComboBoxEntry>;
// Properties
get text_column(): number;
set text_column(val: number);
get textColumn(): number;
set textColumn(val: number);
// Constructors
constructor(properties?: Partial<ComboBoxEntry.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ComboBoxEntry;
static new_text(): ComboBoxEntry;
static new_with_model(model: TreeModel, text_column: number): ComboBoxEntry;
// Conflicted with Gtk.ComboBox.new_with_model
static new_with_model(...args: never[]): any;
// Methods
/**
* Returns the column which `entry_box` is using to get the strings from.
* @returns A column in the data source model of @entry_box.
*/
get_text_column(): number;
/**
* Sets the model column which `entry_box` should use to get strings from
* to be `text_column`.
* @param text_column A column in @model to get the strings from.
*/
set_text_column(text_column: number): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace ComboBoxText {
// Constructor properties interface
interface ConstructorProps
extends ComboBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
CellEditable.ConstructorProps,
CellLayout.ConstructorProps {}
}
/**
* A GtkComboBoxText is a simple variant of #GtkComboBox that hides
* the model-view complexity for simple text-only use cases.
*
* To create a GtkComboBoxText, use gtk_combo_box_text_new() or
* gtk_combo_box_text_new_with_entry().
*
* You can add items to a GtkComboBoxText with
* gtk_combo_box_text_append_text(), gtk_combo_box_text_insert_text()
* or gtk_combo_box_text_prepend_text() and remove options with
* gtk_combo_box_text_remove().
*
* If the GtkComboBoxText contains an entry (via the 'has-entry' property),
* its contents can be retrieved using gtk_combo_box_text_get_active_text().
* The entry itself can be accessed by calling gtk_bin_get_child() on the
* combo box.
*
* <refsect2 id="GtkComboBoxText-BUILDER-UI">
* <title>GtkComboBoxText as GtkBuildable</title>
* <para>
* The GtkComboBoxText implementation of the GtkBuildable interface
* supports adding items directly using the &lt;items&gt element
* and specifying &lt;item&gt; elements for each item. Each &lt;item&gt;
* element supports the regular translation attributes "translatable",
* "context" and "comments".
* </para>
* <example>
* <title>A UI definition fragment specifying GtkComboBoxText items</title>
* <programlisting><![CDATA[
* <object class="GtkComboBoxText">
* <items>
* <item translatable="yes">Factory</item>
* <item translatable="yes">Home</item>
* <item translatable="yes">Subway</item>
* </items>
* </object>
* ]]></programlisting>
* </example>
* </refsect2>
*/
class ComboBoxText extends ComboBox implements Atk.ImplementorIface, Buildable, CellEditable, CellLayout {
static $gtype: GObject.GType<ComboBoxText>;
// Constructors
constructor(properties?: Partial<ComboBoxText.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ComboBoxText;
static new_with_entry(): ComboBoxText;
// Methods
/**
* Appends `string` to the list of strings stored in `combo_box`.
* @param text A string
*/
append_text(text: string): void;
/**
* Returns the currently active string in `combo_box,` or %NULL
* if none is selected. If `combo_box` contains an entry, this
* function will return its contents (which will not necessarily
* be an item from the list).
* @returns a newly allocated string containing the currently active text. Must be freed with g_free().
*/
get_active_text(): string;
/**
* Inserts `string` at `position` in the list of strings stored in `combo_box`.
* @param position An index to insert @text
* @param text A string
*/
insert_text(position: number, text: string): void;
/**
* Prepends `string` to the list of strings stored in `combo_box`.
* @param text A string
*/
prepend_text(text: string): void;
/**
* Removes the string at `position` from `combo_box`.
* @param position Index of the item to remove
*/
remove(position: number): void;
// Conflicted with Gtk.Container.remove
remove(...args: never[]): any;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
get visible(): boolean;
set visible(val: boolean);
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace Container {
// Signal callback interfaces
interface Add {
(object: Widget): void;
}
interface CheckResize {
(): void;
}
interface Remove {
(object: Widget): void;
}
interface SetFocusChild {
(object: Widget): void;
}
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
border_width: number;
borderWidth: number;
child: Widget;
resize_mode: ResizeMode;
resizeMode: ResizeMode;
}
}
abstract class Container extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Container>;
// Properties
get border_width(): number;
set border_width(val: number);
get borderWidth(): number;
set borderWidth(val: number);
set child(val: Widget);
get resize_mode(): ResizeMode;
set resize_mode(val: ResizeMode);
get resizeMode(): ResizeMode;
set resizeMode(val: ResizeMode);
// Fields
widget: Widget;
focus_child: Widget;
// Constructors
constructor(properties?: Partial<Container.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'add', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'add', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'add', object: Widget): void;
connect(signal: 'check-resize', callback: (_source: this) => void): number;
connect_after(signal: 'check-resize', callback: (_source: this) => void): number;
emit(signal: 'check-resize'): void;
connect(signal: 'remove', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'remove', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'remove', object: Widget): void;
connect(signal: 'set-focus-child', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'set-focus-child', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'set-focus-child', object: Widget): void;
// Static methods
static find_child_property(property_name: string): GObject.ParamSpec;
static install_child_property(property_id: number, pspec: GObject.ParamSpec): void;
static list_child_properties(): GObject.ParamSpec[];
// Virtual methods
/**
* Adds `widget` to `container`. Typically used for simple containers
* such as #GtkWindow, #GtkFrame, or #GtkButton; for more complicated
* layout containers such as #GtkBox or #GtkTable, this function will
* pick default packing parameters that may not be correct. So
* consider functions such as gtk_box_pack_start() and
* gtk_table_attach() as an alternative to gtk_container_add() in
* those cases. A widget may be added to only one container at a time;
* you can't place the same widget inside two different containers.
* @param widget a widget to be placed inside @container
*/
vfunc_add(widget: Widget): void;
vfunc_check_resize(): void;
/**
* Returns the type of the children supported by the container.
*
* Note that this may return %G_TYPE_NONE to indicate that no more
* children can be added, e.g. for a #GtkPaned which already has two
* children.
*/
vfunc_child_type(): GObject.GType;
vfunc_composite_name(child: Widget): string;
vfunc_get_child_property(
child: Widget,
property_id: number,
value: GObject.Value | any,
pspec: GObject.ParamSpec,
): void;
/**
* Removes `widget` from `container`. `widget` must be inside `container`.
* Note that `container` will own a reference to `widget,` and that this
* may be the last reference held; so removing a widget from its
* container can destroy that widget. If you want to use `widget`
* again, you need to add a reference to it while it's not inside
* a container, using g_object_ref(). If you don't want to use `widget`
* again it's usually more efficient to simply destroy it directly
* using gtk_widget_destroy() since this will remove it from the
* container and help break any circular reference count cycles.
* @param widget a current child of @container
*/
vfunc_remove(widget: Widget): void;
vfunc_set_child_property(
child: Widget,
property_id: number,
value: GObject.Value | any,
pspec: GObject.ParamSpec,
): void;
/**
* Sets, or unsets if `child` is %NULL, the focused child of `container`.
*
* This function emits the GtkContainer::set_focus_child signal of
* `container`. Implementations of #GtkContainer can override the
* default behaviour by overriding the class closure of this signal.
*
* This is function is mostly meant to be used by widgets. Applications can use
* gtk_widget_grab_focus() to manualy set the focus to a specific widget.
* @param widget
*/
vfunc_set_focus_child(widget: Widget): void;
// Methods
/**
* Adds `widget` to `container`. Typically used for simple containers
* such as #GtkWindow, #GtkFrame, or #GtkButton; for more complicated
* layout containers such as #GtkBox or #GtkTable, this function will
* pick default packing parameters that may not be correct. So
* consider functions such as gtk_box_pack_start() and
* gtk_table_attach() as an alternative to gtk_container_add() in
* those cases. A widget may be added to only one container at a time;
* you can't place the same widget inside two different containers.
* @param widget a widget to be placed inside @container
*/
add(widget: Widget): void;
check_resize(): void;
/**
* Gets the value of a child property for `child` and `container`.
* @param child a widget which is a child of @container
* @param property_name the name of the property to get
* @param value a location to return the value
*/
child_get_property(child: Widget, property_name: string, value: GObject.Value | any): void;
/**
* Sets a child property for `child` and `container`.
* @param child a widget which is a child of @container
* @param property_name the name of the property to set
* @param value the value to set the property to
*/
child_set_property(child: Widget, property_name: string, value: GObject.Value | any): void;
/**
* Returns the type of the children supported by the container.
*
* Note that this may return %G_TYPE_NONE to indicate that no more
* children can be added, e.g. for a #GtkPaned which already has two
* children.
* @returns a #GType.
*/
child_type(): GObject.GType;
/**
* Invokes `callback` on each non-internal child of `container`. See
* gtk_container_forall() for details on what constitutes an
* "internal" child. Most applications should use
* gtk_container_foreach(), rather than gtk_container_forall().
* @param callback a callback
*/
foreach(callback: Callback): void;
/**
* Retrieves the border width of the container. See
* gtk_container_set_border_width().
* @returns the current border width
*/
get_border_width(): number;
/**
* Returns the container's non-internal children. See
* gtk_container_forall() for details on what constitutes an "internal" child.
* @returns a newly-allocated list of the container's non-internal children.
*/
get_children(): Widget[];
/**
* Retrieves the focus chain of the container, if one has been
* set explicitly. If no focus chain has been explicitly
* set, GTK+ computes the focus chain based on the positions
* of the children. In that case, GTK+ stores %NULL in
* `focusable_widgets` and returns %FALSE.
* @returns %TRUE if the focus chain of the container has been set explicitly.
*/
get_focus_chain(): [boolean, Widget[]];
/**
* Returns the current focus child widget inside `container`. This is not the
* currently focused widget. That can be obtained by calling
* gtk_window_get_focus().
* @returns The child widget which will receive the focus inside @container when the @conatiner is focussed, or %NULL if none is set.
*/
get_focus_child(): Widget;
/**
* Retrieves the horizontal focus adjustment for the container. See
* gtk_container_set_focus_hadjustment ().
* @returns the horizontal focus adjustment, or %NULL if none has been set.
*/
get_focus_hadjustment(): Adjustment;
/**
* Retrieves the vertical focus adjustment for the container. See
* gtk_container_set_focus_vadjustment().
* @returns the vertical focus adjustment, or %NULL if none has been set.
*/
get_focus_vadjustment(): Adjustment;
/**
* Returns the resize mode for the container. See
* gtk_container_set_resize_mode ().
* @returns the current resize mode
*/
get_resize_mode(): ResizeMode;
/**
* When a container receives an expose event, it must send synthetic
* expose events to all children that don't have their own #GdkWindows.
* This function provides a convenient way of doing this. A container,
* when it receives an expose event, calls gtk_container_propagate_expose()
* once for each child, passing in the event the container received.
*
* gtk_container_propagate_expose() takes care of deciding whether
* an expose event needs to be sent to the child, intersecting
* the event's area with the child area, and sending the event.
*
* In most cases, a container can simply either simply inherit the
* #GtkWidget::expose implementation from #GtkContainer, or, do some drawing
* and then chain to the ::expose implementation from #GtkContainer.
*
* Note that the ::expose-event signal has been replaced by a ::draw
* signal in GTK+ 3, and consequently, gtk_container_propagate_expose()
* has been replaced by gtk_container_propagate_draw().
* The <link linkend="http://library.gnome.org/devel/gtk3/3.0/gtk-migrating-2-to-3.html">GTK+ 3 migration guide</link>
* for hints on how to port from ::expose-event to ::draw.
* @param child a child of @container
* @param event a expose event sent to container
*/
propagate_expose(child: Widget, event: Gdk.EventExpose): void;
/**
* Removes `widget` from `container`. `widget` must be inside `container`.
* Note that `container` will own a reference to `widget,` and that this
* may be the last reference held; so removing a widget from its
* container can destroy that widget. If you want to use `widget`
* again, you need to add a reference to it while it's not inside
* a container, using g_object_ref(). If you don't want to use `widget`
* again it's usually more efficient to simply destroy it directly
* using gtk_widget_destroy() since this will remove it from the
* container and help break any circular reference count cycles.
* @param widget a current child of @container
*/
remove(widget: Widget): void;
resize_children(): void;
/**
* Sets the border width of the container.
*
* The border width of a container is the amount of space to leave
* around the outside of the container. The only exception to this is
* #GtkWindow; because toplevel windows can't leave space outside,
* they leave the space inside. The border is added on all sides of
* the container. To add space to only one side, one approach is to
* create a #GtkAlignment widget, call gtk_widget_set_size_request()
* to give it a size, and place it on the side of the container as
* a spacer.
* @param border_width amount of blank space to leave <emphasis>outside</emphasis> the container. Valid values are in the range 0-65535 pixels.
*/
set_border_width(border_width: number): void;
/**
* Sets a focus chain, overriding the one computed automatically by GTK+.
*
* In principle each widget in the chain should be a descendant of the
* container, but this is not enforced by this method, since it's allowed
* to set the focus chain before you pack the widgets, or have a widget
* in the chain that isn't always packed. The necessary checks are done
* when the focus chain is actually traversed.
* @param focusable_widgets the new focus chain
*/
set_focus_chain(focusable_widgets: Widget[]): void;
/**
* Sets, or unsets if `child` is %NULL, the focused child of `container`.
*
* This function emits the GtkContainer::set_focus_child signal of
* `container`. Implementations of #GtkContainer can override the
* default behaviour by overriding the class closure of this signal.
*
* This is function is mostly meant to be used by widgets. Applications can use
* gtk_widget_grab_focus() to manualy set the focus to a specific widget.
* @param child a #GtkWidget, or %NULL
*/
set_focus_child(child?: Widget | null): void;
/**
* Hooks up an adjustment to focus handling in a container, so when a child
* of the container is focused, the adjustment is scrolled to show that
* widget. This function sets the horizontal alignment.
* See gtk_scrolled_window_get_hadjustment() for a typical way of obtaining
* the adjustment and gtk_container_set_focus_vadjustment() for setting
* the vertical adjustment.
*
* The adjustments have to be in pixel units and in the same coordinate
* system as the allocation for immediate children of the container.
* @param adjustment an adjustment which should be adjusted when the focus is moved among the descendents of @container
*/
set_focus_hadjustment(adjustment: Adjustment): void;
/**
* Hooks up an adjustment to focus handling in a container, so when a
* child of the container is focused, the adjustment is scrolled to
* show that widget. This function sets the vertical alignment. See
* gtk_scrolled_window_get_vadjustment() for a typical way of obtaining
* the adjustment and gtk_container_set_focus_hadjustment() for setting
* the horizontal adjustment.
*
* The adjustments have to be in pixel units and in the same coordinate
* system as the allocation for immediate children of the container.
* @param adjustment an adjustment which should be adjusted when the focus is moved among the descendents of @container
*/
set_focus_vadjustment(adjustment: Adjustment): void;
/**
* Sets the `reallocate_redraws` flag of the container to the given value.
*
* Containers requesting reallocation redraws get automatically
* redrawn if any of their children changed allocation.
* @param needs_redraws the new value for the container's @reallocate_redraws flag
*/
set_reallocate_redraws(needs_redraws: boolean): void;
/**
* Sets the resize mode for the container.
*
* The resize mode of a container determines whether a resize request
* will be passed to the container's parent, queued for later execution
* or executed immediately.
* @param resize_mode the new resize mode
*/
set_resize_mode(resize_mode: ResizeMode | null): void;
/**
* Removes a focus chain explicitly set with gtk_container_set_focus_chain().
*/
unset_focus_chain(): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Curve {
// Signal callback interfaces
interface CurveTypeChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
curve_type: CurveType;
curveType: CurveType;
max_x: number;
maxX: number;
max_y: number;
maxY: number;
min_x: number;
minX: number;
min_y: number;
minY: number;
}
}
class Curve extends DrawingArea implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Curve>;
// Properties
get curve_type(): CurveType;
set curve_type(val: CurveType);
get curveType(): CurveType;
set curveType(val: CurveType);
get max_x(): number;
set max_x(val: number);
get maxX(): number;
set maxX(val: number);
get max_y(): number;
set max_y(val: number);
get maxY(): number;
set maxY(val: number);
get min_x(): number;
set min_x(val: number);
get minX(): number;
set minX(val: number);
get min_y(): number;
set min_y(val: number);
get minY(): number;
set minY(val: number);
// Fields
graph: DrawingArea;
cursor_type: number;
pixmap: Gdk.Pixmap;
height: number;
grab_point: number;
last: number;
num_points: number;
point: Gdk.Point;
num_ctlpoints: number;
ctlpoint: number;
// Constructors
constructor(properties?: Partial<Curve.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Curve;
// 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: 'curve-type-changed', callback: (_source: this) => void): number;
connect_after(signal: 'curve-type-changed', callback: (_source: this) => void): number;
emit(signal: 'curve-type-changed'): void;
// Virtual methods
vfunc_curve_type_changed(): void;
// Methods
get_vector(veclen: number, vector: number): void;
reset(): void;
set_curve_type(type: CurveType | null): void;
set_gamma(gamma_: number): void;
set_range(min_x: number, max_x: number, min_y: number, max_y: number): void;
set_vector(veclen: number, vector: 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 Dialog {
// Signal callback interfaces
interface Close {
(): void;
}
interface Response {
(response_id: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Window.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
has_separator: boolean;
hasSeparator: boolean;
}
}
class Dialog extends Window implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Dialog>;
// Properties
/**
* When %TRUE, the dialog has a separator bar above its buttons.
*/
get has_separator(): boolean;
set has_separator(val: boolean);
/**
* When %TRUE, the dialog has a separator bar above its buttons.
*/
get hasSeparator(): boolean;
set hasSeparator(val: boolean);
// Fields
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
window: Window;
vbox: Widget;
action_area: Widget;
// Constructors
constructor(properties?: Partial<Dialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Dialog;
// 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', callback: (_source: this) => void): number;
connect_after(signal: 'close', callback: (_source: this) => void): number;
emit(signal: 'close'): void;
connect(signal: 'response', callback: (_source: this, response_id: number) => void): number;
connect_after(signal: 'response', callback: (_source: this, response_id: number) => void): number;
emit(signal: 'response', response_id: number): void;
// Virtual methods
vfunc_close(): void;
/**
* Emits the #GtkDialog::response signal with the given response ID.
* Used to indicate that the user has responded to the dialog in some way;
* typically either you or gtk_dialog_run() will be monitoring the
* ::response signal and take appropriate action.
* @param response_id response ID
*/
vfunc_response(response_id: number): void;
// Methods
/**
* Adds an activatable widget to the action area of a #GtkDialog,
* connecting a signal handler that will emit the #GtkDialog::response
* signal on the dialog when the widget is activated. The widget is
* appended to the end of the dialog's action area. If you want to add a
* non-activatable widget, simply pack it into the `action_area` field
* of the #GtkDialog struct.
* @param child an activatable widget
* @param response_id response ID for @child
*/
add_action_widget(child: Widget, response_id: number): void;
/**
* Adds a button with the given text (or a stock button, if `button_text` is a
* stock ID) and sets things up so that clicking the button will emit the
* #GtkDialog::response signal with the given `response_id`. The button is
* appended to the end of the dialog's action area. The button widget is
* returned, but usually you don't need it.
* @param button_text text of button, or stock ID
* @param response_id response ID for the button
* @returns the button widget that was added
*/
add_button(button_text: string, response_id: number): Widget;
/**
* Returns the action area of `dialog`.
* @returns the action area.
*/
get_action_area(): Widget;
/**
* Returns the content area of `dialog`.
* @returns the content area #GtkVBox.
*/
get_content_area(): Widget;
/**
* Accessor for whether the dialog has a separator.
* @returns %TRUE if the dialog has a separator
*/
get_has_separator(): boolean;
/**
* Gets the response id of a widget in the action area
* of a dialog.
* @param widget a widget in the action area of @dialog
* @returns the response id of @widget, or %GTK_RESPONSE_NONE if @widget doesn't have a response id set.
*/
get_response_for_widget(widget: Widget): number;
/**
* Gets the widget button that uses the given response ID in the action area
* of a dialog.
* @param response_id the response ID used by the @dialog widget
* @returns the @widget button that uses the given @response_id, or %NULL.
*/
get_widget_for_response(response_id: number): Widget;
/**
* Emits the #GtkDialog::response signal with the given response ID.
* Used to indicate that the user has responded to the dialog in some way;
* typically either you or gtk_dialog_run() will be monitoring the
* ::response signal and take appropriate action.
* @param response_id response ID
*/
response(response_id: number): void;
/**
* Blocks in a recursive main loop until the `dialog` either emits the
* #GtkDialog::response signal, or is destroyed. If the dialog is
* destroyed during the call to gtk_dialog_run(), gtk_dialog_run() returns
* #GTK_RESPONSE_NONE. Otherwise, it returns the response ID from the
* ::response signal emission.
*
* Before entering the recursive main loop, gtk_dialog_run() calls
* gtk_widget_show() on the dialog for you. Note that you still
* need to show any children of the dialog yourself.
*
* During gtk_dialog_run(), the default behavior of #GtkWidget::delete-event
* is disabled; if the dialog receives ::delete_event, it will not be
* destroyed as windows usually are, and gtk_dialog_run() will return
* #GTK_RESPONSE_DELETE_EVENT. Also, during gtk_dialog_run() the dialog
* will be modal. You can force gtk_dialog_run() to return at any time by
* calling gtk_dialog_response() to emit the ::response signal. Destroying
* the dialog during gtk_dialog_run() is a very bad idea, because your
* post-run code won't know whether the dialog was destroyed or not.
*
* After gtk_dialog_run() returns, you are responsible for hiding or
* destroying the dialog if you wish to do so.
*
* Typical usage of this function might be:
*
* ```
* gint result = gtk_dialog_run (GTK_DIALOG (dialog));
* switch (result)
* {
* case GTK_RESPONSE_ACCEPT:
* do_application_specific_something ();
* break;
* default:
* do_nothing_since_dialog_was_cancelled ();
* break;
* }
* gtk_widget_destroy (dialog);
* ```
*
*
* Note that even though the recursive main loop gives the effect of a
* modal dialog (it prevents the user from interacting with other
* windows in the same window group while the dialog is run), callbacks
* such as timeouts, IO channel watches, DND drops, etc, <emphasis>will</emphasis>
* be triggered during a gtk_dialog_run() call.
* @returns response ID
*/
run(): number;
/**
* Sets an alternative button order. If the
* #GtkSettings:gtk-alternative-button-order setting is set to %TRUE,
* the dialog buttons are reordered according to the order of the
* response ids in `new_order`.
*
* See gtk_dialog_set_alternative_button_order() for more information.
*
* This function is for use by language bindings.
* @param new_order an array of response ids of @dialog's buttons
*/
set_alternative_button_order_from_array(new_order: number[]): void;
/**
* Sets the last widget in the dialog's action area with the given `response_id`
* as the default widget for the dialog. Pressing "Enter" normally activates
* the default widget.
* @param response_id a response ID
*/
set_default_response(response_id: number): void;
/**
* Sets whether the dialog has a separator above the buttons.
* @param setting %TRUE to have a separator
*/
set_has_separator(setting: boolean): void;
/**
* Calls <literal>gtk_widget_set_sensitive (widget, `setting)`</literal>
* for each widget in the dialog's action area with the given `response_id`.
* A convenient way to sensitize/desensitize dialog buttons.
* @param response_id a response ID
* @param setting %TRUE for sensitive
*/
set_response_sensitive(response_id: number, setting: 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 DrawingArea {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
class DrawingArea extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<DrawingArea>;
// Fields
widget: Widget;
draw_data: any;
// Constructors
constructor(properties?: Partial<DrawingArea.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): DrawingArea;
// Methods
size(width: number, height: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Entry {
// Signal callback interfaces
interface Activate {
(): void;
}
interface Backspace {
(): void;
}
interface CopyClipboard {
(): void;
}
interface CutClipboard {
(): void;
}
interface DeleteFromCursor {
(type: DeleteType, count: number): void;
}
interface IconPress {
(icon_pos: EntryIconPosition, event: Gdk.Event): void;
}
interface IconRelease {
(icon_pos: EntryIconPosition, event: Gdk.Event): void;
}
interface InsertAtCursor {
(string: string): void;
}
interface MoveCursor {
(step: MovementStep, count: number, extend_selection: boolean): void;
}
interface PasteClipboard {
(): void;
}
interface PopulatePopup {
(menu: Menu): void;
}
interface PreeditChanged {
(preedit: string): void;
}
interface ToggleOverwrite {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
CellEditable.ConstructorProps,
Editable.ConstructorProps {
activates_default: boolean;
activatesDefault: boolean;
buffer: EntryBuffer;
caps_lock_warning: boolean;
capsLockWarning: boolean;
cursor_position: number;
cursorPosition: number;
editable: boolean;
has_frame: boolean;
hasFrame: boolean;
im_module: string;
imModule: string;
inner_border: Border;
innerBorder: Border;
invisible_char: number;
invisibleChar: number;
invisible_char_set: boolean;
invisibleCharSet: boolean;
max_length: number;
maxLength: number;
overwrite_mode: boolean;
overwriteMode: boolean;
primary_icon_activatable: boolean;
primaryIconActivatable: boolean;
primary_icon_gicon: Gio.Icon;
primaryIconGicon: Gio.Icon;
primary_icon_name: string;
primaryIconName: string;
primary_icon_pixbuf: GdkPixbuf.Pixbuf;
primaryIconPixbuf: GdkPixbuf.Pixbuf;
primary_icon_sensitive: boolean;
primaryIconSensitive: boolean;
primary_icon_stock: string;
primaryIconStock: string;
primary_icon_storage_type: ImageType;
primaryIconStorageType: ImageType;
primary_icon_tooltip_markup: string;
primaryIconTooltipMarkup: string;
primary_icon_tooltip_text: string;
primaryIconTooltipText: string;
progress_fraction: number;
progressFraction: number;
progress_pulse_step: number;
progressPulseStep: number;
scroll_offset: number;
scrollOffset: number;
secondary_icon_activatable: boolean;
secondaryIconActivatable: boolean;
secondary_icon_gicon: Gio.Icon;
secondaryIconGicon: Gio.Icon;
secondary_icon_name: string;
secondaryIconName: string;
secondary_icon_pixbuf: GdkPixbuf.Pixbuf;
secondaryIconPixbuf: GdkPixbuf.Pixbuf;
secondary_icon_sensitive: boolean;
secondaryIconSensitive: boolean;
secondary_icon_stock: string;
secondaryIconStock: string;
secondary_icon_storage_type: ImageType;
secondaryIconStorageType: ImageType;
secondary_icon_tooltip_markup: string;
secondaryIconTooltipMarkup: string;
secondary_icon_tooltip_text: string;
secondaryIconTooltipText: string;
selection_bound: number;
selectionBound: number;
shadow_type: ShadowType;
shadowType: ShadowType;
text: string;
text_length: number;
textLength: number;
truncate_multiline: boolean;
truncateMultiline: boolean;
visibility: boolean;
width_chars: number;
widthChars: number;
xalign: number;
}
}
class Entry extends Widget implements Atk.ImplementorIface, Buildable, CellEditable, Editable {
static $gtype: GObject.GType<Entry>;
// Properties
get activates_default(): boolean;
set activates_default(val: boolean);
get activatesDefault(): boolean;
set activatesDefault(val: boolean);
get buffer(): EntryBuffer;
set buffer(val: EntryBuffer);
/**
* Whether password entries will show a warning when Caps Lock is on.
*
* Note that the warning is shown using a secondary icon, and thus
* does not work if you are using the secondary icon position for some
* other purpose.
*/
get caps_lock_warning(): boolean;
set caps_lock_warning(val: boolean);
/**
* Whether password entries will show a warning when Caps Lock is on.
*
* Note that the warning is shown using a secondary icon, and thus
* does not work if you are using the secondary icon position for some
* other purpose.
*/
get capsLockWarning(): boolean;
set capsLockWarning(val: boolean);
get cursor_position(): number;
get cursorPosition(): number;
get editable(): boolean;
set editable(val: boolean);
get has_frame(): boolean;
set has_frame(val: boolean);
get hasFrame(): boolean;
set hasFrame(val: boolean);
/**
* Which IM (input method) module should be used for this entry.
* See #GtkIMContext.
*
* Setting this to a non-%NULL value overrides the
* system-wide IM module setting. See the GtkSettings
* #GtkSettings:gtk-im-module property.
*/
get im_module(): string;
set im_module(val: string);
/**
* Which IM (input method) module should be used for this entry.
* See #GtkIMContext.
*
* Setting this to a non-%NULL value overrides the
* system-wide IM module setting. See the GtkSettings
* #GtkSettings:gtk-im-module property.
*/
get imModule(): string;
set imModule(val: string);
/**
* Sets the text area's border between the text and the frame.
*/
get inner_border(): Border;
set inner_border(val: Border);
/**
* Sets the text area's border between the text and the frame.
*/
get innerBorder(): Border;
set innerBorder(val: Border);
/**
* The invisible character is used when masking entry contents (in
* \"password mode\")"). When it is not explicitly set with the
* #GtkEntry::invisible-char property, GTK+ determines the character
* to use from a list of possible candidates, depending on availability
* in the current font.
*
* This style property allows the theme to prepend a character
* to the list of candidates.
*/
get invisible_char(): number;
set invisible_char(val: number);
/**
* The invisible character is used when masking entry contents (in
* \"password mode\")"). When it is not explicitly set with the
* #GtkEntry::invisible-char property, GTK+ determines the character
* to use from a list of possible candidates, depending on availability
* in the current font.
*
* This style property allows the theme to prepend a character
* to the list of candidates.
*/
get invisibleChar(): number;
set invisibleChar(val: number);
/**
* Whether the invisible char has been set for the #GtkEntry.
*/
get invisible_char_set(): boolean;
set invisible_char_set(val: boolean);
/**
* Whether the invisible char has been set for the #GtkEntry.
*/
get invisibleCharSet(): boolean;
set invisibleCharSet(val: boolean);
get max_length(): number;
set max_length(val: number);
get maxLength(): number;
set maxLength(val: number);
/**
* If text is overwritten when typing in the #GtkEntry.
*/
get overwrite_mode(): boolean;
set overwrite_mode(val: boolean);
/**
* If text is overwritten when typing in the #GtkEntry.
*/
get overwriteMode(): boolean;
set overwriteMode(val: boolean);
/**
* Whether the primary icon is activatable.
*
* GTK+ emits the #GtkEntry::icon-press and #GtkEntry::icon-release
* signals only on sensitive, activatable icons.
*
* Sensitive, but non-activatable icons can be used for purely
* informational purposes.
*/
get primary_icon_activatable(): boolean;
set primary_icon_activatable(val: boolean);
/**
* Whether the primary icon is activatable.
*
* GTK+ emits the #GtkEntry::icon-press and #GtkEntry::icon-release
* signals only on sensitive, activatable icons.
*
* Sensitive, but non-activatable icons can be used for purely
* informational purposes.
*/
get primaryIconActivatable(): boolean;
set primaryIconActivatable(val: boolean);
/**
* The #GIcon to use for the primary icon for the entry.
*/
get primary_icon_gicon(): Gio.Icon;
set primary_icon_gicon(val: Gio.Icon);
/**
* The #GIcon to use for the primary icon for the entry.
*/
get primaryIconGicon(): Gio.Icon;
set primaryIconGicon(val: Gio.Icon);
/**
* The icon name to use for the primary icon for the entry.
*/
get primary_icon_name(): string;
set primary_icon_name(val: string);
/**
* The icon name to use for the primary icon for the entry.
*/
get primaryIconName(): string;
set primaryIconName(val: string);
/**
* A pixbuf to use as the primary icon for the entry.
*/
get primary_icon_pixbuf(): GdkPixbuf.Pixbuf;
set primary_icon_pixbuf(val: GdkPixbuf.Pixbuf);
/**
* A pixbuf to use as the primary icon for the entry.
*/
get primaryIconPixbuf(): GdkPixbuf.Pixbuf;
set primaryIconPixbuf(val: GdkPixbuf.Pixbuf);
/**
* Whether the primary icon is sensitive.
*
* An insensitive icon appears grayed out. GTK+ does not emit the
* #GtkEntry::icon-press and #GtkEntry::icon-release signals and
* does not allow DND from insensitive icons.
*
* An icon should be set insensitive if the action that would trigger
* when clicked is currently not available.
*/
get primary_icon_sensitive(): boolean;
set primary_icon_sensitive(val: boolean);
/**
* Whether the primary icon is sensitive.
*
* An insensitive icon appears grayed out. GTK+ does not emit the
* #GtkEntry::icon-press and #GtkEntry::icon-release signals and
* does not allow DND from insensitive icons.
*
* An icon should be set insensitive if the action that would trigger
* when clicked is currently not available.
*/
get primaryIconSensitive(): boolean;
set primaryIconSensitive(val: boolean);
/**
* The stock id to use for the primary icon for the entry.
*/
get primary_icon_stock(): string;
set primary_icon_stock(val: string);
/**
* The stock id to use for the primary icon for the entry.
*/
get primaryIconStock(): string;
set primaryIconStock(val: string);
/**
* The representation which is used for the primary icon of the entry.
*/
get primary_icon_storage_type(): ImageType;
/**
* The representation which is used for the primary icon of the entry.
*/
get primaryIconStorageType(): ImageType;
/**
* The contents of the tooltip on the primary icon, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>.
*
* Also see gtk_entry_set_icon_tooltip_markup().
*/
get primary_icon_tooltip_markup(): string;
set primary_icon_tooltip_markup(val: string);
/**
* The contents of the tooltip on the primary icon, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>.
*
* Also see gtk_entry_set_icon_tooltip_markup().
*/
get primaryIconTooltipMarkup(): string;
set primaryIconTooltipMarkup(val: string);
/**
* The contents of the tooltip on the primary icon.
*
* Also see gtk_entry_set_icon_tooltip_text().
*/
get primary_icon_tooltip_text(): string;
set primary_icon_tooltip_text(val: string);
/**
* The contents of the tooltip on the primary icon.
*
* Also see gtk_entry_set_icon_tooltip_text().
*/
get primaryIconTooltipText(): string;
set primaryIconTooltipText(val: string);
/**
* The current fraction of the task that's been completed.
*/
get progress_fraction(): number;
set progress_fraction(val: number);
/**
* The current fraction of the task that's been completed.
*/
get progressFraction(): number;
set progressFraction(val: number);
/**
* The fraction of total entry width to move the progress
* bouncing block for each call to gtk_entry_progress_pulse().
*/
get progress_pulse_step(): number;
set progress_pulse_step(val: number);
/**
* The fraction of total entry width to move the progress
* bouncing block for each call to gtk_entry_progress_pulse().
*/
get progressPulseStep(): number;
set progressPulseStep(val: number);
get scroll_offset(): number;
get scrollOffset(): number;
/**
* Whether the secondary icon is activatable.
*
* GTK+ emits the #GtkEntry::icon-press and #GtkEntry::icon-release
* signals only on sensitive, activatable icons.
*
* Sensitive, but non-activatable icons can be used for purely
* informational purposes.
*/
get secondary_icon_activatable(): boolean;
set secondary_icon_activatable(val: boolean);
/**
* Whether the secondary icon is activatable.
*
* GTK+ emits the #GtkEntry::icon-press and #GtkEntry::icon-release
* signals only on sensitive, activatable icons.
*
* Sensitive, but non-activatable icons can be used for purely
* informational purposes.
*/
get secondaryIconActivatable(): boolean;
set secondaryIconActivatable(val: boolean);
/**
* The #GIcon to use for the secondary icon for the entry.
*/
get secondary_icon_gicon(): Gio.Icon;
set secondary_icon_gicon(val: Gio.Icon);
/**
* The #GIcon to use for the secondary icon for the entry.
*/
get secondaryIconGicon(): Gio.Icon;
set secondaryIconGicon(val: Gio.Icon);
/**
* The icon name to use for the secondary icon for the entry.
*/
get secondary_icon_name(): string;
set secondary_icon_name(val: string);
/**
* The icon name to use for the secondary icon for the entry.
*/
get secondaryIconName(): string;
set secondaryIconName(val: string);
/**
* An pixbuf to use as the secondary icon for the entry.
*/
get secondary_icon_pixbuf(): GdkPixbuf.Pixbuf;
set secondary_icon_pixbuf(val: GdkPixbuf.Pixbuf);
/**
* An pixbuf to use as the secondary icon for the entry.
*/
get secondaryIconPixbuf(): GdkPixbuf.Pixbuf;
set secondaryIconPixbuf(val: GdkPixbuf.Pixbuf);
/**
* Whether the secondary icon is sensitive.
*
* An insensitive icon appears grayed out. GTK+ does not emit the
* #GtkEntry::icon-press and #GtkEntry::icon-release signals and
* does not allow DND from insensitive icons.
*
* An icon should be set insensitive if the action that would trigger
* when clicked is currently not available.
*/
get secondary_icon_sensitive(): boolean;
set secondary_icon_sensitive(val: boolean);
/**
* Whether the secondary icon is sensitive.
*
* An insensitive icon appears grayed out. GTK+ does not emit the
* #GtkEntry::icon-press and #GtkEntry::icon-release signals and
* does not allow DND from insensitive icons.
*
* An icon should be set insensitive if the action that would trigger
* when clicked is currently not available.
*/
get secondaryIconSensitive(): boolean;
set secondaryIconSensitive(val: boolean);
/**
* The stock id to use for the secondary icon for the entry.
*/
get secondary_icon_stock(): string;
set secondary_icon_stock(val: string);
/**
* The stock id to use for the secondary icon for the entry.
*/
get secondaryIconStock(): string;
set secondaryIconStock(val: string);
/**
* The representation which is used for the secondary icon of the entry.
*/
get secondary_icon_storage_type(): ImageType;
/**
* The representation which is used for the secondary icon of the entry.
*/
get secondaryIconStorageType(): ImageType;
/**
* The contents of the tooltip on the secondary icon, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>.
*
* Also see gtk_entry_set_icon_tooltip_markup().
*/
get secondary_icon_tooltip_markup(): string;
set secondary_icon_tooltip_markup(val: string);
/**
* The contents of the tooltip on the secondary icon, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>.
*
* Also see gtk_entry_set_icon_tooltip_markup().
*/
get secondaryIconTooltipMarkup(): string;
set secondaryIconTooltipMarkup(val: string);
/**
* The contents of the tooltip on the secondary icon.
*
* Also see gtk_entry_set_icon_tooltip_text().
*/
get secondary_icon_tooltip_text(): string;
set secondary_icon_tooltip_text(val: string);
/**
* The contents of the tooltip on the secondary icon.
*
* Also see gtk_entry_set_icon_tooltip_text().
*/
get secondaryIconTooltipText(): string;
set secondaryIconTooltipText(val: string);
get selection_bound(): number;
get selectionBound(): number;
/**
* Which kind of shadow to draw around the entry when
* #GtkEntry:has-frame is set to %TRUE.
*/
get shadow_type(): ShadowType;
set shadow_type(val: ShadowType);
/**
* Which kind of shadow to draw around the entry when
* #GtkEntry:has-frame is set to %TRUE.
*/
get shadowType(): ShadowType;
set shadowType(val: ShadowType);
get text(): string;
set text(val: string);
/**
* The length of the text in the #GtkEntry.
*/
get text_length(): number;
/**
* The length of the text in the #GtkEntry.
*/
get textLength(): number;
/**
* When %TRUE, pasted multi-line text is truncated to the first line.
*/
get truncate_multiline(): boolean;
set truncate_multiline(val: boolean);
/**
* When %TRUE, pasted multi-line text is truncated to the first line.
*/
get truncateMultiline(): boolean;
set truncateMultiline(val: boolean);
get visibility(): boolean;
set visibility(val: boolean);
get width_chars(): number;
set width_chars(val: number);
get widthChars(): number;
set widthChars(val: number);
/**
* The horizontal alignment, from 0 (left) to 1 (right).
* Reversed for RTL layouts.
*/
get xalign(): number;
set xalign(val: number);
// Fields
widget: Widget;
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
visible: number;
in_drag: number;
text_max_length: number;
// Constructors
constructor(properties?: Partial<Entry.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Entry;
static new_with_buffer(buffer: EntryBuffer): Entry;
static new_with_max_length(max: number): Entry;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate', callback: (_source: this) => void): number;
connect_after(signal: 'activate', callback: (_source: this) => void): number;
emit(signal: 'activate'): void;
connect(signal: 'backspace', callback: (_source: this) => void): number;
connect_after(signal: 'backspace', callback: (_source: this) => void): number;
emit(signal: 'backspace'): void;
connect(signal: 'copy-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'copy-clipboard', callback: (_source: this) => void): number;
emit(signal: 'copy-clipboard'): void;
connect(signal: 'cut-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'cut-clipboard', callback: (_source: this) => void): number;
emit(signal: 'cut-clipboard'): void;
connect(
signal: 'delete-from-cursor',
callback: (_source: this, type: DeleteType, count: number) => void,
): number;
connect_after(
signal: 'delete-from-cursor',
callback: (_source: this, type: DeleteType, count: number) => void,
): number;
emit(signal: 'delete-from-cursor', type: DeleteType, count: number): void;
connect(
signal: 'icon-press',
callback: (_source: this, icon_pos: EntryIconPosition, event: Gdk.Event) => void,
): number;
connect_after(
signal: 'icon-press',
callback: (_source: this, icon_pos: EntryIconPosition, event: Gdk.Event) => void,
): number;
emit(signal: 'icon-press', icon_pos: EntryIconPosition, event: Gdk.Event): void;
connect(
signal: 'icon-release',
callback: (_source: this, icon_pos: EntryIconPosition, event: Gdk.Event) => void,
): number;
connect_after(
signal: 'icon-release',
callback: (_source: this, icon_pos: EntryIconPosition, event: Gdk.Event) => void,
): number;
emit(signal: 'icon-release', icon_pos: EntryIconPosition, event: Gdk.Event): void;
connect(signal: 'insert-at-cursor', callback: (_source: this, string: string) => void): number;
connect_after(signal: 'insert-at-cursor', callback: (_source: this, string: string) => void): number;
emit(signal: 'insert-at-cursor', string: string): void;
connect(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number, extend_selection: boolean) => void,
): number;
connect_after(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number, extend_selection: boolean) => void,
): number;
emit(signal: 'move-cursor', step: MovementStep, count: number, extend_selection: boolean): void;
connect(signal: 'paste-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'paste-clipboard', callback: (_source: this) => void): number;
emit(signal: 'paste-clipboard'): void;
connect(signal: 'populate-popup', callback: (_source: this, menu: Menu) => void): number;
connect_after(signal: 'populate-popup', callback: (_source: this, menu: Menu) => void): number;
emit(signal: 'populate-popup', menu: Menu): void;
connect(signal: 'preedit-changed', callback: (_source: this, preedit: string) => void): number;
connect_after(signal: 'preedit-changed', callback: (_source: this, preedit: string) => void): number;
emit(signal: 'preedit-changed', preedit: string): void;
connect(signal: 'toggle-overwrite', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-overwrite', callback: (_source: this) => void): number;
emit(signal: 'toggle-overwrite'): void;
// Virtual methods
vfunc_activate(): void;
vfunc_backspace(): void;
vfunc_copy_clipboard(): void;
vfunc_cut_clipboard(): void;
vfunc_delete_from_cursor(type: DeleteType, count: number): void;
vfunc_get_text_area_size(x: number, y: number, width: number, height: number): void;
vfunc_insert_at_cursor(str: string): void;
vfunc_move_cursor(step: MovementStep, count: number, extend_selection: boolean): void;
vfunc_paste_clipboard(): void;
vfunc_populate_popup(menu: Menu): void;
vfunc_toggle_overwrite(): void;
// Methods
/**
* Appends the given text to the contents of the widget.
* @param text the text to append
*/
append_text(text: string): void;
/**
* Retrieves the value set by gtk_entry_set_activates_default().
* @returns %TRUE if the entry will activate the default widget
*/
get_activates_default(): boolean;
/**
* Gets the value set by gtk_entry_set_alignment().
* @returns the alignment
*/
get_alignment(): number;
/**
* Get the #GtkEntryBuffer object which holds the text for
* this widget.
* @returns A #GtkEntryBuffer object.
*/
get_buffer(): EntryBuffer;
/**
* Returns the auxiliary completion object currently in use by `entry`.
* @returns The auxiliary completion object currently in use by @entry.
*/
get_completion(): EntryCompletion;
/**
* Returns the index of the icon which is the source of the current
* DND operation, or -1.
*
* This function is meant to be used in a #GtkWidget::drag-data-get
* callback.
* @returns index of the icon which is the source of the current DND operation, or -1.
*/
get_current_icon_drag_source(): number;
/**
* Retrieves the horizontal cursor adjustment for the entry.
* See gtk_entry_set_cursor_hadjustment().
* @returns the horizontal cursor adjustment, or %NULL if none has been set.
*/
get_cursor_hadjustment(): Adjustment;
/**
* Gets the value set by gtk_entry_set_has_frame().
* @returns whether the entry has a beveled frame
*/
get_has_frame(): boolean;
/**
* Returns whether the icon is activatable.
* @param icon_pos Icon position
* @returns %TRUE if the icon is activatable.
*/
get_icon_activatable(icon_pos: EntryIconPosition | null): boolean;
/**
* Finds the icon at the given position and return its index.
* If `x,` `y` doesn't lie inside an icon, -1 is returned.
* This function is intended for use in a #GtkWidget::query-tooltip
* signal handler.
* @param x the x coordinate of the position to find
* @param y the y coordinate of the position to find
* @returns the index of the icon at the given position, or -1
*/
get_icon_at_pos(x: number, y: number): number;
/**
* Retrieves the #GIcon used for the icon, or %NULL if there is
* no icon or if the icon was set by some other method (e.g., by
* stock, pixbuf, or icon name).
* @param icon_pos Icon position
* @returns A #GIcon, or %NULL if no icon is set or if the icon is not a #GIcon
*/
get_icon_gicon(icon_pos: EntryIconPosition | null): Gio.Icon;
/**
* Retrieves the icon name used for the icon, or %NULL if there is
* no icon or if the icon was set by some other method (e.g., by
* pixbuf, stock or gicon).
* @param icon_pos Icon position
* @returns An icon name, or %NULL if no icon is set or if the icon wasn't set from an icon name
*/
get_icon_name(icon_pos: EntryIconPosition | null): string;
/**
* Retrieves the image used for the icon.
*
* Unlike the other methods of setting and getting icon data, this
* method will work regardless of whether the icon was set using a
* #GdkPixbuf, a #GIcon, a stock item, or an icon name.
* @param icon_pos Icon position
* @returns A #GdkPixbuf, or %NULL if no icon is set for this position.
*/
get_icon_pixbuf(icon_pos: EntryIconPosition | null): GdkPixbuf.Pixbuf;
/**
* Returns whether the icon appears sensitive or insensitive.
* @param icon_pos Icon position
* @returns %TRUE if the icon is sensitive.
*/
get_icon_sensitive(icon_pos: EntryIconPosition | null): boolean;
/**
* Retrieves the stock id used for the icon, or %NULL if there is
* no icon or if the icon was set by some other method (e.g., by
* pixbuf, icon name or gicon).
* @param icon_pos Icon position
* @returns A stock id, or %NULL if no icon is set or if the icon wasn't set from a stock id
*/
get_icon_stock(icon_pos: EntryIconPosition | null): string;
/**
* Gets the type of representation being used by the icon
* to store image data. If the icon has no image data,
* the return value will be %GTK_IMAGE_EMPTY.
* @param icon_pos Icon position
* @returns image representation being used
*/
get_icon_storage_type(icon_pos: EntryIconPosition | null): ImageType;
/**
* Gets the contents of the tooltip on the icon at the specified
* position in `entry`.
* @param icon_pos the icon position
* @returns the tooltip text, or %NULL. Free the returned string with g_free() when done.
*/
get_icon_tooltip_markup(icon_pos: EntryIconPosition | null): string;
/**
* Gets the contents of the tooltip on the icon at the specified
* position in `entry`.
* @param icon_pos the icon position
* @returns the tooltip text, or %NULL. Free the returned string with g_free() when done.
*/
get_icon_tooltip_text(icon_pos: EntryIconPosition | null): string;
/**
* Returns the #GdkWindow which contains the entry's icon at
* `icon_pos`. This function is useful when drawing something to the
* entry in an expose-event callback because it enables the callback
* to distinguish between the text window and entry's icon windows.
*
* See also gtk_entry_get_text_window().
*
* Note that GTK+ 3 does not have this function anymore; it has
* been replaced by gtk_entry_get_icon_area().
* @param icon_pos Icon position
* @returns the entry's icon window at @icon_pos.
*/
get_icon_window(icon_pos: EntryIconPosition | null): Gdk.Window;
/**
* This function returns the entry's #GtkEntry:inner-border property. See
* gtk_entry_set_inner_border() for more information.
* @returns the entry's #GtkBorder, or %NULL if none was set.
*/
get_inner_border(): Border;
/**
* Retrieves the character displayed in place of the real characters
* for entries with visibility set to false. See gtk_entry_set_invisible_char().
* @returns the current invisible char, or 0, if the entry does not show invisible text at all.
*/
get_invisible_char(): number;
/**
* Gets the #PangoLayout used to display the entry.
* The layout is useful to e.g. convert text positions to
* pixel positions, in combination with gtk_entry_get_layout_offsets().
* The returned layout is owned by the entry and must not be
* modified or freed by the caller.
*
* Keep in mind that the layout text may contain a preedit string, so
* gtk_entry_layout_index_to_text_index() and
* gtk_entry_text_index_to_layout_index() are needed to convert byte
* indices in the layout to byte indices in the entry contents.
* @returns the #PangoLayout for this entry
*/
get_layout(): Pango.Layout;
/**
* Obtains the position of the #PangoLayout used to render text
* in the entry, in widget coordinates. Useful if you want to line
* up the text in an entry with some other text, e.g. when using the
* entry to implement editable cells in a sheet widget.
*
* Also useful to convert mouse events into coordinates inside the
* #PangoLayout, e.g. to take some action if some part of the entry text
* is clicked.
*
* Note that as the user scrolls around in the entry the offsets will
* change; you'll need to connect to the "notify::scroll-offset"
* signal to track this. Remember when using the #PangoLayout
* functions you need to convert to and from pixels using
* PANGO_PIXELS() or #PANGO_SCALE.
*
* Keep in mind that the layout text may contain a preedit string, so
* gtk_entry_layout_index_to_text_index() and
* gtk_entry_text_index_to_layout_index() are needed to convert byte
* indices in the layout to byte indices in the entry contents.
*/
get_layout_offsets(): [number, number];
/**
* Retrieves the maximum allowed length of the text in
* `entry`. See gtk_entry_set_max_length().
*
* This is equivalent to:
*
* <informalexample><programlisting>
* gtk_entry_buffer_get_max_length (gtk_entry_get_buffer (entry));
* </programlisting></informalexample>
* @returns the maximum allowed number of characters in #GtkEntry, or 0 if there is no maximum.
*/
get_max_length(): number;
/**
* Gets the value set by gtk_entry_set_overwrite_mode().
* @returns whether the text is overwritten when typing.
*/
get_overwrite_mode(): boolean;
/**
* Returns the current fraction of the task that's been completed.
* See gtk_entry_set_progress_fraction().
* @returns a fraction from 0.0 to 1.0
*/
get_progress_fraction(): number;
/**
* Retrieves the pulse step set with gtk_entry_set_progress_pulse_step().
* @returns a fraction from 0.0 to 1.0
*/
get_progress_pulse_step(): number;
/**
* Retrieves the contents of the entry widget.
* See also gtk_editable_get_chars().
*
* This is equivalent to:
*
* <informalexample><programlisting>
* gtk_entry_buffer_get_text (gtk_entry_get_buffer (entry));
* </programlisting></informalexample>
* @returns a pointer to the contents of the widget as a string. This string points to internally allocated storage in the widget and must not be freed, modified or stored.
*/
get_text(): string;
/**
* Retrieves the current length of the text in
* `entry`.
*
* This is equivalent to:
*
* <informalexample><programlisting>
* gtk_entry_buffer_get_length (gtk_entry_get_buffer (entry));
* </programlisting></informalexample>
* @returns the current number of characters in #GtkEntry, or 0 if there are none.
*/
get_text_length(): number;
/**
* Returns the #GdkWindow which contains the text. This function is
* useful when drawing something to the entry in an expose-event
* callback because it enables the callback to distinguish between
* the text window and entry's icon windows.
*
* See also gtk_entry_get_icon_window().
*
* Note that GTK+ 3 does not have this function anymore; it has
* been replaced by gtk_entry_get_text_area().
* @returns the entry's text window.
*/
get_text_window(): Gdk.Window;
/**
* Retrieves whether the text in `entry` is visible. See
* gtk_entry_set_visibility().
* @returns %TRUE if the text is currently visible
*/
get_visibility(): boolean;
/**
* Gets the value set by gtk_entry_set_width_chars().
* @returns number of chars to request space for, or negative if unset
*/
get_width_chars(): number;
/**
* Allow the #GtkEntry input method to internally handle key press
* and release events. If this function returns %TRUE, then no further
* processing should be done for this key event. See
* gtk_im_context_filter_keypress().
*
* Note that you are expected to call this function from your handler
* when overriding key event handling. This is needed in the case when
* you need to insert your own key handling between the input method
* and the default key event handling of the #GtkEntry.
* See gtk_text_view_reset_im_context() for an example of use.
* @param event the key event
* @returns %TRUE if the input method handled the key event.
*/
im_context_filter_keypress(event: Gdk.EventKey): boolean;
/**
* Converts from a position in the entry contents (returned
* by gtk_entry_get_text()) to a position in the
* entry's #PangoLayout (returned by gtk_entry_get_layout(),
* with text retrieved via pango_layout_get_text()).
* @param layout_index byte index into the entry layout text
* @returns byte index into the entry contents
*/
layout_index_to_text_index(layout_index: number): number;
/**
* Prepends the given text to the contents of the widget.
* @param text the text to prepend
*/
prepend_text(text: string): void;
/**
* Indicates that some progress is made, but you don't know how much.
* Causes the entry's progress indicator to enter "activity mode,"
* where a block bounces back and forth. Each call to
* gtk_entry_progress_pulse() causes the block to move by a little bit
* (the amount of movement per pulse is determined by
* gtk_entry_set_progress_pulse_step()).
*/
progress_pulse(): void;
/**
* Reset the input method context of the entry if needed.
*
* This can be necessary in the case where modifying the buffer
* would confuse on-going input method behavior.
*/
reset_im_context(): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the characters
* selected will be those characters from `start_pos` to the end of
* the text.
* @param start the starting position
* @param end the end position
*/
select_region(start: number, end: number): void;
/**
* If `setting` is %TRUE, pressing Enter in the `entry` will activate the default
* widget for the window containing the entry. This usually means that
* the dialog box containing the entry will be closed, since the default
* widget is usually one of the dialog buttons.
*
* (For experts: if `setting` is %TRUE, the entry calls
* gtk_window_activate_default() on the window containing the entry, in
* the default handler for the #GtkWidget::activate signal.)
* @param setting %TRUE to activate window's default widget on Enter keypress
*/
set_activates_default(setting: boolean): void;
/**
* Sets the alignment for the contents of the entry. This controls
* the horizontal positioning of the contents when the displayed
* text is shorter than the width of the entry.
* @param xalign The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts
*/
set_alignment(xalign: number): void;
/**
* Set the #GtkEntryBuffer object which holds the text for
* this widget.
* @param buffer a #GtkEntryBuffer
*/
set_buffer(buffer: EntryBuffer): void;
/**
* Sets `completion` to be the auxiliary completion object to use with `entry`.
* All further configuration of the completion mechanism is done on
* `completion` using the #GtkEntryCompletion API. Completion is disabled if
* `completion` is set to %NULL.
* @param completion The #GtkEntryCompletion or %NULL
*/
set_completion(completion?: EntryCompletion | null): void;
/**
* Hooks up an adjustment to the cursor position in an entry, so that when
* the cursor is moved, the adjustment is scrolled to show that position.
* See gtk_scrolled_window_get_hadjustment() for a typical way of obtaining
* the adjustment.
*
* The adjustment has to be in pixel units and in the same coordinate system
* as the entry.
* @param adjustment an adjustment which should be adjusted when the cursor is moved, or %NULL
*/
set_cursor_hadjustment(adjustment: Adjustment): void;
/**
* Determines if the user can edit the text in the editable
* widget or not.
* @param editable %TRUE if the user is allowed to edit the text in the widget
*/
set_editable(editable: boolean): void;
/**
* Sets whether the entry has a beveled frame around it.
* @param setting new value
*/
set_has_frame(setting: boolean): void;
/**
* Sets whether the icon is activatable.
* @param icon_pos Icon position
* @param activatable %TRUE if the icon should be activatable
*/
set_icon_activatable(icon_pos: EntryIconPosition | null, activatable: boolean): void;
/**
* Sets up the icon at the given position so that GTK+ will start a drag
* operation when the user clicks and drags the icon.
*
* To handle the drag operation, you need to connect to the usual
* #GtkWidget::drag-data-get (or possibly #GtkWidget::drag-data-delete)
* signal, and use gtk_entry_get_current_icon_drag_source() in
* your signal handler to find out if the drag was started from
* an icon.
*
* By default, GTK+ uses the icon as the drag icon. You can use the
* #GtkWidget::drag-begin signal to set a different icon. Note that you
* have to use g_signal_connect_after() to ensure that your signal handler
* gets executed after the default handler.
* @param icon_pos icon position
* @param target_list the targets (data formats) in which the data can be provided
* @param actions a bitmask of the allowed drag actions
*/
set_icon_drag_source(
icon_pos: EntryIconPosition | null,
target_list: TargetList,
actions: Gdk.DragAction | null,
): void;
/**
* Sets the icon shown in the entry at the specified position
* from the current icon theme.
* If the icon isn't known, a "broken image" icon will be displayed
* instead.
*
* If `icon` is %NULL, no icon will be shown in the specified position.
* @param icon_pos The position at which to set the icon
* @param icon The icon to set, or %NULL
*/
set_icon_from_gicon(icon_pos: EntryIconPosition | null, icon?: Gio.Icon | null): void;
/**
* Sets the icon shown in the entry at the specified position
* from the current icon theme.
*
* If the icon name isn't known, a "broken image" icon will be displayed
* instead.
*
* If `icon_name` is %NULL, no icon will be shown in the specified position.
* @param icon_pos The position at which to set the icon
* @param icon_name An icon name, or %NULL
*/
set_icon_from_icon_name(icon_pos: EntryIconPosition | null, icon_name?: string | null): void;
/**
* Sets the icon shown in the specified position using a pixbuf.
*
* If `pixbuf` is %NULL, no icon will be shown in the specified position.
* @param icon_pos Icon position
* @param pixbuf A #GdkPixbuf, or %NULL
*/
set_icon_from_pixbuf(icon_pos: EntryIconPosition | null, pixbuf?: GdkPixbuf.Pixbuf | null): void;
/**
* Sets the icon shown in the entry at the specified position from
* a stock image.
*
* If `stock_id` is %NULL, no icon will be shown in the specified position.
* @param icon_pos Icon position
* @param stock_id The name of the stock item, or %NULL
*/
set_icon_from_stock(icon_pos: EntryIconPosition | null, stock_id?: string | null): void;
/**
* Sets the sensitivity for the specified icon.
* @param icon_pos Icon position
* @param sensitive Specifies whether the icon should appear sensitive or insensitive
*/
set_icon_sensitive(icon_pos: EntryIconPosition | null, sensitive: boolean): void;
/**
* Sets `tooltip` as the contents of the tooltip for the icon at
* the specified position. `tooltip` is assumed to be marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* Use %NULL for `tooltip` to remove an existing tooltip.
*
* See also gtk_widget_set_tooltip_markup() and
* gtk_entry_set_icon_tooltip_text().
* @param icon_pos the icon position
* @param tooltip the contents of the tooltip for the icon, or %NULL
*/
set_icon_tooltip_markup(icon_pos: EntryIconPosition | null, tooltip?: string | null): void;
/**
* Sets `tooltip` as the contents of the tooltip for the icon
* at the specified position.
*
* Use %NULL for `tooltip` to remove an existing tooltip.
*
* See also gtk_widget_set_tooltip_text() and
* gtk_entry_set_icon_tooltip_markup().
*
* If you unset the widget tooltip via gtk_widget_set_tooltip_text() or
* gtk_widget_set_tooltip_markup(), this sets GtkWidget:has-tooltip to %FALSE,
* which suppresses icon tooltips too. You can resolve this by then calling
* gtk_widget_set_has_tooltip() to set GtkWidget:has-tooltip back to %TRUE, or
* setting at least one non-empty tooltip on any icon achieves the same result.
* @param icon_pos the icon position
* @param tooltip the contents of the tooltip for the icon, or %NULL
*/
set_icon_tooltip_text(icon_pos: EntryIconPosition | null, tooltip?: string | null): void;
/**
* Sets %entry's inner-border property to %border, or clears it if %NULL
* is passed. The inner-border is the area around the entry's text, but
* inside its frame.
*
* If set, this property overrides the inner-border style property.
* Overriding the style-provided border is useful when you want to do
* in-place editing of some text in a canvas or list widget, where
* pixel-exact positioning of the entry is important.
* @param border a #GtkBorder, or %NULL
*/
set_inner_border(border?: Border | null): void;
/**
* Sets the character to use in place of the actual text when
* gtk_entry_set_visibility() has been called to set text visibility
* to %FALSE. i.e. this is the character used in "password mode" to
* show the user how many characters have been typed. By default, GTK+
* picks the best invisible char available in the current font. If you
* set the invisible char to 0, then the user will get no feedback
* at all; there will be no text on the screen as they type.
* @param ch a Unicode character
*/
set_invisible_char(ch: number): void;
/**
* Sets the maximum allowed length of the contents of the widget. If
* the current contents are longer than the given length, then they
* will be truncated to fit.
*
* This is equivalent to:
*
* <informalexample><programlisting>
* gtk_entry_buffer_set_max_length (gtk_entry_get_buffer (entry), max);
* </programlisting></informalexample>
* @param max the maximum length of the entry, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536.
*/
set_max_length(max: number): void;
/**
* Sets whether the text is overwritten when typing in the #GtkEntry.
* @param overwrite new value
*/
set_overwrite_mode(overwrite: boolean): void;
/**
* Sets the cursor position in an entry to the given value.
* @param position the position of the cursor. The cursor is displayed before the character with the given (base 0) index in the widget. The value must be less than or equal to the number of characters in the widget. A value of -1 indicates that the position should be set after the last character in the entry. Note that this position is in characters, not in bytes.
*/
set_position(position: number): void;
/**
* Causes the entry's progress indicator to "fill in" the given
* fraction of the bar. The fraction should be between 0.0 and 1.0,
* inclusive.
* @param fraction fraction of the task that's been completed
*/
set_progress_fraction(fraction: number): void;
/**
* Sets the fraction of total entry width to move the progress
* bouncing block for each call to gtk_entry_progress_pulse().
* @param fraction fraction between 0.0 and 1.0
*/
set_progress_pulse_step(fraction: number): void;
/**
* Sets the text in the widget to the given
* value, replacing the current contents.
*
* See gtk_entry_buffer_set_text().
* @param text the new text
*/
set_text(text: string): void;
/**
* Sets whether the contents of the entry are visible or not.
* When visibility is set to %FALSE, characters are displayed
* as the invisible char, and will also appear that way when
* the text in the entry widget is copied elsewhere.
*
* By default, GTK+ picks the best invisible character available
* in the current font, but it can be changed with
* gtk_entry_set_invisible_char().
* @param visible %TRUE if the contents of the entry are displayed as plaintext
*/
set_visibility(visible: boolean): void;
/**
* Changes the size request of the entry to be about the right size
* for `n_chars` characters. Note that it changes the size
* <emphasis>request</emphasis>, the size can still be affected by
* how you pack the widget into containers. If `n_chars` is -1, the
* size reverts to the default entry size.
* @param n_chars width in chars
*/
set_width_chars(n_chars: number): void;
/**
* Converts from a position in the entry's #PangoLayout (returned by
* gtk_entry_get_layout()) to a position in the entry contents
* (returned by gtk_entry_get_text()).
* @param text_index byte index into the entry contents
* @returns byte index into the entry layout text
*/
text_index_to_layout_index(text_index: number): number;
/**
* Unsets the invisible char previously set with
* gtk_entry_set_invisible_char(). So that the
* default invisible char is used again.
*/
unset_invisible_char(): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
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
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Copies the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
copy_clipboard(): void;
/**
* Removes the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
cut_clipboard(): void;
/**
* Deletes the currently selected text of the editable.
* This call doesn't do anything if there is no selected text.
*/
delete_selection(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
delete_text(start_pos: number, end_pos: number): void;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
* @returns a pointer to the contents of the widget as a string. This string is allocated by the #GtkEditable implementation and should be freed by the caller.
*/
get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves whether `editable` is editable. See
* gtk_editable_set_editable().
* @returns %TRUE if @editable is editable.
*/
get_editable(): boolean;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
* @returns the cursor position
*/
get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
* @returns %TRUE if an area is selected, %FALSE otherwise
*/
get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Pastes the content of the clipboard to the current position of the
* cursor in the editable.
*/
paste_clipboard(): void;
/**
* 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): RcStyle;
/**
* Returns the current value of the GtkWidget:no-show-all property,
* which determines whether calls to gtk_widget_show_all() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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 #GtkWidget:no-show-all property, which determines whether
* calls to gtk_widget_show_all() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace EntryBuffer {
// Signal callback interfaces
interface DeletedText {
(position: number, n_chars: number): void;
}
interface InsertedText {
(position: number, chars: string, n_chars: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
length: number;
max_length: number;
maxLength: number;
text: string;
}
}
/**
* The #GtkEntryBuffer class contains the actual text displayed in a
* #GtkEntry widget.
*
* A single #GtkEntryBuffer object can be shared by multiple #GtkEntry
* widgets which will then share the same text content, but not the cursor
* position, visibility attributes, icon etc.
*
* #GtkEntryBuffer may be derived from. Such a derived class might allow
* text to be stored in an alternate location, such as non-pageable memory,
* useful in the case of important passwords. Or a derived class could
* integrate with an application's concept of undo/redo.
*/
class EntryBuffer extends GObject.Object {
static $gtype: GObject.GType<EntryBuffer>;
// Properties
/**
* The length (in characters) of the text in buffer.
*/
get length(): number;
/**
* The maximum length (in characters) of the text in the buffer.
*/
get max_length(): number;
set max_length(val: number);
/**
* The maximum length (in characters) of the text in the buffer.
*/
get maxLength(): number;
set maxLength(val: number);
/**
* The contents of the buffer.
*/
get text(): string;
set text(val: string);
// Constructors
constructor(properties?: Partial<EntryBuffer.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](initial_chars: string | null, n_initial_chars: number): EntryBuffer;
// 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: 'deleted-text',
callback: (_source: this, position: number, n_chars: number) => void,
): number;
connect_after(
signal: 'deleted-text',
callback: (_source: this, position: number, n_chars: number) => void,
): number;
emit(signal: 'deleted-text', position: number, n_chars: number): void;
connect(
signal: 'inserted-text',
callback: (_source: this, position: number, chars: string, n_chars: number) => void,
): number;
connect_after(
signal: 'inserted-text',
callback: (_source: this, position: number, chars: string, n_chars: number) => void,
): number;
emit(signal: 'inserted-text', position: number, chars: string, n_chars: number): void;
// Virtual methods
/**
* Deletes a sequence of characters from the buffer. `n_chars` characters are
* deleted starting at `position`. If `n_chars` is negative, then all characters
* until the end of the text are deleted.
*
* If `position` or `n_chars` are out of bounds, then they are coerced to sane
* values.
*
* Note that the positions are specified in characters, not bytes.
* @param position position at which to delete text
* @param n_chars number of characters to delete
*/
vfunc_delete_text(position: number, n_chars: number): number;
vfunc_deleted_text(position: number, n_chars: number): void;
/**
* Retrieves the length in characters of the buffer.
*/
vfunc_get_length(): number;
vfunc_get_text(n_bytes: number): string;
/**
* Inserts `n_chars` characters of `chars` into the contents of the
* buffer, at position `position`.
*
* If `n_chars` is negative, then characters from chars will be inserted
* until a null-terminator is found. If `position` or `n_chars` are out of
* bounds, or the maximum buffer text length is exceeded, then they are
* coerced to sane values.
*
* Note that the position and length are in characters, not in bytes.
* @param position the position at which to insert text.
* @param chars the text to insert into the buffer.
* @param n_chars the length of the text in characters, or -1
*/
vfunc_insert_text(position: number, chars: string, n_chars: number): number;
vfunc_inserted_text(position: number, chars: string, n_chars: number): void;
// Methods
/**
* Deletes a sequence of characters from the buffer. `n_chars` characters are
* deleted starting at `position`. If `n_chars` is negative, then all characters
* until the end of the text are deleted.
*
* If `position` or `n_chars` are out of bounds, then they are coerced to sane
* values.
*
* Note that the positions are specified in characters, not bytes.
* @param position position at which to delete text
* @param n_chars number of characters to delete
* @returns The number of characters deleted.
*/
delete_text(position: number, n_chars: number): number;
/**
* Used when subclassing #GtkEntryBuffer
* @param position position at which text was deleted
* @param n_chars number of characters deleted
*/
emit_deleted_text(position: number, n_chars: number): void;
/**
* Used when subclassing #GtkEntryBuffer
* @param position position at which text was inserted
* @param chars text that was inserted
* @param n_chars number of characters inserted
*/
emit_inserted_text(position: number, chars: string, n_chars: number): void;
/**
* Retrieves the length in bytes of the buffer.
* See gtk_entry_buffer_get_length().
* @returns The byte length of the buffer.
*/
get_bytes(): number;
/**
* Retrieves the length in characters of the buffer.
* @returns The number of characters in the buffer.
*/
get_length(): number;
/**
* Retrieves the maximum allowed length of the text in
* `buffer`. See gtk_entry_buffer_set_max_length().
* @returns the maximum allowed number of characters in #GtkEntryBuffer, or 0 if there is no maximum.
*/
get_max_length(): number;
/**
* Retrieves the contents of the buffer.
*
* The memory pointer returned by this call will not change
* unless this object emits a signal, or is finalized.
* @returns a pointer to the contents of the widget as a string. This string points to internally allocated storage in the buffer and must not be freed, modified or stored.
*/
get_text(): string;
/**
* Inserts `n_chars` characters of `chars` into the contents of the
* buffer, at position `position`.
*
* If `n_chars` is negative, then characters from chars will be inserted
* until a null-terminator is found. If `position` or `n_chars` are out of
* bounds, or the maximum buffer text length is exceeded, then they are
* coerced to sane values.
*
* Note that the position and length are in characters, not in bytes.
* @param position the position at which to insert text.
* @param chars the text to insert into the buffer.
* @param n_chars the length of the text in characters, or -1
* @returns The number of characters actually inserted.
*/
insert_text(position: number, chars: string, n_chars: number): number;
/**
* Sets the maximum allowed length of the contents of the buffer. If
* the current contents are longer than the given length, then they
* will be truncated to fit.
* @param max_length the maximum length of the entry buffer, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range 0-65536.
*/
set_max_length(max_length: number): void;
/**
* Sets the text in the buffer.
*
* This is roughly equivalent to calling gtk_entry_buffer_delete_text()
* and gtk_entry_buffer_insert_text().
*
* Note that `n_chars` is in characters, not in bytes.
* @param chars the new text
* @param n_chars the number of characters in @text, or -1
*/
set_text(chars: string, n_chars: number): void;
}
namespace EntryCompletion {
// Signal callback interfaces
interface ActionActivated {
(index: number): void;
}
interface CursorOnMatch {
(model: TreeModel, iter: TreeIter): boolean;
}
interface InsertPrefix {
(prefix: string): boolean;
}
interface MatchSelected {
(model: TreeModel, iter: TreeIter): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends GObject.Object.ConstructorProps,
Buildable.ConstructorProps,
CellLayout.ConstructorProps {
inline_completion: boolean;
inlineCompletion: boolean;
inline_selection: boolean;
inlineSelection: boolean;
minimum_key_length: number;
minimumKeyLength: number;
model: TreeModel;
popup_completion: boolean;
popupCompletion: boolean;
popup_set_width: boolean;
popupSetWidth: boolean;
popup_single_match: boolean;
popupSingleMatch: boolean;
text_column: number;
textColumn: number;
}
}
class EntryCompletion extends GObject.Object implements Buildable, CellLayout {
static $gtype: GObject.GType<EntryCompletion>;
// Properties
/**
* Determines whether the common prefix of the possible completions
* should be inserted automatically in the entry. Note that this
* requires text-column to be set, even if you are using a custom
* match function.
*/
get inline_completion(): boolean;
set inline_completion(val: boolean);
/**
* Determines whether the common prefix of the possible completions
* should be inserted automatically in the entry. Note that this
* requires text-column to be set, even if you are using a custom
* match function.
*/
get inlineCompletion(): boolean;
set inlineCompletion(val: boolean);
/**
* Determines whether the possible completions on the popup
* will appear in the entry as you navigate through them.
*/
get inline_selection(): boolean;
set inline_selection(val: boolean);
/**
* Determines whether the possible completions on the popup
* will appear in the entry as you navigate through them.
*/
get inlineSelection(): boolean;
set inlineSelection(val: boolean);
get minimum_key_length(): number;
set minimum_key_length(val: number);
get minimumKeyLength(): number;
set minimumKeyLength(val: number);
get model(): TreeModel;
set model(val: TreeModel);
/**
* Determines whether the possible completions should be
* shown in a popup window.
*/
get popup_completion(): boolean;
set popup_completion(val: boolean);
/**
* Determines whether the possible completions should be
* shown in a popup window.
*/
get popupCompletion(): boolean;
set popupCompletion(val: boolean);
/**
* Determines whether the completions popup window will be
* resized to the width of the entry.
*/
get popup_set_width(): boolean;
set popup_set_width(val: boolean);
/**
* Determines whether the completions popup window will be
* resized to the width of the entry.
*/
get popupSetWidth(): boolean;
set popupSetWidth(val: boolean);
/**
* Determines whether the completions popup window will shown
* for a single possible completion. You probably want to set
* this to %FALSE if you are using
* <link linkend="GtkEntryCompletion--inline-completion">inline
* completion</link>.
*/
get popup_single_match(): boolean;
set popup_single_match(val: boolean);
/**
* Determines whether the completions popup window will shown
* for a single possible completion. You probably want to set
* this to %FALSE if you are using
* <link linkend="GtkEntryCompletion--inline-completion">inline
* completion</link>.
*/
get popupSingleMatch(): boolean;
set popupSingleMatch(val: boolean);
/**
* The column of the model containing the strings.
* Note that the strings must be UTF-8.
*/
get text_column(): number;
set text_column(val: number);
/**
* The column of the model containing the strings.
* Note that the strings must be UTF-8.
*/
get textColumn(): number;
set textColumn(val: number);
// Constructors
constructor(properties?: Partial<EntryCompletion.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): EntryCompletion;
// 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: 'action-activated', callback: (_source: this, index: number) => void): number;
connect_after(signal: 'action-activated', callback: (_source: this, index: number) => void): number;
emit(signal: 'action-activated', index: number): void;
connect(
signal: 'cursor-on-match',
callback: (_source: this, model: TreeModel, iter: TreeIter) => boolean,
): number;
connect_after(
signal: 'cursor-on-match',
callback: (_source: this, model: TreeModel, iter: TreeIter) => boolean,
): number;
emit(signal: 'cursor-on-match', model: TreeModel, iter: TreeIter): void;
connect(signal: 'insert-prefix', callback: (_source: this, prefix: string) => boolean): number;
connect_after(signal: 'insert-prefix', callback: (_source: this, prefix: string) => boolean): number;
emit(signal: 'insert-prefix', prefix: string): void;
connect(
signal: 'match-selected',
callback: (_source: this, model: TreeModel, iter: TreeIter) => boolean,
): number;
connect_after(
signal: 'match-selected',
callback: (_source: this, model: TreeModel, iter: TreeIter) => boolean,
): number;
emit(signal: 'match-selected', model: TreeModel, iter: TreeIter): void;
// Virtual methods
vfunc_action_activated(index_: number): void;
vfunc_cursor_on_match(model: TreeModel, iter: TreeIter): boolean;
vfunc_insert_prefix(prefix: string): boolean;
vfunc_match_selected(model: TreeModel, iter: TreeIter): boolean;
// Methods
/**
* Requests a completion operation, or in other words a refiltering of the
* current list with completions, using the current key. The completion list
* view will be updated accordingly.
*/
complete(): void;
/**
* Deletes the action at `index_` from `completion'`s action list.
* @param index_ The index of the item to Delete.
*/
delete_action(index_: number): void;
/**
* Get the original text entered by the user that triggered
* the completion or %NULL if there's no completion ongoing.
* @returns the prefix for the current completion
*/
get_completion_prefix(): string;
/**
* Gets the entry `completion` has been attached to.
* @returns The entry @completion has been attached to.
*/
get_entry(): Widget;
/**
* Returns whether the common prefix of the possible completions should
* be automatically inserted in the entry.
* @returns %TRUE if inline completion is turned on
*/
get_inline_completion(): boolean;
/**
* Returns %TRUE if inline-selection mode is turned on.
* @returns %TRUE if inline-selection mode is on
*/
get_inline_selection(): boolean;
/**
* Returns the minimum key length as set for `completion`.
* @returns The currently used minimum key length.
*/
get_minimum_key_length(): number;
/**
* Returns the model the #GtkEntryCompletion is using as data source.
* Returns %NULL if the model is unset.
* @returns A #GtkTreeModel, or %NULL if none is currently being used.
*/
get_model(): TreeModel;
/**
* Returns whether the completions should be presented in a popup window.
* @returns %TRUE if popup completion is turned on
*/
get_popup_completion(): boolean;
/**
* Returns whether the completion popup window will be resized to the
* width of the entry.
* @returns %TRUE if the popup window will be resized to the width of the entry
*/
get_popup_set_width(): boolean;
/**
* Returns whether the completion popup window will appear even if there is
* only a single match.
* @returns %TRUE if the popup window will appear regardless of the number of matches.
*/
get_popup_single_match(): boolean;
/**
* Returns the column in the model of `completion` to get strings from.
* @returns the column containing the strings
*/
get_text_column(): number;
/**
* Inserts an action in `completion'`s action item list at position `index_`
* with markup `markup`.
* @param index_ The index of the item to insert.
* @param markup Markup of the item to insert.
*/
insert_action_markup(index_: number, markup: string): void;
/**
* Inserts an action in `completion'`s action item list at position `index_`
* with text `text`. If you want the action item to have markup, use
* gtk_entry_completion_insert_action_markup().
* @param index_ The index of the item to insert.
* @param text Text of the item to insert.
*/
insert_action_text(index_: number, text: string): void;
/**
* Requests a prefix insertion.
*/
insert_prefix(): void;
/**
* Sets whether the common prefix of the possible completions should
* be automatically inserted in the entry.
* @param inline_completion %TRUE to do inline completion
*/
set_inline_completion(inline_completion: boolean): void;
/**
* Sets whether it is possible to cycle through the possible completions
* inside the entry.
* @param inline_selection %TRUE to do inline selection
*/
set_inline_selection(inline_selection: boolean): void;
/**
* Sets the match function for `completion` to be `func`. The match function
* is used to determine if a row should or should not be in the completion
* list.
* @param func The #GtkEntryCompletionMatchFunc to use.
*/
set_match_func(func: EntryCompletionMatchFunc): void;
/**
* Requires the length of the search key for `completion` to be at least
* `length`. This is useful for long lists, where completing using a small
* key takes a lot of time and will come up with meaningless results anyway
* (ie, a too large dataset).
* @param length The minimum length of the key in order to start completing.
*/
set_minimum_key_length(length: number): void;
/**
* Sets the model for a #GtkEntryCompletion. If `completion` already has
* a model set, it will remove it before setting the new model.
* If model is %NULL, then it will unset the model.
* @param model The #GtkTreeModel.
*/
set_model(model?: TreeModel | null): void;
/**
* Sets whether the completions should be presented in a popup window.
* @param popup_completion %TRUE to do popup completion
*/
set_popup_completion(popup_completion: boolean): void;
/**
* Sets whether the completion popup window will be resized to be the same
* width as the entry.
* @param popup_set_width %TRUE to make the width of the popup the same as the entry
*/
set_popup_set_width(popup_set_width: boolean): void;
/**
* Sets whether the completion popup window will appear even if there is
* only a single match. You may want to set this to %FALSE if you
* are using <link linkend="GtkEntryCompletion--inline-completion">inline
* completion</link>.
* @param popup_single_match %TRUE if the popup should appear even for a single match
*/
set_popup_single_match(popup_single_match: boolean): void;
/**
* Convenience function for setting up the most used case of this code: a
* completion list with just strings. This function will set up `completion`
* to have a list displaying all (and just) strings in the completion list,
* and to get those strings from `column` in the model of `completion`.
*
* This functions creates and adds a #GtkCellRendererText for the selected
* column. If you need to set the text column, but don't want the cell
* renderer, use g_object_set() to set the ::text_column property directly.
* @param column The column in the model of @completion to get strings from.
*/
set_text_column(column: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): 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 EventBox {
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
above_child: boolean;
aboveChild: boolean;
visible_window: boolean;
visibleWindow: boolean;
}
}
class EventBox extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<EventBox>;
// Properties
get above_child(): boolean;
set above_child(val: boolean);
get aboveChild(): boolean;
set aboveChild(val: boolean);
get visible_window(): boolean;
set visible_window(val: boolean);
get visibleWindow(): boolean;
set visibleWindow(val: boolean);
// Fields
bin: Bin;
// Constructors
constructor(properties?: Partial<EventBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): EventBox;
// Methods
/**
* Returns whether the event box window is above or below the
* windows of its child. See gtk_event_box_set_above_child() for
* details.
* @returns %TRUE if the event box window is above the window of its child.
*/
get_above_child(): boolean;
/**
* Returns whether the event box has a visible window.
* See gtk_event_box_set_visible_window() for details.
* @returns %TRUE if the event box window is visible
*/
get_visible_window(): boolean;
/**
* Set whether the event box window is positioned above the windows of its child,
* as opposed to below it. If the window is above, all events inside the
* event box will go to the event box. If the window is below, events
* in windows of child widgets will first got to that widget, and then
* to its parents.
*
* The default is to keep the window below the child.
* @param above_child %TRUE if the event box window is above the windows of its child
*/
set_above_child(above_child: boolean): void;
/**
* Set whether the event box uses a visible or invisible child
* window. The default is to use visible windows.
*
* In an invisible window event box, the window that the
* event box creates is a %GDK_INPUT_ONLY window, which
* means that it is invisible and only serves to receive
* events.
*
* A visible window event box creates a visible (%GDK_INPUT_OUTPUT)
* window that acts as the parent window for all the widgets
* contained in the event box.
*
* You should generally make your event box invisible if
* you just want to trap events. Creating a visible window
* may cause artifacts that are visible to the user, especially
* if the user is using a theme with gradients or pixmaps.
*
* The main reason to create a non input-only event box is if
* you want to set the background to a different color or
* draw on it.
*
* <note><para>
* There is one unexpected issue for an invisible event box that has its
* window below the child. (See gtk_event_box_set_above_child().)
* Since the input-only window is not an ancestor window of any windows
* that descendent widgets of the event box create, events on these
* windows aren't propagated up by the windowing system, but only by GTK+.
* The practical effect of this is if an event isn't in the event
* mask for the descendant window (see gtk_widget_add_events()),
* it won't be received by the event box.
* </para><para>
* This problem doesn't occur for visible event boxes, because in
* that case, the event box window is actually the ancestor of the
* descendant windows, not just at the same place on the screen.
* </para></note>
* @param visible_window boolean value
*/
set_visible_window(visible_window: 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 Expander {
// Signal callback interfaces
interface Activate {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
expanded: boolean;
label: string;
label_fill: boolean;
labelFill: boolean;
label_widget: Widget;
labelWidget: Widget;
spacing: number;
use_markup: boolean;
useMarkup: boolean;
use_underline: boolean;
useUnderline: boolean;
}
}
class Expander extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Expander>;
// Properties
get expanded(): boolean;
set expanded(val: boolean);
get label(): string;
set label(val: string);
get label_fill(): boolean;
set label_fill(val: boolean);
get labelFill(): boolean;
set labelFill(val: boolean);
get label_widget(): Widget;
set label_widget(val: Widget);
get labelWidget(): Widget;
set labelWidget(val: Widget);
get spacing(): number;
set spacing(val: number);
get use_markup(): boolean;
set use_markup(val: boolean);
get useMarkup(): boolean;
set useMarkup(val: boolean);
get use_underline(): boolean;
set use_underline(val: boolean);
get useUnderline(): boolean;
set useUnderline(val: boolean);
// Fields
bin: Bin;
// Constructors
constructor(properties?: Partial<Expander.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](label: string): Expander;
static new_with_mnemonic(label?: string | null): Expander;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate', callback: (_source: this) => void): number;
connect_after(signal: 'activate', callback: (_source: this) => void): number;
emit(signal: 'activate'): void;
// Virtual methods
vfunc_activate(): void;
// Methods
/**
* Queries a #GtkExpander and returns its current state. Returns %TRUE
* if the child widget is revealed.
*
* See gtk_expander_set_expanded().
* @returns the current state of the expander.
*/
get_expanded(): boolean;
/**
* Fetches the text from a label widget including any embedded
* underlines indicating mnemonics and Pango markup, as set by
* gtk_expander_set_label(). If the label text has not been set the
* return value will be %NULL. This will be the case if you create an
* empty button with gtk_button_new() to use as a container.
*
* Note that this function behaved differently in versions prior to
* 2.14 and used to return the label text stripped of embedded
* underlines indicating mnemonics and Pango markup. This problem can
* be avoided by fetching the label text directly from the label
* widget.
* @returns The text of the label widget. This string is owned by the widget and must not be modified or freed.
*/
get_label(): string;
/**
* Returns whether the label widget will fill all available horizontal
* space allocated to `expander`.
* @returns %TRUE if the label widget will fill all available horizontal space
*/
get_label_fill(): boolean;
/**
* Retrieves the label widget for the frame. See
* gtk_expander_set_label_widget().
* @returns the label widget, or %NULL if there is none.
*/
get_label_widget(): Widget;
/**
* Gets the value set by gtk_expander_set_spacing().
* @returns spacing between the expander and child.
*/
get_spacing(): number;
/**
* Returns whether the label's text is interpreted as marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>. See gtk_expander_set_use_markup ().
* @returns %TRUE if the label's text will be parsed for markup
*/
get_use_markup(): boolean;
/**
* Returns whether an embedded underline in the expander label indicates a
* mnemonic. See gtk_expander_set_use_underline().
* @returns %TRUE if an embedded underline in the expander label indicates the mnemonic accelerator keys.
*/
get_use_underline(): boolean;
/**
* Sets the state of the expander. Set to %TRUE, if you want
* the child widget to be revealed, and %FALSE if you want the
* child widget to be hidden.
* @param expanded whether the child widget is revealed
*/
set_expanded(expanded: boolean): void;
/**
* Sets the text of the label of the expander to `label`.
*
* This will also clear any previously set labels.
* @param label a string
*/
set_label(label?: string | null): void;
/**
* Sets whether the label widget should fill all available horizontal space
* allocated to `expander`.
* @param label_fill %TRUE if the label should should fill all available horizontal space
*/
set_label_fill(label_fill: boolean): void;
/**
* Set the label widget for the expander. This is the widget
* that will appear embedded alongside the expander arrow.
* @param label_widget the new label widget
*/
set_label_widget(label_widget?: Widget | null): void;
/**
* Sets the spacing field of `expander,` which is the number of pixels to
* place between expander and the child.
* @param spacing distance between the expander and child in pixels.
*/
set_spacing(spacing: number): void;
/**
* Sets whether the text of the label contains markup in <link
* linkend="PangoMarkupFormat">Pango's text markup
* language</link>. See gtk_label_set_markup().
* @param use_markup %TRUE if the label's text should be parsed for markup
*/
set_use_markup(use_markup: boolean): void;
/**
* If true, an underline in the text of the expander label indicates
* the next character should be used for the mnemonic accelerator key.
* @param use_underline %TRUE if underlines in the text indicate mnemonics
*/
set_use_underline(use_underline: 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 FileChooserButton {
// Signal callback interfaces
interface FileSet {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends HBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
FileChooser.ConstructorProps,
Orientable.ConstructorProps {
dialog: FileChooser;
focus_on_click: boolean;
focusOnClick: boolean;
title: string;
width_chars: number;
widthChars: number;
}
}
class FileChooserButton extends HBox implements Atk.ImplementorIface, Buildable, FileChooser, Orientable {
static $gtype: GObject.GType<FileChooserButton>;
// Properties
/**
* Instance of the #GtkFileChooserDialog associated with the button.
*/
set dialog(val: FileChooser);
/**
* Whether the #GtkFileChooserButton button grabs focus when it is clicked
* with the mouse.
*/
get focus_on_click(): boolean;
set focus_on_click(val: boolean);
/**
* Whether the #GtkFileChooserButton button grabs focus when it is clicked
* with the mouse.
*/
get focusOnClick(): boolean;
set focusOnClick(val: boolean);
/**
* Title to put on the #GtkFileChooserDialog associated with the button.
*/
get title(): string;
set title(val: string);
/**
* The width of the entry and label inside the button, in characters.
*/
get width_chars(): number;
set width_chars(val: number);
/**
* The width of the entry and label inside the button, in characters.
*/
get widthChars(): number;
set widthChars(val: number);
// Constructors
constructor(properties?: Partial<FileChooserButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title: string, action: FileChooserAction): FileChooserButton;
// Conflicted with Gtk.HBox.new
static ['new'](...args: never[]): any;
static new_with_backend(title: string, action: FileChooserAction, backend: string): FileChooserButton;
static new_with_dialog(dialog: Widget): FileChooserButton;
// 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: 'file-set', callback: (_source: this) => void): number;
connect_after(signal: 'file-set', callback: (_source: this) => void): number;
emit(signal: 'file-set'): void;
// Virtual methods
vfunc_file_set(): void;
// Methods
/**
* Returns whether the button grabs focus when it is clicked with the mouse.
* See gtk_file_chooser_button_set_focus_on_click().
* @returns %TRUE if the button grabs focus when it is clicked with the mouse.
*/
get_focus_on_click(): boolean;
/**
* Retrieves the title of the browse dialog used by `button`. The returned value
* should not be modified or freed.
* @returns a pointer to the browse dialog's title.
*/
get_title(): string;
/**
* Retrieves the width in characters of the `button` widget's entry and/or label.
* @returns an integer width (in characters) that the button will use to size itself.
*/
get_width_chars(): number;
/**
* Sets whether the button will 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 button grabs focus when clicked with the mouse
*/
set_focus_on_click(focus_on_click: boolean): void;
/**
* Modifies the `title` of the browse dialog used by `button`.
* @param title the new browse dialog title.
*/
set_title(title: string): void;
/**
* Sets the width (in characters) that `button` will use to `n_chars`.
* @param n_chars the new width, in characters.
*/
set_width_chars(n_chars: number): void;
// Inherited properties
get action(): FileChooserAction;
set action(val: FileChooserAction);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get create_folders(): boolean;
set create_folders(val: boolean);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get createFolders(): boolean;
set createFolders(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get do_overwrite_confirmation(): boolean;
set do_overwrite_confirmation(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get doOverwriteConfirmation(): boolean;
set doOverwriteConfirmation(val: boolean);
get extra_widget(): Widget;
set extra_widget(val: Widget);
get extraWidget(): Widget;
set extraWidget(val: Widget);
set file_system_backend(val: string);
set fileSystemBackend(val: string);
get filter(): FileFilter;
set filter(val: FileFilter);
get local_only(): boolean;
set local_only(val: boolean);
get localOnly(): boolean;
set localOnly(val: boolean);
get preview_widget(): Widget;
set preview_widget(val: Widget);
get previewWidget(): Widget;
set previewWidget(val: Widget);
get preview_widget_active(): boolean;
set preview_widget_active(val: boolean);
get previewWidgetActive(): boolean;
set previewWidgetActive(val: boolean);
get select_multiple(): boolean;
set select_multiple(val: boolean);
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
get show_hidden(): boolean;
set show_hidden(val: boolean);
get showHidden(): boolean;
set showHidden(val: boolean);
get use_preview_label(): boolean;
set use_preview_label(val: boolean);
get usePreviewLabel(): boolean;
set usePreviewLabel(val: boolean);
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 or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
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
/**
* Adds `filter` to the list of filters that the user can select between.
* When a filter is selected, only files that are passed by that
* filter are displayed.
*
* Note that the `chooser` takes ownership of the filter, so you have to
* ref and sink it if you want to keep a reference.
* @param filter a #GtkFileFilter
*/
add_filter(filter: FileFilter): void;
/**
* Adds a folder to be displayed with the shortcut folders in a file chooser.
* Note that shortcut folders do not get saved, as they are provided by the
* application. For example, you can use this to add a
* "/usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param folder filename of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder(folder: string): boolean;
/**
* Adds a folder URI to be displayed with the shortcut folders in a file
* chooser. Note that shortcut folders do not get saved, as they are provided
* by the application. For example, you can use this to add a
* "file:///usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param uri URI of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder_uri(uri: string): boolean;
/**
* Gets the type of operation that the file chooser is performing; see
* gtk_file_chooser_set_action().
* @returns the action that the file selector is performing
*/
get_action(): FileChooserAction;
/**
* Gets whether file choser will offer to create new folders.
* See gtk_file_chooser_set_create_folders().
* @returns %TRUE if the New Folder button should be displayed.
*/
get_create_folders(): boolean;
/**
* Gets the current folder of `chooser` as a local filename.
* See gtk_file_chooser_set_current_folder().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "/home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "/home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the full path of the current folder, or %NULL if the current path cannot be represented as a local filename. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder() on a nonexistent folder.
*/
get_current_folder(): string;
/**
* Gets the current folder of `chooser` as #GFile.
* See gtk_file_chooser_get_current_folder_uri().
* @returns the #GFile for the current folder.
*/
get_current_folder_file(): Gio.File;
/**
* Gets the current folder of `chooser` as an URI.
* See gtk_file_chooser_set_current_folder_uri().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "file:///home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "file:///home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the URI for the current folder. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder_uri() on a nonexistent folder.
*/
get_current_folder_uri(): string;
/**
* Queries whether a file chooser is set to confirm for overwriting when the user
* types a file name that already exists.
* @returns %TRUE if the file chooser will present a confirmation dialog; %FALSE otherwise.
*/
get_do_overwrite_confirmation(): boolean;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_extra_widget().
* @returns the current extra widget, or %NULL
*/
get_extra_widget(): Widget;
/**
* Gets the #GFile for the currently selected file in
* the file selector. If multiple files are selected,
* one of the files will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns a selected #GFile. You own the returned file; use g_object_unref() to release it.
*/
get_file(): Gio.File;
/**
* Gets the filename for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected filename, or %NULL if no file is selected, or the selected file can't be represented with a local filename. Free with g_free().
*/
get_filename(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute paths. If files in the current
* folder cannot be represented as local filenames they will be ignored. (See
* gtk_file_chooser_get_uris())
* @returns a #GSList containing the filenames of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_filenames(): string[];
/**
* Lists all the selected files and subfolders in the current folder of `chooser`
* as #GFile. An internal function, see gtk_file_chooser_get_uris().
* @returns a #GSList containing a #GFile for each selected file and subfolder in the current folder. Free the returned list with g_slist_free(), and the files with g_object_unref().
*/
get_files(): Gio.File[];
/**
* Gets the current filter; see gtk_file_chooser_set_filter().
* @returns the current filter, or %NULL
*/
get_filter(): FileFilter;
/**
* Gets whether only local files can be selected in the
* file selector. See gtk_file_chooser_set_local_only()
* @returns %TRUE if only local files can be selected.
*/
get_local_only(): boolean;
/**
* Gets the #GFile that should be previewed in a custom preview
* Internal function, see gtk_file_chooser_get_preview_uri().
* @returns the #GFile for the file to preview, or %NULL if no file is selected. Free with g_object_unref().
*/
get_preview_file(): Gio.File;
/**
* Gets the filename that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the filename to preview, or %NULL if no file is selected, or if the selected file cannot be represented as a local filename. Free with g_free()
*/
get_preview_filename(): string;
/**
* Gets the URI that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the URI for the file to preview, or %NULL if no file is selected. Free with g_free().
*/
get_preview_uri(): string;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_preview_widget().
* @returns the current preview widget, or %NULL
*/
get_preview_widget(): Widget;
/**
* Gets whether the preview widget set by gtk_file_chooser_set_preview_widget()
* should be shown for the current filename. See
* gtk_file_chooser_set_preview_widget_active().
* @returns %TRUE if the preview widget is active for the current filename.
*/
get_preview_widget_active(): boolean;
/**
* Gets whether multiple files can be selected in the file
* selector. See gtk_file_chooser_set_select_multiple().
* @returns %TRUE if multiple files can be selected.
*/
get_select_multiple(): boolean;
/**
* Gets whether hidden files and folders are displayed in the file selector.
* See gtk_file_chooser_set_show_hidden().
* @returns %TRUE if hidden files and folders are displayed.
*/
get_show_hidden(): boolean;
/**
* Gets the URI for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected URI, or %NULL if no file is selected. If gtk_file_chooser_set_local_only() is set to %TRUE (the default) a local URI will be returned for any FUSE locations. Free with g_free()
*/
get_uri(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute URIs.
* @returns a #GSList containing the URIs of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_uris(): string[];
/**
* Gets whether a stock label should be drawn with the name of the previewed
* file. See gtk_file_chooser_set_use_preview_label().
* @returns %TRUE if the file chooser is set to display a label with the name of the previewed file, %FALSE otherwise.
*/
get_use_preview_label(): boolean;
/**
* Lists the current set of user-selectable filters; see
* gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter().
* @returns a #GSList containing the current set of user selectable filters. The contents of the list are owned by GTK+, but you must free the list itself with g_slist_free() when you are done with it.
*/
list_filters(): FileFilter[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder_uri().
* @returns A list of folder URIs, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the URIs with g_free().
*/
list_shortcut_folder_uris(): string[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder().
* @returns A list of folder filenames, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
list_shortcut_folders(): string[];
/**
* Removes `filter` from the list of filters that the user can select between.
* @param filter a #GtkFileFilter
*/
remove_filter(filter: FileFilter): void;
/**
* Removes a folder from a file chooser's list of shortcut folders.
* @param folder filename of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder()
*/
remove_shortcut_folder(folder: string): boolean;
/**
* Removes a folder URI from a file chooser's list of shortcut folders.
* @param uri URI of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder_uri()
*/
remove_shortcut_folder_uri(uri: string): boolean;
/**
* Selects all the files in the current folder of a file chooser.
*/
select_all(): void;
/**
* Selects the file referred to by `file`. An internal function. See
* _gtk_file_chooser_select_uri().
* @param file the file to select
* @returns %TRUE if both the folder could be changed and the path was selected successfully, %FALSE otherwise.
*/
select_file(file: Gio.File): boolean;
/**
* Selects a filename. If the file name isn't in the current
* folder of `chooser,` then the current folder of `chooser` will
* be changed to the folder containing `filename`.
* @param filename the filename to select
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
select_filename(filename: string): boolean;
/**
* Selects the file to by `uri`. If the URI doesn't refer to a
* file in the current folder of `chooser,` then the current folder of
* `chooser` will be changed to the folder containing `filename`.
* @param uri the URI to select
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
select_uri(uri: string): boolean;
/**
* Sets the type of operation that the chooser is performing; the
* user interface is adapted to suit the selected action. For example,
* an option to create a new folder might be shown if the action is
* %GTK_FILE_CHOOSER_ACTION_SAVE but not if the action is
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param action the action that the file selector is performing
*/
set_action(action: FileChooserAction | null): void;
/**
* Sets whether file choser will offer to create new folders.
* This is only relevant if the action is not set to be
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param create_folders %TRUE if the New Folder button should be displayed
*/
set_create_folders(create_folders: boolean): void;
/**
* Sets the current folder for `chooser` from a local filename.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param filename the full path of the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder(filename: string): boolean;
/**
* Sets the current folder for `chooser` from a #GFile.
* Internal function, see gtk_file_chooser_set_current_folder_uri().
* @param file the #GFile for the new folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_file(file: Gio.File): boolean;
/**
* Sets the current folder for `chooser` from an URI.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param uri the URI for the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_uri(uri: string): boolean;
/**
* Sets the current name in the file selector, as if entered
* by the user. Note that the name passed in here is a UTF-8
* string rather than a filename. This function is meant for
* such uses as a suggested name in a "Save As..." dialog.
*
* If you want to preselect a particular existing file, you should use
* gtk_file_chooser_set_filename() or gtk_file_chooser_set_uri() instead.
* Please see the documentation for those functions for an example of using
* gtk_file_chooser_set_current_name() as well.
* @param name the filename to use, as a UTF-8 string
*/
set_current_name(name: string): void;
/**
* Sets whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode will present
* a confirmation dialog if the user types a file name that already exists. This
* is %FALSE by default.
*
* Regardless of this setting, the `chooser` will emit the
* #GtkFileChooser::confirm-overwrite signal when appropriate.
*
* If all you need is the stock confirmation dialog, set this property to %TRUE.
* You can override the way confirmation is done by actually handling the
* #GtkFileChooser::confirm-overwrite signal; please refer to its documentation
* for the details.
* @param do_overwrite_confirmation whether to confirm overwriting in save mode
*/
set_do_overwrite_confirmation(do_overwrite_confirmation: boolean): void;
/**
* Sets an application-supplied widget to provide extra options to the user.
* @param extra_widget widget for extra options
*/
set_extra_widget(extra_widget: Widget): void;
/**
* Sets `file` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_file (chooser, existing_file);
* }
* ```
*
* @param file the #GFile to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_file(file: Gio.File): boolean;
/**
* Sets `filename` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_filename (chooser, existing_filename);
* }
* ```
*
* @param filename the filename to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_filename(filename: string): boolean;
/**
* Sets the current filter; only the files that pass the
* filter will be displayed. If the user-selectable list of filters
* is non-empty, then the filter should be one of the filters
* in that list. Setting the current filter when the list of
* filters is empty is useful if you want to restrict the displayed
* set of files without letting the user change it.
* @param filter a #GtkFileFilter
*/
set_filter(filter: FileFilter): void;
/**
* Sets whether only local files can be selected in the
* file selector. If `local_only` is %TRUE (the default),
* then the selected file are files are guaranteed to be
* accessible through the operating systems native file
* file system and therefore the application only
* needs to worry about the filename functions in
* #GtkFileChooser, like gtk_file_chooser_get_filename(),
* rather than the URI functions like
* gtk_file_chooser_get_uri(),
*
* On some systems non-native files may still be
* available using the native filesystem via a userspace
* filesystem (FUSE).
* @param local_only %TRUE if only local files can be selected
*/
set_local_only(local_only: boolean): void;
/**
* Sets an application-supplied widget to use to display a custom preview
* of the currently selected file. To implement a preview, after setting the
* preview widget, you connect to the #GtkFileChooser::update-preview
* signal, and call gtk_file_chooser_get_preview_filename() or
* gtk_file_chooser_get_preview_uri() on each change. If you can
* display a preview of the new file, update your widget and
* set the preview active using gtk_file_chooser_set_preview_widget_active().
* Otherwise, set the preview inactive.
*
* When there is no application-supplied preview widget, or the
* application-supplied preview widget is not active, the file chooser
* may display an internally generated preview of the current file or
* it may display no preview at all.
* @param preview_widget widget for displaying preview.
*/
set_preview_widget(preview_widget: Widget): void;
/**
* Sets whether the preview widget set by
* gtk_file_chooser_set_preview_widget() should be shown for the
* current filename. When `active` is set to false, the file chooser
* may display an internally generated preview of the current file
* or it may display no preview at all. See
* gtk_file_chooser_set_preview_widget() for more details.
* @param active whether to display the user-specified preview widget
*/
set_preview_widget_active(active: boolean): void;
/**
* Sets whether multiple files can be selected in the file selector. This is
* only relevant if the action is set to be %GTK_FILE_CHOOSER_ACTION_OPEN or
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
* @param select_multiple %TRUE if multiple files can be selected.
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether hidden files and folders are displayed in the file selector.
* @param show_hidden %TRUE if hidden files and folders should be displayed.
*/
set_show_hidden(show_hidden: boolean): void;
/**
* Sets the file referred to by `uri` as the current file for the file chooser,
* by changing to the URI's parent folder and actually selecting the URI in the
* list. If the `chooser` is %GTK_FILE_CHOOSER_ACTION_SAVE mode, the URI's base
* name will also appear in the dialog's file name entry.
*
* If the URI isn't in the current folder of `chooser,` then the current folder
* of `chooser` will be changed to the folder containing `uri`. This is equivalent
* to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_uri().
*
* Note that the URI must exist, or nothing will be done except for the
* directory change.
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_uri (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_uri (chooser, existing_uri);
* }
* ```
*
* @param uri the URI to set as current
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
set_uri(uri: string): boolean;
/**
* Sets whether the file chooser should display a stock label with the name of
* the file that is being previewed; the default is %TRUE. Applications that
* want to draw the whole preview area themselves should set this to %FALSE and
* display the name themselves in their preview widget.
*
* See also: gtk_file_chooser_set_preview_widget()
* @param use_label whether to display a stock label with the name of the previewed file
*/
set_use_preview_label(use_label: boolean): void;
/**
* Unselects all the files in the current folder of a file chooser.
*/
unselect_all(): void;
/**
* Unselects the file referred to by `file`. If the file is not in the current
* directory, does not exist, or is otherwise not currently selected, does nothing.
* @param file a #GFile
*/
unselect_file(file: Gio.File): void;
/**
* Unselects a currently selected filename. If the filename
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param filename the filename to unselect
*/
unselect_filename(filename: string): void;
/**
* Unselects the file referred to by `uri`. If the file
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param uri the URI to unselect
*/
unselect_uri(uri: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
/**
* 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace FileChooserDialog {
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
FileChooser.ConstructorProps {}
}
class FileChooserDialog extends Dialog implements Atk.ImplementorIface, Buildable, FileChooser {
static $gtype: GObject.GType<FileChooserDialog>;
// Constructors
constructor(properties?: Partial<FileChooserDialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Inherited properties
get action(): FileChooserAction;
set action(val: FileChooserAction);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get create_folders(): boolean;
set create_folders(val: boolean);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get createFolders(): boolean;
set createFolders(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get do_overwrite_confirmation(): boolean;
set do_overwrite_confirmation(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get doOverwriteConfirmation(): boolean;
set doOverwriteConfirmation(val: boolean);
get extra_widget(): Widget;
set extra_widget(val: Widget);
get extraWidget(): Widget;
set extraWidget(val: Widget);
set file_system_backend(val: string);
set fileSystemBackend(val: string);
get filter(): FileFilter;
set filter(val: FileFilter);
get local_only(): boolean;
set local_only(val: boolean);
get localOnly(): boolean;
set localOnly(val: boolean);
get preview_widget(): Widget;
set preview_widget(val: Widget);
get previewWidget(): Widget;
set previewWidget(val: Widget);
get preview_widget_active(): boolean;
set preview_widget_active(val: boolean);
get previewWidgetActive(): boolean;
set previewWidgetActive(val: boolean);
get select_multiple(): boolean;
set select_multiple(val: boolean);
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
get show_hidden(): boolean;
set show_hidden(val: boolean);
get showHidden(): boolean;
set showHidden(val: boolean);
get use_preview_label(): boolean;
set use_preview_label(val: boolean);
get usePreviewLabel(): boolean;
set usePreviewLabel(val: boolean);
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 or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
get has_default(): boolean;
set has_default(val: boolean);
get hasDefault(): boolean;
set hasDefault(val: boolean);
// This accessor conflicts with a property or field in a parent class or interface.
has_focus: boolean | any;
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
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.
*/
// This accessor conflicts with a property or field in a parent class or interface.
window: Gdk.Window | any;
// Inherited methods
/**
* Adds `filter` to the list of filters that the user can select between.
* When a filter is selected, only files that are passed by that
* filter are displayed.
*
* Note that the `chooser` takes ownership of the filter, so you have to
* ref and sink it if you want to keep a reference.
* @param filter a #GtkFileFilter
*/
add_filter(filter: FileFilter): void;
/**
* Adds a folder to be displayed with the shortcut folders in a file chooser.
* Note that shortcut folders do not get saved, as they are provided by the
* application. For example, you can use this to add a
* "/usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param folder filename of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder(folder: string): boolean;
/**
* Adds a folder URI to be displayed with the shortcut folders in a file
* chooser. Note that shortcut folders do not get saved, as they are provided
* by the application. For example, you can use this to add a
* "file:///usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param uri URI of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder_uri(uri: string): boolean;
/**
* Gets the type of operation that the file chooser is performing; see
* gtk_file_chooser_set_action().
* @returns the action that the file selector is performing
*/
get_action(): FileChooserAction;
/**
* Gets whether file choser will offer to create new folders.
* See gtk_file_chooser_set_create_folders().
* @returns %TRUE if the New Folder button should be displayed.
*/
get_create_folders(): boolean;
/**
* Gets the current folder of `chooser` as a local filename.
* See gtk_file_chooser_set_current_folder().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "/home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "/home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the full path of the current folder, or %NULL if the current path cannot be represented as a local filename. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder() on a nonexistent folder.
*/
get_current_folder(): string;
/**
* Gets the current folder of `chooser` as #GFile.
* See gtk_file_chooser_get_current_folder_uri().
* @returns the #GFile for the current folder.
*/
get_current_folder_file(): Gio.File;
/**
* Gets the current folder of `chooser` as an URI.
* See gtk_file_chooser_set_current_folder_uri().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "file:///home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "file:///home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the URI for the current folder. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder_uri() on a nonexistent folder.
*/
get_current_folder_uri(): string;
/**
* Queries whether a file chooser is set to confirm for overwriting when the user
* types a file name that already exists.
* @returns %TRUE if the file chooser will present a confirmation dialog; %FALSE otherwise.
*/
get_do_overwrite_confirmation(): boolean;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_extra_widget().
* @returns the current extra widget, or %NULL
*/
get_extra_widget(): Widget;
/**
* Gets the #GFile for the currently selected file in
* the file selector. If multiple files are selected,
* one of the files will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns a selected #GFile. You own the returned file; use g_object_unref() to release it.
*/
get_file(): Gio.File;
/**
* Gets the filename for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected filename, or %NULL if no file is selected, or the selected file can't be represented with a local filename. Free with g_free().
*/
get_filename(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute paths. If files in the current
* folder cannot be represented as local filenames they will be ignored. (See
* gtk_file_chooser_get_uris())
* @returns a #GSList containing the filenames of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_filenames(): string[];
/**
* Lists all the selected files and subfolders in the current folder of `chooser`
* as #GFile. An internal function, see gtk_file_chooser_get_uris().
* @returns a #GSList containing a #GFile for each selected file and subfolder in the current folder. Free the returned list with g_slist_free(), and the files with g_object_unref().
*/
get_files(): Gio.File[];
/**
* Gets the current filter; see gtk_file_chooser_set_filter().
* @returns the current filter, or %NULL
*/
get_filter(): FileFilter;
/**
* Gets whether only local files can be selected in the
* file selector. See gtk_file_chooser_set_local_only()
* @returns %TRUE if only local files can be selected.
*/
get_local_only(): boolean;
/**
* Gets the #GFile that should be previewed in a custom preview
* Internal function, see gtk_file_chooser_get_preview_uri().
* @returns the #GFile for the file to preview, or %NULL if no file is selected. Free with g_object_unref().
*/
get_preview_file(): Gio.File;
/**
* Gets the filename that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the filename to preview, or %NULL if no file is selected, or if the selected file cannot be represented as a local filename. Free with g_free()
*/
get_preview_filename(): string;
/**
* Gets the URI that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the URI for the file to preview, or %NULL if no file is selected. Free with g_free().
*/
get_preview_uri(): string;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_preview_widget().
* @returns the current preview widget, or %NULL
*/
get_preview_widget(): Widget;
/**
* Gets whether the preview widget set by gtk_file_chooser_set_preview_widget()
* should be shown for the current filename. See
* gtk_file_chooser_set_preview_widget_active().
* @returns %TRUE if the preview widget is active for the current filename.
*/
get_preview_widget_active(): boolean;
/**
* Gets whether multiple files can be selected in the file
* selector. See gtk_file_chooser_set_select_multiple().
* @returns %TRUE if multiple files can be selected.
*/
get_select_multiple(): boolean;
/**
* Gets whether hidden files and folders are displayed in the file selector.
* See gtk_file_chooser_set_show_hidden().
* @returns %TRUE if hidden files and folders are displayed.
*/
get_show_hidden(): boolean;
/**
* Gets the URI for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected URI, or %NULL if no file is selected. If gtk_file_chooser_set_local_only() is set to %TRUE (the default) a local URI will be returned for any FUSE locations. Free with g_free()
*/
get_uri(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute URIs.
* @returns a #GSList containing the URIs of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_uris(): string[];
/**
* Gets whether a stock label should be drawn with the name of the previewed
* file. See gtk_file_chooser_set_use_preview_label().
* @returns %TRUE if the file chooser is set to display a label with the name of the previewed file, %FALSE otherwise.
*/
get_use_preview_label(): boolean;
/**
* Lists the current set of user-selectable filters; see
* gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter().
* @returns a #GSList containing the current set of user selectable filters. The contents of the list are owned by GTK+, but you must free the list itself with g_slist_free() when you are done with it.
*/
list_filters(): FileFilter[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder_uri().
* @returns A list of folder URIs, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the URIs with g_free().
*/
list_shortcut_folder_uris(): string[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder().
* @returns A list of folder filenames, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
list_shortcut_folders(): string[];
/**
* Removes `filter` from the list of filters that the user can select between.
* @param filter a #GtkFileFilter
*/
remove_filter(filter: FileFilter): void;
/**
* Removes a folder from a file chooser's list of shortcut folders.
* @param folder filename of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder()
*/
remove_shortcut_folder(folder: string): boolean;
/**
* Removes a folder URI from a file chooser's list of shortcut folders.
* @param uri URI of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder_uri()
*/
remove_shortcut_folder_uri(uri: string): boolean;
/**
* Selects all the files in the current folder of a file chooser.
*/
select_all(): void;
/**
* Selects the file referred to by `file`. An internal function. See
* _gtk_file_chooser_select_uri().
* @param file the file to select
* @returns %TRUE if both the folder could be changed and the path was selected successfully, %FALSE otherwise.
*/
select_file(file: Gio.File): boolean;
/**
* Selects a filename. If the file name isn't in the current
* folder of `chooser,` then the current folder of `chooser` will
* be changed to the folder containing `filename`.
* @param filename the filename to select
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
select_filename(filename: string): boolean;
/**
* Selects the file to by `uri`. If the URI doesn't refer to a
* file in the current folder of `chooser,` then the current folder of
* `chooser` will be changed to the folder containing `filename`.
* @param uri the URI to select
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
select_uri(uri: string): boolean;
/**
* Sets the type of operation that the chooser is performing; the
* user interface is adapted to suit the selected action. For example,
* an option to create a new folder might be shown if the action is
* %GTK_FILE_CHOOSER_ACTION_SAVE but not if the action is
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param action the action that the file selector is performing
*/
set_action(action: FileChooserAction | null): void;
/**
* Sets whether file choser will offer to create new folders.
* This is only relevant if the action is not set to be
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param create_folders %TRUE if the New Folder button should be displayed
*/
set_create_folders(create_folders: boolean): void;
/**
* Sets the current folder for `chooser` from a local filename.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param filename the full path of the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder(filename: string): boolean;
/**
* Sets the current folder for `chooser` from a #GFile.
* Internal function, see gtk_file_chooser_set_current_folder_uri().
* @param file the #GFile for the new folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_file(file: Gio.File): boolean;
/**
* Sets the current folder for `chooser` from an URI.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param uri the URI for the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_uri(uri: string): boolean;
/**
* Sets the current name in the file selector, as if entered
* by the user. Note that the name passed in here is a UTF-8
* string rather than a filename. This function is meant for
* such uses as a suggested name in a "Save As..." dialog.
*
* If you want to preselect a particular existing file, you should use
* gtk_file_chooser_set_filename() or gtk_file_chooser_set_uri() instead.
* Please see the documentation for those functions for an example of using
* gtk_file_chooser_set_current_name() as well.
* @param name the filename to use, as a UTF-8 string
*/
set_current_name(name: string): void;
/**
* Sets whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode will present
* a confirmation dialog if the user types a file name that already exists. This
* is %FALSE by default.
*
* Regardless of this setting, the `chooser` will emit the
* #GtkFileChooser::confirm-overwrite signal when appropriate.
*
* If all you need is the stock confirmation dialog, set this property to %TRUE.
* You can override the way confirmation is done by actually handling the
* #GtkFileChooser::confirm-overwrite signal; please refer to its documentation
* for the details.
* @param do_overwrite_confirmation whether to confirm overwriting in save mode
*/
set_do_overwrite_confirmation(do_overwrite_confirmation: boolean): void;
/**
* Sets an application-supplied widget to provide extra options to the user.
* @param extra_widget widget for extra options
*/
set_extra_widget(extra_widget: Widget): void;
/**
* Sets `file` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_file (chooser, existing_file);
* }
* ```
*
* @param file the #GFile to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_file(file: Gio.File): boolean;
/**
* Sets `filename` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_filename (chooser, existing_filename);
* }
* ```
*
* @param filename the filename to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_filename(filename: string): boolean;
/**
* Sets the current filter; only the files that pass the
* filter will be displayed. If the user-selectable list of filters
* is non-empty, then the filter should be one of the filters
* in that list. Setting the current filter when the list of
* filters is empty is useful if you want to restrict the displayed
* set of files without letting the user change it.
* @param filter a #GtkFileFilter
*/
set_filter(filter: FileFilter): void;
/**
* Sets whether only local files can be selected in the
* file selector. If `local_only` is %TRUE (the default),
* then the selected file are files are guaranteed to be
* accessible through the operating systems native file
* file system and therefore the application only
* needs to worry about the filename functions in
* #GtkFileChooser, like gtk_file_chooser_get_filename(),
* rather than the URI functions like
* gtk_file_chooser_get_uri(),
*
* On some systems non-native files may still be
* available using the native filesystem via a userspace
* filesystem (FUSE).
* @param local_only %TRUE if only local files can be selected
*/
set_local_only(local_only: boolean): void;
/**
* Sets an application-supplied widget to use to display a custom preview
* of the currently selected file. To implement a preview, after setting the
* preview widget, you connect to the #GtkFileChooser::update-preview
* signal, and call gtk_file_chooser_get_preview_filename() or
* gtk_file_chooser_get_preview_uri() on each change. If you can
* display a preview of the new file, update your widget and
* set the preview active using gtk_file_chooser_set_preview_widget_active().
* Otherwise, set the preview inactive.
*
* When there is no application-supplied preview widget, or the
* application-supplied preview widget is not active, the file chooser
* may display an internally generated preview of the current file or
* it may display no preview at all.
* @param preview_widget widget for displaying preview.
*/
set_preview_widget(preview_widget: Widget): void;
/**
* Sets whether the preview widget set by
* gtk_file_chooser_set_preview_widget() should be shown for the
* current filename. When `active` is set to false, the file chooser
* may display an internally generated preview of the current file
* or it may display no preview at all. See
* gtk_file_chooser_set_preview_widget() for more details.
* @param active whether to display the user-specified preview widget
*/
set_preview_widget_active(active: boolean): void;
/**
* Sets whether multiple files can be selected in the file selector. This is
* only relevant if the action is set to be %GTK_FILE_CHOOSER_ACTION_OPEN or
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
* @param select_multiple %TRUE if multiple files can be selected.
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether hidden files and folders are displayed in the file selector.
* @param show_hidden %TRUE if hidden files and folders should be displayed.
*/
set_show_hidden(show_hidden: boolean): void;
/**
* Sets the file referred to by `uri` as the current file for the file chooser,
* by changing to the URI's parent folder and actually selecting the URI in the
* list. If the `chooser` is %GTK_FILE_CHOOSER_ACTION_SAVE mode, the URI's base
* name will also appear in the dialog's file name entry.
*
* If the URI isn't in the current folder of `chooser,` then the current folder
* of `chooser` will be changed to the folder containing `uri`. This is equivalent
* to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_uri().
*
* Note that the URI must exist, or nothing will be done except for the
* directory change.
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_uri (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_uri (chooser, existing_uri);
* }
* ```
*
* @param uri the URI to set as current
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
set_uri(uri: string): boolean;
/**
* Sets whether the file chooser should display a stock label with the name of
* the file that is being previewed; the default is %TRUE. Applications that
* want to draw the whole preview area themselves should set this to %FALSE and
* display the name themselves in their preview widget.
*
* See also: gtk_file_chooser_set_preview_widget()
* @param use_label whether to display a stock label with the name of the previewed file
*/
set_use_preview_label(use_label: boolean): void;
/**
* Unselects all the files in the current folder of a file chooser.
*/
unselect_all(): void;
/**
* Unselects the file referred to by `file`. If the file is not in the current
* directory, does not exist, or is otherwise not currently selected, does nothing.
* @param file a #GFile
*/
unselect_file(file: Gio.File): void;
/**
* Unselects a currently selected filename. If the filename
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param filename the filename to unselect
*/
unselect_filename(filename: string): void;
/**
* Unselects the file referred to by `uri`. If the file
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param uri the URI to unselect
*/
unselect_uri(uri: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
/**
* 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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;
// Conflicted with Gtk.Window.mnemonic_activate
mnemonic_activate(...args: never[]): any;
/**
* 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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace FileChooserWidget {
// Constructor properties interface
interface ConstructorProps
extends VBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
FileChooser.ConstructorProps,
Orientable.ConstructorProps {}
}
class FileChooserWidget extends VBox implements Atk.ImplementorIface, Buildable, FileChooser, Orientable {
static $gtype: GObject.GType<FileChooserWidget>;
// Constructors
constructor(properties?: Partial<FileChooserWidget.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](action: FileChooserAction): FileChooserWidget;
// Conflicted with Gtk.VBox.new
static ['new'](...args: never[]): any;
static new_with_backend(action: FileChooserAction, backend: string): FileChooserWidget;
// Inherited properties
get action(): FileChooserAction;
set action(val: FileChooserAction);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get create_folders(): boolean;
set create_folders(val: boolean);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get createFolders(): boolean;
set createFolders(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get do_overwrite_confirmation(): boolean;
set do_overwrite_confirmation(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get doOverwriteConfirmation(): boolean;
set doOverwriteConfirmation(val: boolean);
get extra_widget(): Widget;
set extra_widget(val: Widget);
get extraWidget(): Widget;
set extraWidget(val: Widget);
set file_system_backend(val: string);
set fileSystemBackend(val: string);
get filter(): FileFilter;
set filter(val: FileFilter);
get local_only(): boolean;
set local_only(val: boolean);
get localOnly(): boolean;
set localOnly(val: boolean);
get preview_widget(): Widget;
set preview_widget(val: Widget);
get previewWidget(): Widget;
set previewWidget(val: Widget);
get preview_widget_active(): boolean;
set preview_widget_active(val: boolean);
get previewWidgetActive(): boolean;
set previewWidgetActive(val: boolean);
get select_multiple(): boolean;
set select_multiple(val: boolean);
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
get show_hidden(): boolean;
set show_hidden(val: boolean);
get showHidden(): boolean;
set showHidden(val: boolean);
get use_preview_label(): boolean;
set use_preview_label(val: boolean);
get usePreviewLabel(): boolean;
set usePreviewLabel(val: boolean);
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 or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
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
/**
* Adds `filter` to the list of filters that the user can select between.
* When a filter is selected, only files that are passed by that
* filter are displayed.
*
* Note that the `chooser` takes ownership of the filter, so you have to
* ref and sink it if you want to keep a reference.
* @param filter a #GtkFileFilter
*/
add_filter(filter: FileFilter): void;
/**
* Adds a folder to be displayed with the shortcut folders in a file chooser.
* Note that shortcut folders do not get saved, as they are provided by the
* application. For example, you can use this to add a
* "/usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param folder filename of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder(folder: string): boolean;
/**
* Adds a folder URI to be displayed with the shortcut folders in a file
* chooser. Note that shortcut folders do not get saved, as they are provided
* by the application. For example, you can use this to add a
* "file:///usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param uri URI of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder_uri(uri: string): boolean;
/**
* Gets the type of operation that the file chooser is performing; see
* gtk_file_chooser_set_action().
* @returns the action that the file selector is performing
*/
get_action(): FileChooserAction;
/**
* Gets whether file choser will offer to create new folders.
* See gtk_file_chooser_set_create_folders().
* @returns %TRUE if the New Folder button should be displayed.
*/
get_create_folders(): boolean;
/**
* Gets the current folder of `chooser` as a local filename.
* See gtk_file_chooser_set_current_folder().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "/home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "/home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the full path of the current folder, or %NULL if the current path cannot be represented as a local filename. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder() on a nonexistent folder.
*/
get_current_folder(): string;
/**
* Gets the current folder of `chooser` as #GFile.
* See gtk_file_chooser_get_current_folder_uri().
* @returns the #GFile for the current folder.
*/
get_current_folder_file(): Gio.File;
/**
* Gets the current folder of `chooser` as an URI.
* See gtk_file_chooser_set_current_folder_uri().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "file:///home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "file:///home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the URI for the current folder. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder_uri() on a nonexistent folder.
*/
get_current_folder_uri(): string;
/**
* Queries whether a file chooser is set to confirm for overwriting when the user
* types a file name that already exists.
* @returns %TRUE if the file chooser will present a confirmation dialog; %FALSE otherwise.
*/
get_do_overwrite_confirmation(): boolean;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_extra_widget().
* @returns the current extra widget, or %NULL
*/
get_extra_widget(): Widget;
/**
* Gets the #GFile for the currently selected file in
* the file selector. If multiple files are selected,
* one of the files will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns a selected #GFile. You own the returned file; use g_object_unref() to release it.
*/
get_file(): Gio.File;
/**
* Gets the filename for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected filename, or %NULL if no file is selected, or the selected file can't be represented with a local filename. Free with g_free().
*/
get_filename(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute paths. If files in the current
* folder cannot be represented as local filenames they will be ignored. (See
* gtk_file_chooser_get_uris())
* @returns a #GSList containing the filenames of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_filenames(): string[];
/**
* Lists all the selected files and subfolders in the current folder of `chooser`
* as #GFile. An internal function, see gtk_file_chooser_get_uris().
* @returns a #GSList containing a #GFile for each selected file and subfolder in the current folder. Free the returned list with g_slist_free(), and the files with g_object_unref().
*/
get_files(): Gio.File[];
/**
* Gets the current filter; see gtk_file_chooser_set_filter().
* @returns the current filter, or %NULL
*/
get_filter(): FileFilter;
/**
* Gets whether only local files can be selected in the
* file selector. See gtk_file_chooser_set_local_only()
* @returns %TRUE if only local files can be selected.
*/
get_local_only(): boolean;
/**
* Gets the #GFile that should be previewed in a custom preview
* Internal function, see gtk_file_chooser_get_preview_uri().
* @returns the #GFile for the file to preview, or %NULL if no file is selected. Free with g_object_unref().
*/
get_preview_file(): Gio.File;
/**
* Gets the filename that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the filename to preview, or %NULL if no file is selected, or if the selected file cannot be represented as a local filename. Free with g_free()
*/
get_preview_filename(): string;
/**
* Gets the URI that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the URI for the file to preview, or %NULL if no file is selected. Free with g_free().
*/
get_preview_uri(): string;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_preview_widget().
* @returns the current preview widget, or %NULL
*/
get_preview_widget(): Widget;
/**
* Gets whether the preview widget set by gtk_file_chooser_set_preview_widget()
* should be shown for the current filename. See
* gtk_file_chooser_set_preview_widget_active().
* @returns %TRUE if the preview widget is active for the current filename.
*/
get_preview_widget_active(): boolean;
/**
* Gets whether multiple files can be selected in the file
* selector. See gtk_file_chooser_set_select_multiple().
* @returns %TRUE if multiple files can be selected.
*/
get_select_multiple(): boolean;
/**
* Gets whether hidden files and folders are displayed in the file selector.
* See gtk_file_chooser_set_show_hidden().
* @returns %TRUE if hidden files and folders are displayed.
*/
get_show_hidden(): boolean;
/**
* Gets the URI for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected URI, or %NULL if no file is selected. If gtk_file_chooser_set_local_only() is set to %TRUE (the default) a local URI will be returned for any FUSE locations. Free with g_free()
*/
get_uri(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute URIs.
* @returns a #GSList containing the URIs of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_uris(): string[];
/**
* Gets whether a stock label should be drawn with the name of the previewed
* file. See gtk_file_chooser_set_use_preview_label().
* @returns %TRUE if the file chooser is set to display a label with the name of the previewed file, %FALSE otherwise.
*/
get_use_preview_label(): boolean;
/**
* Lists the current set of user-selectable filters; see
* gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter().
* @returns a #GSList containing the current set of user selectable filters. The contents of the list are owned by GTK+, but you must free the list itself with g_slist_free() when you are done with it.
*/
list_filters(): FileFilter[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder_uri().
* @returns A list of folder URIs, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the URIs with g_free().
*/
list_shortcut_folder_uris(): string[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder().
* @returns A list of folder filenames, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
list_shortcut_folders(): string[];
/**
* Removes `filter` from the list of filters that the user can select between.
* @param filter a #GtkFileFilter
*/
remove_filter(filter: FileFilter): void;
/**
* Removes a folder from a file chooser's list of shortcut folders.
* @param folder filename of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder()
*/
remove_shortcut_folder(folder: string): boolean;
/**
* Removes a folder URI from a file chooser's list of shortcut folders.
* @param uri URI of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder_uri()
*/
remove_shortcut_folder_uri(uri: string): boolean;
/**
* Selects all the files in the current folder of a file chooser.
*/
select_all(): void;
/**
* Selects the file referred to by `file`. An internal function. See
* _gtk_file_chooser_select_uri().
* @param file the file to select
* @returns %TRUE if both the folder could be changed and the path was selected successfully, %FALSE otherwise.
*/
select_file(file: Gio.File): boolean;
/**
* Selects a filename. If the file name isn't in the current
* folder of `chooser,` then the current folder of `chooser` will
* be changed to the folder containing `filename`.
* @param filename the filename to select
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
select_filename(filename: string): boolean;
/**
* Selects the file to by `uri`. If the URI doesn't refer to a
* file in the current folder of `chooser,` then the current folder of
* `chooser` will be changed to the folder containing `filename`.
* @param uri the URI to select
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
select_uri(uri: string): boolean;
/**
* Sets the type of operation that the chooser is performing; the
* user interface is adapted to suit the selected action. For example,
* an option to create a new folder might be shown if the action is
* %GTK_FILE_CHOOSER_ACTION_SAVE but not if the action is
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param action the action that the file selector is performing
*/
set_action(action: FileChooserAction | null): void;
/**
* Sets whether file choser will offer to create new folders.
* This is only relevant if the action is not set to be
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param create_folders %TRUE if the New Folder button should be displayed
*/
set_create_folders(create_folders: boolean): void;
/**
* Sets the current folder for `chooser` from a local filename.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param filename the full path of the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder(filename: string): boolean;
/**
* Sets the current folder for `chooser` from a #GFile.
* Internal function, see gtk_file_chooser_set_current_folder_uri().
* @param file the #GFile for the new folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_file(file: Gio.File): boolean;
/**
* Sets the current folder for `chooser` from an URI.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param uri the URI for the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_uri(uri: string): boolean;
/**
* Sets the current name in the file selector, as if entered
* by the user. Note that the name passed in here is a UTF-8
* string rather than a filename. This function is meant for
* such uses as a suggested name in a "Save As..." dialog.
*
* If you want to preselect a particular existing file, you should use
* gtk_file_chooser_set_filename() or gtk_file_chooser_set_uri() instead.
* Please see the documentation for those functions for an example of using
* gtk_file_chooser_set_current_name() as well.
* @param name the filename to use, as a UTF-8 string
*/
set_current_name(name: string): void;
/**
* Sets whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode will present
* a confirmation dialog if the user types a file name that already exists. This
* is %FALSE by default.
*
* Regardless of this setting, the `chooser` will emit the
* #GtkFileChooser::confirm-overwrite signal when appropriate.
*
* If all you need is the stock confirmation dialog, set this property to %TRUE.
* You can override the way confirmation is done by actually handling the
* #GtkFileChooser::confirm-overwrite signal; please refer to its documentation
* for the details.
* @param do_overwrite_confirmation whether to confirm overwriting in save mode
*/
set_do_overwrite_confirmation(do_overwrite_confirmation: boolean): void;
/**
* Sets an application-supplied widget to provide extra options to the user.
* @param extra_widget widget for extra options
*/
set_extra_widget(extra_widget: Widget): void;
/**
* Sets `file` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_file (chooser, existing_file);
* }
* ```
*
* @param file the #GFile to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_file(file: Gio.File): boolean;
/**
* Sets `filename` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_filename (chooser, existing_filename);
* }
* ```
*
* @param filename the filename to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_filename(filename: string): boolean;
/**
* Sets the current filter; only the files that pass the
* filter will be displayed. If the user-selectable list of filters
* is non-empty, then the filter should be one of the filters
* in that list. Setting the current filter when the list of
* filters is empty is useful if you want to restrict the displayed
* set of files without letting the user change it.
* @param filter a #GtkFileFilter
*/
set_filter(filter: FileFilter): void;
/**
* Sets whether only local files can be selected in the
* file selector. If `local_only` is %TRUE (the default),
* then the selected file are files are guaranteed to be
* accessible through the operating systems native file
* file system and therefore the application only
* needs to worry about the filename functions in
* #GtkFileChooser, like gtk_file_chooser_get_filename(),
* rather than the URI functions like
* gtk_file_chooser_get_uri(),
*
* On some systems non-native files may still be
* available using the native filesystem via a userspace
* filesystem (FUSE).
* @param local_only %TRUE if only local files can be selected
*/
set_local_only(local_only: boolean): void;
/**
* Sets an application-supplied widget to use to display a custom preview
* of the currently selected file. To implement a preview, after setting the
* preview widget, you connect to the #GtkFileChooser::update-preview
* signal, and call gtk_file_chooser_get_preview_filename() or
* gtk_file_chooser_get_preview_uri() on each change. If you can
* display a preview of the new file, update your widget and
* set the preview active using gtk_file_chooser_set_preview_widget_active().
* Otherwise, set the preview inactive.
*
* When there is no application-supplied preview widget, or the
* application-supplied preview widget is not active, the file chooser
* may display an internally generated preview of the current file or
* it may display no preview at all.
* @param preview_widget widget for displaying preview.
*/
set_preview_widget(preview_widget: Widget): void;
/**
* Sets whether the preview widget set by
* gtk_file_chooser_set_preview_widget() should be shown for the
* current filename. When `active` is set to false, the file chooser
* may display an internally generated preview of the current file
* or it may display no preview at all. See
* gtk_file_chooser_set_preview_widget() for more details.
* @param active whether to display the user-specified preview widget
*/
set_preview_widget_active(active: boolean): void;
/**
* Sets whether multiple files can be selected in the file selector. This is
* only relevant if the action is set to be %GTK_FILE_CHOOSER_ACTION_OPEN or
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
* @param select_multiple %TRUE if multiple files can be selected.
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether hidden files and folders are displayed in the file selector.
* @param show_hidden %TRUE if hidden files and folders should be displayed.
*/
set_show_hidden(show_hidden: boolean): void;
/**
* Sets the file referred to by `uri` as the current file for the file chooser,
* by changing to the URI's parent folder and actually selecting the URI in the
* list. If the `chooser` is %GTK_FILE_CHOOSER_ACTION_SAVE mode, the URI's base
* name will also appear in the dialog's file name entry.
*
* If the URI isn't in the current folder of `chooser,` then the current folder
* of `chooser` will be changed to the folder containing `uri`. This is equivalent
* to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_uri().
*
* Note that the URI must exist, or nothing will be done except for the
* directory change.
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_uri (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_uri (chooser, existing_uri);
* }
* ```
*
* @param uri the URI to set as current
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
set_uri(uri: string): boolean;
/**
* Sets whether the file chooser should display a stock label with the name of
* the file that is being previewed; the default is %TRUE. Applications that
* want to draw the whole preview area themselves should set this to %FALSE and
* display the name themselves in their preview widget.
*
* See also: gtk_file_chooser_set_preview_widget()
* @param use_label whether to display a stock label with the name of the previewed file
*/
set_use_preview_label(use_label: boolean): void;
/**
* Unselects all the files in the current folder of a file chooser.
*/
unselect_all(): void;
/**
* Unselects the file referred to by `file`. If the file is not in the current
* directory, does not exist, or is otherwise not currently selected, does nothing.
* @param file a #GFile
*/
unselect_file(file: Gio.File): void;
/**
* Unselects a currently selected filename. If the filename
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param filename the filename to unselect
*/
unselect_filename(filename: string): void;
/**
* Unselects the file referred to by `uri`. If the file
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param uri the URI to unselect
*/
unselect_uri(uri: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
/**
* 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace FileFilter {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
class FileFilter extends Object {
static $gtype: GObject.GType<FileFilter>;
// Constructors
constructor(properties?: Partial<FileFilter.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): FileFilter;
// Methods
/**
* Adds rule to a filter that allows files based on a custom callback
* function. The bitfield `needed` which is passed in provides information
* about what sorts of information that the filter function needs;
* this allows GTK+ to avoid retrieving expensive information when
* it isn't needed by the filter.
* @param needed bitfield of flags indicating the information that the custom filter function needs.
* @param func callback function; if the function returns %TRUE, then the file will be displayed.
*/
add_custom(needed: FileFilterFlags | null, func: FileFilterFunc): void;
/**
* Adds a rule allowing a given mime type to `filter`.
* @param mime_type name of a MIME type
*/
add_mime_type(mime_type: string): void;
/**
* Adds a rule allowing a shell style glob to a filter.
* @param pattern a shell style glob
*/
add_pattern(pattern: string): void;
/**
* Adds a rule allowing image files in the formats supported
* by GdkPixbuf.
*/
add_pixbuf_formats(): void;
/**
* Tests whether a file should be displayed according to `filter`.
* The #GtkFileFilterInfo structure `filter_info` should include
* the fields returned from gtk_file_filter_get_needed().
*
* This function will not typically be used by applications; it
* is intended principally for use in the implementation of
* #GtkFileChooser.
* @param filter_info a #GtkFileFilterInfo structure containing information about a file.
* @returns %TRUE if the file should be displayed
*/
filter(filter_info: FileFilterInfo): boolean;
/**
* Gets the human-readable name for the filter. See gtk_file_filter_set_name().
* @returns The human-readable name of the filter, or %NULL. This value is owned by GTK+ and must not be modified or freed.
*/
get_name(): string;
/**
* Gets the fields that need to be filled in for the structure
* passed to gtk_file_filter_filter()
*
* This function will not typically be used by applications; it
* is intended principally for use in the implementation of
* #GtkFileChooser.
* @returns bitfield of flags indicating needed fields when calling gtk_file_filter_filter()
*/
get_needed(): FileFilterFlags;
/**
* Sets the human-readable name of the filter; this is the string
* that will be displayed in the file selector user interface if
* there is a selectable list of filters.
* @param name the human-readable-name for the filter, or %NULL to remove any existing name.
*/
set_name(name?: string | null): void;
}
namespace FileSelection {
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
filename: string;
select_multiple: boolean;
selectMultiple: boolean;
show_fileops: boolean;
showFileops: boolean;
}
}
class FileSelection extends Dialog implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<FileSelection>;
// Properties
get filename(): string;
set filename(val: string);
get select_multiple(): boolean;
set select_multiple(val: boolean);
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
get show_fileops(): boolean;
set show_fileops(val: boolean);
get showFileops(): boolean;
set showFileops(val: boolean);
// Fields
dir_list: Widget;
file_list: Widget;
selection_entry: Widget;
selection_text: Widget;
main_vbox: Widget;
ok_button: Widget;
cancel_button: Widget;
help_button: Widget;
history_pulldown: Widget;
history_menu: Widget;
history_list: any[];
fileop_dialog: Widget;
fileop_entry: Widget;
fileop_file: string;
cmpl_state: any;
fileop_c_dir: Widget;
fileop_del_file: Widget;
fileop_ren_file: Widget;
button_area: Widget;
action_area: Widget;
// Constructors
constructor(properties?: Partial<FileSelection.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title: string): FileSelection;
// Conflicted with Gtk.Dialog.new
static ['new'](...args: never[]): any;
// Methods
complete(pattern: string): void;
/**
* This function returns the selected filename in the GLib file name
* encoding. To convert to UTF-8, call g_filename_to_utf8(). The
* returned string points to a statically allocated buffer and should
* be copied if you plan to keep it around.
*
* If no file is selected then the selected directory path is returned.
* @returns currently-selected filename in the on-disk encoding.
*/
get_filename(): string;
/**
* Determines whether or not the user is allowed to select multiple files in
* the file list. See gtk_file_selection_set_select_multiple().
* @returns %TRUE if the user is allowed to select multiple files in the file list
*/
get_select_multiple(): boolean;
hide_fileop_buttons(): void;
/**
* Sets a default path for the file requestor. If `filename` includes a
* directory path, then the requestor will open with that path as its
* current working directory.
*
* This has the consequence that in order to open the requestor with a
* working directory and an empty filename, `filename` must have a trailing
* directory separator.
*
* The encoding of `filename` is preferred GLib file name encoding, which
* may not be UTF-8. See g_filename_from_utf8().
* @param filename a string to set as the default file name.
*/
set_filename(filename: string): void;
/**
* Sets whether the user is allowed to select multiple files in the file list.
* Use gtk_file_selection_get_selections () to get the list of selected files.
* @param select_multiple whether or not the user is allowed to select multiple files in the file list.
*/
set_select_multiple(select_multiple: boolean): void;
show_fileop_buttons(): 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 Fixed {
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
class Fixed extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Fixed>;
// Fields
container: Container;
children: any[];
// Constructors
constructor(properties?: Partial<Fixed.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Fixed;
// Methods
/**
* Gets whether the #GtkFixed has its own #GdkWindow.
* See gtk_fixed_set_has_window().
* @returns %TRUE if @fixed has its own window.
*/
get_has_window(): boolean;
move(widget: Widget, x: number, y: number): void;
put(widget: Widget, x: number, y: number): void;
/**
* Sets whether a #GtkFixed widget is created with a separate
* #GdkWindow for `widget->`window or not. (By default, it will be
* created with no separate #GdkWindow). This function must be called
* while the #GtkFixed is not realized, for instance, immediately after the
* window is created.
*
* This function was added to provide an easy migration path for
* older applications which may expect #GtkFixed to have a separate window.
* @param has_window %TRUE if a separate window should be created
*/
set_has_window(has_window: 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 FontButton {
// Signal callback interfaces
interface FontSet {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
font_name: string;
fontName: string;
show_size: boolean;
showSize: boolean;
show_style: boolean;
showStyle: boolean;
title: string;
use_font: boolean;
useFont: boolean;
use_size: boolean;
useSize: boolean;
}
}
class FontButton extends Button implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<FontButton>;
// Properties
/**
* The name of the currently selected font.
*/
get font_name(): string;
set font_name(val: string);
/**
* The name of the currently selected font.
*/
get fontName(): string;
set fontName(val: string);
/**
* If this property is set to %TRUE, the selected font size will be shown
* in the label. For a more WYSIWYG way to show the selected size, see the
* ::use-size property.
*/
get show_size(): boolean;
set show_size(val: boolean);
/**
* If this property is set to %TRUE, the selected font size will be shown
* in the label. For a more WYSIWYG way to show the selected size, see the
* ::use-size property.
*/
get showSize(): boolean;
set showSize(val: boolean);
/**
* If this property is set to %TRUE, the name of the selected font style
* will be shown in the label. For a more WYSIWYG way to show the selected
* style, see the ::use-font property.
*/
get show_style(): boolean;
set show_style(val: boolean);
/**
* If this property is set to %TRUE, the name of the selected font style
* will be shown in the label. For a more WYSIWYG way to show the selected
* style, see the ::use-font property.
*/
get showStyle(): boolean;
set showStyle(val: boolean);
/**
* The title of the font selection dialog.
*/
get title(): string;
set title(val: string);
/**
* If this property is set to %TRUE, the label will be drawn
* in the selected font.
*/
get use_font(): boolean;
set use_font(val: boolean);
/**
* If this property is set to %TRUE, the label will be drawn
* in the selected font.
*/
get useFont(): boolean;
set useFont(val: boolean);
/**
* If this property is set to %TRUE, the label will be drawn
* with the selected font size.
*/
get use_size(): boolean;
set use_size(val: boolean);
/**
* If this property is set to %TRUE, the label will be drawn
* with the selected font size.
*/
get useSize(): boolean;
set useSize(val: boolean);
// Fields
button: Button;
// Constructors
constructor(properties?: Partial<FontButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): FontButton;
static new_with_font(fontname: string): FontButton;
// 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: 'font-set', callback: (_source: this) => void): number;
connect_after(signal: 'font-set', callback: (_source: this) => void): number;
emit(signal: 'font-set'): void;
// Virtual methods
vfunc_font_set(): void;
// Methods
/**
* Retrieves the name of the currently selected font. This name includes
* style and size information as well. If you want to render something
* with the font, use this string with pango_font_description_from_string() .
* If you're interested in peeking certain values (family name,
* style, size, weight) just query these properties from the
* #PangoFontDescription object.
* @returns an internal copy of the font name which must not be freed.
*/
get_font_name(): string;
/**
* Returns whether the font size will be shown in the label.
* @returns whether the font size will be shown in the label.
*/
get_show_size(): boolean;
/**
* Returns whether the name of the font style will be shown in the label.
* @returns whether the font style will be shown in the label.
*/
get_show_style(): boolean;
/**
* Retrieves the title of the font selection dialog.
* @returns an internal copy of the title string which must not be freed.
*/
get_title(): string;
/**
* Returns whether the selected font is used in the label.
* @returns whether the selected font is used in the label.
*/
get_use_font(): boolean;
/**
* Returns whether the selected size is used in the label.
* @returns whether the selected size is used in the label.
*/
get_use_size(): boolean;
/**
* Sets or updates the currently-displayed font in font picker dialog.
* @param fontname Name of font to display in font selection dialog
* @returns Return value of gtk_font_selection_dialog_set_font_name() if the font selection dialog exists, otherwise %FALSE.
*/
set_font_name(fontname: string): boolean;
/**
* If `show_size` is %TRUE, the font size will be displayed along with the name of the selected font.
* @param show_size %TRUE if font size should be displayed in dialog.
*/
set_show_size(show_size: boolean): void;
/**
* If `show_style` is %TRUE, the font style will be displayed along with name of the selected font.
* @param show_style %TRUE if font style should be displayed in label.
*/
set_show_style(show_style: boolean): void;
/**
* Sets the title for the font selection dialog.
* @param title a string containing the font selection dialog title
*/
set_title(title: string): void;
/**
* If `use_font` is %TRUE, the font name will be written using the selected font.
* @param use_font If %TRUE, font name will be written using font chosen.
*/
set_use_font(use_font: boolean): void;
/**
* If `use_size` is %TRUE, the font name will be written using the selected size.
* @param use_size If %TRUE, font name will be written using the selected size.
*/
set_use_size(use_size: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace FontSelection {
// Constructor properties interface
interface ConstructorProps
extends VBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
font: Gdk.Font;
font_name: string;
fontName: string;
preview_text: string;
previewText: string;
}
}
class FontSelection extends VBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<FontSelection>;
// Properties
get font(): Gdk.Font;
get font_name(): string;
set font_name(val: string);
get fontName(): string;
set fontName(val: string);
get preview_text(): string;
set preview_text(val: string);
get previewText(): string;
set previewText(val: string);
// Fields
font_entry: Widget;
family_list: Widget;
font_style_entry: Widget;
face_list: Widget;
size_entry: Widget;
size_list: Widget;
pixels_button: Widget;
points_button: Widget;
filter_button: Widget;
preview_entry: Widget;
family: Pango.FontFamily;
face: Pango.FontFace;
size: number;
// Constructors
constructor(properties?: Partial<FontSelection.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): FontSelection;
// Methods
/**
* Gets the #PangoFontFace representing the selected font group
* details (i.e. family, slant, weight, width, etc).
* @returns A #PangoFontFace representing the selected font group details. The returned object is owned by @fontsel and must not be modified or freed.
*/
get_face(): Pango.FontFace;
/**
* This returns the #GtkTreeView which lists all styles available for
* the selected font. For example, 'Regular', 'Bold', etc.
* @returns A #GtkWidget that is part of @fontsel
*/
get_face_list(): Widget;
/**
* Gets the #PangoFontFamily representing the selected font family.
* @returns A #PangoFontFamily representing the selected font family. Font families are a collection of font faces. The returned object is owned by @fontsel and must not be modified or freed.
*/
get_family(): Pango.FontFamily;
/**
* This returns the #GtkTreeView that lists font families, for
* example, 'Sans', 'Serif', etc.
* @returns A #GtkWidget that is part of @fontsel
*/
get_family_list(): Widget;
/**
* Gets the currently-selected font.
* @returns A #GdkFont.
*/
get_font(): Gdk.Font;
/**
* Gets the currently-selected font name.
*
* Note that this can be a different string than what you set with
* gtk_font_selection_set_font_name(), as the font selection widget may
* normalize font names and thus return a string with a different structure.
* For example, "Helvetica Italic Bold 12" could be normalized to
* "Helvetica Bold Italic 12". Use pango_font_description_equal()
* if you want to compare two font descriptions.
* @returns A string with the name of the current font, or %NULL if no font is selected. You must free this string with g_free().
*/
get_font_name(): string;
/**
* This returns the #GtkEntry used to display the font as a preview.
* @returns A #GtkWidget that is part of @fontsel
*/
get_preview_entry(): Widget;
/**
* Gets the text displayed in the preview area.
* @returns the text displayed in the preview area. This string is owned by the widget and should not be modified or freed
*/
get_preview_text(): string;
/**
* The selected font size.
* @returns A n integer representing the selected font size, or -1 if no font size is selected.
*/
get_size(): number;
/**
* This returns the #GtkEntry used to allow the user to edit the font
* number manually instead of selecting it from the list of font sizes.
* @returns A #GtkWidget that is part of @fontsel
*/
get_size_entry(): Widget;
/**
* This returns the #GtkTreeeView used to list font sizes.
* @returns A #GtkWidget that is part of @fontsel
*/
get_size_list(): Widget;
/**
* Sets the currently-selected font.
*
* Note that the `fontsel` needs to know the screen in which it will appear
* for this to work; this can be guaranteed by simply making sure that the
* `fontsel` is inserted in a toplevel window before you call this function.
* @param fontname a font name like "Helvetica 12" or "Times Bold 18"
* @returns %TRUE if the font could be set successfully; %FALSE if no such font exists or if the @fontsel doesn't belong to a particular screen yet.
*/
set_font_name(fontname: string): boolean;
/**
* Sets the text displayed in the preview area.
* The `text` is used to show how the selected font looks.
* @param text the text to display in the preview area
*/
set_preview_text(text: string): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace FontSelectionDialog {
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
class FontSelectionDialog extends Dialog implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<FontSelectionDialog>;
// Fields
ok_button: Widget;
apply_button: Widget;
cancel_button: Widget;
// Constructors
constructor(properties?: Partial<FontSelectionDialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](title: string): FontSelectionDialog;
// Conflicted with Gtk.Dialog.new
static ['new'](...args: never[]): any;
// Methods
/**
* Gets the 'Cancel' button.
* @returns the #GtkWidget used in the dialog for the 'Cancel' button.
*/
get_cancel_button(): Widget;
/**
* Gets the currently-selected font.
* @returns the #GdkFont from the #GtkFontSelection for the currently selected font in the dialog, or %NULL if no font is selected
*/
get_font(): Gdk.Font;
/**
* Gets the currently-selected font name.
*
* Note that this can be a different string than what you set with
* gtk_font_selection_dialog_set_font_name(), as the font selection widget
* may normalize font names and thus return a string with a different
* structure. For example, "Helvetica Italic Bold 12" could be normalized
* to "Helvetica Bold Italic 12". Use pango_font_description_equal()
* if you want to compare two font descriptions.
* @returns A string with the name of the current font, or %NULL if no font is selected. You must free this string with g_free().
*/
get_font_name(): string;
/**
* Retrieves the #GtkFontSelection widget embedded in the dialog.
* @returns the embedded #GtkFontSelection
*/
get_font_selection(): Widget;
/**
* Gets the 'OK' button.
* @returns the #GtkWidget used in the dialog for the 'OK' button.
*/
get_ok_button(): Widget;
/**
* Gets the text displayed in the preview area.
* @returns the text displayed in the preview area. This string is owned by the widget and should not be modified or freed
*/
get_preview_text(): string;
/**
* Sets the currently selected font.
* @param fontname a font name like "Helvetica 12" or "Times Bold 18"
* @returns %TRUE if the font selected in @fsd is now the @fontname specified, %FALSE otherwise.
*/
set_font_name(fontname: string): boolean;
/**
* Sets the text displayed in the preview area.
* @param text the text to display in the preview area
*/
set_preview_text(text: string): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Frame {
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
label: string;
label_widget: Widget;
labelWidget: Widget;
label_xalign: number;
labelXalign: number;
label_yalign: number;
labelYalign: number;
shadow: ShadowType;
shadow_type: ShadowType;
shadowType: ShadowType;
}
}
class Frame extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Frame>;
// Properties
get label(): string;
set label(val: string);
get label_widget(): Widget;
set label_widget(val: Widget);
get labelWidget(): Widget;
set labelWidget(val: Widget);
get label_xalign(): number;
set label_xalign(val: number);
get labelXalign(): number;
set labelXalign(val: number);
get label_yalign(): number;
set label_yalign(val: number);
get labelYalign(): number;
set labelYalign(val: number);
get shadow(): ShadowType;
set shadow(val: ShadowType);
get shadow_type(): ShadowType;
set shadow_type(val: ShadowType);
get shadowType(): ShadowType;
set shadowType(val: ShadowType);
// Fields
bin: Bin;
child_allocation: Allocation;
// Constructors
constructor(properties?: Partial<Frame.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](label: string): Frame;
// Virtual methods
vfunc_compute_child_allocation(allocation: Allocation): void;
// Methods
/**
* If the frame's label widget is a #GtkLabel, returns the
* text in the label widget. (The frame will have a #GtkLabel
* for the label widget if a non-%NULL argument was passed
* to gtk_frame_new().)
* @returns the text in the label, or %NULL if there was no label widget or the lable widget was not a #GtkLabel. This string is owned by GTK+ and must not be modified or freed.
*/
get_label(): string;
/**
* Retrieves the X and Y alignment of the frame's label. See
* gtk_frame_set_label_align().
*/
get_label_align(): [number, number];
/**
* Retrieves the label widget for the frame. See
* gtk_frame_set_label_widget().
* @returns the label widget, or %NULL if there is none.
*/
get_label_widget(): Widget;
/**
* Retrieves the shadow type of the frame. See
* gtk_frame_set_shadow_type().
* @returns the current shadow type of the frame.
*/
get_shadow_type(): ShadowType;
/**
* Sets the text of the label. If `label` is %NULL,
* the current label is removed.
* @param label the text to use as the label of the frame
*/
set_label(label?: string | null): void;
/**
* Sets the alignment of the frame widget's label. The
* default values for a newly created frame are 0.0 and 0.5.
* @param xalign The position of the label along the top edge of the widget. A value of 0.0 represents left alignment; 1.0 represents right alignment.
* @param yalign The y alignment of the label. A value of 0.0 aligns under the frame; 1.0 aligns above the frame. If the values are exactly 0.0 or 1.0 the gap in the frame won't be painted because the label will be completely above or below the frame.
*/
set_label_align(xalign: number, yalign: number): void;
/**
* Sets the label widget for the frame. This is the widget that
* will appear embedded in the top edge of the frame as a
* title.
* @param label_widget the new label widget
*/
set_label_widget(label_widget: Widget): void;
/**
* Sets the shadow type for `frame`.
* @param type the new #GtkShadowType
*/
set_shadow_type(type: ShadowType | 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 GammaCurve {
// Constructor properties interface
interface ConstructorProps
extends VBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class GammaCurve extends VBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<GammaCurve>;
// Fields
vbox: VBox;
table: Widget;
curve: Widget;
button: Widget[];
gamma: number;
gamma_dialog: Widget;
gamma_text: Widget;
// Constructors
constructor(properties?: Partial<GammaCurve.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): GammaCurve;
// 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 HBox {
// Constructor properties interface
interface ConstructorProps
extends Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* #GtkHBox is a container that organizes child widgets into a single row.
*
* Use the #GtkBox packing interface to determine the arrangement,
* spacing, width, and alignment of #GtkHBox children.
*
* All children are allocated the same height.
*/
class HBox extends Box implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<HBox>;
// Fields
box: Box;
// Constructors
constructor(properties?: Partial<HBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](homogeneous: boolean, spacing: number): HBox;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace HButtonBox {
// Constructor properties interface
interface ConstructorProps
extends ButtonBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class HButtonBox extends ButtonBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<HButtonBox>;
// Fields
button_box: ButtonBox;
// Constructors
constructor(properties?: Partial<HButtonBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HButtonBox;
// Static methods
static get_layout_default(): ButtonBoxStyle;
static get_spacing_default(): number;
static set_layout_default(layout: ButtonBoxStyle): void;
static set_spacing_default(spacing: 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 HPaned {
// Constructor properties interface
interface ConstructorProps
extends Paned.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class HPaned extends Paned implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<HPaned>;
// Fields
paned: Paned;
// Constructors
constructor(properties?: Partial<HPaned.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HPaned;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace HRuler {
// Constructor properties interface
interface ConstructorProps
extends Ruler.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class HRuler extends Ruler implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<HRuler>;
// Fields
ruler: Ruler;
// Constructors
constructor(properties?: Partial<HRuler.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HRuler;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace HSV {
// Signal callback interfaces
interface Changed {
(): void;
}
interface Move {
(object: DirectionType): void;
}
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
class HSV extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<HSV>;
// Fields
priv: any;
// Constructors
constructor(properties?: Partial<HSV.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HSV;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'move', callback: (_source: this, object: DirectionType) => void): number;
connect_after(signal: 'move', callback: (_source: this, object: DirectionType) => void): number;
emit(signal: 'move', object: DirectionType): void;
// Static methods
/**
* Converts a color from HSV space to RGB.
* Input values must be in the [0.0, 1.0] range;
* output values will be in the same range.
* @param h Hue
* @param s Saturation
* @param v Value
*/
static to_rgb(h: number, s: number, v: number): [number, number, number];
// Virtual methods
vfunc_changed(): void;
vfunc_move(type: DirectionType): void;
// Methods
/**
* Queries the current color in an HSV color selector.
* Returned values will be in the [0.0, 1.0] range.
*/
get_color(): [number, number, number];
/**
* Queries the size and ring width of an HSV color selector.
*/
get_metrics(): [number, number];
/**
* An HSV color selector can be said to be adjusting if multiple rapid
* changes are being made to its value, for example, when the user is
* adjusting the value with the mouse. This function queries whether
* the HSV color selector is being adjusted or not.
* @returns %TRUE if clients can ignore changes to the color value, since they may be transitory, or %FALSE if they should consider the color value status to be final.
*/
is_adjusting(): boolean;
/**
* Sets the current color in an HSV color selector.
* Color component values must be in the [0.0, 1.0] range.
* @param h Hue
* @param s Saturation
* @param v Value
*/
set_color(h: number, s: number, v: number): void;
/**
* Sets the size and ring width of an HSV color selector.
* @param size Diameter for the hue ring
* @param ring_width Width of the hue ring
*/
set_metrics(size: number, ring_width: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace HScale {
// Constructor properties interface
interface ConstructorProps
extends Scale.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class HScale extends Scale implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<HScale>;
// Fields
scale: Scale;
// Constructors
constructor(properties?: Partial<HScale.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](adjustment: Adjustment): HScale;
static new_with_range(min: number, max: number, step: number): HScale;
// 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 HScrollbar {
// Constructor properties interface
interface ConstructorProps
extends Scrollbar.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class HScrollbar extends Scrollbar implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<HScrollbar>;
// Fields
scrollbar: Scrollbar;
// Constructors
constructor(properties?: Partial<HScrollbar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](adjustment?: Adjustment | null): HScrollbar;
// 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 HSeparator {
// Constructor properties interface
interface ConstructorProps
extends Separator.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class HSeparator extends Separator implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<HSeparator>;
// Fields
separator: Separator;
// Constructors
constructor(properties?: Partial<HSeparator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HSeparator;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace HandleBox {
// Signal callback interfaces
interface ChildAttached {
(object: Widget): void;
}
interface ChildDetached {
(object: Widget): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
child_detached: boolean;
childDetached: boolean;
handle_position: PositionType;
handlePosition: PositionType;
shadow: ShadowType;
shadow_type: ShadowType;
shadowType: ShadowType;
snap_edge: PositionType;
snapEdge: PositionType;
snap_edge_set: boolean;
snapEdgeSet: boolean;
}
}
class HandleBox extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<HandleBox>;
// Properties
get child_detached(): boolean;
get childDetached(): boolean;
get handle_position(): PositionType;
set handle_position(val: PositionType);
get handlePosition(): PositionType;
set handlePosition(val: PositionType);
get shadow(): ShadowType;
set shadow(val: ShadowType);
get shadow_type(): ShadowType;
set shadow_type(val: ShadowType);
get shadowType(): ShadowType;
set shadowType(val: ShadowType);
get snap_edge(): PositionType;
set snap_edge(val: PositionType);
get snapEdge(): PositionType;
set snapEdge(val: PositionType);
get snap_edge_set(): boolean;
set snap_edge_set(val: boolean);
get snapEdgeSet(): boolean;
set snapEdgeSet(val: boolean);
// Fields
bin: Bin;
bin_window: Gdk.Window;
float_window: Gdk.Window;
float_window_mapped: number;
in_drag: number;
shrink_on_detach: number;
deskoff_x: number;
deskoff_y: number;
attach_allocation: Allocation;
float_allocation: Allocation;
// Constructors
constructor(properties?: Partial<HandleBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): HandleBox;
// 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: 'child-attached', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'child-attached', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'child-attached', object: Widget): void;
connect(signal: 'child-detached', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'child-detached', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'child-detached', object: Widget): void;
// Virtual methods
vfunc_child_attached(child: Widget): void;
vfunc_child_detached(child: Widget): void;
// Methods
/**
* Whether the handlebox's child is currently detached.
* @returns %TRUE if the child is currently detached, otherwise %FALSE
*/
get_child_detached(): boolean;
/**
* Gets the handle position of the handle box. See
* gtk_handle_box_set_handle_position().
* @returns the current handle position.
*/
get_handle_position(): PositionType;
/**
* Gets the type of shadow drawn around the handle box. See
* gtk_handle_box_set_shadow_type().
* @returns the type of shadow currently drawn around the handle box.
*/
get_shadow_type(): ShadowType;
/**
* Gets the edge used for determining reattachment of the handle box. See
* gtk_handle_box_set_snap_edge().
* @returns the edge used for determining reattachment, or (GtkPositionType)-1 if this is determined (as per default) from the handle position.
*/
get_snap_edge(): PositionType;
set_handle_position(position: PositionType | null): void;
set_shadow_type(type: ShadowType | null): void;
set_snap_edge(edge: PositionType | 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 IMContext {
// Signal callback interfaces
interface Commit {
(str: string): void;
}
interface DeleteSurrounding {
(offset: number, n_chars: number): boolean;
}
interface PreeditChanged {
(): void;
}
interface PreeditEnd {
(): void;
}
interface PreeditStart {
(): void;
}
interface RetrieveSurrounding {
(): boolean;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* #GtkIMContext defines the interface for GTK+ input methods. An input method
* is used by GTK+ text input widgets like #GtkEntry to map from key events to
* Unicode character strings.
*
* The user may change the current input method via a context menu, unless the
* #GtkSettings:gtk-show-input-method-menu GtkSettings property is set to FALSE.
* The default input method can be set programmatically via the
* #GtkSettings:gtk-im-module GtkSettings property. Alternatively, you may set
* the GTK_IM_MODULE environment variable as documented in #gtk-running.
*
* The #GtkEntry #GtkEntry:im-module and #GtkTextView #GtkTextView:im-module
* properties may also be used to set input methods for specific widget
* instances. For instance, a certain entry widget might be expected to contain
* certain characters which would be easier to input with a certain input
* method.
*
* An input method may consume multiple key events in sequence and finally
* output the composed result. This is called preediting, and an input method
* may provide feedback about this process by displaying the intermediate
* composition states as preedit text. For instance, the default GTK+ input
* method implements the input of arbitrary Unicode code points by holding down
* the Control and Shift keys and then typing "U" followed by the hexadecimal
* digits of the code point. When releasing the Control and Shift keys,
* preediting ends and the character is inserted as text. Ctrl+Shift+u20AC for
* example results in the € sign.
*
* Additional input methods can be made available for use by GTK+ widgets as
* loadable modules. An input method module is a small shared library which
* implements a subclass of #GtkIMContext or #GtkIMContextSimple and exports
* these four functions:
*
* <informalexample><programlisting>
* void im_module_init(#GTypeModule *module);
* </programlisting></informalexample>
* This function should register the #GType of the #GtkIMContext subclass which
* implements the input method by means of g_type_module_register_type(). Note
* that g_type_register_static() cannot be used as the type needs to be
* registered dynamically.
*
* <informalexample><programlisting>
* void im_module_exit(void);
* </programlisting></informalexample>
* Here goes any cleanup code your input method might require on module unload.
*
* <informalexample><programlisting>
* void im_module_list(const #GtkIMContextInfo ***contexts, int *n_contexts)
* {
* *contexts = info_list;
* *n_contexts = G_N_ELEMENTS (info_list);
* }
* </programlisting></informalexample>
* This function returns the list of input methods provided by the module. The
* example implementation above shows a common solution and simply returns a
* pointer to statically defined array of #GtkIMContextInfo items for each
* provided input method.
*
* <informalexample><programlisting>
* #GtkIMContext * im_module_create(const #gchar *context_id);
* </programlisting></informalexample>
* This function should return a pointer to a newly created instance of the
* #GtkIMContext subclass identified by `context_id`. The context ID is the same
* as specified in the #GtkIMContextInfo array returned by im_module_list().
*
* After a new loadable input method module has been installed on the system,
* the configuration file <filename>immodules.cache</filename> needs to be
* regenerated by <link linkend="gtk-query-immodules-2.0">gtk-query-immodules-2.0</link>,
* in order for the new input method to become available to GTK+ applications.
*/
abstract class IMContext extends GObject.Object {
static $gtype: GObject.GType<IMContext>;
// Constructors
constructor(properties?: Partial<IMContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'commit', callback: (_source: this, str: string) => void): number;
connect_after(signal: 'commit', callback: (_source: this, str: string) => void): number;
emit(signal: 'commit', str: string): void;
connect(
signal: 'delete-surrounding',
callback: (_source: this, offset: number, n_chars: number) => boolean,
): number;
connect_after(
signal: 'delete-surrounding',
callback: (_source: this, offset: number, n_chars: number) => boolean,
): number;
emit(signal: 'delete-surrounding', offset: number, n_chars: number): void;
connect(signal: 'preedit-changed', callback: (_source: this) => void): number;
connect_after(signal: 'preedit-changed', callback: (_source: this) => void): number;
emit(signal: 'preedit-changed'): void;
connect(signal: 'preedit-end', callback: (_source: this) => void): number;
connect_after(signal: 'preedit-end', callback: (_source: this) => void): number;
emit(signal: 'preedit-end'): void;
connect(signal: 'preedit-start', callback: (_source: this) => void): number;
connect_after(signal: 'preedit-start', callback: (_source: this) => void): number;
emit(signal: 'preedit-start'): void;
connect(signal: 'retrieve-surrounding', callback: (_source: this) => boolean): number;
connect_after(signal: 'retrieve-surrounding', callback: (_source: this) => boolean): number;
emit(signal: 'retrieve-surrounding'): void;
// Virtual methods
/**
* Default handler of the #GtkIMContext::commit signal.
* @param str
*/
vfunc_commit(str: string): void;
/**
* Asks the widget that the input context is attached to to delete
* characters around the cursor position by emitting the
* GtkIMContext::delete_surrounding signal. Note that `offset` and `n_chars`
* are in characters not in bytes which differs from the usage other
* places in #GtkIMContext.
*
* In order to use this function, you should first call
* gtk_im_context_get_surrounding() to get the current context, and
* call this function immediately afterwards to make sure that you
* know what you are deleting. You should also account for the fact
* that even if the signal was handled, the input context might not
* have deleted all the characters that were requested to be deleted.
*
* This function is used by an input method that wants to make
* subsitutions in the existing text in response to new input. It is
* not useful for applications.
* @param offset offset from cursor position in chars; a negative value means start before the cursor.
* @param n_chars number of characters to delete.
*/
vfunc_delete_surrounding(offset: number, n_chars: number): boolean;
/**
* Allow an input method to internally handle key press and release
* events. If this function returns %TRUE, then no further processing
* should be done for this key event.
* @param event the key event
*/
vfunc_filter_keypress(event: Gdk.EventKey): boolean;
/**
* Notify the input method that the widget to which this
* input context corresponds has gained focus. The input method
* may, for example, change the displayed feedback to reflect
* this change.
*/
vfunc_focus_in(): void;
/**
* Notify the input method that the widget to which this
* input context corresponds has lost focus. The input method
* may, for example, change the displayed feedback or reset the contexts
* state to reflect this change.
*/
vfunc_focus_out(): void;
/**
* Retrieve the current preedit string for the input context,
* and a list of attributes to apply to the string.
* This string should be displayed inserted at the insertion
* point.
*/
vfunc_get_preedit_string(): [string, Pango.AttrList, number];
/**
* Retrieves context around the insertion point. Input methods
* typically want context in order to constrain input text based on
* existing text; this is important for languages such as Thai where
* only some sequences of characters are allowed.
*
* This function is implemented by emitting the
* GtkIMContext::retrieve_surrounding signal on the input method; in
* response to this signal, a widget should provide as much context as
* is available, up to an entire paragraph, by calling
* gtk_im_context_set_surrounding(). Note that there is no obligation
* for a widget to respond to the ::retrieve_surrounding signal, so input
* methods must be prepared to function without context.
*/
vfunc_get_surrounding(): [boolean, string, number];
/**
* Default handler of the #GtkIMContext::preedit-changed
* signal.
*/
vfunc_preedit_changed(): void;
/**
* Default handler of the #GtkIMContext::preedit-end signal.
*/
vfunc_preedit_end(): void;
/**
* Default handler of the #GtkIMContext::preedit-start signal.
*/
vfunc_preedit_start(): void;
/**
* Notify the input method that a change such as a change in cursor
* position has been made. This will typically cause the input
* method to clear the preedit state.
*/
vfunc_reset(): void;
/**
* Default handler of the
* #GtkIMContext::retrieve-surrounding signal.
*/
vfunc_retrieve_surrounding(): boolean;
/**
* Set the client window for the input context; this is the
* #GdkWindow in which the input appears. This window is
* used in order to correctly position status windows, and may
* also be used for purposes internal to the input method.
* @param window the client window. This may be %NULL to indicate that the previous client window no longer exists.
*/
vfunc_set_client_window(window?: Gdk.Window | null): void;
/**
* Notify the input method that a change in cursor
* position has been made. The location is relative to the client
* window.
* @param area new location
*/
vfunc_set_cursor_location(area: Gdk.Rectangle): void;
/**
* Sets surrounding context around the insertion point and preedit
* string. This function is expected to be called in response to the
* GtkIMContext::retrieve_surrounding signal, and will likely have no
* effect if called at other times.
* @param text text surrounding the insertion point, as UTF-8. the preedit string should not be included within @text.
* @param len the length of @text, or -1 if @text is nul-terminated
* @param cursor_index the byte index of the insertion cursor within @text.
*/
vfunc_set_surrounding(text: string, len: number, cursor_index: number): void;
/**
* Sets whether the IM context should use the preedit string
* to display feedback. If `use_preedit` is FALSE (default
* is TRUE), then the IM context may use some other method to display
* feedback, such as displaying it in a child of the root window.
* @param use_preedit whether the IM context should use the preedit string.
*/
vfunc_set_use_preedit(use_preedit: boolean): void;
// Methods
/**
* Asks the widget that the input context is attached to to delete
* characters around the cursor position by emitting the
* GtkIMContext::delete_surrounding signal. Note that `offset` and `n_chars`
* are in characters not in bytes which differs from the usage other
* places in #GtkIMContext.
*
* In order to use this function, you should first call
* gtk_im_context_get_surrounding() to get the current context, and
* call this function immediately afterwards to make sure that you
* know what you are deleting. You should also account for the fact
* that even if the signal was handled, the input context might not
* have deleted all the characters that were requested to be deleted.
*
* This function is used by an input method that wants to make
* subsitutions in the existing text in response to new input. It is
* not useful for applications.
* @param offset offset from cursor position in chars; a negative value means start before the cursor.
* @param n_chars number of characters to delete.
* @returns %TRUE if the signal was handled.
*/
delete_surrounding(offset: number, n_chars: number): boolean;
/**
* Allow an input method to internally handle key press and release
* events. If this function returns %TRUE, then no further processing
* should be done for this key event.
* @param event the key event
* @returns %TRUE if the input method handled the key event.
*/
filter_keypress(event: Gdk.EventKey): boolean;
/**
* Notify the input method that the widget to which this
* input context corresponds has gained focus. The input method
* may, for example, change the displayed feedback to reflect
* this change.
*/
focus_in(): void;
/**
* Notify the input method that the widget to which this
* input context corresponds has lost focus. The input method
* may, for example, change the displayed feedback or reset the contexts
* state to reflect this change.
*/
focus_out(): void;
/**
* Retrieve the current preedit string for the input context,
* and a list of attributes to apply to the string.
* This string should be displayed inserted at the insertion
* point.
*/
get_preedit_string(): [string, Pango.AttrList, number];
/**
* Retrieves context around the insertion point. Input methods
* typically want context in order to constrain input text based on
* existing text; this is important for languages such as Thai where
* only some sequences of characters are allowed.
*
* This function is implemented by emitting the
* GtkIMContext::retrieve_surrounding signal on the input method; in
* response to this signal, a widget should provide as much context as
* is available, up to an entire paragraph, by calling
* gtk_im_context_set_surrounding(). Note that there is no obligation
* for a widget to respond to the ::retrieve_surrounding signal, so input
* methods must be prepared to function without context.
* @returns %TRUE if surrounding text was provided; in this case you must free the result stored in *text.
*/
get_surrounding(): [boolean, string, number];
/**
* Notify the input method that a change such as a change in cursor
* position has been made. This will typically cause the input
* method to clear the preedit state.
*/
reset(): void;
/**
* Set the client window for the input context; this is the
* #GdkWindow in which the input appears. This window is
* used in order to correctly position status windows, and may
* also be used for purposes internal to the input method.
* @param window the client window. This may be %NULL to indicate that the previous client window no longer exists.
*/
set_client_window(window?: Gdk.Window | null): void;
/**
* Notify the input method that a change in cursor
* position has been made. The location is relative to the client
* window.
* @param area new location
*/
set_cursor_location(area: Gdk.Rectangle): void;
/**
* Sets surrounding context around the insertion point and preedit
* string. This function is expected to be called in response to the
* GtkIMContext::retrieve_surrounding signal, and will likely have no
* effect if called at other times.
* @param text text surrounding the insertion point, as UTF-8. the preedit string should not be included within @text.
* @param len the length of @text, or -1 if @text is nul-terminated
* @param cursor_index the byte index of the insertion cursor within @text.
*/
set_surrounding(text: string, len: number, cursor_index: number): void;
/**
* Sets whether the IM context should use the preedit string
* to display feedback. If `use_preedit` is FALSE (default
* is TRUE), then the IM context may use some other method to display
* feedback, such as displaying it in a child of the root window.
* @param use_preedit whether the IM context should use the preedit string.
*/
set_use_preedit(use_preedit: boolean): void;
}
namespace IMContextSimple {
// Constructor properties interface
interface ConstructorProps extends IMContext.ConstructorProps {}
}
class IMContextSimple extends IMContext {
static $gtype: GObject.GType<IMContextSimple>;
// Fields
object: IMContext;
tables: any[];
compose_buffer: number[];
tentative_match: number;
tentative_match_len: number;
in_hex_sequence: number;
modifiers_dropped: number;
// Constructors
constructor(properties?: Partial<IMContextSimple.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): IMContextSimple;
// Methods
/**
* Adds an additional table to search to the input context.
* Each row of the table consists of `max_seq_len` key symbols
* followed by two #guint16 interpreted as the high and low
* words of a #gunicode value. Tables are searched starting
* from the last added.
*
* The table must be sorted in dictionary order on the
* numeric value of the key symbol fields. (Values beyond
* the length of the sequence should be zero.)
* @param data the table
* @param max_seq_len Maximum length of a sequence in the table (cannot be greater than #GTK_MAX_COMPOSE_LEN)
* @param n_seqs number of sequences in the table
*/
add_table(data: number, max_seq_len: number, n_seqs: number): void;
}
namespace IMMulticontext {
// Constructor properties interface
interface ConstructorProps extends IMContext.ConstructorProps {}
}
class IMMulticontext extends IMContext {
static $gtype: GObject.GType<IMMulticontext>;
// Fields
object: IMContext;
slave: IMContext;
context_id: string;
// Constructors
constructor(properties?: Partial<IMMulticontext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): IMMulticontext;
// Methods
/**
* Add menuitems for various available input methods to a menu;
* the menuitems, when selected, will switch the input method
* for the context and the global default input method.
* @param menushell a #GtkMenuShell
*/
append_menuitems(menushell: MenuShell): void;
/**
* Gets the id of the currently active slave of the `context`.
* @returns the id of the currently active slave
*/
get_context_id(): string;
/**
* Sets the context id for `context`.
*
* This causes the currently active slave of `context` to be
* replaced by the slave corresponding to the new context id.
* @param context_id the id to use
*/
set_context_id(context_id: string): void;
}
namespace IconFactory {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps {}
}
class IconFactory extends GObject.Object implements Buildable {
static $gtype: GObject.GType<IconFactory>;
// Constructors
constructor(properties?: Partial<IconFactory.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): IconFactory;
// Static methods
/**
* Looks for an icon in the list of default icon factories. For
* display to the user, you should use gtk_style_lookup_icon_set() on
* the #GtkStyle for the widget that will display the icon, instead of
* using this function directly, so that themes are taken into
* account.
* @param stock_id an icon name
*/
static lookup_default(stock_id: string): IconSet;
// Methods
/**
* Adds the given `icon_set` to the icon factory, under the name
* `stock_id`. `stock_id` should be namespaced for your application,
* e.g. "myapp-whatever-icon". Normally applications create a
* #GtkIconFactory, then add it to the list of default factories with
* gtk_icon_factory_add_default(). Then they pass the `stock_id` to
* widgets such as #GtkImage to display the icon. Themes can provide
* an icon with the same name (such as "myapp-whatever-icon") to
* override your application's default icons. If an icon already
* existed in `factory` for `stock_id,` it is unreferenced and replaced
* with the new `icon_set`.
* @param stock_id icon name
* @param icon_set icon set
*/
add(stock_id: string, icon_set: IconSet): void;
/**
* Adds an icon factory to the list of icon factories searched by
* gtk_style_lookup_icon_set(). This means that, for example,
* gtk_image_new_from_stock() will be able to find icons in `factory`.
* There will normally be an icon factory added for each library or
* application that comes with icons. The default icon factories
* can be overridden by themes.
*/
add_default(): void;
/**
* Looks up `stock_id` in the icon factory, returning an icon set
* if found, otherwise %NULL. For display to the user, you should
* use gtk_style_lookup_icon_set() on the #GtkStyle for the
* widget that will display the icon, instead of using this
* function directly, so that themes are taken into account.
* @param stock_id an icon name
* @returns icon set of @stock_id.
*/
lookup(stock_id: string): IconSet;
/**
* Removes an icon factory from the list of default icon
* factories. Not normally used; you might use it for a library that
* can be unloaded or shut down.
*/
remove_default(): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace IconTheme {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class IconTheme extends GObject.Object {
static $gtype: GObject.GType<IconTheme>;
// Constructors
constructor(properties?: Partial<IconTheme.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): IconTheme;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Static methods
/**
* Registers a built-in icon for icon theme lookups. The idea
* of built-in icons is to allow an application or library
* that uses themed icons to function requiring files to
* be present in the file system. For instance, the default
* images for all of GTK+'s stock icons are registered
* as built-icons.
*
* In general, if you use gtk_icon_theme_add_builtin_icon()
* you should also install the icon in the icon theme, so
* that the icon is generally available.
*
* This function will generally be used with pixbufs loaded
* via gdk_pixbuf_new_from_inline().
* @param icon_name the name of the icon to register
* @param size the size at which to register the icon (different images can be registered for the same icon name at different sizes.)
* @param pixbuf #GdkPixbuf that contains the image to use for @icon_name.
*/
static add_builtin_icon(icon_name: string, size: number, pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Gets the icon theme for the default screen. See
* gtk_icon_theme_get_for_screen().
*/
static get_default(): IconTheme;
/**
* Gets the icon theme object associated with `screen;` if this
* function has not previously been called for the given
* screen, a new icon theme object will be created and
* associated with the screen. Icon theme objects are
* fairly expensive to create, so using this function
* is usually a better choice than calling than gtk_icon_theme_new()
* and setting the screen yourself; by using this function
* a single icon theme object will be shared between users.
* @param screen a #GdkScreen
*/
static get_for_screen(screen: Gdk.Screen): IconTheme;
// Virtual methods
vfunc_changed(): void;
// Methods
/**
* Appends a directory to the search path.
* See gtk_icon_theme_set_search_path().
* @param path directory name to append to the icon path
*/
append_search_path(path: string): void;
/**
* Looks up a named icon and returns a structure containing
* information such as the filename of the icon. The icon
* can then be rendered into a pixbuf using
* gtk_icon_info_load_icon(). (gtk_icon_theme_load_icon()
* combines these two steps if all you need is the pixbuf.)
*
* If `icon_names` contains more than one name, this function
* tries them all in the given order before falling back to
* inherited icon themes.
* @param icon_names %NULL-terminated array of icon names to lookup
* @param size desired icon size
* @param flags flags modifying the behavior of the icon lookup
* @returns a #GtkIconInfo structure containing information about the icon, or %NULL if the icon wasn't found. Free with gtk_icon_info_free()
*/
choose_icon(icon_names: string[], size: number, flags: IconLookupFlags | null): IconInfo;
/**
* Gets the name of an icon that is representative of the
* current theme (for instance, to use when presenting
* a list of themes to the user.)
* @returns the name of an example icon or %NULL. Free with g_free().
*/
get_example_icon_name(): string;
/**
* Returns an array of integers describing the sizes at which
* the icon is available without scaling. A size of -1 means
* that the icon is available in a scalable format. The array
* is zero-terminated.
* @param icon_name the name of an icon
* @returns An newly allocated array describing the sizes at which the icon is available. The array should be freed with g_free() when it is no longer needed.
*/
get_icon_sizes(icon_name: string): number[];
/**
* Gets the current search path. See gtk_icon_theme_set_search_path().
*/
get_search_path(): string[] | null;
/**
* Checks whether an icon theme includes an icon
* for a particular name.
* @param icon_name the name of an icon
* @returns %TRUE if @icon_theme includes an icon for @icon_name.
*/
has_icon(icon_name: string): boolean;
/**
* Gets the list of contexts available within the current
* hierarchy of icon themes
* @returns a #GList list holding the names of all the contexts in the theme. You must first free each element in the list with g_free(), then free the list itself with g_list_free().
*/
list_contexts(): string[];
/**
* Lists the icons in the current icon theme. Only a subset
* of the icons can be listed by providing a context string.
* The set of values for the context string is system dependent,
* but will typically include such values as "Applications" and
* "MimeTypes".
* @param context a string identifying a particular type of icon, or %NULL to list all icons.
* @returns a #GList list holding the names of all the icons in the theme. You must first free each element in the list with g_free(), then free the list itself with g_list_free().
*/
list_icons(context: string): string[];
/**
* Looks up an icon in an icon theme, scales it to the given size
* and renders it into a pixbuf. This is a convenience function;
* if more details about the icon are needed, use
* gtk_icon_theme_lookup_icon() followed by gtk_icon_info_load_icon().
*
* Note that you probably want to listen for icon theme changes and
* update the icon. This is usually done by connecting to the
* GtkWidget::style-set signal. If for some reason you do not want to
* update the icon when the icon theme changes, you should consider
* using gdk_pixbuf_copy() to make a private copy of the pixbuf
* returned by this function. Otherwise GTK+ may need to keep the old
* icon theme loaded, which would be a waste of memory.
* @param icon_name the name of the icon to lookup
* @param size the desired icon size. The resulting icon may not be exactly this size; see gtk_icon_info_load_icon().
* @param flags flags modifying the behavior of the icon lookup
* @returns the rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use g_object_unref() to release your reference to the icon. %NULL if the icon isn't found.
*/
load_icon(icon_name: string, size: number, flags: IconLookupFlags | null): GdkPixbuf.Pixbuf;
/**
* Looks up an icon and returns a structure containing
* information such as the filename of the icon.
* The icon can then be rendered into a pixbuf using
* gtk_icon_info_load_icon().
* @param icon the #GIcon to look up
* @param size desired icon size
* @param flags flags modifying the behavior of the icon lookup
* @returns a #GtkIconInfo structure containing information about the icon, or %NULL if the icon wasn't found. Free with gtk_icon_info_free()
*/
lookup_by_gicon(icon: Gio.Icon, size: number, flags: IconLookupFlags | null): IconInfo;
/**
* Looks up a named icon and returns a structure containing
* information such as the filename of the icon. The icon
* can then be rendered into a pixbuf using
* gtk_icon_info_load_icon(). (gtk_icon_theme_load_icon()
* combines these two steps if all you need is the pixbuf.)
* @param icon_name the name of the icon to lookup
* @param size desired icon size
* @param flags flags modifying the behavior of the icon lookup
* @returns a #GtkIconInfo structure containing information about the icon, or %NULL if the icon wasn't found. Free with gtk_icon_info_free()
*/
lookup_icon(icon_name: string, size: number, flags: IconLookupFlags | null): IconInfo;
/**
* Prepends a directory to the search path.
* See gtk_icon_theme_set_search_path().
* @param path directory name to prepend to the icon path
*/
prepend_search_path(path: string): void;
/**
* Checks to see if the icon theme has changed; if it has, any
* currently cached information is discarded and will be reloaded
* next time `icon_theme` is accessed.
* @returns %TRUE if the icon theme has changed and needed to be reloaded.
*/
rescan_if_needed(): boolean;
/**
* Sets the name of the icon theme that the #GtkIconTheme object uses
* overriding system configuration. This function cannot be called
* on the icon theme objects returned from gtk_icon_theme_get_default()
* and gtk_icon_theme_get_for_screen().
* @param theme_name name of icon theme to use instead of configured theme, or %NULL to unset a previously set custom theme
*/
set_custom_theme(theme_name: string): void;
/**
* Sets the screen for an icon theme; the screen is used
* to track the user's currently configured icon theme,
* which might be different for different screens.
* @param screen a #GdkScreen
*/
set_screen(screen: Gdk.Screen): void;
/**
* Sets the search path for the icon theme object. When looking
* for an icon theme, GTK+ will search for a subdirectory of
* one or more of the directories in `path` with the same name
* as the icon theme. (Themes from multiple of the path elements
* are combined to allow themes to be extended by adding icons
* in the user's home directory.)
*
* In addition if an icon found isn't found either in the current
* icon theme or the default icon theme, and an image file with
* the right name is found directly in one of the elements of
* `path,` then that image will be used for the icon name.
* (This is legacy feature, and new icons should be put
* into the default icon theme, which is called DEFAULT_THEME_NAME,
* rather than directly on the icon path.)
* @param path array of directories that are searched for icon themes
*/
set_search_path(path: string[]): void;
}
namespace IconView {
// Signal callback interfaces
interface ActivateCursorItem {
(): boolean;
}
interface ItemActivated {
(path: TreePath): void;
}
interface MoveCursor {
(step: MovementStep, count: number): boolean;
}
interface SelectAll {
(): void;
}
interface SelectCursorItem {
(): void;
}
interface SelectionChanged {
(): void;
}
interface SetScrollAdjustments {
(object: Adjustment, p0: Adjustment): void;
}
interface ToggleCursorItem {
(): void;
}
interface UnselectAll {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
CellLayout.ConstructorProps {
column_spacing: number;
columnSpacing: number;
columns: number;
item_orientation: Orientation;
itemOrientation: Orientation;
item_padding: number;
itemPadding: number;
item_width: number;
itemWidth: number;
margin: number;
markup_column: number;
markupColumn: number;
model: TreeModel;
orientation: Orientation;
pixbuf_column: number;
pixbufColumn: number;
reorderable: boolean;
row_spacing: number;
rowSpacing: number;
selection_mode: SelectionMode;
selectionMode: SelectionMode;
spacing: number;
text_column: number;
textColumn: number;
tooltip_column: number;
tooltipColumn: number;
}
}
class IconView extends Container implements Atk.ImplementorIface, Buildable, CellLayout {
static $gtype: GObject.GType<IconView>;
// Properties
/**
* The column-spacing property specifies the space which is inserted between
* the columns of the icon view.
*/
get column_spacing(): number;
set column_spacing(val: number);
/**
* The column-spacing property specifies the space which is inserted between
* the columns of the icon view.
*/
get columnSpacing(): number;
set columnSpacing(val: number);
/**
* The columns property contains the number of the columns in which the
* items should be displayed. If it is -1, the number of columns will
* be chosen automatically to fill the available area.
*/
get columns(): number;
set columns(val: number);
/**
* The item-orientation property specifies how the cells (i.e. the icon and
* the text) of the item are positioned relative to each other.
*/
get item_orientation(): Orientation;
set item_orientation(val: Orientation);
/**
* The item-orientation property specifies how the cells (i.e. the icon and
* the text) of the item are positioned relative to each other.
*/
get itemOrientation(): Orientation;
set itemOrientation(val: Orientation);
/**
* The item-padding property specifies the padding around each
* of the icon view's item.
*/
get item_padding(): number;
set item_padding(val: number);
/**
* The item-padding property specifies the padding around each
* of the icon view's item.
*/
get itemPadding(): number;
set itemPadding(val: number);
/**
* The item-width property specifies the width to use for each item.
* If it is set to -1, the icon view will automatically determine a
* suitable item size.
*/
get item_width(): number;
set item_width(val: number);
/**
* The item-width property specifies the width to use for each item.
* If it is set to -1, the icon view will automatically determine a
* suitable item size.
*/
get itemWidth(): number;
set itemWidth(val: number);
/**
* The margin property specifies the space which is inserted
* at the edges of the icon view.
*/
get margin(): number;
set margin(val: number);
/**
* The ::markup-column property contains the number of the model column
* containing markup information to be displayed. The markup column must be
* of type #G_TYPE_STRING. If this property and the :text-column property
* are both set to column numbers, it overrides the text column.
* If both are set to -1, no texts are displayed.
*/
get markup_column(): number;
set markup_column(val: number);
/**
* The ::markup-column property contains the number of the model column
* containing markup information to be displayed. The markup column must be
* of type #G_TYPE_STRING. If this property and the :text-column property
* are both set to column numbers, it overrides the text column.
* If both are set to -1, no texts are displayed.
*/
get markupColumn(): number;
set markupColumn(val: number);
get model(): TreeModel;
set model(val: TreeModel);
/**
* The orientation property specifies how the cells (i.e. the icon and
* the text) of the item are positioned relative to each other.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
/**
* The ::pixbuf-column property contains the number of the model column
* containing the pixbufs which are displayed. The pixbuf column must be
* of type #GDK_TYPE_PIXBUF. Setting this property to -1 turns off the
* display of pixbufs.
*/
get pixbuf_column(): number;
set pixbuf_column(val: number);
/**
* The ::pixbuf-column property contains the number of the model column
* containing the pixbufs which are displayed. The pixbuf column must be
* of type #GDK_TYPE_PIXBUF. Setting this property to -1 turns off the
* display of pixbufs.
*/
get pixbufColumn(): number;
set pixbufColumn(val: number);
/**
* The reorderable property specifies if the items can be reordered
* by DND.
*/
get reorderable(): boolean;
set reorderable(val: boolean);
/**
* The row-spacing property specifies the space which is inserted between
* the rows of the icon view.
*/
get row_spacing(): number;
set row_spacing(val: number);
/**
* The row-spacing property specifies the space which is inserted between
* the rows of the icon view.
*/
get rowSpacing(): number;
set rowSpacing(val: number);
/**
* The ::selection-mode property specifies the selection mode of
* icon view. If the mode is #GTK_SELECTION_MULTIPLE, rubberband selection
* is enabled, for the other modes, only keyboard selection is possible.
*/
get selection_mode(): SelectionMode;
set selection_mode(val: SelectionMode);
/**
* The ::selection-mode property specifies the selection mode of
* icon view. If the mode is #GTK_SELECTION_MULTIPLE, rubberband selection
* is enabled, for the other modes, only keyboard selection is possible.
*/
get selectionMode(): SelectionMode;
set selectionMode(val: SelectionMode);
/**
* The spacing property specifies the space which is inserted between
* the cells (i.e. the icon and the text) of an item.
*/
get spacing(): number;
set spacing(val: number);
/**
* The ::text-column property contains the number of the model column
* containing the texts which are displayed. The text column must be
* of type #G_TYPE_STRING. If this property and the :markup-column
* property are both set to -1, no texts are displayed.
*/
get text_column(): number;
set text_column(val: number);
/**
* The ::text-column property contains the number of the model column
* containing the texts which are displayed. The text column must be
* of type #G_TYPE_STRING. If this property and the :markup-column
* property are both set to -1, no texts are displayed.
*/
get textColumn(): number;
set textColumn(val: number);
get tooltip_column(): number;
set tooltip_column(val: number);
get tooltipColumn(): number;
set tooltipColumn(val: number);
// Constructors
constructor(properties?: Partial<IconView.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): IconView;
static new_with_model(model: TreeModel): IconView;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate-cursor-item', callback: (_source: this) => boolean): number;
connect_after(signal: 'activate-cursor-item', callback: (_source: this) => boolean): number;
emit(signal: 'activate-cursor-item'): void;
connect(signal: 'item-activated', callback: (_source: this, path: TreePath) => void): number;
connect_after(signal: 'item-activated', callback: (_source: this, path: TreePath) => void): number;
emit(signal: 'item-activated', path: TreePath): void;
connect(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number) => boolean,
): number;
connect_after(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number) => boolean,
): number;
emit(signal: 'move-cursor', step: MovementStep, count: number): void;
connect(signal: 'select-all', callback: (_source: this) => void): number;
connect_after(signal: 'select-all', callback: (_source: this) => void): number;
emit(signal: 'select-all'): void;
connect(signal: 'select-cursor-item', callback: (_source: this) => void): number;
connect_after(signal: 'select-cursor-item', callback: (_source: this) => void): number;
emit(signal: 'select-cursor-item'): void;
connect(signal: 'selection-changed', callback: (_source: this) => void): number;
connect_after(signal: 'selection-changed', callback: (_source: this) => void): number;
emit(signal: 'selection-changed'): void;
connect(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
connect_after(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
emit(signal: 'set-scroll-adjustments', object: Adjustment, p0: Adjustment): void;
connect(signal: 'toggle-cursor-item', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-cursor-item', callback: (_source: this) => void): number;
emit(signal: 'toggle-cursor-item'): void;
connect(signal: 'unselect-all', callback: (_source: this) => void): number;
connect_after(signal: 'unselect-all', callback: (_source: this) => void): number;
emit(signal: 'unselect-all'): void;
// Virtual methods
vfunc_activate_cursor_item(): boolean;
/**
* Activates the item determined by `path`.
* @param path The #GtkTreePath to be activated
*/
vfunc_item_activated(path: TreePath): void;
vfunc_move_cursor(step: MovementStep, count: number): boolean;
/**
* Selects all the icons. `icon_view` must has its selection mode set
* to #GTK_SELECTION_MULTIPLE.
*/
vfunc_select_all(): void;
vfunc_select_cursor_item(): void;
vfunc_selection_changed(): void;
vfunc_set_scroll_adjustments(hadjustment: Adjustment, vadjustment: Adjustment): void;
vfunc_toggle_cursor_item(): void;
/**
* Unselects all the icons.
*/
vfunc_unselect_all(): void;
// Methods
/**
* Converts widget coordinates to coordinates for the bin_window,
* as expected by e.g. gtk_icon_view_get_path_at_pos().
* @param wx X coordinate relative to the widget
* @param wy Y coordinate relative to the widget
*/
convert_widget_to_bin_window_coords(wx: number, wy: number): [number, number];
/**
* Creates a #GdkPixmap representation of the item at `path`.
* This image is used for a drag icon.
* @param path a #GtkTreePath in @icon_view
* @returns a newly-allocated pixmap of the drag icon.
*/
create_drag_icon(path: TreePath): Gdk.Pixmap;
/**
* Turns `icon_view` into a drop destination for automatic DND. Calling this
* method sets #GtkIconView:reorderable to %FALSE.
* @param targets the table of targets that the drag will support
* @param n_targets the number of items in @targets
* @param actions the bitmask of possible actions for a drag to this widget
*/
enable_model_drag_dest(targets: TargetEntry, n_targets: number, actions: Gdk.DragAction | null): void;
/**
* Turns `icon_view` into a drag source for automatic DND. Calling this
* method sets #GtkIconView:reorderable to %FALSE.
* @param start_button_mask Mask of allowed buttons to start drag
* @param targets the table of targets that the drag will support
* @param n_targets the number of items in @targets
* @param actions the bitmask of possible actions for a drag from this widget
*/
enable_model_drag_source(
start_button_mask: Gdk.ModifierType | null,
targets: TargetEntry,
n_targets: number,
actions: Gdk.DragAction | null,
): void;
/**
* Returns the value of the ::column-spacing property.
* @returns the space between columns
*/
get_column_spacing(): number;
/**
* Returns the value of the ::columns property.
* @returns the number of columns, or -1
*/
get_columns(): number;
/**
* Fills in `path` and `cell` with the current cursor path and cell.
* If the cursor isn't currently set, then *`path` will be %NULL.
* If no cell currently has focus, then *`cell` will be %NULL.
*
* The returned #GtkTreePath must be freed with gtk_tree_path_free().
* @param path Return location for the current cursor path, or %NULL
* @param cell Return location the current focus cell, or %NULL
* @returns %TRUE if the cursor is set.
*/
get_cursor(path?: TreePath | null, cell?: CellRenderer | null): boolean;
/**
* Determines the destination item for a given position.
* @param drag_x the position to determine the destination item for
* @param drag_y the position to determine the destination item for
* @param path Return location for the path of the item, or %NULL.
* @param pos Return location for the drop position, or %NULL
* @returns whether there is an item at the given position.
*/
get_dest_item_at_pos(
drag_x: number,
drag_y: number,
path?: TreePath | null,
pos?: (IconViewDropPosition | null) | null,
): boolean;
/**
* Gets information about the item that is highlighted for feedback.
* @param path Return location for the path of the highlighted item, or %NULL.
* @param pos Return location for the drop position, or %NULL
*/
get_drag_dest_item(path?: TreePath | null, pos?: (IconViewDropPosition | null) | null): void;
/**
* Finds the path at the point (`x,` `y)`, relative to bin_window coordinates.
* In contrast to gtk_icon_view_get_path_at_pos(), this function also
* obtains the cell at the specified position. The returned path should
* be freed with gtk_tree_path_free().
* See gtk_icon_view_convert_widget_to_bin_window_coords() for converting
* widget coordinates to bin_window coordinates.
* @param x The x position to be identified
* @param y The y position to be identified
* @param path Return location for the path, or %NULL
* @param cell Return location for the renderer responsible for the cell at (@x, @y), or %NULL
* @returns %TRUE if an item exists at the specified position
*/
get_item_at_pos(x: number, y: number, path: TreePath | null, cell: CellRenderer): boolean;
/**
* Gets the column in which the item `path` is currently
* displayed. Column numbers start at 0.
* @param path the #GtkTreePath of the item
* @returns The column in which the item is displayed
*/
get_item_column(path: TreePath): number;
/**
* Returns the value of the ::item-orientation property which determines
* whether the labels are drawn beside the icons instead of below.
* @returns the relative position of texts and icons
*/
get_item_orientation(): Orientation;
/**
* Returns the value of the ::item-padding property.
* @returns the padding around items
*/
get_item_padding(): number;
/**
* Gets the row in which the item `path` is currently
* displayed. Row numbers start at 0.
* @param path the #GtkTreePath of the item
* @returns The row in which the item is displayed
*/
get_item_row(path: TreePath): number;
/**
* Returns the value of the ::item-width property.
* @returns the width of a single item, or -1
*/
get_item_width(): number;
/**
* Returns the value of the ::margin property.
* @returns the space at the borders
*/
get_margin(): number;
/**
* Returns the column with markup text for `icon_view`.
* @returns the markup column, or -1 if it's unset.
*/
get_markup_column(): number;
/**
* Returns the model the #GtkIconView is based on. Returns %NULL if the
* model is unset.
* @returns A #GtkTreeModel, or %NULL if none is currently being used.
*/
get_model(): TreeModel;
/**
* Returns the value of the ::orientation property which determines
* whether the labels are drawn beside the icons instead of below.
* @returns the relative position of texts and icons
*/
get_orientation(): Orientation;
/**
* Finds the path at the point (`x,` `y)`, relative to bin_window coordinates.
* See gtk_icon_view_get_item_at_pos(), if you are also interested in
* the cell at the specified position.
* See gtk_icon_view_convert_widget_to_bin_window_coords() for converting
* widget coordinates to bin_window coordinates.
* @param x The x position to be identified
* @param y The y position to be identified
* @returns The #GtkTreePath corresponding to the icon or %NULL if no icon exists at that position.
*/
get_path_at_pos(x: number, y: number): TreePath;
/**
* Returns the column with pixbufs for `icon_view`.
* @returns the pixbuf column, or -1 if it's unset.
*/
get_pixbuf_column(): number;
/**
* Retrieves whether the user can reorder the list via drag-and-drop.
* See gtk_icon_view_set_reorderable().
* @returns %TRUE if the list can be reordered.
*/
get_reorderable(): boolean;
/**
* Returns the value of the ::row-spacing property.
* @returns the space between rows
*/
get_row_spacing(): number;
/**
* Creates a list of paths of all selected items. Additionally, if you are
* planning on modifying the model after calling this function, you may
* want to convert the returned list into a list of #GtkTreeRowReference<!-- -->s.
* To do this, you can use gtk_tree_row_reference_new().
*
* To free the return value, use:
*
* ```
* g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
* g_list_free (list);
* ```
*
* @returns A #GList containing a #GtkTreePath for each selected row.
*/
get_selected_items(): TreePath[];
/**
* Gets the selection mode of the `icon_view`.
* @returns the current selection mode
*/
get_selection_mode(): SelectionMode;
/**
* Returns the value of the ::spacing property.
* @returns the space between cells
*/
get_spacing(): number;
/**
* Returns the column with text for `icon_view`.
* @returns the text column, or -1 if it's unset.
*/
get_text_column(): number;
/**
* Returns the column of `icon_view'`s model which is being used for
* displaying tooltips on `icon_view'`s rows.
* @returns the index of the tooltip column that is currently being used, or -1 if this is disabled.
*/
get_tooltip_column(): number;
/**
* This function is supposed to be used in a #GtkWidget::query-tooltip
* signal handler for #GtkIconView. The `x,` `y` and `keyboard_tip` values
* which are received in the signal handler, should be passed to this
* function without modification.
*
* The return value indicates whether there is an icon view item at the given
* coordinates (%TRUE) or not (%FALSE) for mouse tooltips. For keyboard
* tooltips the item returned will be the cursor item. When %TRUE, then any of
* `model,` `path` and `iter` which have been provided will be set to point to
* that row and the corresponding model. `x` and `y` will always be converted
* to be relative to `icon_view'`s bin_window if `keyboard_tooltip` is %FALSE.
* @param x the x coordinate (relative to widget coordinates)
* @param y the y coordinate (relative to widget coordinates)
* @param keyboard_tip whether this is a keyboard tooltip or not
* @returns whether or not the given tooltip context points to a item
*/
get_tooltip_context(
x: number,
y: number,
keyboard_tip: boolean,
): [boolean, number, number, TreeModel | null, TreePath | null, TreeIter | null];
/**
* Sets `start_path` and `end_path` to be the first and last visible path.
* Note that there may be invisible paths in between.
*
* Both paths should be freed with gtk_tree_path_free() after use.
* @param start_path Return location for start of region, or %NULL
* @param end_path Return location for end of region, or %NULL
* @returns %TRUE, if valid paths were placed in @start_path and @end_path
*/
get_visible_range(start_path?: TreePath | null, end_path?: TreePath | null): boolean;
/**
* Activates the item determined by `path`.
* @param path The #GtkTreePath to be activated
*/
item_activated(path: TreePath): void;
/**
* Returns %TRUE if the icon pointed to by `path` is currently
* selected. If `path` does not point to a valid location, %FALSE is returned.
* @param path A #GtkTreePath to check selection on.
* @returns %TRUE if @path is selected.
*/
path_is_selected(path: TreePath): boolean;
/**
* Moves the alignments of `icon_view` to the position specified by `path`.
* `row_align` determines where the row is placed, and `col_align` determines
* where `column` is placed. Both are expected to be between 0.0 and 1.0.
* 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means
* center.
*
* If `use_align` is %FALSE, then the alignment arguments are ignored, and the
* tree does the minimum amount of work to scroll the item onto the screen.
* This means that the item will be scrolled to the edge closest to its current
* position. If the item is currently visible on the screen, nothing is done.
*
* This function only works if the model is set, and `path` is a valid row on
* the model. If the model changes before the `icon_view` is realized, the
* centered path will be modified to reflect this change.
* @param path The path of the item to move to.
* @param use_align whether to use alignment arguments, or %FALSE.
* @param row_align The vertical alignment of the item specified by @path.
* @param col_align The horizontal alignment of the item specified by @path.
*/
scroll_to_path(path: TreePath, use_align: boolean, row_align: number, col_align: number): void;
/**
* Selects all the icons. `icon_view` must has its selection mode set
* to #GTK_SELECTION_MULTIPLE.
*/
select_all(): void;
/**
* Selects the row at `path`.
* @param path The #GtkTreePath to be selected.
*/
select_path(path: TreePath): void;
/**
* Calls a function for each selected icon. Note that the model or
* selection cannot be modified from within this function.
* @param func The function to call for each selected icon.
*/
selected_foreach(func: IconViewForeachFunc): void;
/**
* Sets the ::column-spacing property which specifies the space
* which is inserted between the columns of the icon view.
* @param column_spacing the column spacing
*/
set_column_spacing(column_spacing: number): void;
/**
* Sets the ::columns property which determines in how
* many columns the icons are arranged. If `columns` is
* -1, the number of columns will be chosen automatically
* to fill the available area.
* @param columns the number of columns
*/
set_columns(columns: number): void;
/**
* Sets the current keyboard focus to be at `path,` and selects it. This is
* useful when you want to focus the user's attention on a particular item.
* If `cell` is not %NULL, then focus is given to the cell specified by
* it. Additionally, if `start_editing` is %TRUE, then editing should be
* started in the specified cell.
*
* This function is often followed by <literal>gtk_widget_grab_focus
* (icon_view)</literal> in order to give keyboard focus to the widget.
* Please note that editing can only happen when the widget is realized.
* @param path A #GtkTreePath
* @param cell One of the cell renderers of @icon_view, or %NULL
* @param start_editing %TRUE if the specified cell should start being edited.
*/
set_cursor(path: TreePath, cell: CellRenderer | null, start_editing: boolean): void;
/**
* Sets the item that is highlighted for feedback.
* @param path The path of the item to highlight, or %NULL.
* @param pos Specifies where to drop, relative to the item
*/
set_drag_dest_item(path: TreePath | null, pos: IconViewDropPosition | null): void;
/**
* Sets the ::item-orientation property which determines whether
* the labels are drawn beside the icons instead of below.
* @param orientation the relative position of texts and icons
*/
set_item_orientation(orientation: Orientation | null): void;
/**
* Sets the #GtkIconView:item-padding property which specifies the padding
* around each of the icon view's items.
* @param item_padding the item padding
*/
set_item_padding(item_padding: number): void;
/**
* Sets the ::item-width property which specifies the width
* to use for each item. If it is set to -1, the icon view will
* automatically determine a suitable item size.
* @param item_width the width for each item
*/
set_item_width(item_width: number): void;
/**
* Sets the ::margin property which specifies the space
* which is inserted at the top, bottom, left and right
* of the icon view.
* @param margin the margin
*/
set_margin(margin: number): void;
/**
* Sets the column with markup information for `icon_view` to be
* `column`. The markup column must be of type #G_TYPE_STRING.
* If the markup column is set to something, it overrides
* the text column set by gtk_icon_view_set_text_column().
* @param column A column in the currently used model, or -1 to display no text
*/
set_markup_column(column: number): void;
/**
* Sets the model for a #GtkIconView.
* If the `icon_view` already has a model set, it will remove
* it before setting the new model. If `model` is %NULL, then
* it will unset the old model.
* @param model The model.
*/
set_model(model?: TreeModel | null): void;
/**
* Sets the ::orientation property which determines whether the labels
* are drawn beside the icons instead of below.
* @param orientation the relative position of texts and icons
*/
set_orientation(orientation: Orientation | null): void;
/**
* Sets the column with pixbufs for `icon_view` to be `column`. The pixbuf
* column must be of type #GDK_TYPE_PIXBUF
* @param column A column in the currently used model, or -1 to disable
*/
set_pixbuf_column(column: number): void;
/**
* This function is a convenience function to allow you to reorder models that
* support the #GtkTreeDragSourceIface and the #GtkTreeDragDestIface. Both
* #GtkTreeStore and #GtkListStore support these. If `reorderable` is %TRUE, then
* the user can reorder the model by dragging and dropping rows. The
* developer can listen to these changes by connecting to the model's
* row_inserted and row_deleted signals. The reordering is implemented by setting up
* the icon view as a drag source and destination. Therefore, drag and
* drop can not be used in a reorderable view for any other purpose.
*
* This function does not give you any degree of control over the order -- any
* reordering is allowed. If more control is needed, you should probably
* handle drag and drop manually.
* @param reorderable %TRUE, if the list of items can be reordered.
*/
set_reorderable(reorderable: boolean): void;
/**
* Sets the ::row-spacing property which specifies the space
* which is inserted between the rows of the icon view.
* @param row_spacing the row spacing
*/
set_row_spacing(row_spacing: number): void;
/**
* Sets the selection mode of the `icon_view`.
* @param mode The selection mode
*/
set_selection_mode(mode: SelectionMode | null): void;
/**
* Sets the ::spacing property which specifies the space
* which is inserted between the cells (i.e. the icon and
* the text) of an item.
* @param spacing the spacing
*/
set_spacing(spacing: number): void;
/**
* Sets the column with text for `icon_view` to be `column`. The text
* column must be of type #G_TYPE_STRING.
* @param column A column in the currently used model, or -1 to display no text
*/
set_text_column(column: number): void;
/**
* Sets the tip area of `tooltip` to the area which `cell` occupies in
* the item pointed to by `path`. See also gtk_tooltip_set_tip_area().
*
* See also gtk_icon_view_set_tooltip_column() for a simpler alternative.
* @param tooltip a #GtkTooltip
* @param path a #GtkTreePath
* @param cell a #GtkCellRenderer or %NULL
*/
set_tooltip_cell(tooltip: Tooltip, path: TreePath, cell?: CellRenderer | null): void;
/**
* If you only plan to have simple (text-only) tooltips on full items, you
* can use this function to have #GtkIconView handle these automatically
* for you. `column` should be set to the column in `icon_view'`s model
* containing the tooltip texts, or -1 to disable this feature.
*
* When enabled, #GtkWidget::has-tooltip will be set to %TRUE and
* `icon_view` will connect a #GtkWidget::query-tooltip signal handler.
* @param column an integer, which is a valid column number for @icon_view's model
*/
set_tooltip_column(column: number): void;
/**
* Sets the tip area of `tooltip` to be the area covered by the item at `path`.
* See also gtk_icon_view_set_tooltip_column() for a simpler alternative.
* See also gtk_tooltip_set_tip_area().
* @param tooltip a #GtkTooltip
* @param path a #GtkTreePath
*/
set_tooltip_item(tooltip: Tooltip, path: TreePath): void;
/**
* Unselects all the icons.
*/
unselect_all(): void;
/**
* Unselects the row at `path`.
* @param path The #GtkTreePath to be unselected.
*/
unselect_path(path: TreePath): void;
/**
* Undoes the effect of gtk_icon_view_enable_model_drag_dest(). Calling this
* method sets #GtkIconView:reorderable to %FALSE.
*/
unset_model_drag_dest(): void;
/**
* Undoes the effect of gtk_icon_view_enable_model_drag_source(). Calling this
* method sets #GtkIconView:reorderable to %FALSE.
*/
unset_model_drag_source(): void;
// Inherited methods
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): 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;
}
class Identifier {
static $gtype: GObject.GType<Identifier>;
// Constructors
_init(...args: any[]): void;
}
namespace Image {
// Constructor properties interface
interface ConstructorProps
extends Misc.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
file: string;
gicon: Gio.Icon;
icon_name: string;
iconName: string;
icon_set: IconSet;
iconSet: IconSet;
icon_size: number;
iconSize: number;
image: Gdk.Image;
mask: Gdk.Pixmap;
pixbuf: GdkPixbuf.Pixbuf;
pixbuf_animation: GdkPixbuf.PixbufAnimation;
pixbufAnimation: GdkPixbuf.PixbufAnimation;
pixel_size: number;
pixelSize: number;
pixmap: Gdk.Pixmap;
stock: string;
storage_type: ImageType;
storageType: ImageType;
}
}
/**
* The #GtkImage widget displays an image. Various kinds of object
* can be displayed as an image; most typically, you would load a
* #GdkPixbuf ("pixel buffer") from a file, and then display that.
* There's a convenience function to do this, gtk_image_new_from_file(),
* used as follows:
* <informalexample><programlisting>
* GtkWidget *image;
* image = gtk_image_new_from_file ("myfile.png");
* </programlisting></informalexample>
* If the file isn't loaded successfully, the image will contain a
* "broken image" icon similar to that used in many web browsers.
* If you want to handle errors in loading the file yourself,
* for example by displaying an error message, then load the image with
* gdk_pixbuf_new_from_file(), then create the #GtkImage with
* gtk_image_new_from_pixbuf().
*
* The image file may contain an animation, if so the #GtkImage will
* display an animation (#GdkPixbufAnimation) instead of a static image.
*
* #GtkImage is a subclass of #GtkMisc, which implies that you can
* align it (center, left, right) and add padding to it, using
* #GtkMisc methods.
*
* #GtkImage is a "no window" widget (has no #GdkWindow of its own),
* so by default does not receive events. If you want to receive events
* on the image, such as button clicks, place the image inside a
* #GtkEventBox, then connect to the event signals on the event box.
* <example>
* <title>Handling button press events on a
* <structname>GtkImage</structname>.</title>
* <programlisting>
* static gboolean
* button_press_callback (GtkWidget *event_box,
* GdkEventButton *event,
* gpointer data)
* {
* g_print ("Event box clicked at coordinates &percnt;f,&percnt;f\n",
* event->x, event->y);
*
* /<!---->* Returning TRUE means we handled the event, so the signal
* * emission should be stopped (don't call any further
* * callbacks that may be connected). Return FALSE
* * to continue invoking callbacks.
* *<!---->/
* return TRUE;
* }
*
* static GtkWidget*
* create_image (void)
* {
* GtkWidget *image;
* GtkWidget *event_box;
*
* image = gtk_image_new_from_file ("myfile.png");
*
* event_box = gtk_event_box_new (<!-- -->);
*
* gtk_container_add (GTK_CONTAINER (event_box), image);
*
* g_signal_connect (G_OBJECT (event_box),
* "button_press_event",
* G_CALLBACK (button_press_callback),
* image);
*
* return image;
* }
* </programlisting>
* </example>
*
* When handling events on the event box, keep in mind that coordinates
* in the image may be different from event box coordinates due to
* the alignment and padding settings on the image (see #GtkMisc).
* The simplest way to solve this is to set the alignment to 0.0
* (left/top), and set the padding to zero. Then the origin of
* the image will be the same as the origin of the event box.
*
* Sometimes an application will want to avoid depending on external data
* files, such as image files. GTK+ comes with a program to avoid this,
* called <application>gdk-pixbuf-csource</application>. This program
* allows you to convert an image into a C variable declaration, which
* can then be loaded into a #GdkPixbuf using
* gdk_pixbuf_new_from_inline().
*/
class Image extends Misc implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Image>;
// Properties
get file(): string;
set file(val: string);
/**
* The GIcon displayed in the GtkImage. For themed icons,
* If the icon theme is changed, the image will be updated
* automatically.
*/
get gicon(): Gio.Icon;
set gicon(val: Gio.Icon);
/**
* The name of the icon in the icon theme. If the icon theme is
* changed, the image will be updated automatically.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of the icon in the icon theme. If the icon theme is
* changed, the image will be updated automatically.
*/
get iconName(): string;
set iconName(val: string);
get icon_set(): IconSet;
set icon_set(val: IconSet);
get iconSet(): IconSet;
set iconSet(val: IconSet);
get icon_size(): number;
set icon_size(val: number);
get iconSize(): number;
set iconSize(val: number);
get image(): Gdk.Image;
set image(val: Gdk.Image);
get mask(): Gdk.Pixmap;
set mask(val: Gdk.Pixmap);
get pixbuf(): GdkPixbuf.Pixbuf;
set pixbuf(val: GdkPixbuf.Pixbuf);
get pixbuf_animation(): GdkPixbuf.PixbufAnimation;
set pixbuf_animation(val: GdkPixbuf.PixbufAnimation);
get pixbufAnimation(): GdkPixbuf.PixbufAnimation;
set pixbufAnimation(val: GdkPixbuf.PixbufAnimation);
/**
* The "pixel-size" property can be used to specify a fixed size
* overriding the #GtkImage:icon-size property for images of type
* %GTK_IMAGE_ICON_NAME.
*/
get pixel_size(): number;
set pixel_size(val: number);
/**
* The "pixel-size" property can be used to specify a fixed size
* overriding the #GtkImage:icon-size property for images of type
* %GTK_IMAGE_ICON_NAME.
*/
get pixelSize(): number;
set pixelSize(val: number);
get pixmap(): Gdk.Pixmap;
set pixmap(val: Gdk.Pixmap);
get stock(): string;
set stock(val: string);
get storage_type(): ImageType;
get storageType(): ImageType;
// Fields
misc: Misc;
// Constructors
constructor(properties?: Partial<Image.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Image;
static new_from_animation(animation: GdkPixbuf.PixbufAnimation): Image;
static new_from_file(filename: string): Image;
static new_from_gicon(icon: Gio.Icon, size: number): Image;
static new_from_icon_name(icon_name: string, size: number): Image;
static new_from_icon_set(icon_set: IconSet, size: number): Image;
static new_from_image(image?: Gdk.Image | null, mask?: Gdk.Bitmap | null): Image;
static new_from_pixbuf(pixbuf?: GdkPixbuf.Pixbuf | null): Image;
static new_from_pixmap(pixmap?: Gdk.Pixmap | null, mask?: Gdk.Bitmap | null): Image;
static new_from_stock(stock_id: string, size: number): Image;
// Methods
/**
* Resets the image to be empty.
*/
clear(): void;
/**
* Gets the #GtkImage.
* @param val return location for a #GdkImage
* @param mask a #GdkBitmap that indicates which parts of the image should be transparent.
*/
get(val: Gdk.Image, mask: Gdk.Bitmap): void;
/**
* Gets the #GdkPixbufAnimation being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_ANIMATION (see gtk_image_get_storage_type()).
* The caller of this function does not own a reference to the
* returned animation.
* @returns the displayed animation, or %NULL if the image is empty
*/
get_animation(): GdkPixbuf.PixbufAnimation;
/**
* Gets the #GIcon and size being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_GICON (see gtk_image_get_storage_type()).
* The caller of this function does not own a reference to the
* returned #GIcon.
*/
get_gicon(): [Gio.Icon | null, number];
/**
* Gets the icon name and size being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_ICON_NAME (see gtk_image_get_storage_type()).
* The returned string is owned by the #GtkImage and should not
* be freed.
*/
get_icon_name(): [string, number];
/**
* Gets the icon set and size being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_ICON_SET (see gtk_image_get_storage_type()).
*/
get_icon_set(): [IconSet | null, number];
/**
* Gets the #GdkImage and mask being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_IMAGE (see gtk_image_get_storage_type()).
* The caller of this function does not own a reference to the
* returned image and mask.
*/
get_image(): [Gdk.Image | null, Gdk.Bitmap | null];
/**
* Gets the #GdkPixbuf being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_PIXBUF (see gtk_image_get_storage_type()).
* The caller of this function does not own a reference to the
* returned pixbuf.
* @returns the displayed pixbuf, or %NULL if the image is empty
*/
get_pixbuf(): GdkPixbuf.Pixbuf;
/**
* Gets the pixel size used for named icons.
* @returns the pixel size used for named icons.
*/
get_pixel_size(): number;
/**
* Gets the pixmap and mask being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_PIXMAP (see gtk_image_get_storage_type()).
* The caller of this function does not own a reference to the
* returned pixmap and mask.
*/
get_pixmap(): [Gdk.Pixmap | null, Gdk.Bitmap | null];
/**
* Gets the stock icon name and size being displayed by the #GtkImage.
* The storage type of the image must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_STOCK (see gtk_image_get_storage_type()).
* The returned string is owned by the #GtkImage and should not
* be freed.
*/
get_stock(): [string, number];
/**
* Gets the type of representation being used by the #GtkImage
* to store image data. If the #GtkImage has no image data,
* the return value will be %GTK_IMAGE_EMPTY.
* @returns image representation being used
*/
get_storage_type(): ImageType;
/**
* Sets the #GtkImage.
* @param val a #GdkImage
* @param mask a #GdkBitmap that indicates which parts of the image should be transparent.
*/
set(val: Gdk.Image, mask: Gdk.Bitmap): void;
// Conflicted with GObject.Object.set
set(...args: never[]): any;
/**
* Causes the #GtkImage to display the given animation (or display
* nothing, if you set the animation to %NULL).
* @param animation the #GdkPixbufAnimation
*/
set_from_animation(animation: GdkPixbuf.PixbufAnimation): void;
/**
* See gtk_image_new_from_file() for details.
* @param filename a filename or %NULL
*/
set_from_file(filename?: string | null): void;
/**
* See gtk_image_new_from_gicon() for details.
* @param icon an icon
* @param size an icon size
*/
set_from_gicon(icon: Gio.Icon, size: number): void;
/**
* See gtk_image_new_from_icon_name() for details.
* @param icon_name an icon name
* @param size an icon size
*/
set_from_icon_name(icon_name: string, size: number): void;
/**
* See gtk_image_new_from_icon_set() for details.
* @param icon_set a #GtkIconSet
* @param size a stock icon size
*/
set_from_icon_set(icon_set: IconSet, size: number): void;
/**
* See gtk_image_new_from_image() for details.
* @param gdk_image a #GdkImage or %NULL
* @param mask a #GdkBitmap or %NULL
*/
set_from_image(gdk_image?: Gdk.Image | null, mask?: Gdk.Bitmap | null): void;
/**
* See gtk_image_new_from_pixbuf() for details.
* @param pixbuf a #GdkPixbuf or %NULL
*/
set_from_pixbuf(pixbuf?: GdkPixbuf.Pixbuf | null): void;
/**
* See gtk_image_new_from_pixmap() for details.
* @param pixmap a #GdkPixmap or %NULL
* @param mask a #GdkBitmap or %NULL
*/
set_from_pixmap(pixmap?: Gdk.Pixmap | null, mask?: Gdk.Bitmap | null): void;
/**
* See gtk_image_new_from_stock() for details.
* @param stock_id a stock icon name
* @param size a stock icon size
*/
set_from_stock(stock_id: string, size: number): void;
/**
* Sets the pixel size to use for named icons. If the pixel size is set
* to a value != -1, it is used instead of the icon size set by
* gtk_image_set_from_icon_name().
* @param pixel_size the new pixel size
*/
set_pixel_size(pixel_size: number): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ImageMenuItem {
// Constructor properties interface
interface ConstructorProps
extends MenuItem.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
accel_group: AccelGroup;
accelGroup: AccelGroup;
always_show_image: boolean;
alwaysShowImage: boolean;
image: Widget;
use_stock: boolean;
useStock: boolean;
}
}
class ImageMenuItem extends MenuItem implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<ImageMenuItem>;
// Properties
/**
* The Accel Group to use for stock accelerator keys
*/
set accel_group(val: AccelGroup);
/**
* The Accel Group to use for stock accelerator keys
*/
set accelGroup(val: AccelGroup);
/**
* If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images
* setting and always show the image, if available.
*
* Use this property if the menuitem would be useless or hard to use
* without the image.
*/
get always_show_image(): boolean;
set always_show_image(val: boolean);
/**
* If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images
* setting and always show the image, if available.
*
* Use this property if the menuitem would be useless or hard to use
* without the image.
*/
get alwaysShowImage(): boolean;
set alwaysShowImage(val: boolean);
get image(): Widget;
set image(val: Widget);
/**
* If %TRUE, the label set in the menuitem is used as a
* stock id to select the stock item for the item.
*/
get use_stock(): boolean;
set use_stock(val: boolean);
/**
* If %TRUE, the label set in the menuitem is used as a
* stock id to select the stock item for the item.
*/
get useStock(): boolean;
set useStock(val: boolean);
// Fields
menu_item: MenuItem;
// Constructors
constructor(properties?: Partial<ImageMenuItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ImageMenuItem;
static new_from_stock(stock_id: string, accel_group?: AccelGroup | null): ImageMenuItem;
static new_with_label(label: string): ImageMenuItem;
static new_with_mnemonic(label: string): ImageMenuItem;
// Methods
/**
* Returns whether the menu item will ignore the #GtkSettings:gtk-menu-images
* setting and always show the image, if available.
* @returns %TRUE if the menu item will always show the image
*/
get_always_show_image(): boolean;
/**
* Gets the widget that is currently set as the image of `image_menu_item`.
* See gtk_image_menu_item_set_image().
* @returns the widget set as image of @image_menu_item
*/
get_image(): Widget;
/**
* Checks whether the label set in the menuitem is used as a
* stock id to select the stock item for the item.
* @returns %TRUE if the label set in the menuitem is used as a stock id to select the stock item for the item
*/
get_use_stock(): boolean;
/**
* Specifies an `accel_group` to add the menu items accelerator to
* (this only applies to stock items so a stock item must already
* be set, make sure to call gtk_image_menu_item_set_use_stock()
* and gtk_menu_item_set_label() with a valid stock item first).
*
* If you want this menu item to have changeable accelerators then
* you shouldnt need this (see gtk_image_menu_item_new_from_stock()).
* @param accel_group the #GtkAccelGroup
*/
set_accel_group(accel_group: AccelGroup): void;
/**
* If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images
* setting and always show the image, if available.
*
* Use this property if the menuitem would be useless or hard to use
* without the image.
* @param always_show %TRUE if the menuitem should always show the image
*/
set_always_show_image(always_show: boolean): void;
/**
* Sets the image of `image_menu_item` to the given widget.
* Note that it depends on the show-menu-images setting whether
* the image will be displayed or not.
* @param image a widget to set as the image for the menu item.
*/
set_image(image?: Widget | null): void;
/**
* If %TRUE, the label set in the menuitem is used as a
* stock id to select the stock item for the item.
* @param use_stock %TRUE if the menuitem should use a stock item
*/
set_use_stock(use_stock: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace InfoBar {
// Signal callback interfaces
interface Close {
(): void;
}
interface Response {
(response_id: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends HBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
message_type: MessageType;
messageType: MessageType;
}
}
/**
* #GtkInfoBar is a widget that can be used to show messages to
* the user without showing a dialog. It is often temporarily shown
* at the top or bottom of a document. In contrast to #GtkDialog, which
* has a horizontal action area at the bottom, #GtkInfoBar has a
* vertical action area at the side.
*
* The API of #GtkInfoBar is very similar to #GtkDialog, allowing you
* to add buttons to the action area with gtk_info_bar_add_button() or
* gtk_info_bar_new_with_buttons(). The sensitivity of action widgets
* can be controlled with gtk_info_bar_set_response_sensitive().
* To add widgets to the main content area of a #GtkInfoBar, use
* gtk_info_bar_get_content_area() and add your widgets to the container.
*
* Similar to #GtkMessageDialog, the contents of a #GtkInfoBar can by
* classified as error message, warning, informational message, etc,
* by using gtk_info_bar_set_message_type(). GTK+ uses the message type
* to determine the background color of the message area.
*
* <example>
* <title>Simple GtkInfoBar usage.</title>
* <programlisting>
* /&ast; set up info bar &ast;/
* info_bar = gtk_info_bar_new ();
* gtk_widget_set_no_show_all (info_bar, TRUE);
* message_label = gtk_label_new ("");
* gtk_widget_show (message_label);
* content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar));
* gtk_container_add (GTK_CONTAINER (content_area), message_label);
* gtk_info_bar_add_button (GTK_INFO_BAR (info_bar),
* GTK_STOCK_OK, GTK_RESPONSE_OK);
* g_signal_connect (info_bar, "response",
* G_CALLBACK (gtk_widget_hide), NULL);
* gtk_table_attach (GTK_TABLE (table),
* info_bar,
* 0, 1, 2, 3,
* GTK_EXPAND | GTK_FILL, 0,
* 0, 0);
*
* /&ast; ... &ast;/
*
* /&ast; show an error message &ast;/
* gtk_label_set_text (GTK_LABEL (message_label), error_message);
* gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar),
* GTK_MESSAGE_ERROR);
* gtk_widget_show (info_bar);
* </programlisting>
* </example>
*
* <refsect2 id="GtkInfoBar-BUILDER-UI">
* <title>GtkInfoBar as GtkBuildable</title>
* <para>
* The GtkInfoBar implementation of the GtkBuildable interface exposes
* the content area and action area as internal children with the names
* "content_area" and "action_area".
* </para>
* <para>
* GtkInfoBar supports a custom &lt;action-widgets&gt; element, which
* can contain multiple &lt;action-widget&gt; elements. The "response"
* attribute specifies a numeric response, and the content of the element
* is the id of widget (which should be a child of the dialogs `action_area)`.
* </para>
* </refsect2>
*/
class InfoBar extends HBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<InfoBar>;
// Properties
/**
* The type of the message.
*
* The type is used to determine the colors to use in the info bar.
* The following symbolic color names can by used to customize
* these colors:
* "info_fg_color", "info_bg_color",
* "warning_fg_color", "warning_bg_color",
* "question_fg_color", "question_bg_color",
* "error_fg_color", "error_bg_color".
* "other_fg_color", "other_bg_color".
*
* If the type is #GTK_MESSAGE_OTHER, no info bar is painted but the
* colors are still set.
*/
get message_type(): MessageType;
set message_type(val: MessageType);
/**
* The type of the message.
*
* The type is used to determine the colors to use in the info bar.
* The following symbolic color names can by used to customize
* these colors:
* "info_fg_color", "info_bg_color",
* "warning_fg_color", "warning_bg_color",
* "question_fg_color", "question_bg_color",
* "error_fg_color", "error_bg_color".
* "other_fg_color", "other_bg_color".
*
* If the type is #GTK_MESSAGE_OTHER, no info bar is painted but the
* colors are still set.
*/
get messageType(): MessageType;
set messageType(val: MessageType);
// Constructors
constructor(properties?: Partial<InfoBar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): InfoBar;
// 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', callback: (_source: this) => void): number;
connect_after(signal: 'close', callback: (_source: this) => void): number;
emit(signal: 'close'): void;
connect(signal: 'response', callback: (_source: this, response_id: number) => void): number;
connect_after(signal: 'response', callback: (_source: this, response_id: number) => void): number;
emit(signal: 'response', response_id: number): void;
// Virtual methods
vfunc_close(): void;
/**
* Emits the 'response' signal with the given `response_id`.
* @param response_id a response ID
*/
vfunc_response(response_id: number): void;
// Methods
/**
* Add an activatable widget to the action area of a #GtkInfoBar,
* connecting a signal handler that will emit the #GtkInfoBar::response
* signal on the message area when the widget is activated. The widget
* is appended to the end of the message areas action area.
* @param child an activatable widget
* @param response_id response ID for @child
*/
add_action_widget(child: Widget, response_id: number): void;
/**
* Adds a button with the given text (or a stock button, if button_text
* is a stock ID) and sets things up so that clicking the button will emit
* the "response" signal with the given response_id. The button is appended
* to the end of the info bars's action area. The button widget is
* returned, but usually you don't need it.
* @param button_text text of button, or stock ID
* @param response_id response ID for the button
* @returns the button widget that was added
*/
add_button(button_text: string, response_id: number): Widget;
/**
* Returns the action area of `info_bar`.
* @returns the action area
*/
get_action_area(): Widget;
/**
* Returns the content area of `info_bar`.
* @returns the content area
*/
get_content_area(): Widget;
/**
* Returns the message type of the message area.
* @returns the message type of the message area.
*/
get_message_type(): MessageType;
/**
* Emits the 'response' signal with the given `response_id`.
* @param response_id a response ID
*/
response(response_id: number): void;
/**
* Sets the last widget in the info bar's action area with
* the given response_id as the default widget for the dialog.
* Pressing "Enter" normally activates the default widget.
*
* Note that this function currently requires `info_bar` to
* be added to a widget hierarchy.
* @param response_id a response ID
*/
set_default_response(response_id: number): void;
/**
* Sets the message type of the message area.
* GTK+ uses this type to determine what color to use
* when drawing the message area.
* @param message_type a #GtkMessageType
*/
set_message_type(message_type: MessageType | null): void;
/**
* Calls gtk_widget_set_sensitive (widget, setting) for each
* widget in the info bars's action area with the given response_id.
* A convenient way to sensitize/desensitize dialog buttons.
* @param response_id a response ID
* @param setting TRUE for sensitive
*/
set_response_sensitive(response_id: number, setting: 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 InputDialog {
// Signal callback interfaces
interface DisableDevice {
(object: Gdk.Device): void;
}
interface EnableDevice {
(object: Gdk.Device): void;
}
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
class InputDialog extends Dialog implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<InputDialog>;
// Fields
dialog: Dialog;
axis_list: Widget;
axis_listbox: Widget;
mode_optionmenu: Widget;
close_button: Widget;
save_button: Widget;
axis_items: Widget[];
current_device: Gdk.Device;
keys_list: Widget;
keys_listbox: Widget;
// Constructors
constructor(properties?: Partial<InputDialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): InputDialog;
// 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: 'disable-device', callback: (_source: this, object: Gdk.Device) => void): number;
connect_after(signal: 'disable-device', callback: (_source: this, object: Gdk.Device) => void): number;
emit(signal: 'disable-device', object: Gdk.Device): void;
connect(signal: 'enable-device', callback: (_source: this, object: Gdk.Device) => void): number;
connect_after(signal: 'enable-device', callback: (_source: this, object: Gdk.Device) => void): number;
emit(signal: 'enable-device', object: Gdk.Device): void;
// Virtual methods
vfunc_disable_device(device: Gdk.Device): void;
vfunc_enable_device(device: Gdk.Device): 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 Invisible {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
screen: Gdk.Screen;
}
}
class Invisible extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Invisible>;
// Properties
get screen(): Gdk.Screen;
set screen(val: Gdk.Screen);
// Fields
widget: Widget;
has_user_ref_count: boolean;
// Constructors
constructor(properties?: Partial<Invisible.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Invisible;
static new_for_screen(screen: Gdk.Screen): Invisible;
// Methods
/**
* Returns the #GdkScreen object associated with `invisible`
* @returns the associated #GdkScreen.
*/
get_screen(): Gdk.Screen;
/**
* Sets the #GdkScreen where the #GtkInvisible object will be displayed.
* @param screen a #GdkScreen.
*/
set_screen(screen: Gdk.Screen): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Item {
// Signal callback interfaces
interface Deselect {
(): void;
}
interface Select {
(): void;
}
interface Toggle {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
abstract class Item extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Item>;
// Fields
bin: Bin;
// Constructors
constructor(properties?: Partial<Item.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'deselect', callback: (_source: this) => void): number;
connect_after(signal: 'deselect', callback: (_source: this) => void): number;
emit(signal: 'deselect'): void;
connect(signal: 'select', callback: (_source: this) => void): number;
connect_after(signal: 'select', callback: (_source: this) => void): number;
emit(signal: 'select'): void;
connect(signal: 'toggle', callback: (_source: this) => void): number;
connect_after(signal: 'toggle', callback: (_source: this) => void): number;
emit(signal: 'toggle'): void;
// Static methods
/**
* Deletes all widgets constructed from the specified path.
* @param ifactory_path a factory path to prepend to @path. May be %NULL if @path starts with a factory path
* @param path a path
*/
static factories_path_delete(ifactory_path: string, path: string): void;
// Virtual methods
vfunc_deselect(): void;
vfunc_select(): void;
vfunc_toggle(): void;
// Methods
deselect(): void;
select(): void;
toggle(): 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 ItemFactory {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
class ItemFactory extends Object {
static $gtype: GObject.GType<ItemFactory>;
// Fields
object: Object;
path: string;
accel_group: AccelGroup;
widget: Widget;
items: any[];
translate_func: TranslateFunc;
translate_data: any;
translate_notify: GLib.DestroyNotify;
// Constructors
constructor(properties?: Partial<ItemFactory.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](container_type: GObject.GType, path: string, accel_group?: AccelGroup | null): ItemFactory;
// Static methods
/**
* Installs an accelerator for `accel_widget` in `accel_group,` that causes
* the ::activate signal to be emitted if the accelerator is activated.
*
* This function can be used to make widgets participate in the accel
* saving/restoring functionality provided by gtk_accel_map_save() and
* gtk_accel_map_load(), even if they haven't been created by an item
* factory.
* @param accel_widget widget to install an accelerator on
* @param full_path the full path for the @accel_widget
* @param accel_group the accelerator group to install the accelerator in
* @param keyval key value of the accelerator
* @param modifiers modifier combination of the accelerator
*/
static add_foreign(
accel_widget: Widget,
full_path: string,
accel_group: AccelGroup,
keyval: number,
modifiers: Gdk.ModifierType,
): void;
/**
* Creates the menu items from the `entries`.
* @param n_entries the length of @entries
* @param entries an array of #GtkMenuEntry<!-- -->s
*/
static create_menu_entries(n_entries: number, entries: MenuEntry): void;
/**
* If `widget` has been created by an item factory, returns the full path
* to it. (The full path of a widget is the concatenation of the factory
* path specified in gtk_item_factory_new() with the path specified in the
* #GtkItemFactoryEntry from which the widget was created.)
* @param widget a widget
*/
static path_from_widget(widget: Widget): string;
/**
* Obtains the `popup_data` which was passed to
* gtk_item_factory_popup_with_data(). This data is available until the menu
* is popped down again.
* @param widget a widget
*/
static popup_data_from_widget(widget: Widget): any | null;
// Methods
/**
* Initializes an item factory.
* @param container_type the kind of menu to create; can be #GTK_TYPE_MENU_BAR, #GTK_TYPE_MENU or #GTK_TYPE_OPTION_MENU
* @param path the factory path of @ifactory, a string of the form <literal>"&lt;name&gt;"</literal>
* @param accel_group a #GtkAccelGroup to which the accelerators for the menu items will be added, or %NULL to create a new one
*/
construct(container_type: GObject.GType, path: string, accel_group: AccelGroup): void;
/**
* Creates an item for `entry`.
* @param entry the #GtkItemFactoryEntry to create an item for
* @param callback_data data passed to the callback function of @entry
* @param callback_type 1 if the callback function of @entry is of type #GtkItemFactoryCallback1, 2 if it is of type #GtkItemFactoryCallback2
*/
create_item(entry: ItemFactoryEntry, callback_data: any | null, callback_type: number): void;
/**
* Creates the menu items from the `entries`.
* @param n_entries the length of @entries
* @param entries an array of #GtkItemFactoryEntry<!-- -->s whose @callback members must by of type #GtkItemFactoryCallback1
* @param callback_data data passed to the callback functions of all entries
*/
create_items(n_entries: number, entries: ItemFactoryEntry, callback_data?: any | null): void;
/**
* Creates the menu items from the `entries`.
* @param n_entries the length of @entries
* @param entries an array of #GtkItemFactoryEntry<!-- -->s
* @param callback_data data passed to the callback functions of all entries
* @param callback_type 1 if the callback functions in @entries are of type #GtkItemFactoryCallback1, 2 if they are of type #GtkItemFactoryCallback2
*/
create_items_ac(
n_entries: number,
entries: ItemFactoryEntry,
callback_data: any | null,
callback_type: number,
): void;
/**
* Deletes the menu items which were created from the `entries` by the given
* item factory.
* @param n_entries the length of @entries
* @param entries an array of #GtkItemFactoryEntry<!-- -->s
*/
delete_entries(n_entries: number, entries: ItemFactoryEntry): void;
/**
* Deletes the menu item which was created from `entry` by the given
* item factory.
* @param entry a #GtkItemFactoryEntry
*/
delete_entry(entry: ItemFactoryEntry): void;
/**
* Deletes the menu item which was created for `path` by the given
* item factory.
* @param path a path
*/
delete_item(path: string): void;
/**
* Pops up the menu constructed from the item factory at (`x,` `y)`.
*
* The `mouse_button` parameter should be the mouse button pressed to initiate
* the menu popup. If the menu popup was initiated by something other than
* a mouse button press, such as a mouse button release or a keypress,
* `mouse_button` should be 0.
*
* The `time_` parameter should be the time stamp of the event that
* initiated the popup. If such an event is not available, use
* gtk_get_current_event_time() instead.
*
* The operation of the `mouse_button` and the `time_` parameter is the same
* as the `button` and `activation_time` parameters for gtk_menu_popup().
* @param x the x position
* @param y the y position
* @param mouse_button the mouse button which was pressed to initiate the popup
* @param time_ the time at which the activation event occurred
*/
popup(x: number, y: number, mouse_button: number, time_: number): void;
/**
* Obtains the `popup_data` which was passed to
* gtk_item_factory_popup_with_data(). This data is available until the menu
* is popped down again.
* @returns @popup_data associated with @ifactory
*/
popup_data(): any | null;
/**
* Pops up the menu constructed from the item factory at (`x,` `y)`. Callbacks
* can access the `popup_data` while the menu is posted via
* gtk_item_factory_popup_data() and gtk_item_factory_popup_data_from_widget().
*
* The `mouse_button` parameter should be the mouse button pressed to initiate
* the menu popup. If the menu popup was initiated by something other than
* a mouse button press, such as a mouse button release or a keypress,
* `mouse_button` should be 0.
*
* The `time_` parameter should be the time stamp of the event that
* initiated the popup. If such an event is not available, use
* gtk_get_current_event_time() instead.
*
* The operation of the `mouse_button` and the `time_` parameters is the same
* as the `button` and `activation_time` parameters for gtk_menu_popup().
* @param popup_data data available for callbacks while the menu is posted
* @param x the x position
* @param y the y position
* @param mouse_button the mouse button which was pressed to initiate the popup
* @param time_ the time at which the activation event occurred
*/
popup_with_data(popup_data: any | null, x: number, y: number, mouse_button: number, time_: number): void;
/**
* Sets a function to be used for translating the path elements before they
* are displayed.
* @param func the #GtkTranslateFunc function to be used to translate path elements
*/
set_translate_func(func: TranslateFunc): void;
}
namespace Label {
// Signal callback interfaces
interface ActivateCurrentLink {
(): void;
}
interface ActivateLink {
(uri: string): boolean;
}
interface CopyClipboard {
(): void;
}
interface MoveCursor {
(step: MovementStep, count: number, extend_selection: boolean): void;
}
interface PopulatePopup {
(menu: Menu): void;
}
// Constructor properties interface
interface ConstructorProps
extends Misc.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
angle: number;
attributes: Pango.AttrList;
cursor_position: number;
cursorPosition: number;
ellipsize: Pango.EllipsizeMode;
justify: Justification;
label: string;
max_width_chars: number;
maxWidthChars: number;
mnemonic_keyval: number;
mnemonicKeyval: number;
mnemonic_widget: Widget;
mnemonicWidget: Widget;
pattern: string;
selectable: boolean;
selection_bound: number;
selectionBound: number;
single_line_mode: boolean;
singleLineMode: boolean;
track_visited_links: boolean;
trackVisitedLinks: boolean;
use_markup: boolean;
useMarkup: boolean;
use_underline: boolean;
useUnderline: boolean;
width_chars: number;
widthChars: number;
wrap: boolean;
wrap_mode: Pango.WrapMode;
wrapMode: Pango.WrapMode;
}
}
class Label extends Misc implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Label>;
// Properties
/**
* The angle that the baseline of the label makes with the horizontal,
* in degrees, measured counterclockwise. An angle of 90 reads from
* from bottom to top, an angle of 270, from top to bottom. Ignored
* if the label is selectable, wrapped, or ellipsized.
*/
get angle(): number;
set angle(val: number);
get attributes(): Pango.AttrList;
set attributes(val: Pango.AttrList);
get cursor_position(): number;
get cursorPosition(): number;
/**
* The preferred place to ellipsize the string, if the label does
* not have enough room to display the entire string, specified as a
* #PangoEllisizeMode.
*
* 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 "...". In particular, this
* means that ellipsizing labels do not work well in notebook tabs, unless
* the tab's #GtkNotebook:tab-expand property is set to %TRUE. Other ways
* to set a label's width are gtk_widget_set_size_request() and
* gtk_label_set_width_chars().
*/
get ellipsize(): Pango.EllipsizeMode;
set ellipsize(val: Pango.EllipsizeMode);
get justify(): Justification;
set justify(val: Justification);
get label(): string;
set label(val: string);
/**
* The desired maximum width of the label, in characters. If this property
* is set to -1, the width will be calculated automatically, otherwise the
* label will request space for no more than the requested number of
* characters. If the #GtkLabel:width-chars property is set to a positive
* value, then the "max-width-chars" property is ignored.
*/
get max_width_chars(): number;
set max_width_chars(val: number);
/**
* The desired maximum width of the label, in characters. If this property
* is set to -1, the width will be calculated automatically, otherwise the
* label will request space for no more than the requested number of
* characters. If the #GtkLabel:width-chars property is set to a positive
* value, then the "max-width-chars" property is ignored.
*/
get maxWidthChars(): number;
set maxWidthChars(val: number);
get mnemonic_keyval(): number;
get mnemonicKeyval(): number;
get mnemonic_widget(): Widget;
set mnemonic_widget(val: Widget);
get mnemonicWidget(): Widget;
set mnemonicWidget(val: Widget);
set pattern(val: string);
get selectable(): boolean;
set selectable(val: boolean);
get selection_bound(): number;
get selectionBound(): number;
/**
* Whether the label is in single line mode. In single line mode,
* the height of the label does not depend on the actual text, it
* is always set to ascent + descent of the font. This can be an
* advantage in situations where resizing the label because of text
* changes would be distracting, e.g. in a statusbar.
*/
get single_line_mode(): boolean;
set single_line_mode(val: boolean);
/**
* Whether the label is in single line mode. In single line mode,
* the height of the label does not depend on the actual text, it
* is always set to ascent + descent of the font. This can be an
* advantage in situations where resizing the label because of text
* changes would be distracting, e.g. in a statusbar.
*/
get singleLineMode(): boolean;
set singleLineMode(val: boolean);
/**
* Set this property to %TRUE to make the label track which links
* have been clicked. It will then apply the ::visited-link-color
* color, instead of ::link-color.
*/
get track_visited_links(): boolean;
set track_visited_links(val: boolean);
/**
* Set this property to %TRUE to make the label track which links
* have been clicked. It will then apply the ::visited-link-color
* color, instead of ::link-color.
*/
get trackVisitedLinks(): boolean;
set trackVisitedLinks(val: boolean);
get use_markup(): boolean;
set use_markup(val: boolean);
get useMarkup(): boolean;
set useMarkup(val: boolean);
get use_underline(): boolean;
set use_underline(val: boolean);
get useUnderline(): boolean;
set useUnderline(val: boolean);
/**
* The desired width of the label, in characters. If this property is set to
* -1, the width will be calculated automatically, otherwise the label will
* request either 3 characters or the property value, whichever is greater.
* If the "width-chars" property is set to a positive value, then the
* #GtkLabel:max-width-chars property is ignored.
*/
get width_chars(): number;
set width_chars(val: number);
/**
* The desired width of the label, in characters. If this property is set to
* -1, the width will be calculated automatically, otherwise the label will
* request either 3 characters or the property value, whichever is greater.
* If the "width-chars" property is set to a positive value, then the
* #GtkLabel:max-width-chars property is ignored.
*/
get widthChars(): number;
set widthChars(val: number);
get wrap(): boolean;
set wrap(val: boolean);
/**
* If line wrapping is on (see the #GtkLabel:wrap property) this controls
* how the line wrapping is done. The default is %PANGO_WRAP_WORD, which
* means wrap on word boundaries.
*/
get wrap_mode(): Pango.WrapMode;
set wrap_mode(val: Pango.WrapMode);
/**
* If line wrapping is on (see the #GtkLabel:wrap property) this controls
* how the line wrapping is done. The default is %PANGO_WRAP_WORD, which
* means wrap on word boundaries.
*/
get wrapMode(): Pango.WrapMode;
set wrapMode(val: Pango.WrapMode);
// Fields
misc: Misc;
// Constructors
constructor(properties?: Partial<Label.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](str: string): Label;
static new_with_mnemonic(str: string): Label;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate-current-link', callback: (_source: this) => void): number;
connect_after(signal: 'activate-current-link', callback: (_source: this) => void): number;
emit(signal: 'activate-current-link'): void;
connect(signal: 'activate-link', callback: (_source: this, uri: string) => boolean): number;
connect_after(signal: 'activate-link', callback: (_source: this, uri: string) => boolean): number;
emit(signal: 'activate-link', uri: string): void;
connect(signal: 'copy-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'copy-clipboard', callback: (_source: this) => void): number;
emit(signal: 'copy-clipboard'): void;
connect(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number, extend_selection: boolean) => void,
): number;
connect_after(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number, extend_selection: boolean) => void,
): number;
emit(signal: 'move-cursor', step: MovementStep, count: number, extend_selection: boolean): void;
connect(signal: 'populate-popup', callback: (_source: this, menu: Menu) => void): number;
connect_after(signal: 'populate-popup', callback: (_source: this, menu: Menu) => void): number;
emit(signal: 'populate-popup', menu: Menu): void;
// Virtual methods
vfunc_activate_link(uri: string): boolean;
vfunc_copy_clipboard(): void;
vfunc_move_cursor(step: MovementStep, count: number, extend_selection: boolean): void;
vfunc_populate_popup(menu: Menu): void;
// Methods
get(str: string): void;
/**
* Gets the angle of rotation for the label. See
* gtk_label_set_angle().
* @returns the angle of rotation for the label
*/
get_angle(): number;
/**
* Gets the attribute list that was set on the label using
* gtk_label_set_attributes(), if any. This function does
* not reflect attributes that come from the labels markup
* (see gtk_label_set_markup()). If you want to get the
* effective attributes for the label, use
* pango_layout_get_attribute (gtk_label_get_layout (label)).
* @returns the attribute list, or %NULL if none was set.
*/
get_attributes(): Pango.AttrList;
/**
* Returns the URI for the currently active link in the label.
* The active link is the one under the mouse pointer or, in a
* selectable label, the link in which the text cursor is currently
* positioned.
*
* This function is intended for use in a #GtkLabel::activate-link handler
* or for use in a #GtkWidget::query-tooltip handler.
* @returns the currently active URI. The string is owned by GTK+ and must not be freed or modified.
*/
get_current_uri(): string;
/**
* Returns the ellipsizing position of the label. See gtk_label_set_ellipsize().
* @returns #PangoEllipsizeMode
*/
get_ellipsize(): Pango.EllipsizeMode;
/**
* Returns the justification of the label. See gtk_label_set_justify().
* @returns #GtkJustification
*/
get_justify(): Justification;
/**
* Fetches the text from a label widget including any embedded
* underlines indicating mnemonics and Pango markup. (See
* gtk_label_get_text()).
* @returns the text of the label widget. This string is owned by the widget and must not be modified or freed.
*/
get_label(): string;
/**
* Gets the #PangoLayout used to display the label.
* The layout is useful to e.g. convert text positions to
* pixel positions, in combination with gtk_label_get_layout_offsets().
* The returned layout is owned by the label so need not be
* freed by the caller.
* @returns the #PangoLayout for this label
*/
get_layout(): Pango.Layout;
/**
* Obtains the coordinates where the label will draw the #PangoLayout
* representing the text in the label; useful to convert mouse events
* into coordinates inside the #PangoLayout, e.g. to take some action
* if some part of the label is clicked. Of course you will need to
* create a #GtkEventBox to receive the events, and pack the label
* inside it, since labels are a #GTK_NO_WINDOW widget. Remember
* when using the #PangoLayout functions you need to convert to
* and from pixels using PANGO_PIXELS() or #PANGO_SCALE.
*/
get_layout_offsets(): [number, number];
/**
* Returns whether lines in the label are automatically wrapped.
* See gtk_label_set_line_wrap().
* @returns %TRUE if the lines of the label are automatically wrapped.
*/
get_line_wrap(): boolean;
/**
* Returns line wrap mode used by the label. See gtk_label_set_line_wrap_mode().
* @returns %TRUE if the lines of the label are automatically wrapped.
*/
get_line_wrap_mode(): Pango.WrapMode;
/**
* Retrieves the desired maximum width of `label,` in characters. See
* gtk_label_set_width_chars().
* @returns the maximum width of the label in characters.
*/
get_max_width_chars(): number;
/**
* If the label has been set so that it has an mnemonic key this function
* returns the keyval used for the mnemonic accelerator. If there is no
* mnemonic set up it returns #GDK_VoidSymbol.
* @returns GDK keyval usable for accelerators, or #GDK_VoidSymbol
*/
get_mnemonic_keyval(): number;
/**
* Retrieves the target of the mnemonic (keyboard shortcut) of this
* label. See gtk_label_set_mnemonic_widget().
* @returns the target of the label's mnemonic, or %NULL if none has been set and the default algorithm will be used.
*/
get_mnemonic_widget(): Widget;
/**
* Gets the value set by gtk_label_set_selectable().
* @returns %TRUE if the user can copy text from the label
*/
get_selectable(): boolean;
/**
* Gets the selected range of characters in the label, returning %TRUE
* if there's a selection.
* @returns %TRUE if selection is non-empty
*/
get_selection_bounds(): [boolean, number, number];
/**
* Returns whether the label is in single line mode.
* @returns %TRUE when the label is in single line mode.
*/
get_single_line_mode(): boolean;
/**
* Fetches the text from a label widget, as displayed on the
* screen. This does not include any embedded underlines
* indicating mnemonics or Pango markup. (See gtk_label_get_label())
* @returns the text in the label widget. This is the internal string used by the label, and must not be modified.
*/
get_text(): string;
/**
* Returns whether the label is currently keeping track
* of clicked links.
* @returns %TRUE if clicked links are remembered
*/
get_track_visited_links(): boolean;
/**
* Returns whether the label's text is interpreted as marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>. See gtk_label_set_use_markup ().
* @returns %TRUE if the label's text will be parsed for markup.
*/
get_use_markup(): boolean;
/**
* Returns whether an embedded underline in the label indicates a
* mnemonic. See gtk_label_set_use_underline().
* @returns %TRUE whether an embedded underline in the label indicates the mnemonic accelerator keys.
*/
get_use_underline(): boolean;
/**
* Retrieves the desired width of `label,` in characters. See
* gtk_label_set_width_chars().
* @returns the width of the label in characters.
*/
get_width_chars(): number;
parse_uline(string: string): number;
/**
* Selects a range of characters in the label, if the label is selectable.
* See gtk_label_set_selectable(). If the label is not selectable,
* this function has no effect. If `start_offset` or
* `end_offset` are -1, then the end of the label will be substituted.
* @param start_offset start offset (in characters not bytes)
* @param end_offset end offset (in characters not bytes)
*/
select_region(start_offset: number, end_offset: number): void;
/**
* Sets the angle of rotation for the label. An angle of 90 reads from
* from bottom to top, an angle of 270, from top to bottom. The angle
* setting for the label is ignored if the label is selectable,
* wrapped, or ellipsized.
* @param angle the angle that the baseline of the label makes with the horizontal, in degrees, measured counterclockwise
*/
set_angle(angle: number): void;
/**
* Sets a #PangoAttrList; the attributes in the list are applied to the
* label text.
*
* <note><para>The attributes set with this function will be applied
* and merged with any other attributes previously effected by way
* of the #GtkLabel:use-underline or #GtkLabel:use-markup properties.
* While it is not recommended to mix markup strings with manually set
* attributes, if you must; know that the attributes will be applied
* to the label after the markup string is parsed.</para></note>
* @param attrs a #PangoAttrList
*/
set_attributes(attrs: Pango.AttrList): void;
/**
* Sets the mode used to ellipsize (add an ellipsis: "...") to the text
* if there is not enough space to render the entire string.
* @param mode a #PangoEllipsizeMode
*/
set_ellipsize(mode: Pango.EllipsizeMode | null): void;
/**
* Sets the alignment of the lines in the text of the label relative to
* each other. %GTK_JUSTIFY_LEFT is the default value when the
* widget is first created with gtk_label_new(). If you instead want
* to set the alignment of the label as a whole, use
* gtk_misc_set_alignment() instead. gtk_label_set_justify() has no
* effect on labels containing only a single line.
* @param jtype a #GtkJustification
*/
set_justify(jtype: Justification | null): void;
/**
* Sets the text of the label. The label is interpreted as
* including embedded underlines and/or Pango markup depending
* on the values of the #GtkLabel:use-underline" and
* #GtkLabel:use-markup properties.
* @param str the new text to set for the label
*/
set_label(str: string): void;
/**
* Toggles line wrapping within the #GtkLabel widget. %TRUE makes it break
* lines if text exceeds the widget's size. %FALSE lets the text get cut off
* by the edge of the widget if it exceeds the widget size.
*
* Note that setting line wrapping to %TRUE does not make the label
* wrap at its parent container's width, because GTK+ widgets
* conceptually can't make their requisition depend on the parent
* container's size. For a label that wraps at a specific position,
* set the label's width using gtk_widget_set_size_request().
* @param wrap the setting
*/
set_line_wrap(wrap: boolean): void;
/**
* If line wrapping is on (see gtk_label_set_line_wrap()) this controls how
* the line wrapping is done. The default is %PANGO_WRAP_WORD which means
* wrap on word boundaries.
* @param wrap_mode the line wrapping mode
*/
set_line_wrap_mode(wrap_mode: Pango.WrapMode | null): void;
/**
* Parses `str` which is marked up with the <link
* linkend="PangoMarkupFormat">Pango text markup language</link>, setting the
* label's text and attribute list based on the parse results. If the `str` is
* external data, you may need to escape it with g_markup_escape_text() or
* g_markup_printf_escaped()<!-- -->:
*
* ```
* char *markup;
*
* markup = g_markup_printf_escaped ("&lt;span style=\"italic\"&gt;&percnt;s&lt;/span&gt;", str);
* gtk_label_set_markup (GTK_LABEL (label), markup);
* g_free (markup);
* ```
*
* @param str a markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>)
*/
set_markup(str: string): void;
/**
* Parses `str` which is marked up with the <link linkend="PangoMarkupFormat">Pango text markup language</link>,
* setting the label's text and attribute list based on the parse results.
* If characters in `str` are preceded by an underscore, they are underlined
* indicating that they represent a keyboard accelerator called a mnemonic.
*
* The mnemonic key can be used to activate another widget, chosen
* automatically, or explicitly using gtk_label_set_mnemonic_widget().
* @param str a markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>)
*/
set_markup_with_mnemonic(str: string): void;
/**
* Sets the desired maximum width in characters of `label` to `n_chars`.
* @param n_chars the new desired maximum width, in characters.
*/
set_max_width_chars(n_chars: number): void;
/**
* If the label has been set so that it has an mnemonic key (using
* i.e. gtk_label_set_markup_with_mnemonic(),
* gtk_label_set_text_with_mnemonic(), gtk_label_new_with_mnemonic()
* or the "use_underline" property) the label can be associated with a
* widget that is the target of the mnemonic. When the label is inside
* a widget (like a #GtkButton or a #GtkNotebook tab) it is
* automatically associated with the correct widget, but sometimes
* (i.e. when the target is a #GtkEntry next to the label) you need to
* set it explicitly using this function.
*
* The target widget will be accelerated by emitting the
* GtkWidget::mnemonic-activate signal on it. The default handler for
* this signal will activate the widget if there are no mnemonic collisions
* and toggle focus between the colliding widgets otherwise.
* @param widget the target #GtkWidget
*/
set_mnemonic_widget(widget?: Widget | null): void;
set_pattern(pattern: string): void;
/**
* Selectable labels allow the user to select text from the label, for
* copy-and-paste.
* @param setting %TRUE to allow selecting text in the label
*/
set_selectable(setting: boolean): void;
/**
* Sets whether the label is in single line mode.
* @param single_line_mode %TRUE if the label should be in single line mode
*/
set_single_line_mode(single_line_mode: boolean): void;
/**
* Sets the text within the #GtkLabel widget. It overwrites any text that
* was there before.
*
* This will also clear any previously set mnemonic accelerators.
* @param str The text you want to set
*/
set_text(str: string): void;
/**
* Sets the label's text from the string `str`.
* If characters in `str` are preceded by an underscore, they are underlined
* indicating that they represent a keyboard accelerator called a mnemonic.
* The mnemonic key can be used to activate another widget, chosen
* automatically, or explicitly using gtk_label_set_mnemonic_widget().
* @param str a string
*/
set_text_with_mnemonic(str: string): void;
/**
* Sets whether the label should keep track of clicked
* links (and use a different color for them).
* @param track_links %TRUE to track visited links
*/
set_track_visited_links(track_links: boolean): void;
/**
* Sets whether the text of the label contains markup in <link
* linkend="PangoMarkupFormat">Pango's text markup
* language</link>. See gtk_label_set_markup().
* @param setting %TRUE if the label's text should be parsed for markup.
*/
set_use_markup(setting: boolean): void;
/**
* If true, an underline in the text indicates the next character should be
* used for the mnemonic accelerator key.
* @param setting %TRUE if underlines in the text indicate mnemonics
*/
set_use_underline(setting: boolean): void;
/**
* Sets the desired width in characters of `label` to `n_chars`.
* @param n_chars the new desired width, in characters.
*/
set_width_chars(n_chars: 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 Layout {
// Signal callback interfaces
interface SetScrollAdjustments {
(object: Adjustment, p0: Adjustment): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
hadjustment: Adjustment;
height: number;
vadjustment: Adjustment;
width: number;
}
}
class Layout extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Layout>;
// Properties
get hadjustment(): Adjustment;
set hadjustment(val: Adjustment);
get height(): number;
set height(val: number);
get vadjustment(): Adjustment;
set vadjustment(val: Adjustment);
get width(): number;
set width(val: number);
// Fields
container: Container;
children: any[];
bin_window: Gdk.Window;
// Constructors
constructor(properties?: Partial<Layout.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): Layout;
// 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: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
connect_after(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
emit(signal: 'set-scroll-adjustments', object: Adjustment, p0: Adjustment): void;
// Virtual methods
vfunc_set_scroll_adjustments(hadjustment: Adjustment, vadjustment: Adjustment): void;
// Methods
/**
* This is a deprecated function, it doesn't do anything useful.
*/
freeze(): void;
/**
* Retrieve the bin window of the layout used for drawing operations.
* @returns a #GdkWindow
*/
get_bin_window(): Gdk.Window;
/**
* This function should only be called after the layout has been
* placed in a #GtkScrolledWindow or otherwise configured for
* scrolling. It returns the #GtkAdjustment used for communication
* between the horizontal scrollbar and `layout`.
*
* See #GtkScrolledWindow, #GtkScrollbar, #GtkAdjustment for details.
* @returns horizontal scroll adjustment
*/
get_hadjustment(): Adjustment;
/**
* Gets the size that has been set on the layout, and that determines
* the total extents of the layout's scrollbar area. See
* gtk_layout_set_size ().
*/
get_size(): [number, number];
/**
* This function should only be called after the layout has been
* placed in a #GtkScrolledWindow or otherwise configured for
* scrolling. It returns the #GtkAdjustment used for communication
* between the vertical scrollbar and `layout`.
*
* See #GtkScrolledWindow, #GtkScrollbar, #GtkAdjustment for details.
* @returns vertical scroll adjustment
*/
get_vadjustment(): Adjustment;
/**
* Moves a current child of `layout` to a new position.
* @param child_widget a current child of @layout
* @param x X position to move to
* @param y Y position to move to
*/
move(child_widget: Widget, x: number, y: number): void;
/**
* Adds `child_widget` to `layout,` at position (`x,``y)`.
* `layout` becomes the new parent container of `child_widget`.
* @param child_widget child widget
* @param x X position of child widget
* @param y Y position of child widget
*/
put(child_widget: Widget, x: number, y: number): void;
/**
* Sets the horizontal scroll adjustment for the layout.
*
* See #GtkScrolledWindow, #GtkScrollbar, #GtkAdjustment for details.
* @param adjustment new scroll adjustment
*/
set_hadjustment(adjustment?: Adjustment | null): void;
/**
* Sets the size of the scrollable area of the layout.
* @param width width of entire scrollable area
* @param height height of entire scrollable area
*/
set_size(width: number, height: number): void;
/**
* Sets the vertical scroll adjustment for the layout.
*
* See #GtkScrolledWindow, #GtkScrollbar, #GtkAdjustment for details.
* @param adjustment new scroll adjustment
*/
set_vadjustment(adjustment?: Adjustment | null): void;
/**
* This is a deprecated function, it doesn't do anything useful.
*/
thaw(): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace LinkButton {
// Constructor properties interface
interface ConstructorProps
extends Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
uri: string;
visited: boolean;
}
}
class LinkButton extends Button implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<LinkButton>;
// Properties
/**
* The URI bound to this button.
*/
get uri(): string;
set uri(val: string);
/**
* The 'visited' state of this button. A visited link is drawn in a
* different color.
*/
get visited(): boolean;
set visited(val: boolean);
// Constructors
constructor(properties?: Partial<LinkButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](uri: string): LinkButton;
// Conflicted with Gtk.Button.new
static ['new'](...args: never[]): any;
static new_with_label(uri: string, label?: string | null): LinkButton;
// Conflicted with Gtk.Button.new_with_label
static new_with_label(...args: never[]): any;
// Methods
/**
* Retrieves the URI set using gtk_link_button_set_uri().
* @returns a valid URI. The returned string is owned by the link button and should not be modified or freed.
*/
get_uri(): string;
/**
* Retrieves the 'visited' state of the URI where the #GtkLinkButton
* points. The button becomes visited when it is clicked. If the URI
* is changed on the button, the 'visited' state is unset again.
*
* The state may also be changed using gtk_link_button_set_visited().
* @returns %TRUE if the link has been visited, %FALSE otherwise
*/
get_visited(): boolean;
/**
* Sets `uri` as the URI where the #GtkLinkButton points. As a side-effect
* this unsets the 'visited' state of the button.
* @param uri a valid URI
*/
set_uri(uri: string): void;
/**
* Sets the 'visited' state of the URI where the #GtkLinkButton
* points. See gtk_link_button_get_visited() for more details.
* @param visited the new 'visited' state
*/
set_visited(visited: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace List {
// Signal callback interfaces
interface SelectChild {
(object: Widget): void;
}
interface SelectionChanged {
(): void;
}
interface UnselectChild {
(object: Widget): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
selection_mode: SelectionMode;
selectionMode: SelectionMode;
}
}
class List extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<List>;
// Properties
get selection_mode(): SelectionMode;
set selection_mode(val: SelectionMode);
get selectionMode(): SelectionMode;
set selectionMode(val: SelectionMode);
// Fields
container: Container;
children: any[];
selection: any[];
undo_unselection: any[];
last_focus_child: Widget;
undo_focus_child: Widget;
htimer: number;
vtimer: number;
anchor: number;
drag_pos: number;
anchor_state: StateType;
drag_selection: number;
add_mode: number;
// Constructors
constructor(properties?: Partial<List.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): List;
// 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: 'select-child', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'select-child', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'select-child', object: Widget): void;
connect(signal: 'selection-changed', callback: (_source: this) => void): number;
connect_after(signal: 'selection-changed', callback: (_source: this) => void): number;
emit(signal: 'selection-changed'): void;
connect(signal: 'unselect-child', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'unselect-child', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'unselect-child', object: Widget): void;
// Virtual methods
vfunc_select_child(child: Widget): void;
vfunc_selection_changed(): void;
vfunc_unselect_child(child: Widget): void;
// Methods
child_position(child: Widget): number;
clear_items(start: number, end: number): void;
end_drag_selection(): void;
end_selection(): void;
extend_selection(scroll_type: ScrollType | null, position: number, auto_start_selection: boolean): void;
scroll_horizontal(scroll_type: ScrollType | null, position: number): void;
scroll_vertical(scroll_type: ScrollType | null, position: number): void;
select_all(): void;
select_child(child: Widget): void;
select_item(item: number): void;
set_selection_mode(mode: SelectionMode | null): void;
start_selection(): void;
toggle_add_mode(): void;
toggle_focus_row(): void;
toggle_row(item: Widget): void;
undo_selection(): void;
unselect_all(): void;
unselect_child(child: Widget): void;
unselect_item(item: 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 ListItem {
// Signal callback interfaces
interface EndSelection {
(): void;
}
interface ExtendSelection {
(object: ScrollType, p0: number, p1: boolean): void;
}
interface ScrollHorizontal {
(object: ScrollType, p0: number): void;
}
interface ScrollVertical {
(object: ScrollType, p0: number): void;
}
interface SelectAll {
(): void;
}
interface StartSelection {
(): void;
}
interface ToggleAddMode {
(): void;
}
interface ToggleFocusRow {
(): void;
}
interface UndoSelection {
(): void;
}
interface UnselectAll {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Item.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
class ListItem extends Item implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<ListItem>;
// Fields
item: Item;
// Constructors
constructor(properties?: Partial<ListItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ListItem;
static new_with_label(label: string): ListItem;
// 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: 'end-selection', callback: (_source: this) => void): number;
connect_after(signal: 'end-selection', callback: (_source: this) => void): number;
emit(signal: 'end-selection'): void;
connect(
signal: 'extend-selection',
callback: (_source: this, object: ScrollType, p0: number, p1: boolean) => void,
): number;
connect_after(
signal: 'extend-selection',
callback: (_source: this, object: ScrollType, p0: number, p1: boolean) => void,
): number;
emit(signal: 'extend-selection', object: ScrollType, p0: number, p1: boolean): void;
connect(
signal: 'scroll-horizontal',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
connect_after(
signal: 'scroll-horizontal',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
emit(signal: 'scroll-horizontal', object: ScrollType, p0: number): void;
connect(
signal: 'scroll-vertical',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
connect_after(
signal: 'scroll-vertical',
callback: (_source: this, object: ScrollType, p0: number) => void,
): number;
emit(signal: 'scroll-vertical', object: ScrollType, p0: number): void;
connect(signal: 'select-all', callback: (_source: this) => void): number;
connect_after(signal: 'select-all', callback: (_source: this) => void): number;
emit(signal: 'select-all'): void;
connect(signal: 'start-selection', callback: (_source: this) => void): number;
connect_after(signal: 'start-selection', callback: (_source: this) => void): number;
emit(signal: 'start-selection'): void;
connect(signal: 'toggle-add-mode', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-add-mode', callback: (_source: this) => void): number;
emit(signal: 'toggle-add-mode'): void;
connect(signal: 'toggle-focus-row', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-focus-row', callback: (_source: this) => void): number;
emit(signal: 'toggle-focus-row'): void;
connect(signal: 'undo-selection', callback: (_source: this) => void): number;
connect_after(signal: 'undo-selection', callback: (_source: this) => void): number;
emit(signal: 'undo-selection'): void;
connect(signal: 'unselect-all', callback: (_source: this) => void): number;
connect_after(signal: 'unselect-all', callback: (_source: this) => void): number;
emit(signal: 'unselect-all'): void;
// Virtual methods
vfunc_end_selection(): void;
vfunc_extend_selection(scroll_type: ScrollType, position: number, auto_start_selection: boolean): void;
vfunc_scroll_horizontal(scroll_type: ScrollType, position: number): void;
vfunc_scroll_vertical(scroll_type: ScrollType, position: number): void;
vfunc_select_all(): void;
vfunc_start_selection(): void;
vfunc_toggle_add_mode(): void;
vfunc_toggle_focus_row(): void;
vfunc_undo_selection(): void;
vfunc_unselect_all(): void;
// Methods
deselect(): void;
select(): 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 ListStore {
// Constructor properties interface
interface ConstructorProps
extends GObject.Object.ConstructorProps,
Buildable.ConstructorProps,
TreeDragDest.ConstructorProps,
TreeDragSource.ConstructorProps,
TreeModel.ConstructorProps,
TreeSortable.ConstructorProps {}
}
class ListStore
extends GObject.Object
implements Buildable, TreeDragDest, TreeDragSource, TreeModel, TreeSortable
{
static $gtype: GObject.GType<ListStore>;
// Constructors
constructor(properties?: Partial<ListStore.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static newv(types: GObject.GType[]): ListStore;
// Conflicted with GObject.Object.newv
static newv(...args: never[]): any;
// Methods
/**
* Appends a new row to `list_store`. `iter` will be changed to point to this new
* row. The row will be empty after this function is called. To fill in
* values, you need to call gtk_list_store_set() or gtk_list_store_set_value().
*/
append(): TreeIter;
/**
* Removes all rows from the list store.
*/
clear(): void;
/**
* Creates a new row at `position`. `iter` will be changed to point to this new
* row. If `position` is larger than the number of rows on the list, then the
* new row will be appended to the list. The row will be empty after this
* function is called. To fill in values, you need to call
* gtk_list_store_set() or gtk_list_store_set_value().
* @param position position to insert the new row
*/
insert(position: number): TreeIter;
/**
* Inserts a new row after `sibling`. If `sibling` is %NULL, then the row will be
* prepended to the beginning of the list. `iter` will be changed to point to
* this new row. The row will be empty after this function is called. To fill
* in values, you need to call gtk_list_store_set() or gtk_list_store_set_value().
* @param sibling A valid #GtkTreeIter, or %NULL
*/
insert_after(sibling?: TreeIter | null): TreeIter;
/**
* Inserts a new row before `sibling`. If `sibling` is %NULL, then the row will
* be appended to the end of the list. `iter` will be changed to point to this
* new row. The row will be empty after this function is called. To fill in
* values, you need to call gtk_list_store_set() or gtk_list_store_set_value().
* @param sibling A valid #GtkTreeIter, or %NULL
*/
insert_before(sibling?: TreeIter | null): TreeIter;
/**
* A variant of gtk_list_store_insert_with_values() which
* takes the columns and values as two arrays, instead of
* varargs. This function is mainly intended for
* language-bindings.
* @param position position to insert the new row
* @param columns an array of column numbers
* @param values an array of GValues
*/
insert_with_valuesv(position: number, columns: number[], values: (GObject.Value | any)[]): TreeIter | null;
/**
* <warning>This function is slow. Only use it for debugging and/or testing
* purposes.</warning>
*
* Checks if the given iter is a valid iter for this #GtkListStore.
* @param iter A #GtkTreeIter.
* @returns %TRUE if the iter is valid, %FALSE if the iter is invalid.
*/
iter_is_valid(iter: TreeIter): boolean;
/**
* Moves `iter` in `store` to the position after `position`. Note that this
* function only works with unsorted stores. If `position` is %NULL, `iter`
* will be moved to the start of the list.
* @param iter A #GtkTreeIter.
* @param position A #GtkTreeIter or %NULL.
*/
move_after(iter: TreeIter, position?: TreeIter | null): void;
/**
* Moves `iter` in `store` to the position before `position`. Note that this
* function only works with unsorted stores. If `position` is %NULL, `iter`
* will be moved to the end of the list.
* @param iter A #GtkTreeIter.
* @param position A #GtkTreeIter, or %NULL.
*/
move_before(iter: TreeIter, position?: TreeIter | null): void;
/**
* Prepends a new row to `list_store`. `iter` will be changed to point to this new
* row. The row will be empty after this function is called. To fill in
* values, you need to call gtk_list_store_set() or gtk_list_store_set_value().
*/
prepend(): TreeIter;
/**
* Removes the given row from the list store. After being removed,
* `iter` is set to be the next valid row, or invalidated if it pointed
* to the last row in `list_store`.
* @param iter A valid #GtkTreeIter
* @returns %TRUE if @iter is valid, %FALSE if not.
*/
remove(iter: TreeIter): boolean;
/**
* Reorders `store` to follow the order indicated by `new_order`. Note that
* this function only works with unsorted stores.
* @param new_order an array of integers mapping the new position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
reorder(new_order: number[]): void;
/**
* This function is meant primarily for #GObjects that inherit from #GtkListStore,
* and should only be used when constructing a new #GtkListStore. It will not
* function after a row has been added, or a method on the #GtkTreeModel
* interface is called.
* @param types An array length n of #GTypes
*/
set_column_types(types: GObject.GType[]): void;
/**
* Sets the data in the cell specified by `iter` and `column`.
* The type of `value` must be convertible to the type of the
* column.
* @param iter A valid #GtkTreeIter for the row being modified
* @param column column number to modify
* @param value new value for the cell
*/
set_value(iter: TreeIter, column: number, value: GObject.Value | any): void;
/**
* A variant of gtk_list_store_set_valist() which
* takes the columns and values as two arrays, instead of
* varargs. This function is mainly intended for
* language-bindings and in case the number of columns to
* change is not known until run-time.
* @param iter A valid #GtkTreeIter for the row being modified
* @param columns an array of column numbers
* @param values an array of GValues
*/
set_valuesv(iter: TreeIter, columns: number[], values: (GObject.Value | any)[]): void;
/**
* Swaps `a` and `b` in `store`. Note that this function only works with
* unsorted stores.
* @param a A #GtkTreeIter.
* @param b Another #GtkTreeIter.
*/
swap(a: TreeIter, b: TreeIter): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
* @returns whether a new row was created before position @dest
*/
drag_data_received(dest: TreePath, selection_data: SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn't exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
* @returns %TRUE if a drop is possible before @dest_path
*/
row_drop_possible(dest_path: TreePath, selection_data: SelectionData): boolean;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
*/
vfunc_drag_data_received(dest: TreePath, selection_data: SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn't exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
*/
vfunc_row_drop_possible(dest_path: TreePath, selection_data: SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
* @returns %TRUE if the row was successfully deleted
*/
drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @returns %TRUE if data of the required type was provided
*/
drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
* @returns %TRUE if the row can be dragged
*/
row_draggable(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
*/
vfunc_drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
*/
vfunc_drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
*/
vfunc_row_draggable(path: TreePath): boolean;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: TreePath | null): TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
* If `func` returns %TRUE, then the tree ceases to be walked, and
* gtk_tree_model_foreach() returns.
* @param func A function to be called on each row
*/
foreach(func: TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ The column index.
* @returns The type of the column.
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
* @returns The flags supported by this interface.
*/
get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter(path: TreePath): [boolean, TreeIter];
/**
* Initializes `iter` with the first iterator in the tree (the one at the path
* "0") and returns %TRUE. Returns %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set.
*/
get_iter_first(): [boolean, TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string A string representation of a #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter_from_string(path_string: string): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns The number of columns.
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
* @returns a newly-created #GtkTreePath.
*/
get_path(iter: TreeIter): TreePath;
/**
* Generates a string representation of the iter. This string is a ':'
* separated list of numbers. For example, "4:10:0:3" would be an
* acceptable return value for this string.
* @param iter An #GtkTreeIter.
* @returns A newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
* @returns %TRUE, if @child has been set to the first child.
*/
iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
* @returns %TRUE if @iter has children.
*/
iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
* @returns The number of children of @iter.
*/
iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
* @returns %TRUE if @iter has been changed to the next node.
*/
iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
* @returns %TRUE, if @parent has an @n<!-- -->th child.
*/
iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
* @returns %TRUE, if @iter is set to the parent of @child.
*/
iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child model.
* @returns A new #GtkTreeModel.
*/
sort_new_with_model(): TreeModel;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
unref_node(iter: TreeIter): void;
/**
* Returns the type of the column.
* @param index_ The column index.
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
*/
vfunc_get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
*/
vfunc_get_iter(path: TreePath): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
*/
vfunc_get_path(iter: TreeIter): TreePath;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
vfunc_get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
*/
vfunc_iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
*/
vfunc_iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
*/
vfunc_iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
*/
vfunc_iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
*/
vfunc_iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
*/
vfunc_iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
vfunc_ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
vfunc_row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
vfunc_row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
vfunc_rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
vfunc_unref_node(iter: TreeIter): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
* @returns %TRUE if the sort column is not one of the special sort column ids.
*/
get_sort_column_id(sort_column_id: number, order: SortType | null): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
* @returns %TRUE, if the model has a default sort function
*/
has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_default_sort_func(sort_func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
set_sort_column_id(sort_column_id: number, order: SortType | null): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_sort_func(
sort_column_id: number,
sort_func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
sort_column_changed(): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
*/
vfunc_get_sort_column_id(sort_column_id: number, order: SortType): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
*/
vfunc_has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_default_sort_func(func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
vfunc_set_sort_column_id(sort_column_id: number, order: SortType): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_sort_func(
sort_column_id: number,
func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
vfunc_sort_column_changed(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* 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 Menu {
// Signal callback interfaces
interface MoveScroll {
(object: ScrollType): void;
}
// Constructor properties interface
interface ConstructorProps
extends MenuShell.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
accel_group: AccelGroup;
accelGroup: AccelGroup;
accel_path: string;
accelPath: string;
active: number | any;
attach_widget: Widget;
attachWidget: Widget;
monitor: number;
reserve_toggle_size: boolean;
reserveToggleSize: boolean;
tearoff_state: boolean;
tearoffState: boolean;
tearoff_title: string;
tearoffTitle: string;
}
}
class Menu extends MenuShell implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Menu>;
// Properties
/**
* The accel group holding accelerators for the menu.
*/
get accel_group(): AccelGroup;
set accel_group(val: AccelGroup);
/**
* The accel group holding accelerators for the menu.
*/
get accelGroup(): AccelGroup;
set accelGroup(val: AccelGroup);
/**
* An accel path used to conveniently construct accel paths of child items.
*/
get accel_path(): string;
set accel_path(val: string);
/**
* An accel path used to conveniently construct accel paths of child items.
*/
get accelPath(): string;
set accelPath(val: string);
/**
* The index of the currently selected menu item, or -1 if no
* menu item is selected.
*/
// This accessor conflicts with a property or field in a parent class or interface.
active: number | any;
/**
* The widget the menu is attached to. Setting this property attaches
* the menu without a #GtkMenuDetachFunc. If you need to use a detacher,
* use gtk_menu_attach_to_widget() directly.
*/
get attach_widget(): Widget;
set attach_widget(val: Widget);
/**
* The widget the menu is attached to. Setting this property attaches
* the menu without a #GtkMenuDetachFunc. If you need to use a detacher,
* use gtk_menu_attach_to_widget() directly.
*/
get attachWidget(): Widget;
set attachWidget(val: Widget);
/**
* The monitor the menu will be popped up on.
*/
get monitor(): number;
set monitor(val: number);
/**
* A boolean that indicates whether the menu reserves space for
* toggles and icons, regardless of their actual presence.
*
* This property should only be changed from its default value
* for special-purposes such as tabular menus. Regular menus that
* are connected to a menu bar or context menus should reserve
* toggle space for consistency.
*/
get reserve_toggle_size(): boolean;
set reserve_toggle_size(val: boolean);
/**
* A boolean that indicates whether the menu reserves space for
* toggles and icons, regardless of their actual presence.
*
* This property should only be changed from its default value
* for special-purposes such as tabular menus. Regular menus that
* are connected to a menu bar or context menus should reserve
* toggle space for consistency.
*/
get reserveToggleSize(): boolean;
set reserveToggleSize(val: boolean);
/**
* A boolean that indicates whether the menu is torn-off.
*/
get tearoff_state(): boolean;
set tearoff_state(val: boolean);
/**
* A boolean that indicates whether the menu is torn-off.
*/
get tearoffState(): boolean;
set tearoffState(val: boolean);
get tearoff_title(): string;
set tearoff_title(val: string);
get tearoffTitle(): string;
set tearoffTitle(val: string);
// Fields
menu_shell: MenuShell;
parent_menu_item: Widget;
old_active_menu_item: Widget;
position_func: MenuPositionFunc;
position_func_data: any;
toggle_size: number;
toplevel: Widget;
tearoff_window: Widget;
tearoff_hbox: Widget;
tearoff_scrollbar: Widget;
tearoff_adjustment: Adjustment;
view_window: Gdk.Window;
bin_window: Gdk.Window;
scroll_offset: number;
saved_scroll_offset: number;
scroll_step: number;
timeout_id: number;
navigation_timeout: number;
needs_destruction_ref_count: number;
torn_off: number;
tearoff_active: number;
scroll_fast: number;
upper_arrow_visible: number;
lower_arrow_visible: number;
upper_arrow_prelight: number;
lower_arrow_prelight: number;
// Constructors
constructor(properties?: Partial<Menu.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Menu;
// 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: 'move-scroll', callback: (_source: this, object: ScrollType) => void): number;
connect_after(signal: 'move-scroll', callback: (_source: this, object: ScrollType) => void): number;
emit(signal: 'move-scroll', object: ScrollType): void;
// Static methods
/**
* Returns a list of the menus which are attached to this widget.
* This list is owned by GTK+ and must not be modified.
* @param widget a #GtkWidget
*/
static get_for_attach_widget(widget: Widget): Widget[];
// Methods
/**
* Adds a new #GtkMenuItem to a (table) menu. The number of 'cells' that
* an item will occupy is specified by `left_attach,` `right_attach,`
* `top_attach` and `bottom_attach`. These each represent the leftmost,
* rightmost, uppermost and lower column and row numbers of the table.
* (Columns and rows are indexed from zero).
*
* Note that this function is not related to gtk_menu_detach().
* @param child a #GtkMenuItem.
* @param left_attach The column number to attach the left side of the item to.
* @param right_attach The column number to attach the right side of the item to.
* @param top_attach The row number to attach the top of the item to.
* @param bottom_attach The row number to attach the bottom of the item to.
*/
attach(
child: Widget,
left_attach: number,
right_attach: number,
top_attach: number,
bottom_attach: number,
): void;
detach(): void;
/**
* `menu` a #GtkMenu
* Gets the #GtkAccelGroup which holds global accelerators for the
* menu. See gtk_menu_set_accel_group().
* @returns the #GtkAccelGroup associated with the menu.
*/
get_accel_group(): AccelGroup;
/**
* Retrieves the accelerator path set on the menu.
* @returns the accelerator path set on the menu.
*/
get_accel_path(): string;
/**
* Returns the selected menu item from the menu. This is used by the
* #GtkOptionMenu.
* @returns the #GtkMenuItem that was last selected in the menu. If a selection has not yet been made, the first menu item is selected.
*/
get_active(): Widget;
/**
* Returns the #GtkWidget that the menu is attached to.
* @returns the #GtkWidget that the menu is attached to
*/
get_attach_widget(): Widget;
/**
* Retrieves the number of the monitor on which to show the menu.
* @returns the number of the monitor on which the menu should be popped up or -1, if no monitor has been set
*/
get_monitor(): number;
/**
* Returns whether the menu reserves space for toggles and
* icons, regardless of their actual presence.
* @returns Whether the menu reserves toggle space
*/
get_reserve_toggle_size(): boolean;
/**
* Returns whether the menu is torn off. See
* gtk_menu_set_tearoff_state ().
* @returns %TRUE if the menu is currently torn off.
*/
get_tearoff_state(): boolean;
/**
* Returns the title of the menu. See gtk_menu_set_title().
* @returns the title of the menu, or %NULL if the menu has no title set on it. This string is owned by the widget and should not be modified or freed.
*/
get_title(): string;
popdown(): void;
reorder_child(child: Widget, position: number): void;
reposition(): void;
set_accel_group(accel_group?: AccelGroup | null): void;
/**
* Sets an accelerator path for this menu from which accelerator paths
* for its immediate children, its menu items, can be constructed.
* The main purpose of this function is to spare the programmer the
* inconvenience of having to call gtk_menu_item_set_accel_path() on
* each menu item that should support runtime user changable accelerators.
* Instead, by just calling gtk_menu_set_accel_path() on their parent,
* each menu item of this menu, that contains a label describing its purpose,
* automatically gets an accel path assigned. For example, a menu containing
* menu items "New" and "Exit", will, after
* <literal>gtk_menu_set_accel_path (menu, "&lt;Gnumeric-Sheet&gt;/File");</literal>
* has been called, assign its items the accel paths:
* <literal>"&lt;Gnumeric-Sheet&gt;/File/New"</literal> and <literal>"&lt;Gnumeric-Sheet&gt;/File/Exit"</literal>.
* Assigning accel paths to menu items then enables the user to change
* their accelerators at runtime. More details about accelerator paths
* and their default setups can be found at gtk_accel_map_add_entry().
*
* Note that `accel_path` string will be stored in a #GQuark. Therefore, if you
* pass a static string, you can save some memory by interning it first with
* g_intern_static_string().
* @param accel_path a valid accelerator path
*/
set_accel_path(accel_path?: string | null): void;
set_active(index_: number): void;
/**
* Informs GTK+ on which monitor a menu should be popped up.
* See gdk_screen_get_monitor_geometry().
*
* This function should be called from a #GtkMenuPositionFunc if the
* menu should not appear on the same monitor as the pointer. This
* information can't be reliably inferred from the coordinates returned
* by a #GtkMenuPositionFunc, since, for very long menus, these coordinates
* may extend beyond the monitor boundaries or even the screen boundaries.
* @param monitor_num the number of the monitor on which the menu should be popped up
*/
set_monitor(monitor_num: number): void;
/**
* Sets whether the menu should reserve space for drawing toggles
* or icons, regardless of their actual presence.
* @param reserve_toggle_size whether to reserve size for toggles
*/
set_reserve_toggle_size(reserve_toggle_size: boolean): void;
/**
* Sets the #GdkScreen on which the menu will be displayed.
* @param screen a #GdkScreen, or %NULL if the screen should be determined by the widget the menu is attached to.
*/
set_screen(screen?: Gdk.Screen | null): void;
set_tearoff_state(torn_off: boolean): void;
/**
* Sets the title string for the menu. The title is displayed when the menu
* is shown as a tearoff menu. If `title` is %NULL, the menu will see if it is
* attached to a parent menu item, and if so it will try to use the same text as
* that menu item's label.
* @param title a string containing the title for the menu.
*/
set_title(title: string): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace MenuBar {
// Constructor properties interface
interface ConstructorProps
extends MenuShell.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
child_pack_direction: PackDirection;
childPackDirection: PackDirection;
pack_direction: PackDirection;
packDirection: PackDirection;
}
}
class MenuBar extends MenuShell implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<MenuBar>;
// Properties
/**
* The child pack direction of the menubar. It determines how
* the widgets contained in child menuitems are arranged.
*/
get child_pack_direction(): PackDirection;
set child_pack_direction(val: PackDirection);
/**
* The child pack direction of the menubar. It determines how
* the widgets contained in child menuitems are arranged.
*/
get childPackDirection(): PackDirection;
set childPackDirection(val: PackDirection);
/**
* The pack direction of the menubar. It determines how
* menuitems are arranged in the menubar.
*/
get pack_direction(): PackDirection;
set pack_direction(val: PackDirection);
/**
* The pack direction of the menubar. It determines how
* menuitems are arranged in the menubar.
*/
get packDirection(): PackDirection;
set packDirection(val: PackDirection);
// Fields
menu_shell: MenuShell;
// Constructors
constructor(properties?: Partial<MenuBar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): MenuBar;
// Methods
/**
* Retrieves the current child pack direction of the menubar.
* See gtk_menu_bar_set_child_pack_direction().
* @returns the child pack direction
*/
get_child_pack_direction(): PackDirection;
/**
* Retrieves the current pack direction of the menubar.
* See gtk_menu_bar_set_pack_direction().
* @returns the pack direction
*/
get_pack_direction(): PackDirection;
/**
* Sets how widgets should be packed inside the children of a menubar.
* @param child_pack_dir a new #GtkPackDirection
*/
set_child_pack_direction(child_pack_dir: PackDirection | null): void;
/**
* Sets how items should be packed inside a menubar.
* @param pack_dir a new #GtkPackDirection
*/
set_pack_direction(pack_dir: PackDirection | 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 MenuItem {
// Signal callback interfaces
interface Activate {
(): void;
}
interface ActivateItem {
(): void;
}
interface ToggleSizeAllocate {
(object: number): void;
}
interface ToggleSizeRequest {
(object?: any | null): void;
}
// Constructor properties interface
interface ConstructorProps
extends Item.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
accel_path: string;
accelPath: string;
label: string;
right_justified: boolean;
rightJustified: boolean;
submenu: Menu;
use_underline: boolean;
useUnderline: boolean;
}
}
class MenuItem extends Item implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<MenuItem>;
// Properties
/**
* Sets the accelerator path of the menu item, through which runtime
* changes of the menu item's accelerator caused by the user can be
* identified and saved to persistant storage.
*/
get accel_path(): string;
set accel_path(val: string);
/**
* Sets the accelerator path of the menu item, through which runtime
* changes of the menu item's accelerator caused by the user can be
* identified and saved to persistant storage.
*/
get accelPath(): string;
set accelPath(val: string);
/**
* The text for the child label.
*/
get label(): string;
set label(val: string);
/**
* Sets whether the menu item appears justified at the right side of a menu bar.
*/
get right_justified(): boolean;
set right_justified(val: boolean);
/**
* Sets whether the menu item appears justified at the right side of a menu bar.
*/
get rightJustified(): boolean;
set rightJustified(val: boolean);
/**
* The submenu attached to the menu item, or NULL if it has none.
*/
get submenu(): Menu;
set submenu(val: Menu);
/**
* %TRUE if underlines in the text indicate mnemonics
*/
get use_underline(): boolean;
set use_underline(val: boolean);
/**
* %TRUE if underlines in the text indicate mnemonics
*/
get useUnderline(): boolean;
set useUnderline(val: boolean);
// Fields
item: Item;
event_window: Gdk.Window;
toggle_size: number;
accelerator_width: number;
show_submenu_indicator: number;
submenu_placement: number;
submenu_direction: number;
right_justify: number;
timer_from_keypress: number;
from_menubar: number;
timer: number;
// Constructors
constructor(properties?: Partial<MenuItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): MenuItem;
static new_with_label(label: string): MenuItem;
static new_with_mnemonic(label: string): MenuItem;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate', callback: (_source: this) => void): number;
connect_after(signal: 'activate', callback: (_source: this) => void): number;
emit(signal: 'activate'): void;
connect(signal: 'activate-item', callback: (_source: this) => void): number;
connect_after(signal: 'activate-item', callback: (_source: this) => void): number;
emit(signal: 'activate-item'): void;
connect(signal: 'toggle-size-allocate', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'toggle-size-allocate', callback: (_source: this, object: number) => void): number;
emit(signal: 'toggle-size-allocate', object: number): void;
connect(signal: 'toggle-size-request', callback: (_source: this, object: any | null) => void): number;
connect_after(signal: 'toggle-size-request', callback: (_source: this, object: any | null) => void): number;
emit(signal: 'toggle-size-request', object?: any | null): void;
// Virtual methods
vfunc_activate(): void;
vfunc_activate_item(): void;
/**
* Sets `text` on the `menu_item` label
*/
vfunc_get_label(): string;
/**
* Sets `text` on the `menu_item` label
* @param label the text you want to set
*/
vfunc_set_label(label: string): void;
vfunc_toggle_size_allocate(allocation: number): void;
vfunc_toggle_size_request(requisition: number): void;
// Methods
activate(): void;
// Conflicted with Gtk.Widget.activate
activate(...args: never[]): any;
deselect(): void;
/**
* Retrieve the accelerator path that was previously set on `menu_item`.
*
* See gtk_menu_item_set_accel_path() for details.
* @returns the accelerator path corresponding to this menu item's functionality, or %NULL if not set
*/
get_accel_path(): string;
/**
* Sets `text` on the `menu_item` label
* @returns The text in the @menu_item label. This is the internal string used by the label, and must not be modified.
*/
get_label(): string;
/**
* Gets whether the menu item appears justified at the right
* side of the menu bar.
* @returns %TRUE if the menu item will appear at the far right if added to a menu bar.
*/
get_right_justified(): boolean;
/**
* Gets the submenu underneath this menu item, if any.
* See gtk_menu_item_set_submenu().
* @returns submenu for this menu item, or %NULL if none.
*/
get_submenu(): Widget;
/**
* Checks if an underline in the text indicates the next character should be
* used for the mnemonic accelerator key.
* @returns %TRUE if an embedded underline in the label indicates the mnemonic accelerator key.
*/
get_use_underline(): boolean;
/**
* Removes the widget's submenu.
*/
remove_submenu(): void;
select(): void;
/**
* Set the accelerator path on `menu_item,` through which runtime changes of the
* menu item's accelerator caused by the user can be identified and saved to
* persistant storage (see gtk_accel_map_save() on this).
* To setup a default accelerator for this menu item, call
* gtk_accel_map_add_entry() with the same `accel_path`.
* See also gtk_accel_map_add_entry() on the specifics of accelerator paths,
* and gtk_menu_set_accel_path() for a more convenient variant of this function.
*
* This function is basically a convenience wrapper that handles calling
* gtk_widget_set_accel_path() with the appropriate accelerator group for
* the menu item.
*
* Note that you do need to set an accelerator on the parent menu with
* gtk_menu_set_accel_group() for this to work.
*
* 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 accelerator path, corresponding to this menu item's functionality, or %NULL to unset the current path.
*/
set_accel_path(accel_path?: string | null): void;
/**
* Sets `text` on the `menu_item` label
* @param label the text you want to set
*/
set_label(label: string): void;
/**
* Sets whether the menu item appears justified at the right
* side of a menu bar. This was traditionally done for "Help" menu
* items, but is now considered a bad idea. (If the widget
* layout is reversed for a right-to-left language like Hebrew
* or Arabic, right-justified-menu-items appear at the left.)
* @param right_justified if %TRUE the menu item will appear at the far right if added to a menu bar.
*/
set_right_justified(right_justified: boolean): void;
/**
* Sets or replaces the menu item's submenu, or removes it when a %NULL
* submenu is passed.
* @param submenu the submenu, or %NULL
*/
set_submenu(submenu?: Widget | null): void;
/**
* If true, an underline in the text indicates the next character should be
* used for the mnemonic accelerator key.
* @param setting %TRUE if underlines in the text indicate mnemonics
*/
set_use_underline(setting: boolean): void;
toggle_size_allocate(allocation: number): void;
toggle_size_request(requisition: number): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace MenuShell {
// Signal callback interfaces
interface ActivateCurrent {
(object: boolean): void;
}
interface Cancel {
(): void;
}
interface CycleFocus {
(object: DirectionType): void;
}
interface Deactivate {
(): void;
}
interface Insert {
(child: Widget, position: number): void;
}
interface MoveCurrent {
(object: MenuDirectionType): void;
}
interface MoveSelected {
(distance: number): boolean;
}
interface SelectionDone {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
take_focus: boolean;
takeFocus: boolean;
}
}
abstract class MenuShell extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<MenuShell>;
// Properties
/**
* A boolean that determines whether the menu and its submenus grab the
* keyboard focus. See gtk_menu_shell_set_take_focus() and
* gtk_menu_shell_get_take_focus().
*/
get take_focus(): boolean;
set take_focus(val: boolean);
/**
* A boolean that determines whether the menu and its submenus grab the
* keyboard focus. See gtk_menu_shell_set_take_focus() and
* gtk_menu_shell_get_take_focus().
*/
get takeFocus(): boolean;
set takeFocus(val: boolean);
// Fields
container: Container;
children: any[];
active_menu_item: Widget;
parent_menu_shell: Widget;
button: number;
activate_time: number;
active: number;
have_grab: number;
have_xgrab: number;
ignore_leave: number;
menu_flag: number;
ignore_enter: number;
keyboard_mode: number;
// Constructors
constructor(properties?: Partial<MenuShell.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate-current', callback: (_source: this, object: boolean) => void): number;
connect_after(signal: 'activate-current', callback: (_source: this, object: boolean) => void): number;
emit(signal: 'activate-current', object: boolean): void;
connect(signal: 'cancel', callback: (_source: this) => void): number;
connect_after(signal: 'cancel', callback: (_source: this) => void): number;
emit(signal: 'cancel'): void;
connect(signal: 'cycle-focus', callback: (_source: this, object: DirectionType) => void): number;
connect_after(signal: 'cycle-focus', callback: (_source: this, object: DirectionType) => void): number;
emit(signal: 'cycle-focus', object: DirectionType): void;
connect(signal: 'deactivate', callback: (_source: this) => void): number;
connect_after(signal: 'deactivate', callback: (_source: this) => void): number;
emit(signal: 'deactivate'): void;
connect(signal: 'insert', callback: (_source: this, child: Widget, position: number) => void): number;
connect_after(signal: 'insert', callback: (_source: this, child: Widget, position: number) => void): number;
emit(signal: 'insert', child: Widget, position: number): void;
connect(signal: 'move-current', callback: (_source: this, object: MenuDirectionType) => void): number;
connect_after(signal: 'move-current', callback: (_source: this, object: MenuDirectionType) => void): number;
emit(signal: 'move-current', object: MenuDirectionType): void;
connect(signal: 'move-selected', callback: (_source: this, distance: number) => boolean): number;
connect_after(signal: 'move-selected', callback: (_source: this, distance: number) => boolean): number;
emit(signal: 'move-selected', distance: number): void;
connect(signal: 'selection-done', callback: (_source: this) => void): number;
connect_after(signal: 'selection-done', callback: (_source: this) => void): number;
emit(signal: 'selection-done'): void;
// Virtual methods
vfunc_activate_current(force_hide: boolean): void;
/**
* Cancels the selection within the menu shell.
*/
vfunc_cancel(): void;
vfunc_deactivate(): void;
vfunc_get_popup_delay(): number;
vfunc_insert(child: Widget, position: number): void;
vfunc_move_current(direction: MenuDirectionType): void;
vfunc_move_selected(distance: number): boolean;
vfunc_select_item(menu_item: Widget): void;
vfunc_selection_done(): void;
// Methods
activate_item(menu_item: Widget, force_deactivate: boolean): void;
append(child: Widget): void;
/**
* Cancels the selection within the menu shell.
*/
cancel(): void;
deactivate(): void;
deselect(): void;
/**
* Returns %TRUE if the menu shell will take the keyboard focus on popup.
* @returns %TRUE if the menu shell will take the keyboard focus on popup.
*/
get_take_focus(): boolean;
insert(child: Widget, position: number): void;
prepend(child: Widget): void;
/**
* Select the first visible or selectable child of the menu shell;
* don't select tearoff items unless the only item is a tearoff
* item.
* @param search_sensitive if %TRUE, search for the first selectable menu item, otherwise select nothing if the first item isn't sensitive. This should be %FALSE if the menu is being popped up initially.
*/
select_first(search_sensitive: boolean): void;
select_item(menu_item: Widget): void;
/**
* If `take_focus` is %TRUE (the default) the menu shell will take the keyboard
* focus so that it will receive all keyboard events which is needed to enable
* keyboard navigation in menus.
*
* Setting `take_focus` to %FALSE is useful only for special applications
* like virtual keyboard implementations which should not take keyboard
* focus.
*
* The `take_focus` state of a menu or menu bar is automatically propagated
* to submenus whenever a submenu is popped up, so you don't have to worry
* about recursively setting it for your entire menu hierarchy. Only when
* programmatically picking a submenu and popping it up manually, the
* `take_focus` property of the submenu needs to be set explicitely.
*
* Note that setting it to %FALSE has side-effects:
*
* If the focus is in some other app, it keeps the focus and keynav in
* the menu doesn't work. Consequently, keynav on the menu will only
* work if the focus is on some toplevel owned by the onscreen keyboard.
*
* To avoid confusing the user, menus with `take_focus` set to %FALSE
* should not display mnemonics or accelerators, since it cannot be
* guaranteed that they will work.
*
* See also gdk_keyboard_grab()
* @param take_focus %TRUE if the menu shell should take the keyboard focus on popup.
*/
set_take_focus(take_focus: 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 MenuToolButton {
// Signal callback interfaces
interface ShowMenu {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends ToolButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
menu: Menu;
}
}
class MenuToolButton extends ToolButton implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<MenuToolButton>;
// Properties
get menu(): Menu;
set menu(val: Menu);
// Constructors
constructor(properties?: Partial<MenuToolButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](icon_widget?: Widget | null, label?: string | null): MenuToolButton;
// Conflicted with Gtk.ToolItem.new
static ['new'](...args: never[]): any;
static new_from_stock(stock_id: string): MenuToolButton;
// 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: 'show-menu', callback: (_source: this) => void): number;
connect_after(signal: 'show-menu', callback: (_source: this) => void): number;
emit(signal: 'show-menu'): void;
// Virtual methods
vfunc_show_menu(): void;
// Methods
/**
* Gets the #GtkMenu associated with #GtkMenuToolButton.
* @returns the #GtkMenu associated with #GtkMenuToolButton
*/
get_menu(): Widget;
/**
* Sets the #GtkTooltips object to be used for arrow button which
* pops up the menu. See gtk_tool_item_set_tooltip() for setting
* a tooltip on the whole #GtkMenuToolButton.
* @param tooltips the #GtkTooltips object to be used
* @param tip_text text to be used as tooltip text for tool_item
* @param tip_private text to be used as private tooltip text
*/
set_arrow_tooltip(tooltips: Tooltips, tip_text?: string | null, tip_private?: string | null): void;
/**
* Sets the tooltip markup text to be used as tooltip for the arrow button
* which pops up the menu. See gtk_tool_item_set_tooltip() for setting a
* tooltip on the whole #GtkMenuToolButton.
* @param markup markup text to be used as tooltip text for button's arrow button
*/
set_arrow_tooltip_markup(markup: string): void;
/**
* Sets the tooltip text to be used as tooltip for the arrow button which
* pops up the menu. See gtk_tool_item_set_tooltip() for setting a tooltip
* on the whole #GtkMenuToolButton.
* @param text text to be used as tooltip text for button's arrow button
*/
set_arrow_tooltip_text(text: string): void;
/**
* Sets the #GtkMenu that is popped up when the user clicks on the arrow.
* If `menu` is NULL, the arrow button becomes insensitive.
* @param menu the #GtkMenu associated with #GtkMenuToolButton
*/
set_menu(menu: Widget): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace MessageDialog {
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
buttons: ButtonsType;
image: Widget;
message_area: Widget;
messageArea: Widget;
message_type: MessageType;
messageType: MessageType;
secondary_text: string;
secondaryText: string;
secondary_use_markup: boolean;
secondaryUseMarkup: boolean;
text: string;
use_markup: boolean;
useMarkup: boolean;
}
}
/**
* #GtkMessageDialog presents a dialog with an image representing the type of
* message (Error, Question, etc.) alongside some message text. It's simply a
* convenience widget; you could construct the equivalent of #GtkMessageDialog
* from #GtkDialog without too much effort, but #GtkMessageDialog saves typing.
*
* The easiest way to do a modal message dialog is to use gtk_dialog_run(), though
* you can also pass in the %GTK_DIALOG_MODAL flag, gtk_dialog_run() automatically
* makes the dialog modal and waits for the user to respond to it. gtk_dialog_run()
* returns when any dialog button is clicked.
* <example>
* <title>A modal dialog.</title>
* <programlisting>
* dialog = gtk_message_dialog_new (main_application_window,
* GTK_DIALOG_DESTROY_WITH_PARENT,
* GTK_MESSAGE_ERROR,
* GTK_BUTTONS_CLOSE,
* "Error loading file '&percnt;s': &percnt;s",
* filename, g_strerror (errno));
* gtk_dialog_run (GTK_DIALOG (dialog));
* gtk_widget_destroy (dialog);
* </programlisting>
* </example>
* You might do a non-modal #GtkMessageDialog as follows:
* <example>
* <title>A non-modal dialog.</title>
* <programlisting>
* dialog = gtk_message_dialog_new (main_application_window,
* GTK_DIALOG_DESTROY_WITH_PARENT,
* GTK_MESSAGE_ERROR,
* GTK_BUTTONS_CLOSE,
* "Error loading file '&percnt;s': &percnt;s",
* filename, g_strerror (errno));
*
* /&ast; Destroy the dialog when the user responds to it (e.g. clicks a button) &ast;/
* g_signal_connect_swapped (dialog, "response",
* G_CALLBACK (gtk_widget_destroy),
* dialog);
* </programlisting>
* </example>
*
* <refsect2 id="GtkMessageDialog-BUILDER-UI">
* <title>GtkMessageDialog as GtkBuildable</title>
* <para>
* The GtkMessageDialog implementation of the GtkBuildable interface exposes
* the message area as an internal child with the name "message_area".
* </para>
* </refsect2>
*/
class MessageDialog extends Dialog implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<MessageDialog>;
// Properties
set buttons(val: ButtonsType);
/**
* The image for this dialog.
*/
get image(): Widget;
set image(val: Widget);
/**
* The #GtkVBox that corresponds to the message area of this dialog. See
* gtk_message_dialog_get_message_area() for a detailed description of this
* area.
*/
get message_area(): Widget;
/**
* The #GtkVBox that corresponds to the message area of this dialog. See
* gtk_message_dialog_get_message_area() for a detailed description of this
* area.
*/
get messageArea(): Widget;
/**
* The type of the message. The type is used to determine
* the image that is shown in the dialog, unless the image is
* explicitly set by the ::image property.
*/
get message_type(): MessageType;
set message_type(val: MessageType);
/**
* The type of the message. The type is used to determine
* the image that is shown in the dialog, unless the image is
* explicitly set by the ::image property.
*/
get messageType(): MessageType;
set messageType(val: MessageType);
/**
* The secondary text of the message dialog.
*/
get secondary_text(): string;
set secondary_text(val: string);
/**
* The secondary text of the message dialog.
*/
get secondaryText(): string;
set secondaryText(val: string);
/**
* %TRUE if the secondary text of the dialog includes Pango markup.
* See pango_parse_markup().
*/
get secondary_use_markup(): boolean;
set secondary_use_markup(val: boolean);
/**
* %TRUE if the secondary text of the dialog includes Pango markup.
* See pango_parse_markup().
*/
get secondaryUseMarkup(): boolean;
set secondaryUseMarkup(val: boolean);
/**
* The primary text of the message dialog. If the dialog has
* a secondary text, this will appear as the title.
*/
get text(): string;
set text(val: string);
/**
* %TRUE if the primary text of the dialog includes Pango markup.
* See pango_parse_markup().
*/
get use_markup(): boolean;
set use_markup(val: boolean);
/**
* %TRUE if the primary text of the dialog includes Pango markup.
* See pango_parse_markup().
*/
get useMarkup(): boolean;
set useMarkup(val: boolean);
// Constructors
constructor(properties?: Partial<MessageDialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the dialog's image.
* @returns the dialog's image
*/
get_image(): Widget;
/**
* Returns the message area of the dialog. This is the box where the
* dialog's primary and secondary labels are packed. You can add your
* own extra content to that box and it will appear below those labels,
* on the right side of the dialog's image (or on the left for right-to-left
* languages). See gtk_dialog_get_content_area() for the corresponding
* function in the parent #GtkDialog.
* @returns A #GtkVBox corresponding to the "message area" in the @message_dialog.
*/
get_message_area(): Widget;
/**
* Sets the dialog's image to `image`.
* @param image the image
*/
set_image(image: Widget): void;
/**
* Sets the text of the message dialog to be `str,` which is marked
* up with the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>.
* @param str markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>)
*/
set_markup(str: string): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Misc {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
xalign: number;
xpad: number;
yalign: number;
ypad: number;
}
}
abstract class Misc extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Misc>;
// Properties
get xalign(): number;
set xalign(val: number);
get xpad(): number;
set xpad(val: number);
get yalign(): number;
set yalign(val: number);
get ypad(): number;
set ypad(val: number);
// Fields
widget: Widget;
// Constructors
constructor(properties?: Partial<Misc.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Gets the X and Y alignment of the widget within its allocation.
* See gtk_misc_set_alignment().
*/
get_alignment(): [number, number];
/**
* Gets the padding in the X and Y directions of the widget.
* See gtk_misc_set_padding().
*/
get_padding(): [number, number];
set_alignment(xalign: number, yalign: number): void;
set_padding(xpad: number, ypad: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace MountOperation {
// Constructor properties interface
interface ConstructorProps extends Gio.MountOperation.ConstructorProps {
is_showing: boolean;
isShowing: boolean;
parent: Window;
screen: Gdk.Screen;
}
}
/**
* This should not be accessed directly. Use the accessor functions below.
*/
class MountOperation extends Gio.MountOperation {
static $gtype: GObject.GType<MountOperation>;
// Properties
get is_showing(): boolean;
get isShowing(): boolean;
get parent(): Window;
set parent(val: Window);
get screen(): Gdk.Screen;
set screen(val: Gdk.Screen);
// Constructors
constructor(properties?: Partial<MountOperation.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](parent?: Window | null): MountOperation;
// Conflicted with Gio.MountOperation.new
static ['new'](...args: never[]): any;
// Methods
/**
* Gets the transient parent used by the #GtkMountOperation
* @returns the transient parent for windows shown by @op
*/
get_parent(): Window;
/**
* Gets the screen on which windows of the #GtkMountOperation
* will be shown.
* @returns the screen on which windows of @op are shown
*/
get_screen(): Gdk.Screen;
/**
* Sets the transient parent for windows shown by the
* #GtkMountOperation.
* @param parent transient parent of the window, or %NULL
*/
set_parent(parent?: Window | null): void;
/**
* Sets the screen to show windows of the #GtkMountOperation on.
* @param screen a #GdkScreen
*/
set_screen(screen: Gdk.Screen): void;
}
namespace Notebook {
// Signal callback interfaces
interface ChangeCurrentPage {
(object: number): boolean;
}
interface CreateWindow {
(page: Widget, x: number, y: number): Notebook;
}
interface FocusTab {
(object: NotebookTab): boolean;
}
interface MoveFocusOut {
(object: DirectionType): void;
}
interface PageAdded {
(child: Widget, page_num: number): void;
}
interface PageRemoved {
(child: Widget, page_num: number): void;
}
interface PageReordered {
(child: Widget, page_num: number): void;
}
interface ReorderTab {
(object: DirectionType, p0: boolean): boolean;
}
interface SelectPage {
(object: boolean): boolean;
}
interface SwitchPage {
(object: any | null, p0: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
enable_popup: boolean;
enablePopup: boolean;
group: any;
group_id: number;
groupId: number;
group_name: string;
groupName: string;
homogeneous: boolean;
page: number;
scrollable: boolean;
show_border: boolean;
showBorder: boolean;
show_tabs: boolean;
showTabs: boolean;
tab_border: number;
tabBorder: number;
tab_hborder: number;
tabHborder: number;
tab_pos: PositionType;
tabPos: PositionType;
tab_vborder: number;
tabVborder: number;
}
}
class Notebook extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Notebook>;
// Properties
get enable_popup(): boolean;
set enable_popup(val: boolean);
get enablePopup(): boolean;
set enablePopup(val: boolean);
/**
* Group for tabs drag and drop.
*/
get group(): any;
set group(val: any);
get group_id(): number;
set group_id(val: number);
get groupId(): number;
set groupId(val: number);
/**
* Group name for tabs drag and drop.
*/
get group_name(): string;
set group_name(val: string);
/**
* Group name for tabs drag and drop.
*/
get groupName(): string;
set groupName(val: string);
get homogeneous(): boolean;
set homogeneous(val: boolean);
get page(): number;
set page(val: number);
get scrollable(): boolean;
set scrollable(val: boolean);
get show_border(): boolean;
set show_border(val: boolean);
get showBorder(): boolean;
set showBorder(val: boolean);
get show_tabs(): boolean;
set show_tabs(val: boolean);
get showTabs(): boolean;
set showTabs(val: boolean);
set tab_border(val: number);
set tabBorder(val: number);
get tab_hborder(): number;
set tab_hborder(val: number);
get tabHborder(): number;
set tabHborder(val: number);
get tab_pos(): PositionType;
set tab_pos(val: PositionType);
get tabPos(): PositionType;
set tabPos(val: PositionType);
get tab_vborder(): number;
set tab_vborder(val: number);
get tabVborder(): number;
set tabVborder(val: number);
// Fields
container: Container;
children: any[];
first_tab: any[];
focus_tab: any[];
menu: Widget;
event_window: Gdk.Window;
timer: number;
in_child: number;
click_child: number;
button: number;
need_timer: number;
child_has_focus: number;
have_visible_child: number;
focus_out: number;
has_before_previous: number;
has_before_next: number;
has_after_previous: number;
has_after_next: number;
// Constructors
constructor(properties?: Partial<Notebook.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Notebook;
// 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: 'change-current-page', callback: (_source: this, object: number) => boolean): number;
connect_after(signal: 'change-current-page', callback: (_source: this, object: number) => boolean): number;
emit(signal: 'change-current-page', object: number): void;
connect(
signal: 'create-window',
callback: (_source: this, page: Widget, x: number, y: number) => Notebook,
): number;
connect_after(
signal: 'create-window',
callback: (_source: this, page: Widget, x: number, y: number) => Notebook,
): number;
emit(signal: 'create-window', page: Widget, x: number, y: number): void;
connect(signal: 'focus-tab', callback: (_source: this, object: NotebookTab) => boolean): number;
connect_after(signal: 'focus-tab', callback: (_source: this, object: NotebookTab) => boolean): number;
emit(signal: 'focus-tab', object: NotebookTab): void;
connect(signal: 'move-focus-out', callback: (_source: this, object: DirectionType) => void): number;
connect_after(signal: 'move-focus-out', callback: (_source: this, object: DirectionType) => void): number;
emit(signal: 'move-focus-out', object: DirectionType): void;
connect(signal: 'page-added', callback: (_source: this, child: Widget, page_num: number) => void): number;
connect_after(
signal: 'page-added',
callback: (_source: this, child: Widget, page_num: number) => void,
): number;
emit(signal: 'page-added', child: Widget, page_num: number): void;
connect(signal: 'page-removed', callback: (_source: this, child: Widget, page_num: number) => void): number;
connect_after(
signal: 'page-removed',
callback: (_source: this, child: Widget, page_num: number) => void,
): number;
emit(signal: 'page-removed', child: Widget, page_num: number): void;
connect(
signal: 'page-reordered',
callback: (_source: this, child: Widget, page_num: number) => void,
): number;
connect_after(
signal: 'page-reordered',
callback: (_source: this, child: Widget, page_num: number) => void,
): number;
emit(signal: 'page-reordered', child: Widget, page_num: number): void;
connect(
signal: 'reorder-tab',
callback: (_source: this, object: DirectionType, p0: boolean) => boolean,
): number;
connect_after(
signal: 'reorder-tab',
callback: (_source: this, object: DirectionType, p0: boolean) => boolean,
): number;
emit(signal: 'reorder-tab', object: DirectionType, p0: boolean): void;
connect(signal: 'select-page', callback: (_source: this, object: boolean) => boolean): number;
connect_after(signal: 'select-page', callback: (_source: this, object: boolean) => boolean): number;
emit(signal: 'select-page', object: boolean): void;
connect(signal: 'switch-page', callback: (_source: this, object: any | null, p0: number) => void): number;
connect_after(
signal: 'switch-page',
callback: (_source: this, object: any | null, p0: number) => void,
): number;
emit(signal: 'switch-page', object: any | null, p0: number): void;
// Virtual methods
vfunc_change_current_page(offset: number): boolean;
vfunc_focus_tab(type: NotebookTab): boolean;
vfunc_insert_page(child: Widget, tab_label: Widget, menu_label: Widget, position: number): number;
vfunc_move_focus_out(direction: DirectionType): void;
vfunc_reorder_tab(direction: DirectionType, move_to_last: boolean): boolean;
vfunc_select_page(move_focus: boolean): boolean;
vfunc_switch_page(page: NotebookPage, page_num: number): void;
// Methods
/**
* Appends a page to `notebook`.
* @param child the #GtkWidget to use as the contents of the page.
* @param tab_label the #GtkWidget to be used as the label for the page, or %NULL to use the default label, 'page N'.
* @returns the index (starting from 0) of the appended page in the notebook, or -1 if function fails
*/
append_page(child: Widget, tab_label?: Widget | null): number;
/**
* Appends a page to `notebook,` specifying the widget to use as the
* label in the popup menu.
* @param child the #GtkWidget to use as the contents of the page.
* @param tab_label the #GtkWidget to be used as the label for the page, or %NULL to use the default label, 'page N'.
* @param menu_label the widget to use as a label for the page-switch menu, if that is enabled. If %NULL, and @tab_label is a #GtkLabel or %NULL, then the menu label will be a newly created label with the same text as @tab_label; If @tab_label is not a #GtkLabel, @menu_label must be specified if the page-switch menu is to be used.
* @returns the index (starting from 0) of the appended page in the notebook, or -1 if function fails
*/
append_page_menu(child: Widget, tab_label?: Widget | null, menu_label?: Widget | null): number;
/**
* Gets one of the action widgets. See gtk_notebook_set_action_widget().
* @param pack_type pack type of the action widget to receive
* @returns The action widget with the given @pack_type or %NULL when this action widget has not been set
*/
get_action_widget(pack_type: PackType | null): Widget;
/**
* Returns the page number of the current page.
* @returns the index (starting from 0) of the current page in the notebook. If the notebook has no pages, then -1 will be returned.
*/
get_current_page(): number;
/**
* Gets the current group identificator pointer for `notebook`.
* @returns the group identificator, or %NULL if none is set.
*/
get_group(): any | null;
/**
* Gets the current group identificator for `notebook`.
* @returns the group identificator, or -1 if none is set.
*/
get_group_id(): number;
/**
* Gets the current group name for `notebook`.
*
* Note that this funtion can emphasis not be used
* together with gtk_notebook_set_group() or
* gtk_notebook_set_group_id().
*
* Return Value: (transfer none): the group name,
* or %NULL if none is set.
*/
get_group_name(): string;
/**
* Retrieves the menu label widget of the page containing `child`.
* @param child a widget contained in a page of @notebook
* @returns the menu label, or %NULL if the notebook page does not have a menu label other than the default (the tab label).
*/
get_menu_label(child: Widget): Widget;
/**
* Retrieves the text of the menu label for the page containing
* `child`.
* @param child the child widget of a page of the notebook.
* @returns the text of the tab label, or %NULL if the widget does not have a menu label other than the default menu label, or the menu label widget is not a #GtkLabel. The string is owned by the widget and must not be freed.
*/
get_menu_label_text(child: Widget): string;
/**
* Gets the number of pages in a notebook.
* @returns the number of pages in the notebook.
*/
get_n_pages(): number;
/**
* Returns the child widget contained in page number `page_num`.
* @param page_num the index of a page in the notebook, or -1 to get the last page.
* @returns the child widget, or %NULL if @page_num is out of bounds.
*/
get_nth_page(page_num: number): Widget;
/**
* Returns whether the tab label area has arrows for scrolling. See
* gtk_notebook_set_scrollable().
* @returns %TRUE if arrows for scrolling are present
*/
get_scrollable(): boolean;
/**
* Returns whether a bevel will be drawn around the notebook pages. See
* gtk_notebook_set_show_border().
* @returns %TRUE if the bevel is drawn
*/
get_show_border(): boolean;
/**
* Returns whether the tabs of the notebook are shown. See
* gtk_notebook_set_show_tabs().
* @returns %TRUE if the tabs are shown
*/
get_show_tabs(): boolean;
/**
* Returns whether the tab contents can be detached from `notebook`.
* @param child a child #GtkWidget
* @returns TRUE if the tab is detachable.
*/
get_tab_detachable(child: Widget): boolean;
/**
* Returns the horizontal width of a tab border.
* @returns horizontal width of a tab border
*/
get_tab_hborder(): number;
/**
* Returns the tab label widget for the page `child`. %NULL is returned
* if `child` is not in `notebook` or if no tab label has specifically
* been set for `child`.
* @param child the page
* @returns the tab label
*/
get_tab_label(child: Widget): Widget;
/**
* Retrieves the text of the tab label for the page containing
* `child`.
* @param child a widget contained in a page of @notebook
* @returns the text of the tab label, or %NULL if the tab label widget is not a #GtkLabel. The string is owned by the widget and must not be freed.
*/
get_tab_label_text(child: Widget): string;
/**
* Gets the edge at which the tabs for switching pages in the
* notebook are drawn.
* @returns the edge at which the tabs are drawn
*/
get_tab_pos(): PositionType;
/**
* Gets whether the tab can be reordered via drag and drop or not.
* @param child a child #GtkWidget
* @returns %TRUE if the tab is reorderable.
*/
get_tab_reorderable(child: Widget): boolean;
/**
* Returns the vertical width of a tab border.
* @returns vertical width of a tab border
*/
get_tab_vborder(): number;
/**
* Insert a page into `notebook` at the given position.
* @param child the #GtkWidget to use as the contents of the page.
* @param tab_label the #GtkWidget to be used as the label for the page, or %NULL to use the default label, 'page N'.
* @param position the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages.
* @returns the index (starting from 0) of the inserted page in the notebook, or -1 if function fails
*/
insert_page(child: Widget, tab_label: Widget | null, position: number): number;
/**
* Insert a page into `notebook` at the given position, specifying
* the widget to use as the label in the popup menu.
* @param child the #GtkWidget to use as the contents of the page.
* @param tab_label the #GtkWidget to be used as the label for the page, or %NULL to use the default label, 'page N'.
* @param menu_label the widget to use as a label for the page-switch menu, if that is enabled. If %NULL, and @tab_label is a #GtkLabel or %NULL, then the menu label will be a newly created label with the same text as @tab_label; If @tab_label is not a #GtkLabel, @menu_label must be specified if the page-switch menu is to be used.
* @param position the index (starting at 0) at which to insert the page, or -1 to append the page after all other pages.
* @returns the index (starting from 0) of the inserted page in the notebook
*/
insert_page_menu(
child: Widget,
tab_label: Widget | null,
menu_label: Widget | null,
position: number,
): number;
/**
* Switches to the next page. Nothing happens if the current page is
* the last page.
*/
next_page(): void;
/**
* Finds the index of the page which contains the given child
* widget.
* @param child a #GtkWidget
* @returns the index of the page containing @child, or -1 if @child is not in the notebook.
*/
page_num(child: Widget): number;
/**
* Disables the popup menu.
*/
popup_disable(): void;
/**
* Enables the popup menu: if the user clicks with the right mouse button on
* the tab labels, a menu with all the pages will be popped up.
*/
popup_enable(): void;
/**
* Prepends a page to `notebook`.
* @param child the #GtkWidget to use as the contents of the page.
* @param tab_label the #GtkWidget to be used as the label for the page, or %NULL to use the default label, 'page N'.
* @returns the index (starting from 0) of the prepended page in the notebook, or -1 if function fails
*/
prepend_page(child: Widget, tab_label?: Widget | null): number;
/**
* Prepends a page to `notebook,` specifying the widget to use as the
* label in the popup menu.
* @param child the #GtkWidget to use as the contents of the page.
* @param tab_label the #GtkWidget to be used as the label for the page, or %NULL to use the default label, 'page N'.
* @param menu_label the widget to use as a label for the page-switch menu, if that is enabled. If %NULL, and @tab_label is a #GtkLabel or %NULL, then the menu label will be a newly created label with the same text as @tab_label; If @tab_label is not a #GtkLabel, @menu_label must be specified if the page-switch menu is to be used.
* @returns the index (starting from 0) of the prepended page in the notebook, or -1 if function fails
*/
prepend_page_menu(child: Widget, tab_label?: Widget | null, menu_label?: Widget | null): number;
/**
* Switches to the previous page. Nothing happens if the current page
* is the first page.
*/
prev_page(): void;
/**
* Query the packing attributes for the tab label of the page
* containing `child`.
* @param child the page
* @param expand location to store the expand value (or NULL)
* @param fill location to store the fill value (or NULL)
* @param pack_type location to store the pack_type (or NULL)
*/
query_tab_label_packing(child: Widget, expand: boolean, fill: boolean, pack_type: PackType | null): void;
/**
* Removes a page from the notebook given its index
* in the notebook.
* @param page_num the index of a notebook page, starting from 0. If -1, the last page will be removed.
*/
remove_page(page_num: number): void;
/**
* Reorders the page containing `child,` so that it appears in position
* `position`. If `position` is greater than or equal to the number of
* children in the list or negative, `child` will be moved to the end
* of the list.
* @param child the child to move
* @param position the new position, or -1 to move to the end
*/
reorder_child(child: Widget, position: number): void;
/**
* Sets `widget` as one of the action widgets. Depending on the pack type
* the widget will be placed before or after the tabs. You can use
* a #GtkBox if you need to pack more than one widget on the same side.
*
* Note that action widgets are "internal" children of the notebook and thus
* not included in the list returned from gtk_container_foreach().
* @param widget a #GtkWidget
* @param pack_type pack type of the action widget
*/
set_action_widget(widget: Widget, pack_type: PackType | null): void;
/**
* Switches to the page number `page_num`.
*
* Note that due to historical reasons, GtkNotebook refuses
* to switch to a page unless the child widget is visible.
* Therefore, it is recommended to show child widgets before
* adding them to a notebook.
* @param page_num index of the page to switch to, starting from 0. If negative, the last page will be used. If greater than the number of pages in the notebook, nothing will be done.
*/
set_current_page(page_num: number): void;
/**
* Sets a group identificator pointer for `notebook,` notebooks sharing
* the same group identificator pointer will be able to exchange tabs
* via drag and drop. A notebook with a %NULL group identificator will
* not be able to exchange tabs with any other notebook.
* @param group a pointer to identify the notebook group, or %NULL to unset it
*/
set_group(group?: any | null): void;
/**
* Sets an group identificator for `notebook,` notebooks sharing
* the same group identificator will be able to exchange tabs
* via drag and drop. A notebook with group identificator -1 will
* not be able to exchange tabs with any other notebook.
* @param group_id a group identificator, or -1 to unset it
*/
set_group_id(group_id: number): void;
/**
* Sets a group name for `notebook`.
*
* Notebooks with the same name will be able to exchange tabs
* via drag and drop. A notebook with a %NULL group name will
* not be able to exchange tabs with any other notebook.
* @param group_name
*/
set_group_name(group_name: string): void;
/**
* Sets whether the tabs must have all the same size or not.
* @param homogeneous %TRUE if all tabs should be the same size.
*/
set_homogeneous_tabs(homogeneous: boolean): void;
/**
* Changes the menu label for the page containing `child`.
* @param child the child widget
* @param menu_label the menu label, or NULL for default
*/
set_menu_label(child: Widget, menu_label?: Widget | null): void;
/**
* Creates a new label and sets it as the menu label of `child`.
* @param child the child widget
* @param menu_text the label text
*/
set_menu_label_text(child: Widget, menu_text: string): void;
/**
* Sets whether the tab label area will have arrows for scrolling if
* there are too many tabs to fit in the area.
* @param scrollable %TRUE if scroll arrows should be added
*/
set_scrollable(scrollable: boolean): void;
/**
* Sets whether a bevel will be drawn around the notebook pages.
* This only has a visual effect when the tabs are not shown.
* See gtk_notebook_set_show_tabs().
* @param show_border %TRUE if a bevel should be drawn around the notebook.
*/
set_show_border(show_border: boolean): void;
/**
* Sets whether to show the tabs for the notebook or not.
* @param show_tabs %TRUE if the tabs should be shown.
*/
set_show_tabs(show_tabs: boolean): void;
/**
* Sets the width the border around the tab labels
* in a notebook. This is equivalent to calling
* gtk_notebook_set_tab_hborder (`notebook,` `border_width)` followed
* by gtk_notebook_set_tab_vborder (`notebook,` `border_width)`.
* @param border_width width of the border around the tab labels.
*/
set_tab_border(border_width: number): void;
/**
* Sets whether the tab can be detached from `notebook` to another
* notebook or widget.
*
* Note that 2 notebooks must share a common group identificator
* (see gtk_notebook_set_group_id ()) to allow automatic tabs
* interchange between them.
*
* If you want a widget to interact with a notebook through DnD
* (i.e.: accept dragged tabs from it) it must be set as a drop
* destination and accept the target "GTK_NOTEBOOK_TAB". The notebook
* will fill the selection with a GtkWidget** pointing to the child
* widget that corresponds to the dropped tab.
*
* ```
* static void
* on_drop_zone_drag_data_received (GtkWidget *widget,
* GdkDragContext *context,
* gint x,
* gint y,
* GtkSelectionData *selection_data,
* guint info,
* guint time,
* gpointer user_data)
* {
* GtkWidget *notebook;
* GtkWidget **child;
*
* notebook = gtk_drag_get_source_widget (context);
* child = (void*) selection_data->data;
*
* process_widget (*child);
* gtk_container_remove (GTK_CONTAINER (notebook), *child);
* }
* ```
*
*
* If you want a notebook to accept drags from other widgets,
* you will have to set your own DnD code to do it.
* @param child a child #GtkWidget
* @param detachable whether the tab is detachable or not
*/
set_tab_detachable(child: Widget, detachable: boolean): void;
/**
* Sets the width of the horizontal border of tab labels.
* @param tab_hborder width of the horizontal border of tab labels.
*/
set_tab_hborder(tab_hborder: number): void;
/**
* Changes the tab label for `child`. If %NULL is specified
* for `tab_label,` then the page will have the label 'page N'.
* @param child the page
* @param tab_label the tab label widget to use, or %NULL for default tab label.
*/
set_tab_label(child: Widget, tab_label?: Widget | null): void;
/**
* Sets the packing parameters for the tab label of the page
* containing `child`. See gtk_box_pack_start() for the exact meaning
* of the parameters.
* @param child the child widget
* @param expand whether to expand the tab label or not
* @param fill whether the tab label should fill the allocated area or not
* @param pack_type the position of the tab label
*/
set_tab_label_packing(child: Widget, expand: boolean, fill: boolean, pack_type: PackType | null): void;
/**
* Creates a new label and sets it as the tab label for the page
* containing `child`.
* @param child the page
* @param tab_text the label text
*/
set_tab_label_text(child: Widget, tab_text: string): void;
/**
* Sets the edge at which the tabs for switching pages in the
* notebook are drawn.
* @param pos the edge to draw the tabs at.
*/
set_tab_pos(pos: PositionType | null): void;
/**
* Sets whether the notebook tab can be reordered
* via drag and drop or not.
* @param child a child #GtkWidget
* @param reorderable whether the tab is reorderable or not.
*/
set_tab_reorderable(child: Widget, reorderable: boolean): void;
/**
* Sets the width of the vertical border of tab labels.
* @param tab_vborder width of the vertical border of tab labels.
*/
set_tab_vborder(tab_vborder: 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 Object {
// Signal callback interfaces
interface Destroy {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps {
user_data: any;
userData: any;
}
}
abstract class Object extends GObject.InitiallyUnowned {
static $gtype: GObject.GType<Object>;
// Properties
get user_data(): any;
set user_data(val: any);
get userData(): any;
set userData(val: any);
// Fields
flags: number;
// Constructors
constructor(properties?: Partial<Object.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'destroy', callback: (_source: this) => void): number;
connect_after(signal: 'destroy', callback: (_source: this) => void): number;
emit(signal: 'destroy'): void;
// Static methods
static add_arg_type(arg_name: string, arg_type: GObject.GType, arg_flags: number, arg_id: number): void;
// Virtual methods
vfunc_destroy(): void;
vfunc_get_arg(arg: Arg, arg_id: number): void;
vfunc_set_arg(arg: Arg, arg_id: number): void;
// Methods
destroy(): void;
get_data(key: string): any | null;
get_data_by_id(data_id: GLib.Quark): any | null;
get_user_data(): any | null;
remove_data(key: string): void;
remove_data_by_id(data_id: GLib.Quark): void;
remove_no_notify(key: string): void;
remove_no_notify_by_id(key_id: GLib.Quark): void;
set_data(key: string, data?: any | null): void;
set_data_by_id(data_id: GLib.Quark, data?: any | null): void;
set_data_by_id_full(data_id: GLib.Quark, data?: any | null): void;
set_data_full(key: string, data?: any | null): void;
set_user_data(data?: any | null): void;
sink(): void;
unref(): void;
weakref(data?: any | null): void;
weakunref(data?: any | null): void;
}
namespace OffscreenWindow {
// Constructor properties interface
interface ConstructorProps
extends Window.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
/**
* #GtkOffscreenWindow is strictly intended to be used for obtaining
* snapshots of widgets that are not part of a normal widget hierarchy.
* It differs from gtk_widget_get_snapshot() in that the widget you
* want to get a snapshot of need not be displayed on the user's screen
* as a part of a widget hierarchy. However, since #GtkOffscreenWindow
* is a toplevel widget you cannot obtain snapshots of a full window
* with it since you cannot pack a toplevel widget in another toplevel.
*
* The idea is to take a widget and manually set the state of it,
* add it to a #GtkOffscreenWindow and then retrieve the snapshot
* as a #GdkPixmap or #GdkPixbuf.
*
* #GtkOffscreenWindow derives from #GtkWindow only as an implementation
* detail. Applications should not use any API specific to #GtkWindow
* to operate on this object. It should be treated as a #GtkBin that
* has no parent widget.
*
* When contained offscreen widgets are redrawn, #GtkOffscreenWindow
* will emit a #GtkWidget::damage-event signal.
*/
class OffscreenWindow extends Window implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<OffscreenWindow>;
// Fields
parent_object: Window;
// Constructors
constructor(properties?: Partial<OffscreenWindow.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): OffscreenWindow;
// Methods
/**
* Retrieves a snapshot of the contained widget in the form of
* a #GdkPixbuf. This is a new pixbuf with a reference count of 1,
* and the application should unreference it once it is no longer
* needed.
* @returns A #GdkPixbuf pointer, or %NULL.
*/
get_pixbuf(): GdkPixbuf.Pixbuf;
/**
* Retrieves a snapshot of the contained widget in the form of
* a #GdkPixmap. If you need to keep this around over window
* resizes then you should add a reference to it.
* @returns A #GdkPixmap pointer to the offscreen pixmap, or %NULL.
*/
get_pixmap(): Gdk.Pixmap;
// 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 OldEditable {
// Signal callback interfaces
interface Activate {
(): void;
}
interface CopyClipboard {
(): void;
}
interface CutClipboard {
(): void;
}
interface KillChar {
(object: number): void;
}
interface KillLine {
(object: number): void;
}
interface KillWord {
(object: number): void;
}
interface MoveCursor {
(object: number, p0: number): void;
}
interface MovePage {
(object: number, p0: number): void;
}
interface MoveToColumn {
(object: number): void;
}
interface MoveToRow {
(object: number): void;
}
interface MoveWord {
(object: number): void;
}
interface PasteClipboard {
(): void;
}
interface SetEditable {
(object: boolean): void;
}
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Editable.ConstructorProps {
editable: boolean;
text_position: number;
textPosition: number;
}
}
abstract class OldEditable extends Widget implements Atk.ImplementorIface, Buildable, Editable {
static $gtype: GObject.GType<OldEditable>;
// Properties
get editable(): boolean;
set editable(val: boolean);
get text_position(): number;
set text_position(val: number);
get textPosition(): number;
set textPosition(val: number);
// Fields
widget: Widget;
current_pos: number;
selection_start_pos: number;
selection_end_pos: number;
has_selection: number;
// Constructors
constructor(properties?: Partial<OldEditable.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate', callback: (_source: this) => void): number;
connect_after(signal: 'activate', callback: (_source: this) => void): number;
emit(signal: 'activate'): void;
connect(signal: 'copy-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'copy-clipboard', callback: (_source: this) => void): number;
emit(signal: 'copy-clipboard'): void;
connect(signal: 'cut-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'cut-clipboard', callback: (_source: this) => void): number;
emit(signal: 'cut-clipboard'): void;
connect(signal: 'kill-char', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'kill-char', callback: (_source: this, object: number) => void): number;
emit(signal: 'kill-char', object: number): void;
connect(signal: 'kill-line', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'kill-line', callback: (_source: this, object: number) => void): number;
emit(signal: 'kill-line', object: number): void;
connect(signal: 'kill-word', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'kill-word', callback: (_source: this, object: number) => void): number;
emit(signal: 'kill-word', object: number): void;
connect(signal: 'move-cursor', callback: (_source: this, object: number, p0: number) => void): number;
connect_after(signal: 'move-cursor', callback: (_source: this, object: number, p0: number) => void): number;
emit(signal: 'move-cursor', object: number, p0: number): void;
connect(signal: 'move-page', callback: (_source: this, object: number, p0: number) => void): number;
connect_after(signal: 'move-page', callback: (_source: this, object: number, p0: number) => void): number;
emit(signal: 'move-page', object: number, p0: number): void;
connect(signal: 'move-to-column', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'move-to-column', callback: (_source: this, object: number) => void): number;
emit(signal: 'move-to-column', object: number): void;
connect(signal: 'move-to-row', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'move-to-row', callback: (_source: this, object: number) => void): number;
emit(signal: 'move-to-row', object: number): void;
connect(signal: 'move-word', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'move-word', callback: (_source: this, object: number) => void): number;
emit(signal: 'move-word', object: number): void;
connect(signal: 'paste-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'paste-clipboard', callback: (_source: this) => void): number;
emit(signal: 'paste-clipboard'): void;
connect(signal: 'set-editable', callback: (_source: this, object: boolean) => void): number;
connect_after(signal: 'set-editable', callback: (_source: this, object: boolean) => void): number;
emit(signal: 'set-editable', object: boolean): void;
// Virtual methods
vfunc_activate(): void;
vfunc_copy_clipboard(): void;
vfunc_cut_clipboard(): void;
vfunc_get_chars(start_pos: number, end_pos: number): string;
vfunc_kill_char(direction: number): void;
vfunc_kill_line(direction: number): void;
vfunc_kill_word(direction: number): void;
vfunc_move_cursor(x: number, y: number): void;
vfunc_move_page(x: number, y: number): void;
vfunc_move_to_column(row: number): void;
vfunc_move_to_row(row: number): void;
vfunc_move_word(n: number): void;
vfunc_paste_clipboard(): void;
vfunc_set_editable(is_editable: boolean): void;
vfunc_set_position(position: number): void;
vfunc_set_selection(start_pos: number, end_pos: number): void;
vfunc_update_text(start_pos: number, end_pos: number): void;
// Methods
/**
* Emits the ::changed signal on `old_editable`.
*/
changed(): void;
/**
* Claims or gives up ownership of the selection.
* @param claim if %TRUE, claim ownership of the selection, if %FALSE, give up ownership
* @param time_ timestamp for this operation
*/
claim_selection(claim: boolean, time_: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Copies the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
copy_clipboard(): void;
/**
* Removes the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
cut_clipboard(): void;
/**
* Deletes the currently selected text of the editable.
* This call doesn't do anything if there is no selected text.
*/
delete_selection(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
delete_text(start_pos: number, end_pos: number): void;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
* @returns a pointer to the contents of the widget as a string. This string is allocated by the #GtkEditable implementation and should be freed by the caller.
*/
get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves whether `editable` is editable. See
* gtk_editable_set_editable().
* @returns %TRUE if @editable is editable.
*/
get_editable(): boolean;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
* @returns the cursor position
*/
get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
* @returns %TRUE if an area is selected, %FALSE otherwise
*/
get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Pastes the content of the clipboard to the current position of the
* cursor in the editable.
*/
paste_clipboard(): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the
* characters selected are those characters from `start_pos` to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of region
* @param end_pos end of region
*/
select_region(start_pos: number, end_pos: number): void;
/**
* Determines if the user can edit the text in the editable
* widget or not.
* @param is_editable %TRUE if the user is allowed to edit the text in the widget
*/
set_editable(is_editable: boolean): void;
/**
* Sets the cursor position in the editable to the given value.
*
* The cursor is displayed before the character with the given (base 0)
* index in the contents of the editable. The value must be less than or
* equal to the number of characters in the editable. A value of -1
* indicates that the position should be set after the last character
* of the editable. Note that `position` is in characters, not in bytes.
* @param position the position of the cursor
*/
set_position(position: number): void;
/**
* 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 OptionMenu {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
menu: Menu;
}
}
class OptionMenu extends Button implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<OptionMenu>;
// Properties
get menu(): Menu;
set menu(val: Menu);
// Fields
button: Button;
menu_item: Widget;
width: number;
height: number;
// Constructors
constructor(properties?: Partial<OptionMenu.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): OptionMenu;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Virtual methods
vfunc_changed(): void;
// Methods
/**
* Retrieves the index of the currently selected menu item. The menu
* items are numbered from top to bottom, starting with 0.
* @returns index of the selected menu item, or -1 if there are no menu items
*/
get_history(): number;
remove_menu(): void;
set_history(index_: number): void;
set_menu(menu: Widget): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace PageSetup {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class PageSetup extends GObject.Object {
static $gtype: GObject.GType<PageSetup>;
// Constructors
constructor(properties?: Partial<PageSetup.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PageSetup;
static new_from_file(file_name: string): PageSetup;
static new_from_key_file(key_file: GLib.KeyFile, group_name?: string | null): PageSetup;
// Methods
/**
* Copies a #GtkPageSetup.
* @returns a copy of @other
*/
copy(): PageSetup;
/**
* Gets the bottom margin in units of `unit`.
* @param unit the unit for the return value
* @returns the bottom margin
*/
get_bottom_margin(unit: Unit | null): number;
/**
* Gets the left margin in units of `unit`.
* @param unit the unit for the return value
* @returns the left margin
*/
get_left_margin(unit: Unit | null): number;
/**
* Gets the page orientation of the #GtkPageSetup.
* @returns the page orientation
*/
get_orientation(): PageOrientation;
/**
* Returns the page height in units of `unit`.
*
* Note that this function takes orientation and
* margins into consideration.
* See gtk_page_setup_get_paper_height().
* @param unit the unit for the return value
* @returns the page height.
*/
get_page_height(unit: Unit | null): number;
/**
* Returns the page width in units of `unit`.
*
* Note that this function takes orientation and
* margins into consideration.
* See gtk_page_setup_get_paper_width().
* @param unit the unit for the return value
* @returns the page width.
*/
get_page_width(unit: Unit | null): number;
/**
* Returns the paper height in units of `unit`.
*
* Note that this function takes orientation, but
* not margins into consideration.
* See gtk_page_setup_get_page_height().
* @param unit the unit for the return value
* @returns the paper height.
*/
get_paper_height(unit: Unit | null): number;
/**
* Gets the paper size of the #GtkPageSetup.
* @returns the paper size
*/
get_paper_size(): PaperSize;
/**
* Returns the paper width in units of `unit`.
*
* Note that this function takes orientation, but
* not margins into consideration.
* See gtk_page_setup_get_page_width().
* @param unit the unit for the return value
* @returns the paper width.
*/
get_paper_width(unit: Unit | null): number;
/**
* Gets the right margin in units of `unit`.
* @param unit the unit for the return value
* @returns the right margin
*/
get_right_margin(unit: Unit | null): number;
/**
* Gets the top margin in units of `unit`.
* @param unit the unit for the return value
* @returns the top margin
*/
get_top_margin(unit: Unit | null): number;
/**
* Reads the page setup from the file `file_name`.
* See gtk_page_setup_to_file().
* @param file_name the filename to read the page setup from
* @returns %TRUE on success
*/
load_file(file_name: string): boolean;
/**
* Reads the page setup from the group `group_name` in the key file
* `key_file`.
* @param key_file the #GKeyFile to retrieve the page_setup from
* @param group_name the name of the group in the key_file to read, or %NULL to use the default name "Page Setup"
* @returns %TRUE on success
*/
load_key_file(key_file: GLib.KeyFile, group_name?: string | null): boolean;
/**
* Sets the bottom margin of the #GtkPageSetup.
* @param margin the new bottom margin in units of @unit
* @param unit the units for @margin
*/
set_bottom_margin(margin: number, unit: Unit | null): void;
/**
* Sets the left margin of the #GtkPageSetup.
* @param margin the new left margin in units of @unit
* @param unit the units for @margin
*/
set_left_margin(margin: number, unit: Unit | null): void;
/**
* Sets the page orientation of the #GtkPageSetup.
* @param orientation a #GtkPageOrientation value
*/
set_orientation(orientation: PageOrientation | null): void;
/**
* Sets the paper size of the #GtkPageSetup without
* changing the margins. See
* gtk_page_setup_set_paper_size_and_default_margins().
* @param size a #GtkPaperSize
*/
set_paper_size(size: PaperSize): void;
/**
* Sets the paper size of the #GtkPageSetup and modifies
* the margins according to the new paper size.
* @param size a #GtkPaperSize
*/
set_paper_size_and_default_margins(size: PaperSize): void;
/**
* Sets the right margin of the #GtkPageSetup.
* @param margin the new right margin in units of @unit
* @param unit the units for @margin
*/
set_right_margin(margin: number, unit: Unit | null): void;
/**
* Sets the top margin of the #GtkPageSetup.
* @param margin the new top margin in units of @unit
* @param unit the units for @margin
*/
set_top_margin(margin: number, unit: Unit | null): void;
/**
* This function saves the information from `setup` to `file_name`.
* @param file_name the file to save to
* @returns %TRUE on success
*/
to_file(file_name: string): boolean;
/**
* This function adds the page setup from `setup` to `key_file`.
* @param key_file the #GKeyFile to save the page setup to
* @param group_name the group to add the settings to in @key_file, or %NULL to use the default name "Page Setup"
*/
to_key_file(key_file: GLib.KeyFile, group_name: string): void;
}
namespace Paned {
// Signal callback interfaces
interface AcceptPosition {
(): boolean;
}
interface CancelPosition {
(): boolean;
}
interface CycleChildFocus {
(reversed: boolean): boolean;
}
interface CycleHandleFocus {
(reversed: boolean): boolean;
}
interface MoveHandle {
(scroll_type: ScrollType): boolean;
}
interface ToggleHandleFocus {
(): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
max_position: number;
maxPosition: number;
min_position: number;
minPosition: number;
position: number;
position_set: boolean;
positionSet: boolean;
}
}
abstract class Paned extends Container implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Paned>;
// Properties
/**
* The largest possible value for the position property. This property is derived from the
* size and shrinkability of the widget's children.
*/
get max_position(): number;
/**
* The largest possible value for the position property. This property is derived from the
* size and shrinkability of the widget's children.
*/
get maxPosition(): number;
/**
* The smallest possible value for the position property. This property is derived from the
* size and shrinkability of the widget's children.
*/
get min_position(): number;
/**
* The smallest possible value for the position property. This property is derived from the
* size and shrinkability of the widget's children.
*/
get minPosition(): number;
get position(): number;
set position(val: number);
get position_set(): boolean;
set position_set(val: boolean);
get positionSet(): boolean;
set positionSet(val: boolean);
// Fields
container: Container;
child1: Widget;
child2: Widget;
handle: Gdk.Window;
xor_gc: Gdk.GC;
cursor_type: Gdk.CursorType;
// Constructors
constructor(properties?: Partial<Paned.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'accept-position', callback: (_source: this) => boolean): number;
connect_after(signal: 'accept-position', callback: (_source: this) => boolean): number;
emit(signal: 'accept-position'): void;
connect(signal: 'cancel-position', callback: (_source: this) => boolean): number;
connect_after(signal: 'cancel-position', callback: (_source: this) => boolean): number;
emit(signal: 'cancel-position'): void;
connect(signal: 'cycle-child-focus', callback: (_source: this, reversed: boolean) => boolean): number;
connect_after(signal: 'cycle-child-focus', callback: (_source: this, reversed: boolean) => boolean): number;
emit(signal: 'cycle-child-focus', reversed: boolean): void;
connect(signal: 'cycle-handle-focus', callback: (_source: this, reversed: boolean) => boolean): number;
connect_after(
signal: 'cycle-handle-focus',
callback: (_source: this, reversed: boolean) => boolean,
): number;
emit(signal: 'cycle-handle-focus', reversed: boolean): void;
connect(signal: 'move-handle', callback: (_source: this, scroll_type: ScrollType) => boolean): number;
connect_after(signal: 'move-handle', callback: (_source: this, scroll_type: ScrollType) => boolean): number;
emit(signal: 'move-handle', scroll_type: ScrollType): void;
connect(signal: 'toggle-handle-focus', callback: (_source: this) => boolean): number;
connect_after(signal: 'toggle-handle-focus', callback: (_source: this) => boolean): number;
emit(signal: 'toggle-handle-focus'): void;
// Virtual methods
vfunc_accept_position(): boolean;
vfunc_cancel_position(): boolean;
vfunc_cycle_child_focus(reverse: boolean): boolean;
vfunc_cycle_handle_focus(reverse: boolean): boolean;
vfunc_move_handle(scroll: ScrollType): boolean;
vfunc_toggle_handle_focus(): boolean;
// Methods
add1(child: Widget): void;
add2(child: Widget): void;
compute_position(allocation: number, child1_req: number, child2_req: number): void;
/**
* Obtains the first child of the paned widget.
* @returns first child, or %NULL if it is not set.
*/
get_child1(): Widget;
/**
* Obtains the second child of the paned widget.
* @returns second child, or %NULL if it is not set.
*/
get_child2(): Widget;
/**
* Returns the #GdkWindow of the handle. This function is
* useful when handling button or motion events because it
* enables the callback to distinguish between the window
* of the paned, a child and the handle.
* @returns the paned's handle window.
*/
get_handle_window(): Gdk.Window;
/**
* Obtains the position of the divider between the two panes.
* @returns position of the divider
*/
get_position(): number;
pack1(child: Widget, resize: boolean, shrink: boolean): void;
pack2(child: Widget, resize: boolean, shrink: boolean): void;
/**
* Sets the position of the divider between the two panes.
* @param position pixel position of divider, a negative value means that the position is unset.
*/
set_position(position: number): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Pixmap {
// Constructor properties interface
interface ConstructorProps
extends Misc.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
class Pixmap extends Misc implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Pixmap>;
// Fields
misc: Misc;
pixmap: Gdk.Pixmap;
pixmap_insensitive: Gdk.Pixmap;
build_insensitive: number;
// Constructors
constructor(properties?: Partial<Pixmap.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](pixmap: Gdk.Pixmap, mask?: Gdk.Bitmap | null): Pixmap;
// Methods
get(val: Gdk.Pixmap, mask: Gdk.Bitmap): void;
set(val: Gdk.Pixmap, mask: Gdk.Bitmap): void;
// Conflicted with GObject.Object.set
set(...args: never[]): any;
set_build_insensitive(build: 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;
/**
* 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 Plug {
// Signal callback interfaces
interface Embedded {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Window.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
embedded: boolean;
socket_window: Gdk.Window;
socketWindow: Gdk.Window;
}
}
/**
* Together with #GtkSocket, #GtkPlug provides the ability
* to embed widgets from one process into another process
* in a fashion that is transparent to the user. One
* process creates a #GtkSocket widget and passes the
* ID of that widget's window to the other process,
* which then creates a #GtkPlug with that window ID.
* Any widgets contained in the #GtkPlug then will appear
* inside the first application's window.
*
* <note>
* The #GtkPlug and #GtkSocket widgets are currently not available
* on all platforms supported by GTK+.
* </note>
*/
class Plug extends Window implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Plug>;
// Properties
/**
* %TRUE if the plug is embedded in a socket.
*/
get embedded(): boolean;
/**
* The window of the socket the plug is embedded in.
*/
get socket_window(): Gdk.Window;
/**
* The window of the socket the plug is embedded in.
*/
get socketWindow(): Gdk.Window;
// Fields
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
window: Window;
modality_window: Widget;
modality_group: WindowGroup;
same_app: number;
// Constructors
constructor(properties?: Partial<Plug.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](socket_id: Gdk.NativeWindow): Plug;
// Conflicted with Gtk.Window.new
static ['new'](...args: never[]): any;
static new_for_display(display: Gdk.Display, socket_id: Gdk.NativeWindow): Plug;
// 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: 'embedded', callback: (_source: this) => void): number;
connect_after(signal: 'embedded', callback: (_source: this) => void): number;
emit(signal: 'embedded'): void;
// Virtual methods
vfunc_embedded(): void;
// Methods
/**
* Finish the initialization of `plug` for a given #GtkSocket identified by
* `socket_id`. This function will generally only be used by classes deriving from #GtkPlug.
* @param socket_id the XID of the socket's window.
*/
construct(socket_id: Gdk.NativeWindow): void;
/**
* Finish the initialization of `plug` for a given #GtkSocket identified by
* `socket_id` which is currently displayed on `display`.
* This function will generally only be used by classes deriving from #GtkPlug.
* @param display the #GdkDisplay associated with @socket_id's #GtkSocket.
* @param socket_id the XID of the socket's window.
*/
construct_for_display(display: Gdk.Display, socket_id: Gdk.NativeWindow): void;
/**
* Determines whether the plug is embedded in a socket.
* @returns %TRUE if the plug is embedded in a socket
*/
get_embedded(): boolean;
/**
* Gets the window ID of a #GtkPlug widget, which can then
* be used to embed this window inside another window, for
* instance with gtk_socket_add_id().
* @returns the window ID for the plug
*/
get_id(): Gdk.NativeWindow;
/**
* Retrieves the socket the plug is embedded in.
* @returns the window of the socket, or %NULL
*/
get_socket_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;
}
namespace Preview {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
expand: boolean;
}
}
class Preview extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Preview>;
// Properties
get expand(): boolean;
set expand(val: boolean);
// Fields
widget: Widget;
buffer: number;
buffer_width: number;
buffer_height: number;
bpp: number;
rowstride: number;
dither: Gdk.RgbDither;
type: number;
// Constructors
constructor(properties?: Partial<Preview.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](type: PreviewType): Preview;
// Static methods
static reset(): void;
static set_color_cube(
nred_shades: number,
ngreen_shades: number,
nblue_shades: number,
ngray_shades: number,
): void;
static set_gamma(gamma_: number): void;
static set_install_cmap(install_cmap: number): void;
static set_reserved(nreserved: number): void;
static uninit(): void;
// Methods
draw_row(data: number, x: number, y: number, w: number): void;
put(
window: Gdk.Window,
gc: Gdk.GC,
srcx: number,
srcy: number,
destx: number,
desty: number,
width: number,
height: number,
): void;
set_dither(dither: Gdk.RgbDither | null): void;
set_expand(expand: boolean): void;
size(width: number, height: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace PrintContext {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class PrintContext extends GObject.Object {
static $gtype: GObject.GType<PrintContext>;
// Constructors
constructor(properties?: Partial<PrintContext.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Creates a new #PangoContext that can be used with the
* #GtkPrintContext.
* @returns a new Pango context for @context
*/
create_pango_context(): Pango.Context;
/**
* Creates a new #PangoLayout that is suitable for use
* with the #GtkPrintContext.
* @returns a new Pango layout for @context
*/
create_pango_layout(): Pango.Layout;
/**
* Obtains the cairo context that is associated with the
* #GtkPrintContext.
* @returns the cairo context of @context
*/
get_cairo_context(): cairo.Context;
/**
* Obtains the horizontal resolution of the #GtkPrintContext,
* in dots per inch.
* @returns the horizontal resolution of @context
*/
get_dpi_x(): number;
/**
* Obtains the vertical resolution of the #GtkPrintContext,
* in dots per inch.
* @returns the vertical resolution of @context
*/
get_dpi_y(): number;
/**
* Obtains the hardware printer margins of the #GtkPrintContext, in units.
* @returns %TRUE if the hard margins were retrieved
*/
get_hard_margins(): [boolean, number, number, number, number];
/**
* Obtains the height of the #GtkPrintContext, in pixels.
* @returns the height of @context
*/
get_height(): number;
/**
* Obtains the #GtkPageSetup that determines the page
* dimensions of the #GtkPrintContext.
* @returns the page setup of @context
*/
get_page_setup(): PageSetup;
/**
* Returns a #PangoFontMap that is suitable for use
* with the #GtkPrintContext.
* @returns the font map of @context
*/
get_pango_fontmap(): Pango.FontMap;
/**
* Obtains the width of the #GtkPrintContext, in pixels.
* @returns the width of @context
*/
get_width(): number;
/**
* Sets a new cairo context on a print context.
*
* This function is intended to be used when implementing
* an internal print preview, it is not needed for printing,
* since GTK+ itself creates a suitable cairo context in that
* case.
* @param cr the cairo context
* @param dpi_x the horizontal resolution to use with @cr
* @param dpi_y the vertical resolution to use with @cr
*/
set_cairo_context(cr: cairo.Context, dpi_x: number, dpi_y: number): void;
}
namespace PrintOperation {
// Signal callback interfaces
interface BeginPrint {
(context: PrintContext): void;
}
interface CreateCustomWidget {
(): GObject.Object;
}
interface CustomWidgetApply {
(widget: Widget): void;
}
interface Done {
(result: PrintOperationResult): void;
}
interface DrawPage {
(context: PrintContext, page_nr: number): void;
}
interface EndPrint {
(context: PrintContext): void;
}
interface Paginate {
(context: PrintContext): boolean;
}
interface Preview {
(preview: PrintOperationPreview, context: PrintContext, parent?: Window | null): boolean;
}
interface RequestPageSetup {
(context: PrintContext, page_nr: number, setup: PageSetup): void;
}
interface StatusChanged {
(): void;
}
interface UpdateCustomWidget {
(widget: Widget, setup: PageSetup, settings: PrintSettings): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PrintOperationPreview.ConstructorProps {
allow_async: boolean;
allowAsync: boolean;
current_page: number;
currentPage: number;
custom_tab_label: string;
customTabLabel: string;
default_page_setup: PageSetup;
defaultPageSetup: PageSetup;
embed_page_setup: boolean;
embedPageSetup: boolean;
export_filename: string;
exportFilename: string;
has_selection: boolean;
hasSelection: boolean;
job_name: string;
jobName: string;
n_pages: number;
nPages: number;
n_pages_to_print: number;
nPagesToPrint: number;
print_settings: PrintSettings;
printSettings: PrintSettings;
show_progress: boolean;
showProgress: boolean;
status: PrintStatus;
status_string: string;
statusString: string;
support_selection: boolean;
supportSelection: boolean;
track_print_status: boolean;
trackPrintStatus: boolean;
unit: Unit;
use_full_page: boolean;
useFullPage: boolean;
}
}
class PrintOperation extends GObject.Object implements PrintOperationPreview {
static $gtype: GObject.GType<PrintOperation>;
// Properties
/**
* Determines whether the print operation may run asynchronously or not.
*
* Some systems don't support asynchronous printing, but those that do
* will return %GTK_PRINT_OPERATION_RESULT_IN_PROGRESS as the status, and
* emit the #GtkPrintOperation::done signal when the operation is actually
* done.
*
* The Windows port does not support asynchronous operation at all (this
* is unlikely to change). On other platforms, all actions except for
* %GTK_PRINT_OPERATION_ACTION_EXPORT support asynchronous operation.
*/
get allow_async(): boolean;
set allow_async(val: boolean);
/**
* Determines whether the print operation may run asynchronously or not.
*
* Some systems don't support asynchronous printing, but those that do
* will return %GTK_PRINT_OPERATION_RESULT_IN_PROGRESS as the status, and
* emit the #GtkPrintOperation::done signal when the operation is actually
* done.
*
* The Windows port does not support asynchronous operation at all (this
* is unlikely to change). On other platforms, all actions except for
* %GTK_PRINT_OPERATION_ACTION_EXPORT support asynchronous operation.
*/
get allowAsync(): boolean;
set allowAsync(val: boolean);
/**
* The current page in the document.
*
* If this is set before gtk_print_operation_run(),
* the user will be able to select to print only the current page.
*
* Note that this only makes sense for pre-paginated documents.
*/
get current_page(): number;
set current_page(val: number);
/**
* The current page in the document.
*
* If this is set before gtk_print_operation_run(),
* the user will be able to select to print only the current page.
*
* Note that this only makes sense for pre-paginated documents.
*/
get currentPage(): number;
set currentPage(val: number);
/**
* Used as the label of the tab containing custom widgets.
* Note that this property may be ignored on some platforms.
*
* If this is %NULL, GTK+ uses a default label.
*/
get custom_tab_label(): string;
set custom_tab_label(val: string);
/**
* Used as the label of the tab containing custom widgets.
* Note that this property may be ignored on some platforms.
*
* If this is %NULL, GTK+ uses a default label.
*/
get customTabLabel(): string;
set customTabLabel(val: string);
/**
* The #GtkPageSetup used by default.
*
* This page setup will be used by gtk_print_operation_run(),
* but it can be overridden on a per-page basis by connecting
* to the #GtkPrintOperation::request-page-setup signal.
*/
get default_page_setup(): PageSetup;
set default_page_setup(val: PageSetup);
/**
* The #GtkPageSetup used by default.
*
* This page setup will be used by gtk_print_operation_run(),
* but it can be overridden on a per-page basis by connecting
* to the #GtkPrintOperation::request-page-setup signal.
*/
get defaultPageSetup(): PageSetup;
set defaultPageSetup(val: PageSetup);
/**
* If %TRUE, page size combo box and orientation combo box are embedded into page setup page.
*/
get embed_page_setup(): boolean;
set embed_page_setup(val: boolean);
/**
* If %TRUE, page size combo box and orientation combo box are embedded into page setup page.
*/
get embedPageSetup(): boolean;
set embedPageSetup(val: boolean);
/**
* The name of a file to generate instead of showing the print dialog.
* Currently, PDF is the only supported format.
*
* The intended use of this property is for implementing
* "Export to PDF" actions.
*
* "Print to PDF" support is independent of this and is done
* by letting the user pick the "Print to PDF" item from the
* list of printers in the print dialog.
*/
get export_filename(): string;
set export_filename(val: string);
/**
* The name of a file to generate instead of showing the print dialog.
* Currently, PDF is the only supported format.
*
* The intended use of this property is for implementing
* "Export to PDF" actions.
*
* "Print to PDF" support is independent of this and is done
* by letting the user pick the "Print to PDF" item from the
* list of printers in the print dialog.
*/
get exportFilename(): string;
set exportFilename(val: string);
/**
* Determines whether there is a selection in your application.
* This can allow your application to print the selection.
* This is typically used to make a "Selection" button sensitive.
*/
get has_selection(): boolean;
set has_selection(val: boolean);
/**
* Determines whether there is a selection in your application.
* This can allow your application to print the selection.
* This is typically used to make a "Selection" button sensitive.
*/
get hasSelection(): boolean;
set hasSelection(val: boolean);
/**
* A string used to identify the job (e.g. in monitoring
* applications like eggcups).
*
* If you don't set a job name, GTK+ picks a default one
* by numbering successive print jobs.
*/
get job_name(): string;
set job_name(val: string);
/**
* A string used to identify the job (e.g. in monitoring
* applications like eggcups).
*
* If you don't set a job name, GTK+ picks a default one
* by numbering successive print jobs.
*/
get jobName(): string;
set jobName(val: string);
/**
* The number of pages in the document.
*
* This <emphasis>must</emphasis> be set to a positive number
* before the rendering starts. It may be set in a
* #GtkPrintOperation::begin-print signal hander.
*
* Note that the page numbers passed to the
* #GtkPrintOperation::request-page-setup and
* #GtkPrintOperation::draw-page signals are 0-based, i.e. if
* the user chooses to print all pages, the last ::draw-page signal
* will be for page `n_pages` - 1.
*/
get n_pages(): number;
set n_pages(val: number);
/**
* The number of pages in the document.
*
* This <emphasis>must</emphasis> be set to a positive number
* before the rendering starts. It may be set in a
* #GtkPrintOperation::begin-print signal hander.
*
* Note that the page numbers passed to the
* #GtkPrintOperation::request-page-setup and
* #GtkPrintOperation::draw-page signals are 0-based, i.e. if
* the user chooses to print all pages, the last ::draw-page signal
* will be for page `n_pages` - 1.
*/
get nPages(): number;
set nPages(val: number);
/**
* The number of pages that will be printed.
*
* Note that this value is set during print preparation phase
* (%GTK_PRINT_STATUS_PREPARING), so this value should never be
* get before the data generation phase (%GTK_PRINT_STATUS_GENERATING_DATA).
* You can connect to the #GtkPrintOperation::status-changed signal
* and call gtk_print_operation_get_n_pages_to_print() when
* print status is %GTK_PRINT_STATUS_GENERATING_DATA.
* This is typically used to track the progress of print operation.
*/
get n_pages_to_print(): number;
/**
* The number of pages that will be printed.
*
* Note that this value is set during print preparation phase
* (%GTK_PRINT_STATUS_PREPARING), so this value should never be
* get before the data generation phase (%GTK_PRINT_STATUS_GENERATING_DATA).
* You can connect to the #GtkPrintOperation::status-changed signal
* and call gtk_print_operation_get_n_pages_to_print() when
* print status is %GTK_PRINT_STATUS_GENERATING_DATA.
* This is typically used to track the progress of print operation.
*/
get nPagesToPrint(): number;
/**
* The #GtkPrintSettings used for initializing the dialog.
*
* Setting this property is typically used to re-establish
* print settings from a previous print operation, see
* gtk_print_operation_run().
*/
get print_settings(): PrintSettings;
set print_settings(val: PrintSettings);
/**
* The #GtkPrintSettings used for initializing the dialog.
*
* Setting this property is typically used to re-establish
* print settings from a previous print operation, see
* gtk_print_operation_run().
*/
get printSettings(): PrintSettings;
set printSettings(val: PrintSettings);
/**
* Determines whether to show a progress dialog during the
* print operation.
*/
get show_progress(): boolean;
set show_progress(val: boolean);
/**
* Determines whether to show a progress dialog during the
* print operation.
*/
get showProgress(): boolean;
set showProgress(val: boolean);
/**
* The status of the print operation.
*/
get status(): PrintStatus;
/**
* A string representation of the status of the print operation.
* The string is translated and suitable for displaying the print
* status e.g. in a #GtkStatusbar.
*
* See the #GtkPrintOperation:status property for a status value that
* is suitable for programmatic use.
*/
get status_string(): string;
/**
* A string representation of the status of the print operation.
* The string is translated and suitable for displaying the print
* status e.g. in a #GtkStatusbar.
*
* See the #GtkPrintOperation:status property for a status value that
* is suitable for programmatic use.
*/
get statusString(): string;
/**
* If %TRUE, the print operation will support print of selection.
* This allows the print dialog to show a "Selection" button.
*/
get support_selection(): boolean;
set support_selection(val: boolean);
/**
* If %TRUE, the print operation will support print of selection.
* This allows the print dialog to show a "Selection" button.
*/
get supportSelection(): boolean;
set supportSelection(val: boolean);
/**
* If %TRUE, the print operation will try to continue report on
* the status of the print job in the printer queues and printer.
* This can allow your application to show things like "out of paper"
* issues, and when the print job actually reaches the printer.
* However, this is often implemented using polling, and should
* not be enabled unless needed.
*/
get track_print_status(): boolean;
set track_print_status(val: boolean);
/**
* If %TRUE, the print operation will try to continue report on
* the status of the print job in the printer queues and printer.
* This can allow your application to show things like "out of paper"
* issues, and when the print job actually reaches the printer.
* However, this is often implemented using polling, and should
* not be enabled unless needed.
*/
get trackPrintStatus(): boolean;
set trackPrintStatus(val: boolean);
/**
* The transformation for the cairo context obtained from
* #GtkPrintContext is set up in such a way that distances
* are measured in units of `unit`.
*/
get unit(): Unit;
set unit(val: Unit);
/**
* If %TRUE, the transformation for the cairo context obtained
* from #GtkPrintContext puts the origin at the top left corner
* of the page (which may not be the top left corner of the sheet,
* depending on page orientation and the number of pages per sheet).
* Otherwise, the origin is at the top left corner of the imageable
* area (i.e. inside the margins).
*/
get use_full_page(): boolean;
set use_full_page(val: boolean);
/**
* If %TRUE, the transformation for the cairo context obtained
* from #GtkPrintContext puts the origin at the top left corner
* of the page (which may not be the top left corner of the sheet,
* depending on page orientation and the number of pages per sheet).
* Otherwise, the origin is at the top left corner of the imageable
* area (i.e. inside the margins).
*/
get useFullPage(): boolean;
set useFullPage(val: boolean);
// Constructors
constructor(properties?: Partial<PrintOperation.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PrintOperation;
// 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-print', callback: (_source: this, context: PrintContext) => void): number;
connect_after(signal: 'begin-print', callback: (_source: this, context: PrintContext) => void): number;
emit(signal: 'begin-print', context: PrintContext): void;
connect(signal: 'create-custom-widget', callback: (_source: this) => GObject.Object): number;
connect_after(signal: 'create-custom-widget', callback: (_source: this) => GObject.Object): number;
emit(signal: 'create-custom-widget'): void;
connect(signal: 'custom-widget-apply', callback: (_source: this, widget: Widget) => void): number;
connect_after(signal: 'custom-widget-apply', callback: (_source: this, widget: Widget) => void): number;
emit(signal: 'custom-widget-apply', widget: Widget): void;
connect(signal: 'done', callback: (_source: this, result: PrintOperationResult) => void): number;
connect_after(signal: 'done', callback: (_source: this, result: PrintOperationResult) => void): number;
emit(signal: 'done', result: PrintOperationResult): void;
connect(
signal: 'draw-page',
callback: (_source: this, context: PrintContext, page_nr: number) => void,
): number;
connect_after(
signal: 'draw-page',
callback: (_source: this, context: PrintContext, page_nr: number) => void,
): number;
emit(signal: 'draw-page', context: PrintContext, page_nr: number): void;
connect(signal: 'end-print', callback: (_source: this, context: PrintContext) => void): number;
connect_after(signal: 'end-print', callback: (_source: this, context: PrintContext) => void): number;
emit(signal: 'end-print', context: PrintContext): void;
connect(signal: 'paginate', callback: (_source: this, context: PrintContext) => boolean): number;
connect_after(signal: 'paginate', callback: (_source: this, context: PrintContext) => boolean): number;
emit(signal: 'paginate', context: PrintContext): void;
connect(
signal: 'preview',
callback: (
_source: this,
preview: PrintOperationPreview,
context: PrintContext,
parent: Window | null,
) => boolean,
): number;
connect_after(
signal: 'preview',
callback: (
_source: this,
preview: PrintOperationPreview,
context: PrintContext,
parent: Window | null,
) => boolean,
): number;
emit(
signal: 'preview',
preview: PrintOperationPreview,
context: PrintContext,
parent?: Window | null,
): void;
connect(
signal: 'request-page-setup',
callback: (_source: this, context: PrintContext, page_nr: number, setup: PageSetup) => void,
): number;
connect_after(
signal: 'request-page-setup',
callback: (_source: this, context: PrintContext, page_nr: number, setup: PageSetup) => void,
): number;
emit(signal: 'request-page-setup', context: PrintContext, page_nr: number, setup: PageSetup): void;
connect(signal: 'status-changed', callback: (_source: this) => void): number;
connect_after(signal: 'status-changed', callback: (_source: this) => void): number;
emit(signal: 'status-changed'): void;
connect(
signal: 'update-custom-widget',
callback: (_source: this, widget: Widget, setup: PageSetup, settings: PrintSettings) => void,
): number;
connect_after(
signal: 'update-custom-widget',
callback: (_source: this, widget: Widget, setup: PageSetup, settings: PrintSettings) => void,
): number;
emit(signal: 'update-custom-widget', widget: Widget, setup: PageSetup, settings: PrintSettings): void;
// Virtual methods
vfunc_begin_print(context: PrintContext): void;
vfunc_custom_widget_apply(widget: Widget): void;
vfunc_done(result: PrintOperationResult): void;
vfunc_draw_page(context: PrintContext, page_nr: number): void;
vfunc_end_print(context: PrintContext): void;
vfunc_paginate(context: PrintContext): boolean;
vfunc_preview(preview: PrintOperationPreview, context: PrintContext, parent: Window): boolean;
vfunc_request_page_setup(context: PrintContext, page_nr: number, setup: PageSetup): void;
vfunc_status_changed(): void;
vfunc_update_custom_widget(widget: Widget, setup: PageSetup, settings: PrintSettings): void;
// Methods
/**
* Cancels a running print operation. This function may
* be called from a #GtkPrintOperation::begin-print,
* #GtkPrintOperation::paginate or #GtkPrintOperation::draw-page
* signal handler to stop the currently running print
* operation.
*/
cancel(): void;
/**
* Signalize that drawing of particular page is complete.
*
* It is called after completion of page drawing (e.g. drawing in another
* thread).
* If gtk_print_operation_set_defer_drawing() was called before, then this function
* has to be called by application. In another case it is called by the library
* itself.
*/
draw_page_finish(): void;
/**
* Returns the default page setup, see
* gtk_print_operation_set_default_page_setup().
* @returns the default page setup
*/
get_default_page_setup(): PageSetup;
/**
* Gets the value of #GtkPrintOperation::embed-page-setup property.
* @returns whether page setup selection combos are embedded
*/
get_embed_page_setup(): boolean;
/**
* Call this when the result of a print operation is
* %GTK_PRINT_OPERATION_RESULT_ERROR, either as returned by
* gtk_print_operation_run(), or in the #GtkPrintOperation::done signal
* handler. The returned #GError will contain more details on what went wrong.
*/
get_error(): void;
/**
* Gets the value of #GtkPrintOperation::has-selection property.
* @returns whether there is a selection
*/
get_has_selection(): boolean;
/**
* Returns the number of pages that will be printed.
*
* Note that this value is set during print preparation phase
* (%GTK_PRINT_STATUS_PREPARING), so this function should never be
* called before the data generation phase (%GTK_PRINT_STATUS_GENERATING_DATA).
* You can connect to the #GtkPrintOperation::status-changed signal
* and call gtk_print_operation_get_n_pages_to_print() when
* print status is %GTK_PRINT_STATUS_GENERATING_DATA.
* This is typically used to track the progress of print operation.
* @returns the number of pages that will be printed
*/
get_n_pages_to_print(): number;
/**
* Returns the current print settings.
*
* Note that the return value is %NULL until either
* gtk_print_operation_set_print_settings() or
* gtk_print_operation_run() have been called.
* @returns the current print settings of @op.
*/
get_print_settings(): PrintSettings;
/**
* Returns the status of the print operation.
* Also see gtk_print_operation_get_status_string().
* @returns the status of the print operation
*/
get_status(): PrintStatus;
/**
* Returns a string representation of the status of the
* print operation. The string is translated and suitable
* for displaying the print status e.g. in a #GtkStatusbar.
*
* Use gtk_print_operation_get_status() to obtain a status
* value that is suitable for programmatic use.
* @returns a string representation of the status of the print operation
*/
get_status_string(): string;
/**
* Gets the value of #GtkPrintOperation::support-selection property.
* @returns whether the application supports print of selection
*/
get_support_selection(): boolean;
/**
* A convenience function to find out if the print operation
* is finished, either successfully (%GTK_PRINT_STATUS_FINISHED)
* or unsuccessfully (%GTK_PRINT_STATUS_FINISHED_ABORTED).
*
* Note: when you enable print status tracking the print operation
* can be in a non-finished state even after done has been called, as
* the operation status then tracks the print job status on the printer.
* @returns %TRUE, if the print operation is finished.
*/
is_finished(): boolean;
/**
* Runs the print operation, by first letting the user modify
* print settings in the print dialog, and then print the document.
*
* Normally that this function does not return until the rendering of all
* pages is complete. You can connect to the
* #GtkPrintOperation::status-changed signal on `op` to obtain some
* information about the progress of the print operation.
* Furthermore, it may use a recursive mainloop to show the print dialog.
*
* If you call gtk_print_operation_set_allow_async() or set the
* #GtkPrintOperation:allow-async property the operation will run
* asynchronously if this is supported on the platform. The
* #GtkPrintOperation::done signal will be emitted with the result of the
* operation when the it is done (i.e. when the dialog is canceled, or when
* the print succeeds or fails).
*
* ```
* if (settings != NULL)
* gtk_print_operation_set_print_settings (print, settings);
*
* if (page_setup != NULL)
* gtk_print_operation_set_default_page_setup (print, page_setup);
*
* g_signal_connect (print, "begin-print",
* G_CALLBACK (begin_print), &data);
* g_signal_connect (print, "draw-page",
* G_CALLBACK (draw_page), &data);
*
* res = gtk_print_operation_run (print,
* GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
* parent,
* &error);
*
* if (res == GTK_PRINT_OPERATION_RESULT_ERROR)
* {
* error_dialog = gtk_message_dialog_new (GTK_WINDOW (parent),
* GTK_DIALOG_DESTROY_WITH_PARENT,
* GTK_MESSAGE_ERROR,
* GTK_BUTTONS_CLOSE,
* "Error printing file:\n%s",
* error->message);
* g_signal_connect (error_dialog, "response",
* G_CALLBACK (gtk_widget_destroy), NULL);
* gtk_widget_show (error_dialog);
* g_error_free (error);
* }
* else if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
* {
* if (settings != NULL)
* g_object_unref (settings);
* settings = g_object_ref (gtk_print_operation_get_print_settings (print));
* }
* ```
*
*
* Note that gtk_print_operation_run() can only be called once on a
* given #GtkPrintOperation.
* @param action the action to start
* @param parent Transient parent of the dialog
* @returns the result of the print operation. A return value of %GTK_PRINT_OPERATION_RESULT_APPLY indicates that the printing was completed successfully. In this case, it is a good idea to obtain the used print settings with gtk_print_operation_get_print_settings() and store them for reuse with the next print operation. A value of %GTK_PRINT_OPERATION_RESULT_IN_PROGRESS means the operation is running asynchronously, and will emit the #GtkPrintOperation::done signal when done.
*/
run(action: PrintOperationAction | null, parent?: Window | null): PrintOperationResult;
/**
* Sets whether the gtk_print_operation_run() may return
* before the print operation is completed. Note that
* some platforms may not allow asynchronous operation.
* @param allow_async %TRUE to allow asynchronous operation
*/
set_allow_async(allow_async: boolean): void;
/**
* Sets the current page.
*
* If this is called before gtk_print_operation_run(),
* the user will be able to select to print only the current page.
*
* Note that this only makes sense for pre-paginated documents.
* @param current_page the current page, 0-based
*/
set_current_page(current_page: number): void;
/**
* Sets the label for the tab holding custom widgets.
* @param label the label to use, or %NULL to use the default label
*/
set_custom_tab_label(label?: string | null): void;
/**
* Makes `default_page_setup` the default page setup for `op`.
*
* This page setup will be used by gtk_print_operation_run(),
* but it can be overridden on a per-page basis by connecting
* to the #GtkPrintOperation::request-page-setup signal.
* @param default_page_setup a #GtkPageSetup, or %NULL
*/
set_default_page_setup(default_page_setup?: PageSetup | null): void;
/**
* Sets up the #GtkPrintOperation to wait for calling of
* gtk_print_operation_draw_page_finish() from application. It can
* be used for drawing page in another thread.
*
* This function must be called in the callback of "draw-page" signal.
*/
set_defer_drawing(): void;
/**
* Embed page size combo box and orientation combo box into page setup page.
* Selected page setup is stored as default page setup in #GtkPrintOperation.
* @param embed %TRUE to embed page setup selection in the #GtkPrintDialog
*/
set_embed_page_setup(embed: boolean): void;
/**
* Sets up the #GtkPrintOperation to generate a file instead
* of showing the print dialog. The indended use of this function
* is for implementing "Export to PDF" actions. Currently, PDF
* is the only supported format.
*
* "Print to PDF" support is independent of this and is done
* by letting the user pick the "Print to PDF" item from the list
* of printers in the print dialog.
* @param filename the filename for the exported file
*/
set_export_filename(filename: string): void;
/**
* Sets whether there is a selection to print.
*
* Application has to set number of pages to which the selection
* will draw by gtk_print_operation_set_n_pages() in a callback of
* #GtkPrintOperation::begin-print.
* @param has_selection %TRUE indicates that a selection exists
*/
set_has_selection(has_selection: boolean): void;
/**
* Sets the name of the print job. The name is used to identify
* the job (e.g. in monitoring applications like eggcups).
*
* If you don't set a job name, GTK+ picks a default one by
* numbering successive print jobs.
* @param job_name a string that identifies the print job
*/
set_job_name(job_name: string): void;
/**
* Sets the number of pages in the document.
*
* This <emphasis>must</emphasis> be set to a positive number
* before the rendering starts. It may be set in a
* #GtkPrintOperation::begin-print signal hander.
*
* Note that the page numbers passed to the
* #GtkPrintOperation::request-page-setup
* and #GtkPrintOperation::draw-page signals are 0-based, i.e. if
* the user chooses to print all pages, the last ::draw-page signal
* will be for page `n_pages` - 1.
* @param n_pages the number of pages
*/
set_n_pages(n_pages: number): void;
/**
* Sets the print settings for `op`. This is typically used to
* re-establish print settings from a previous print operation,
* see gtk_print_operation_run().
* @param print_settings #GtkPrintSettings
*/
set_print_settings(print_settings?: PrintSettings | null): void;
/**
* If `show_progress` is %TRUE, the print operation will show a
* progress dialog during the print operation.
* @param show_progress %TRUE to show a progress dialog
*/
set_show_progress(show_progress: boolean): void;
/**
* Sets whether selection is supported by #GtkPrintOperation.
* @param support_selection %TRUE to support selection
*/
set_support_selection(support_selection: boolean): void;
/**
* If track_status is %TRUE, the print operation will try to continue report
* on the status of the print job in the printer queues and printer. This
* can allow your application to show things like "out of paper" issues,
* and when the print job actually reaches the printer.
*
* This function is often implemented using some form of polling, so it should
* not be enabled unless needed.
* @param track_status %TRUE to track status after printing
*/
set_track_print_status(track_status: boolean): void;
/**
* Sets up the transformation for the cairo context obtained from
* #GtkPrintContext in such a way that distances are measured in
* units of `unit`.
* @param unit the unit to use
*/
set_unit(unit: Unit | null): void;
/**
* If `full_page` is %TRUE, the transformation for the cairo context
* obtained from #GtkPrintContext puts the origin at the top left
* corner of the page (which may not be the top left corner of the
* sheet, depending on page orientation and the number of pages per
* sheet). Otherwise, the origin is at the top left corner of the
* imageable area (i.e. inside the margins).
* @param full_page %TRUE to set up the #GtkPrintContext for the full page
*/
set_use_full_page(full_page: boolean): void;
// Inherited methods
/**
* Ends a preview.
*
* This function must be called to finish a custom print preview.
*/
end_preview(): void;
/**
* Returns whether the given page is included in the set of pages that
* have been selected for printing.
* @param page_nr a page number
* @returns %TRUE if the page has been selected for printing
*/
is_selected(page_nr: number): boolean;
/**
* Renders a page to the preview, using the print context that
* was passed to the #GtkPrintOperation::preview handler together
* with `preview`.
*
* A custom iprint preview should use this function in its ::expose
* handler to render the currently selected page.
*
* Note that this function requires a suitable cairo context to
* be associated with the print context.
* @param page_nr the page to render
*/
render_page(page_nr: number): void;
/**
* Ends a preview.
*
* This function must be called to finish a custom print preview.
*/
vfunc_end_preview(): void;
vfunc_got_page_size(context: PrintContext, page_setup: PageSetup): void;
/**
* Returns whether the given page is included in the set of pages that
* have been selected for printing.
* @param page_nr a page number
*/
vfunc_is_selected(page_nr: number): boolean;
vfunc_ready(context: PrintContext): void;
/**
* Renders a page to the preview, using the print context that
* was passed to the #GtkPrintOperation::preview handler together
* with `preview`.
*
* A custom iprint preview should use this function in its ::expose
* handler to render the currently selected page.
*
* Note that this function requires a suitable cairo context to
* be associated with the print context.
* @param page_nr the page to render
*/
vfunc_render_page(page_nr: 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;
}
namespace PrintSettings {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class PrintSettings extends GObject.Object {
static $gtype: GObject.GType<PrintSettings>;
// Constructors
constructor(properties?: Partial<PrintSettings.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): PrintSettings;
static new_from_file(file_name: string): PrintSettings;
static new_from_key_file(key_file: GLib.KeyFile, group_name?: string | null): PrintSettings;
// Methods
/**
* Copies a #GtkPrintSettings object.
* @returns a newly allocated copy of @other
*/
copy(): PrintSettings;
/**
* Calls `func` for each key-value pair of `settings`.
* @param func the function to call
*/
foreach(func: PrintSettingsFunc): void;
/**
* Looks up the string value associated with `key`.
* @param key a key
* @returns the string value for @key
*/
get(key: string): string;
/**
* Returns the boolean represented by the value
* that is associated with `key`.
*
* The string "true" represents %TRUE, any other
* string %FALSE.
* @param key a key
* @returns %TRUE, if @key maps to a true value.
*/
get_bool(key: string): boolean;
/**
* Gets the value of %GTK_PRINT_SETTINGS_COLLATE.
* @returns whether to collate the printed pages
*/
get_collate(): boolean;
/**
* Gets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
* @returns the default source
*/
get_default_source(): string;
/**
* Gets the value of %GTK_PRINT_SETTINGS_DITHER.
* @returns the dithering that is used
*/
get_dither(): string;
/**
* Returns the double value associated with `key,` or 0.
* @param key a key
* @returns the double value of @key
*/
get_double(key: string): number;
/**
* Returns the floating point number represented by
* the value that is associated with `key,` or `default_val`
* if the value does not represent a floating point number.
*
* Floating point numbers are parsed with g_ascii_strtod().
* @param key a key
* @param def the default value
* @returns the floating point number associated with @key
*/
get_double_with_default(key: string, def: number): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_DUPLEX.
* @returns whether to print the output in duplex.
*/
get_duplex(): PrintDuplex;
/**
* Gets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
* @returns the finishings
*/
get_finishings(): string;
/**
* Returns the integer value of `key,` or 0.
* @param key a key
* @returns the integer value of @key
*/
get_int(key: string): number;
/**
* Returns the value of `key,` interpreted as
* an integer, or the default value.
* @param key a key
* @param def the default value
* @returns the integer value of @key
*/
get_int_with_default(key: string, def: number): number;
/**
* Returns the value associated with `key,` interpreted
* as a length. The returned value is converted to `units`.
* @param key a key
* @param unit the unit of the return value
* @returns the length value of @key, converted to @unit
*/
get_length(key: string, unit: Unit | null): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
*
* The set of media types is defined in PWG 5101.1-2002 PWG.
* <!-- FIXME link here -->
* @returns the media type
*/
get_media_type(): string;
/**
* Gets the value of %GTK_PRINT_SETTINGS_N_COPIES.
* @returns the number of copies to print
*/
get_n_copies(): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
* @returns the number of pages per sheet
*/
get_number_up(): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
* @returns layout of page in number-up mode
*/
get_number_up_layout(): NumberUpLayout;
/**
* Get the value of %GTK_PRINT_SETTINGS_ORIENTATION,
* converted to a #GtkPageOrientation.
* @returns the orientation
*/
get_orientation(): PageOrientation;
/**
* Gets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
* @returns the output bin
*/
get_output_bin(): string;
/**
* Gets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
* @returns an array of #GtkPageRange<!-- -->s. Use g_free() to free the array when it is no longer needed.
*/
get_page_ranges(): PageRange[];
/**
* Gets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
* @returns the set of pages to print
*/
get_page_set(): PageSet;
/**
* Gets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT,
* converted to `unit`.
* @param unit the unit for the return value
* @returns the paper height, in units of @unit
*/
get_paper_height(unit: Unit | null): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
* converted to a #GtkPaperSize.
* @returns the paper size
*/
get_paper_size(): PaperSize;
/**
* Gets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH,
* converted to `unit`.
* @param unit the unit for the return value
* @returns the paper width, in units of @unit
*/
get_paper_width(unit: Unit | null): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
* @returns which pages to print
*/
get_print_pages(): PrintPages;
/**
* Convenience function to obtain the value of
* %GTK_PRINT_SETTINGS_PRINTER.
* @returns the printer name
*/
get_printer(): string;
/**
* Gets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
* @returns the resolution in lpi (lines per inch)
*/
get_printer_lpi(): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_QUALITY.
* @returns the print quality
*/
get_quality(): PrintQuality;
/**
* Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION.
* @returns the resolution in dpi
*/
get_resolution(): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_X.
* @returns the horizontal resolution in dpi
*/
get_resolution_x(): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_RESOLUTION_Y.
* @returns the vertical resolution in dpi
*/
get_resolution_y(): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_REVERSE.
* @returns whether to reverse the order of the printed pages
*/
get_reverse(): boolean;
/**
* Gets the value of %GTK_PRINT_SETTINGS_SCALE.
* @returns the scale in percent
*/
get_scale(): number;
/**
* Gets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
* @returns whether to use color
*/
get_use_color(): boolean;
/**
* Returns %TRUE, if a value is associated with `key`.
* @param key a key
* @returns %TRUE, if @key has a value
*/
has_key(key: string): boolean;
/**
* Reads the print settings from `file_name`. If the file could not be loaded
* then error is set to either a #GFileError or #GKeyFileError.
* See gtk_print_settings_to_file().
* @param file_name the filename to read the settings from
* @returns %TRUE on success
*/
load_file(file_name: string): boolean;
/**
* Reads the print settings from the group `group_name` in `key_file`. If the
* file could not be loaded then error is set to either a #GFileError or
* #GKeyFileError.
* @param key_file the #GKeyFile to retrieve the settings from
* @param group_name the name of the group to use, or %NULL to use the default "Print Settings"
* @returns %TRUE on success
*/
load_key_file(key_file: GLib.KeyFile, group_name?: string | null): boolean;
/**
* Associates `value` with `key`.
* @param key a key
* @param value a string value, or %NULL
*/
set(key: string, value?: string | null): void;
// Conflicted with GObject.Object.set
set(...args: never[]): any;
/**
* Sets `key` to a boolean value.
* @param key a key
* @param value a boolean
*/
set_bool(key: string, value: boolean): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_COLLATE.
* @param collate whether to collate the output
*/
set_collate(collate: boolean): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_DEFAULT_SOURCE.
* @param default_source the default source
*/
set_default_source(default_source: string): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_DITHER.
* @param dither the dithering that is used
*/
set_dither(dither: string): void;
/**
* Sets `key` to a double value.
* @param key a key
* @param value a double value
*/
set_double(key: string, value: number): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_DUPLEX.
* @param duplex a #GtkPrintDuplex value
*/
set_duplex(duplex: PrintDuplex | null): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_FINISHINGS.
* @param finishings the finishings
*/
set_finishings(finishings: string): void;
/**
* Sets `key` to an integer value.
* @param key a key
* @param value an integer
*/
set_int(key: string, value: number): void;
/**
* Associates a length in units of `unit` with `key`.
* @param key a key
* @param value a length
* @param unit the unit of @length
*/
set_length(key: string, value: number, unit: Unit | null): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_MEDIA_TYPE.
*
* The set of media types is defined in PWG 5101.1-2002 PWG.
* <!-- FIXME link here -->
* @param media_type the media type
*/
set_media_type(media_type: string): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_N_COPIES.
* @param num_copies the number of copies
*/
set_n_copies(num_copies: number): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP.
* @param number_up the number of pages per sheet
*/
set_number_up(number_up: number): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT.
* @param number_up_layout a #GtkNumberUpLayout value
*/
set_number_up_layout(number_up_layout: NumberUpLayout | null): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_ORIENTATION.
* @param orientation a page orientation
*/
set_orientation(orientation: PageOrientation | null): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_OUTPUT_BIN.
* @param output_bin the output bin
*/
set_output_bin(output_bin: string): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_PAGE_RANGES.
* @param page_ranges an array of #GtkPageRange<!-- -->s
*/
set_page_ranges(page_ranges: PageRange[]): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_PAGE_SET.
* @param page_set a #GtkPageSet value
*/
set_page_set(page_set: PageSet | null): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
* @param height the paper height
* @param unit the units of @height
*/
set_paper_height(height: number, unit: Unit | null): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_PAPER_FORMAT,
* %GTK_PRINT_SETTINGS_PAPER_WIDTH and
* %GTK_PRINT_SETTINGS_PAPER_HEIGHT.
* @param paper_size a paper size
*/
set_paper_size(paper_size: PaperSize): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_PAPER_WIDTH.
* @param width the paper width
* @param unit the units of @width
*/
set_paper_width(width: number, unit: Unit | null): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_PRINT_PAGES.
* @param pages a #GtkPrintPages value
*/
set_print_pages(pages: PrintPages | null): void;
/**
* Convenience function to set %GTK_PRINT_SETTINGS_PRINTER
* to `printer`.
* @param printer the printer name
*/
set_printer(printer: string): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_PRINTER_LPI.
* @param lpi the resolution in lpi (lines per inch)
*/
set_printer_lpi(lpi: number): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_QUALITY.
* @param quality a #GtkPrintQuality value
*/
set_quality(quality: PrintQuality | null): void;
/**
* Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
* %GTK_PRINT_SETTINGS_RESOLUTION_X and
* %GTK_PRINT_SETTINGS_RESOLUTION_Y.
* @param resolution the resolution in dpi
*/
set_resolution(resolution: number): void;
/**
* Sets the values of %GTK_PRINT_SETTINGS_RESOLUTION,
* %GTK_PRINT_SETTINGS_RESOLUTION_X and
* %GTK_PRINT_SETTINGS_RESOLUTION_Y.
* @param resolution_x the horizontal resolution in dpi
* @param resolution_y the vertical resolution in dpi
*/
set_resolution_xy(resolution_x: number, resolution_y: number): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_REVERSE.
* @param reverse whether to reverse the output
*/
set_reverse(reverse: boolean): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_SCALE.
* @param scale the scale in percent
*/
set_scale(scale: number): void;
/**
* Sets the value of %GTK_PRINT_SETTINGS_USE_COLOR.
* @param use_color whether to use color
*/
set_use_color(use_color: boolean): void;
/**
* This function saves the print settings from `settings` to `file_name`. If the
* file could not be loaded then error is set to either a #GFileError or
* #GKeyFileError.
* @param file_name the file to save to
* @returns %TRUE on success
*/
to_file(file_name: string): boolean;
/**
* This function adds the print settings from `settings` to `key_file`.
* @param key_file the #GKeyFile to save the print settings to
* @param group_name the group to add the settings to in @key_file, or %NULL to use the default "Print Settings"
*/
to_key_file(key_file: GLib.KeyFile, group_name: string): void;
/**
* Removes any value associated with `key`.
* This has the same effect as setting the value to %NULL.
* @param key a key
*/
unset(key: string): void;
}
namespace Progress {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
activity_mode: boolean;
activityMode: boolean;
show_text: boolean;
showText: boolean;
text_xalign: number;
textXalign: number;
text_yalign: number;
textYalign: number;
}
}
abstract class Progress extends Widget implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Progress>;
// Properties
get activity_mode(): boolean;
set activity_mode(val: boolean);
get activityMode(): boolean;
set activityMode(val: boolean);
get show_text(): boolean;
set show_text(val: boolean);
get showText(): boolean;
set showText(val: boolean);
get text_xalign(): number;
set text_xalign(val: number);
get textXalign(): number;
set textXalign(val: number);
get text_yalign(): number;
set text_yalign(val: number);
get textYalign(): number;
set textYalign(val: number);
// Fields
widget: Widget;
adjustment: Adjustment;
offscreen_pixmap: Gdk.Pixmap;
format: string;
x_align: number;
y_align: number;
use_text_format: number;
// Constructors
constructor(properties?: Partial<Progress.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Virtual methods
vfunc_act_mode_enter(): void;
vfunc_paint(): void;
vfunc_update(): void;
// Methods
configure(value: number, min: number, max: number): void;
get_current_percentage(): number;
get_current_text(): string;
get_percentage_from_value(value: number): number;
get_text_from_value(value: number): string;
get_value(): number;
set_activity_mode(activity_mode: boolean): void;
set_adjustment(adjustment: Adjustment): void;
set_format_string(format: string): void;
set_percentage(percentage: number): void;
set_show_text(show_text: boolean): void;
set_text_alignment(x_align: number, y_align: number): void;
set_value(value: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ProgressBar {
// Constructor properties interface
interface ConstructorProps
extends Progress.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
activity_blocks: number;
activityBlocks: number;
activity_step: number;
activityStep: number;
adjustment: Adjustment | any;
bar_style: ProgressBarStyle;
barStyle: ProgressBarStyle;
discrete_blocks: number;
discreteBlocks: number;
ellipsize: Pango.EllipsizeMode;
fraction: number;
orientation: ProgressBarOrientation;
pulse_step: number;
pulseStep: number;
text: string;
}
}
class ProgressBar extends Progress implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<ProgressBar>;
// Properties
get activity_blocks(): number;
set activity_blocks(val: number);
get activityBlocks(): number;
set activityBlocks(val: number);
get activity_step(): number;
set activity_step(val: number);
get activityStep(): number;
set activityStep(val: number);
// This accessor conflicts with a property or field in a parent class or interface.
adjustment: Adjustment | any;
get bar_style(): ProgressBarStyle;
set bar_style(val: ProgressBarStyle);
get barStyle(): ProgressBarStyle;
set barStyle(val: ProgressBarStyle);
get discrete_blocks(): number;
set discrete_blocks(val: number);
get discreteBlocks(): number;
set discreteBlocks(val: number);
/**
* The preferred place to ellipsize the string, if the progressbar does
* not have enough room to display the entire string, specified as a
* #PangoEllisizeMode.
*
* Note that setting this property to a value other than
* %PANGO_ELLIPSIZE_NONE has the side-effect that the progressbar requests
* only enough space to display the ellipsis "...". Another means to set a
* progressbar's width is gtk_widget_set_size_request().
*/
get ellipsize(): Pango.EllipsizeMode;
set ellipsize(val: Pango.EllipsizeMode);
get fraction(): number;
set fraction(val: number);
get orientation(): ProgressBarOrientation;
set orientation(val: ProgressBarOrientation);
get pulse_step(): number;
set pulse_step(val: number);
get pulseStep(): number;
set pulseStep(val: number);
get text(): string;
set text(val: string);
// Fields
progress: Progress;
blocks: number;
in_block: number;
activity_pos: number;
pulse_fraction: number;
activity_dir: number;
dirty: number;
// Constructors
constructor(properties?: Partial<ProgressBar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ProgressBar;
static new_with_adjustment(adjustment?: Adjustment | null): ProgressBar;
// Methods
/**
* Returns the ellipsizing position of the progressbar.
* See gtk_progress_bar_set_ellipsize().
* @returns #PangoEllipsizeMode
*/
get_ellipsize(): Pango.EllipsizeMode;
/**
* Returns the current fraction of the task that's been completed.
* @returns a fraction from 0.0 to 1.0
*/
get_fraction(): number;
/**
* Retrieves the current progress bar orientation.
* @returns orientation of the progress bar
*/
get_orientation(): ProgressBarOrientation;
/**
* Retrieves the pulse step set with gtk_progress_bar_set_pulse_step()
* @returns a fraction from 0.0 to 1.0
*/
get_pulse_step(): number;
/**
* Retrieves the text displayed superimposed on the progress bar,
* if any, otherwise %NULL. The return value is a reference
* to the text, not a copy of it, so will become invalid
* if you change the text in the progress bar.
* @returns text, or %NULL; this string is owned by the widget and should not be modified or freed.
*/
get_text(): string;
/**
* Indicates that some progress is made, but you don't know how much.
* Causes the progress bar to enter "activity mode," where a block
* bounces back and forth. Each call to gtk_progress_bar_pulse()
* causes the block to move by a little bit (the amount of movement
* per pulse is determined by gtk_progress_bar_set_pulse_step()).
*/
pulse(): void;
set_activity_blocks(blocks: number): void;
set_activity_step(step: number): void;
set_bar_style(style: ProgressBarStyle | null): void;
set_discrete_blocks(blocks: number): void;
/**
* Sets the mode used to ellipsize (add an ellipsis: "...") the text
* if there is not enough space to render the entire string.
* @param mode a #PangoEllipsizeMode
*/
set_ellipsize(mode: Pango.EllipsizeMode | null): void;
/**
* Causes the progress bar to "fill in" the given fraction
* of the bar. The fraction should be between 0.0 and 1.0,
* inclusive.
* @param fraction fraction of the task that's been completed
*/
set_fraction(fraction: number): void;
/**
* Causes the progress bar to switch to a different orientation
* (left-to-right, right-to-left, top-to-bottom, or bottom-to-top).
* @param orientation orientation of the progress bar
*/
set_orientation(orientation: ProgressBarOrientation | null): void;
/**
* Sets the fraction of total progress bar length to move the
* bouncing block for each call to gtk_progress_bar_pulse().
* @param fraction fraction between 0.0 and 1.0
*/
set_pulse_step(fraction: number): void;
/**
* Causes the given `text` to appear superimposed on the progress bar.
* @param text a UTF-8 string, or %NULL
*/
set_text(text?: string | null): void;
update(percentage: 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 RadioAction {
// Signal callback interfaces
interface Changed {
(current: RadioAction): void;
}
// Constructor properties interface
interface ConstructorProps extends ToggleAction.ConstructorProps, Buildable.ConstructorProps {
current_value: number;
currentValue: number;
group: RadioAction;
value: number;
}
}
class RadioAction extends ToggleAction implements Buildable {
static $gtype: GObject.GType<RadioAction>;
// Properties
/**
* The value property of the currently active member of the group to which
* this action belongs.
*/
get current_value(): number;
set current_value(val: number);
/**
* The value property of the currently active member of the group to which
* this action belongs.
*/
get currentValue(): number;
set currentValue(val: number);
/**
* Sets a new group for a radio action.
*/
set group(val: RadioAction);
/**
* The value is an arbitrary integer which can be used as a
* convenient way to determine which action in the group is
* currently active in an ::activate or ::changed signal handler.
* See gtk_radio_action_get_current_value() and #GtkRadioActionEntry
* for convenient ways to get and set this property.
*/
get value(): number;
set value(val: number);
// Constructors
constructor(properties?: Partial<RadioAction.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
name: string,
label: string | null,
tooltip: string | null,
stock_id: string,
value: number,
): RadioAction;
// Conflicted with Gtk.ToggleAction.new
static ['new'](...args: never[]): any;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this, current: RadioAction) => void): number;
connect_after(signal: 'changed', callback: (_source: this, current: RadioAction) => void): number;
emit(signal: 'changed', current: RadioAction): void;
// Virtual methods
vfunc_changed(current: RadioAction): void;
// Methods
/**
* Obtains the value property of the currently active member of
* the group to which `action` belongs.
* @returns The value of the currently active group member
*/
get_current_value(): number;
/**
* Returns the list representing the radio group for this object.
* Note that the returned list is only valid until the next change
* to the group.
*
* A common way to set up a group of radio group is the following:
*
* ```
* GSList *group = NULL;
* GtkRadioAction *action;
*
* while (/&ast; more actions to add &ast;/)
* {
* action = gtk_radio_action_new (...);
*
* gtk_radio_action_set_group (action, group);
* group = gtk_radio_action_get_group (action);
* }
* ```
*
* @returns the list representing the radio group for this object
*/
get_group(): Action[];
/**
* Sets the currently active group member to the member with value
* property `current_value`.
* @param current_value the new value
*/
set_current_value(current_value: number): void;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace RadioButton {
// Signal callback interfaces
interface GroupChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends CheckButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
group: RadioButton;
}
}
class RadioButton extends CheckButton implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<RadioButton>;
// Properties
set group(val: RadioButton);
// Fields
check_button: CheckButton;
// Constructors
constructor(properties?: Partial<RadioButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static new_with_label_from_widget(radio_group_member: RadioButton | null, label: string): RadioButton;
static new_with_mnemonic_from_widget(radio_group_member: RadioButton | null, label: string): RadioButton;
// 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: 'group-changed', callback: (_source: this) => void): number;
connect_after(signal: 'group-changed', callback: (_source: this) => void): number;
emit(signal: 'group-changed'): void;
// Virtual methods
vfunc_group_changed(): void;
// Methods
/**
* Retrieves the group assigned to a radio button.
* @returns a linked list containing all the radio buttons in the same group as @radio_button. The returned list is owned by the radio button and must not be modified or freed.
*/
get_group(): RadioButton[];
/**
* Creates a new #GtkRadioButton, adding it to the same group as
* `radio_group_member`. As with gtk_radio_button_new(), a widget
* should be packed into the radio button.
* @returns a new radio button.
*/
new_from_widget(): Widget;
/**
* Sets a #GtkRadioButton's group. It should be noted that this does not change
* the layout of your interface in any way, so if you are changing the group,
* it is likely you will need to re-arrange the user interface to reflect these
* changes.
* @param group an existing radio button group, such as one returned from gtk_radio_button_get_group().
*/
set_group(group: RadioButton[]): 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 RadioMenuItem {
// Signal callback interfaces
interface GroupChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends CheckMenuItem.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
group: RadioMenuItem;
}
}
class RadioMenuItem extends CheckMenuItem implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<RadioMenuItem>;
// Properties
/**
* The radio menu item whose group this widget belongs to.
*/
set group(val: RadioMenuItem);
// Fields
check_menu_item: CheckMenuItem;
// Constructors
constructor(properties?: Partial<RadioMenuItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static new_with_label(group: RadioMenuItem[], label: string): RadioMenuItem;
// Conflicted with Gtk.CheckMenuItem.new_with_label
static new_with_label(...args: never[]): any;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'group-changed', callback: (_source: this) => void): number;
connect_after(signal: 'group-changed', callback: (_source: this) => void): number;
emit(signal: 'group-changed'): void;
// Virtual methods
vfunc_group_changed(): void;
// Methods
/**
* Creates a new #GtkRadioMenuItem adding it to the same group as `group`.
* @returns The new #GtkRadioMenuItem
*/
new_from_widget(): Widget;
/**
* Creates a new GtkRadioMenuItem whose child is a simple GtkLabel.
* The new #GtkRadioMenuItem is added to the same group as `group`.
* @param label the text for the label
* @returns The new #GtkRadioMenuItem
*/
new_with_label_from_widget(label: string): Widget;
/**
* Creates a new GtkRadioMenuItem containing a label. The label will be
* created using gtk_label_new_with_mnemonic(), so underscores in label
* indicate the mnemonic for the menu item.
*
* The new #GtkRadioMenuItem is added to the same group as `group`.
* @param label the text of the button, with an underscore in front of the mnemonic character
* @returns The new #GtkRadioMenuItem
*/
new_with_mnemonic_from_widget(label: string): Widget;
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace RadioToolButton {
// Constructor properties interface
interface ConstructorProps
extends ToggleToolButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
group: RadioToolButton;
}
}
class RadioToolButton extends ToggleToolButton implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<RadioToolButton>;
// Properties
/**
* Sets a new group for a radio tool button.
*/
set group(val: RadioToolButton);
// Constructors
constructor(properties?: Partial<RadioToolButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Creates a new #GtkRadioToolButton adding it to the same group as `gruup`
* @returns The new #GtkRadioToolButton
*/
new_from_widget(): ToolItem;
/**
* Creates a new #GtkRadioToolButton adding it to the same group as `group`.
* The new #GtkRadioToolButton will contain an icon and label from the
* stock item indicated by `stock_id`.
* @param stock_id the name of a stock item
* @returns A new #GtkRadioToolButton
*/
new_with_stock_from_widget(stock_id: string): ToolItem;
// 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 Range {
// Signal callback interfaces
interface AdjustBounds {
(object: number): void;
}
interface ChangeValue {
(scroll: ScrollType, value: number): boolean;
}
interface MoveSlider {
(step: ScrollType): void;
}
interface ValueChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
adjustment: Adjustment;
fill_level: number;
fillLevel: number;
inverted: boolean;
lower_stepper_sensitivity: SensitivityType;
lowerStepperSensitivity: SensitivityType;
restrict_to_fill_level: boolean;
restrictToFillLevel: boolean;
round_digits: number;
roundDigits: number;
show_fill_level: boolean;
showFillLevel: boolean;
update_policy: UpdateType;
updatePolicy: UpdateType;
upper_stepper_sensitivity: SensitivityType;
upperStepperSensitivity: SensitivityType;
}
}
abstract class Range extends Widget implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Range>;
// Properties
get adjustment(): Adjustment;
set adjustment(val: Adjustment);
/**
* The fill level (e.g. prebuffering of a network stream).
* See gtk_range_set_fill_level().
*/
get fill_level(): number;
set fill_level(val: number);
/**
* The fill level (e.g. prebuffering of a network stream).
* See gtk_range_set_fill_level().
*/
get fillLevel(): number;
set fillLevel(val: number);
get inverted(): boolean;
set inverted(val: boolean);
get lower_stepper_sensitivity(): SensitivityType;
set lower_stepper_sensitivity(val: SensitivityType);
get lowerStepperSensitivity(): SensitivityType;
set lowerStepperSensitivity(val: SensitivityType);
/**
* The restrict-to-fill-level property controls whether slider
* movement is restricted to an upper boundary set by the
* fill level. See gtk_range_set_restrict_to_fill_level().
*/
get restrict_to_fill_level(): boolean;
set restrict_to_fill_level(val: boolean);
/**
* The restrict-to-fill-level property controls whether slider
* movement is restricted to an upper boundary set by the
* fill level. See gtk_range_set_restrict_to_fill_level().
*/
get restrictToFillLevel(): boolean;
set restrictToFillLevel(val: boolean);
/**
* The number of digits to round the value to when
* it changes, or -1. See #GtkRange::change-value.
*/
get round_digits(): number;
set round_digits(val: number);
/**
* The number of digits to round the value to when
* it changes, or -1. See #GtkRange::change-value.
*/
get roundDigits(): number;
set roundDigits(val: number);
/**
* The show-fill-level property controls whether fill level indicator
* graphics are displayed on the trough. See
* gtk_range_set_show_fill_level().
*/
get show_fill_level(): boolean;
set show_fill_level(val: boolean);
/**
* The show-fill-level property controls whether fill level indicator
* graphics are displayed on the trough. See
* gtk_range_set_show_fill_level().
*/
get showFillLevel(): boolean;
set showFillLevel(val: boolean);
get update_policy(): UpdateType;
set update_policy(val: UpdateType);
get updatePolicy(): UpdateType;
set updatePolicy(val: UpdateType);
get upper_stepper_sensitivity(): SensitivityType;
set upper_stepper_sensitivity(val: SensitivityType);
get upperStepperSensitivity(): SensitivityType;
set upperStepperSensitivity(val: SensitivityType);
// Fields
widget: Widget;
flippable: number;
has_stepper_a: number;
has_stepper_b: number;
has_stepper_c: number;
has_stepper_d: number;
need_recalc: number;
slider_size_fixed: number;
min_slider_size: number;
orientation: Orientation;
range_rect: Gdk.Rectangle;
slider_start: number;
slider_end: number;
// Constructors
constructor(properties?: Partial<Range.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'adjust-bounds', callback: (_source: this, object: number) => void): number;
connect_after(signal: 'adjust-bounds', callback: (_source: this, object: number) => void): number;
emit(signal: 'adjust-bounds', object: number): void;
connect(
signal: 'change-value',
callback: (_source: this, scroll: ScrollType, value: number) => boolean,
): number;
connect_after(
signal: 'change-value',
callback: (_source: this, scroll: ScrollType, value: number) => boolean,
): number;
emit(signal: 'change-value', scroll: ScrollType, value: number): void;
connect(signal: 'move-slider', callback: (_source: this, step: ScrollType) => void): number;
connect_after(signal: 'move-slider', callback: (_source: this, step: ScrollType) => void): number;
emit(signal: 'move-slider', step: ScrollType): void;
connect(signal: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
// Virtual methods
vfunc_adjust_bounds(new_value: number): void;
vfunc_change_value(scroll: ScrollType, new_value: number): boolean;
vfunc_get_range_border(border_: Border): void;
vfunc_move_slider(scroll: ScrollType): void;
vfunc_value_changed(): void;
// Methods
/**
* Get the #GtkAdjustment which is the "model" object for #GtkRange.
* See gtk_range_set_adjustment() for details.
* The return value does not have a reference added, so should not
* be unreferenced.
* @returns a #GtkAdjustment
*/
get_adjustment(): Adjustment;
/**
* Gets the current position of the fill level indicator.
* @returns The current fill level
*/
get_fill_level(): number;
/**
* Gets the value set by gtk_range_set_flippable().
* @returns %TRUE if the range is flippable
*/
get_flippable(): boolean;
/**
* Gets the value set by gtk_range_set_inverted().
* @returns %TRUE if the range is inverted
*/
get_inverted(): boolean;
/**
* Gets the sensitivity policy for the stepper that points to the
* 'lower' end of the GtkRange's adjustment.
* @returns The lower stepper's sensitivity policy.
*/
get_lower_stepper_sensitivity(): SensitivityType;
/**
* This function is useful mainly for #GtkRange subclasses.
*
* See gtk_range_set_min_slider_size().
* @returns The minimum size of the range's slider.
*/
get_min_slider_size(): number;
/**
* This function returns the area that contains the range's trough
* and its steppers, in widget->window coordinates.
*
* This function is useful mainly for #GtkRange subclasses.
*/
get_range_rect(): Gdk.Rectangle;
/**
* Gets whether the range is restricted to the fill level.
* @returns %TRUE if @range is restricted to the fill level.
*/
get_restrict_to_fill_level(): boolean;
/**
* Gets the number of digits to round the value to when
* it changes. See #GtkRange::change-value.
* @returns the number of digits to round to
*/
get_round_digits(): number;
/**
* Gets whether the range displays the fill level graphically.
* @returns %TRUE if @range shows the fill level.
*/
get_show_fill_level(): boolean;
/**
* This function returns sliders range along the long dimension,
* in widget->window coordinates.
*
* This function is useful mainly for #GtkRange subclasses.
*/
get_slider_range(): [number, number];
/**
* This function is useful mainly for #GtkRange subclasses.
*
* See gtk_range_set_slider_size_fixed().
* @returns whether the range's slider has a fixed size.
*/
get_slider_size_fixed(): boolean;
/**
* Gets the update policy of `range`. See gtk_range_set_update_policy().
* @returns the current update policy
*/
get_update_policy(): UpdateType;
/**
* Gets the sensitivity policy for the stepper that points to the
* 'upper' end of the GtkRange's adjustment.
* @returns The upper stepper's sensitivity policy.
*/
get_upper_stepper_sensitivity(): SensitivityType;
/**
* Gets the current value of the range.
* @returns current value of the range.
*/
get_value(): number;
/**
* Sets the adjustment to be used as the "model" object for this range
* widget. The adjustment indicates the current range value, the
* minimum and maximum range values, the step/page increments used
* for keybindings and scrolling, and the page size. The page size
* is normally 0 for #GtkScale and nonzero for #GtkScrollbar, and
* indicates the size of the visible area of the widget being scrolled.
* The page size affects the size of the scrollbar slider.
* @param adjustment a #GtkAdjustment
*/
set_adjustment(adjustment: Adjustment): void;
/**
* Set the new position of the fill level indicator.
*
* The "fill level" is probably best described by its most prominent
* use case, which is an indicator for the amount of pre-buffering in
* a streaming media player. In that use case, the value of the range
* would indicate the current play position, and the fill level would
* be the position up to which the file/stream has been downloaded.
*
* This amount of prebuffering can be displayed on the range's trough
* and is themeable separately from the trough. To enable fill level
* display, use gtk_range_set_show_fill_level(). The range defaults
* to not showing the fill level.
*
* Additionally, it's possible to restrict the range's slider position
* to values which are smaller than the fill level. This is controller
* by gtk_range_set_restrict_to_fill_level() and is by default
* enabled.
* @param fill_level the new position of the fill level indicator
*/
set_fill_level(fill_level: number): void;
/**
* If a range is flippable, it will switch its direction if it is
* horizontal and its direction is %GTK_TEXT_DIR_RTL.
*
* See gtk_widget_get_direction().
* @param flippable %TRUE to make the range flippable
*/
set_flippable(flippable: boolean): void;
/**
* Sets the step and page sizes for the range.
* The step size is used when the user clicks the #GtkScrollbar
* arrows or moves #GtkScale via arrow keys. The page size
* is used for example when moving via Page Up or Page Down keys.
* @param step step size
* @param page page size
*/
set_increments(step: number, page: number): void;
/**
* Ranges normally move from lower to higher values as the
* slider moves from top to bottom or left to right. Inverted
* ranges have higher values at the top or on the right rather than
* on the bottom or left.
* @param setting %TRUE to invert the range
*/
set_inverted(setting: boolean): void;
/**
* Sets the sensitivity policy for the stepper that points to the
* 'lower' end of the GtkRange's adjustment.
* @param sensitivity the lower stepper's sensitivity policy.
*/
set_lower_stepper_sensitivity(sensitivity: SensitivityType | null): void;
/**
* Sets the minimum size of the range's slider.
*
* This function is useful mainly for #GtkRange subclasses.
* @param min_size The slider's minimum size
*/
set_min_slider_size(min_size: boolean): void;
/**
* Sets the allowable values in the #GtkRange, and clamps the range
* value to be between `min` and `max`. (If the range has a non-zero
* page size, it is clamped between `min` and `max` - page-size.)
* @param min minimum range value
* @param max maximum range value
*/
set_range(min: number, max: number): void;
/**
* Sets whether the slider is restricted to the fill level. See
* gtk_range_set_fill_level() for a general description of the fill
* level concept.
* @param restrict_to_fill_level Whether the fill level restricts slider movement.
*/
set_restrict_to_fill_level(restrict_to_fill_level: boolean): void;
/**
* Sets the number of digits to round the value to when
* it changes. See #GtkRange::change-value.
* @param round_digits the precision in digits, or -1
*/
set_round_digits(round_digits: number): void;
/**
* Sets whether a graphical fill level is show on the trough. See
* gtk_range_set_fill_level() for a general description of the fill
* level concept.
* @param show_fill_level Whether a fill level indicator graphics is shown.
*/
set_show_fill_level(show_fill_level: boolean): void;
/**
* Sets whether the range's slider has a fixed size, or a size that
* depends on it's adjustment's page size.
*
* This function is useful mainly for #GtkRange subclasses.
* @param size_fixed %TRUE to make the slider size constant
*/
set_slider_size_fixed(size_fixed: boolean): void;
/**
* Sets the update policy for the range. #GTK_UPDATE_CONTINUOUS means that
* anytime the range slider is moved, the range value will change and the
* value_changed signal will be emitted. #GTK_UPDATE_DELAYED means that
* the value will be updated after a brief timeout where no slider motion
* occurs, so updates are spaced by a short time rather than
* continuous. #GTK_UPDATE_DISCONTINUOUS means that the value will only
* be updated when the user releases the button and ends the slider
* drag operation.
* @param policy update policy
*/
set_update_policy(policy: UpdateType | null): void;
/**
* Sets the sensitivity policy for the stepper that points to the
* 'upper' end of the GtkRange's adjustment.
* @param sensitivity the upper stepper's sensitivity policy.
*/
set_upper_stepper_sensitivity(sensitivity: SensitivityType | null): void;
/**
* Sets the current value of the range; if the value is outside the
* minimum or maximum range values, it will be clamped to fit inside
* them. The range emits the #GtkRange::value-changed signal if the
* value changes.
* @param value new value of the range
*/
set_value(value: number): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace RcStyle {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class RcStyle extends GObject.Object {
static $gtype: GObject.GType<RcStyle>;
// Fields
name: string;
bg_pixmap_name: string[];
color_flags: RcFlags[];
fg: Gdk.Color[];
bg: Gdk.Color[];
text: Gdk.Color[];
base: Gdk.Color[];
xthickness: number;
ythickness: number;
// Constructors
constructor(properties?: Partial<RcStyle.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): RcStyle;
// Virtual methods
vfunc_merge(src: RcStyle): void;
vfunc_parse(settings: Settings, scanner: GLib.Scanner): number;
// Methods
/**
* Makes a copy of the specified #GtkRcStyle. This function
* will correctly copy an RC style that is a member of a class
* derived from #GtkRcStyle.
* @returns the resulting #GtkRcStyle
*/
copy(): RcStyle;
ref(): void;
// Conflicted with GObject.Object.ref
ref(...args: never[]): any;
unref(): void;
}
namespace RecentAction {
// Constructor properties interface
interface ConstructorProps
extends Action.ConstructorProps,
Buildable.ConstructorProps,
RecentChooser.ConstructorProps {
show_numbers: boolean;
showNumbers: boolean;
}
}
class RecentAction extends Action implements Buildable, RecentChooser {
static $gtype: GObject.GType<RecentAction>;
// Properties
get show_numbers(): boolean;
set show_numbers(val: boolean);
get showNumbers(): boolean;
set showNumbers(val: boolean);
// Constructors
constructor(properties?: Partial<RecentAction.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string, label: string | null, tooltip: string | null, stock_id: string): RecentAction;
static new_for_manager(
name: string,
label: string | null,
tooltip: string | null,
stock_id: string,
manager?: RecentManager | null,
): RecentAction;
// Methods
/**
* Returns the value set by gtk_recent_chooser_menu_set_show_numbers().
* @returns %TRUE if numbers should be shown.
*/
get_show_numbers(): boolean;
/**
* Sets whether a number should be added to the items shown by the
* widgets representing `action`. The numbers are shown to provide
* a unique character for a mnemonic to be used inside the menu item's
* label. Only the first ten items get a number to avoid clashes.
* @param show_numbers %TRUE if the shown items should be numbered
*/
set_show_numbers(show_numbers: boolean): void;
// Inherited properties
/**
* The #GtkRecentFilter object to be used when displaying
* the recently used resources.
*/
get filter(): RecentFilter;
set filter(val: RecentFilter);
/**
* The maximum number of recently used resources to be displayed,
* or -1 to display all items. By default, the
* GtkSetting:gtk-recent-files-limit setting is respected: you can
* override that limit on a particular instance of #GtkRecentChooser
* by setting this property.
*/
get limit(): number;
set limit(val: number);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get local_only(): boolean;
set local_only(val: boolean);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get localOnly(): boolean;
set localOnly(val: boolean);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recent_manager(val: RecentManager);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recentManager(val: RecentManager);
/**
* Allow the user to select multiple resources.
*/
get select_multiple(): boolean;
set select_multiple(val: boolean);
/**
* Allow the user to select multiple resources.
*/
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get show_icons(): boolean;
set show_icons(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get showIcons(): boolean;
set showIcons(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get show_not_found(): boolean;
set show_not_found(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get showNotFound(): boolean;
set showNotFound(val: boolean);
get show_private(): boolean;
set show_private(val: boolean);
get showPrivate(): boolean;
set showPrivate(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get show_tips(): boolean;
set show_tips(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get showTips(): boolean;
set showTips(val: boolean);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sort_type(): RecentSortType;
set sort_type(val: RecentSortType);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sortType(): RecentSortType;
set sortType(val: RecentSortType);
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
add_filter(filter: RecentFilter): void;
/**
* Gets the #GtkRecentInfo currently selected by `chooser`.
* @returns a #GtkRecentInfo. Use gtk_recent_info_unref() when when you have finished using it.
*/
get_current_item(): RecentInfo;
/**
* Gets the URI currently selected by `chooser`.
* @returns a newly allocated string holding a URI.
*/
get_current_uri(): string;
/**
* Gets the #GtkRecentFilter object currently used by `chooser` to affect
* the display of the recently used resources.
* @returns a #GtkRecentFilter object.
*/
get_filter(): RecentFilter;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
* @returns A newly allocated list of #GtkRecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().
*/
get_items(): RecentInfo[];
/**
* Gets the number of items returned by gtk_recent_chooser_get_items()
* and gtk_recent_chooser_get_uris().
* @returns A positive integer, or -1 meaning that all items are returned.
*/
get_limit(): number;
/**
* Gets whether only local resources should be shown in the recently used
* resources selector. See gtk_recent_chooser_set_local_only()
* @returns %TRUE if only local resources should be shown.
*/
get_local_only(): boolean;
/**
* Gets whether `chooser` can select multiple items.
* @returns %TRUE if @chooser can select more than one item.
*/
get_select_multiple(): boolean;
/**
* Retrieves whether `chooser` should show an icon near the resource.
* @returns %TRUE if the icons should be displayed, %FALSE otherwise.
*/
get_show_icons(): boolean;
/**
* Retrieves whether `chooser` should show the recently used resources that
* were not found.
* @returns %TRUE if the resources not found should be displayed, and %FALSE otheriwse.
*/
get_show_not_found(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* registered as private.
* @returns %TRUE if the recent chooser should show private items, %FALSE otherwise.
*/
get_show_private(): boolean;
/**
* Gets whether `chooser` should display tooltips containing the full path
* of a recently user resource.
* @returns %TRUE if the recent chooser should show tooltips, %FALSE otherwise.
*/
get_show_tips(): boolean;
/**
* Gets the value set by gtk_recent_chooser_set_sort_type().
* @returns the sorting order of the @chooser.
*/
get_sort_type(): RecentSortType;
/**
* Gets the URI of the recently used resources.
*
* The return value of this function is affected by the "sort-type" and "limit"
* properties of `chooser`.
*
* Since the returned array is %NULL terminated, `length` may be %NULL.
* @returns A newly allocated, %NULL-terminated array of strings. Use g_strfreev() to free it.
*/
get_uris(): string[];
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
* @returns A singly linked list of #GtkRecentFilter objects. You should just free the returned list using g_slist_free().
*/
list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
* @returns %TRUE if @uri was found.
*/
select_uri(uri: string): boolean;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
* @returns %TRUE if the URI was found.
*/
set_current_uri(uri: string): boolean;
/**
* Sets `filter` as the current #GtkRecentFilter object used by `chooser`
* to affect the displayed recently used resources.
* @param filter a #GtkRecentFilter
*/
set_filter(filter: RecentFilter): void;
/**
* Sets the number of items that should be returned by
* gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
* @param limit a positive integer, or -1 for all items
*/
set_limit(limit: number): void;
/**
* Sets whether only local resources, that is resources using the file:// URI
* scheme, should be shown in the recently used resources selector. If
* `local_only` is %TRUE (the default) then the shown resources are guaranteed
* to be accessible through the operating system native file system.
* @param local_only %TRUE if only local files can be shown
*/
set_local_only(local_only: boolean): void;
/**
* Sets whether `chooser` can select multiple items.
* @param select_multiple %TRUE if @chooser can select more than one item
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether `chooser` should show an icon near the resource when
* displaying it.
* @param show_icons whether to show an icon near the resource
*/
set_show_icons(show_icons: boolean): void;
/**
* Sets whether `chooser` should display the recently used resources that
* it didn't find. This only applies to local resources.
* @param show_not_found whether to show the local items we didn't find
*/
set_show_not_found(show_not_found: boolean): void;
/**
* Whether to show recently used resources marked registered as private.
* @param show_private %TRUE to show private items, %FALSE otherwise
*/
set_show_private(show_private: boolean): void;
/**
* Sets whether to show a tooltips containing the full path of each
* recently used resource in a #GtkRecentChooser widget.
* @param show_tips %TRUE if tooltips should be shown
*/
set_show_tips(show_tips: boolean): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
* @param data_destroy destroy notifier for @sort_data, or %NULL
*/
set_sort_func(sort_func: RecentSortFunc, data_destroy?: GLib.DestroyNotify | null): void;
/**
* Changes the sorting order of the recently used resources list displayed by
* `chooser`.
* @param sort_type sort order that the chooser should use
*/
set_sort_type(sort_type: RecentSortType | null): void;
/**
* Unselects all the items inside `chooser`.
*/
unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
unselect_uri(uri: string): void;
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
vfunc_add_filter(filter: RecentFilter): void;
/**
* Gets the URI currently selected by `chooser`.
*/
vfunc_get_current_uri(): string;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
*/
vfunc_get_items(): RecentInfo[];
vfunc_item_activated(): void;
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
*/
vfunc_list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
vfunc_remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
vfunc_select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_select_uri(uri: string): boolean;
vfunc_selection_changed(): void;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
*/
vfunc_set_current_uri(uri: string): boolean;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
*/
vfunc_set_sort_func(sort_func: RecentSortFunc): void;
/**
* Unselects all the items inside `chooser`.
*/
vfunc_unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_unselect_uri(uri: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace RecentChooserDialog {
// Constructor properties interface
interface ConstructorProps
extends Dialog.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
RecentChooser.ConstructorProps {}
}
class RecentChooserDialog extends Dialog implements Atk.ImplementorIface, Buildable, RecentChooser {
static $gtype: GObject.GType<RecentChooserDialog>;
// Constructors
constructor(properties?: Partial<RecentChooserDialog.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Inherited properties
/**
* The #GtkRecentFilter object to be used when displaying
* the recently used resources.
*/
get filter(): RecentFilter;
set filter(val: RecentFilter);
/**
* The maximum number of recently used resources to be displayed,
* or -1 to display all items. By default, the
* GtkSetting:gtk-recent-files-limit setting is respected: you can
* override that limit on a particular instance of #GtkRecentChooser
* by setting this property.
*/
get limit(): number;
set limit(val: number);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get local_only(): boolean;
set local_only(val: boolean);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get localOnly(): boolean;
set localOnly(val: boolean);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recent_manager(val: RecentManager);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recentManager(val: RecentManager);
/**
* Allow the user to select multiple resources.
*/
get select_multiple(): boolean;
set select_multiple(val: boolean);
/**
* Allow the user to select multiple resources.
*/
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get show_icons(): boolean;
set show_icons(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get showIcons(): boolean;
set showIcons(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get show_not_found(): boolean;
set show_not_found(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get showNotFound(): boolean;
set showNotFound(val: boolean);
get show_private(): boolean;
set show_private(val: boolean);
get showPrivate(): boolean;
set showPrivate(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get show_tips(): boolean;
set show_tips(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get showTips(): boolean;
set showTips(val: boolean);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sort_type(): RecentSortType;
set sort_type(val: RecentSortType);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sortType(): RecentSortType;
set sortType(val: RecentSortType);
// Inherited methods
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
add_filter(filter: RecentFilter): void;
/**
* Gets the #GtkRecentInfo currently selected by `chooser`.
* @returns a #GtkRecentInfo. Use gtk_recent_info_unref() when when you have finished using it.
*/
get_current_item(): RecentInfo;
/**
* Gets the URI currently selected by `chooser`.
* @returns a newly allocated string holding a URI.
*/
get_current_uri(): string;
/**
* Gets the #GtkRecentFilter object currently used by `chooser` to affect
* the display of the recently used resources.
* @returns a #GtkRecentFilter object.
*/
get_filter(): RecentFilter;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
* @returns A newly allocated list of #GtkRecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().
*/
get_items(): RecentInfo[];
/**
* Gets the number of items returned by gtk_recent_chooser_get_items()
* and gtk_recent_chooser_get_uris().
* @returns A positive integer, or -1 meaning that all items are returned.
*/
get_limit(): number;
/**
* Gets whether only local resources should be shown in the recently used
* resources selector. See gtk_recent_chooser_set_local_only()
* @returns %TRUE if only local resources should be shown.
*/
get_local_only(): boolean;
/**
* Gets whether `chooser` can select multiple items.
* @returns %TRUE if @chooser can select more than one item.
*/
get_select_multiple(): boolean;
/**
* Retrieves whether `chooser` should show an icon near the resource.
* @returns %TRUE if the icons should be displayed, %FALSE otherwise.
*/
get_show_icons(): boolean;
/**
* Retrieves whether `chooser` should show the recently used resources that
* were not found.
* @returns %TRUE if the resources not found should be displayed, and %FALSE otheriwse.
*/
get_show_not_found(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* prepended by a unique number.
* @returns %TRUE if the recent chooser should show display numbers, %FALSE otherwise.
*/
get_show_numbers(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* registered as private.
* @returns %TRUE if the recent chooser should show private items, %FALSE otherwise.
*/
get_show_private(): boolean;
/**
* Gets whether `chooser` should display tooltips containing the full path
* of a recently user resource.
* @returns %TRUE if the recent chooser should show tooltips, %FALSE otherwise.
*/
get_show_tips(): boolean;
/**
* Gets the value set by gtk_recent_chooser_set_sort_type().
* @returns the sorting order of the @chooser.
*/
get_sort_type(): RecentSortType;
/**
* Gets the URI of the recently used resources.
*
* The return value of this function is affected by the "sort-type" and "limit"
* properties of `chooser`.
*
* Since the returned array is %NULL terminated, `length` may be %NULL.
* @returns A newly allocated, %NULL-terminated array of strings. Use g_strfreev() to free it.
*/
get_uris(): string[];
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
* @returns A singly linked list of #GtkRecentFilter objects. You should just free the returned list using g_slist_free().
*/
list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
* @returns %TRUE if @uri was found.
*/
select_uri(uri: string): boolean;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
* @returns %TRUE if the URI was found.
*/
set_current_uri(uri: string): boolean;
/**
* Sets `filter` as the current #GtkRecentFilter object used by `chooser`
* to affect the displayed recently used resources.
* @param filter a #GtkRecentFilter
*/
set_filter(filter: RecentFilter): void;
/**
* Sets the number of items that should be returned by
* gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
* @param limit a positive integer, or -1 for all items
*/
set_limit(limit: number): void;
/**
* Sets whether only local resources, that is resources using the file:// URI
* scheme, should be shown in the recently used resources selector. If
* `local_only` is %TRUE (the default) then the shown resources are guaranteed
* to be accessible through the operating system native file system.
* @param local_only %TRUE if only local files can be shown
*/
set_local_only(local_only: boolean): void;
/**
* Sets whether `chooser` can select multiple items.
* @param select_multiple %TRUE if @chooser can select more than one item
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether `chooser` should show an icon near the resource when
* displaying it.
* @param show_icons whether to show an icon near the resource
*/
set_show_icons(show_icons: boolean): void;
/**
* Sets whether `chooser` should display the recently used resources that
* it didn't find. This only applies to local resources.
* @param show_not_found whether to show the local items we didn't find
*/
set_show_not_found(show_not_found: boolean): void;
/**
* Whether to show recently used resources prepended by a unique number.
* @param show_numbers %TRUE to show numbers, %FALSE otherwise
*/
set_show_numbers(show_numbers: boolean): void;
/**
* Whether to show recently used resources marked registered as private.
* @param show_private %TRUE to show private items, %FALSE otherwise
*/
set_show_private(show_private: boolean): void;
/**
* Sets whether to show a tooltips containing the full path of each
* recently used resource in a #GtkRecentChooser widget.
* @param show_tips %TRUE if tooltips should be shown
*/
set_show_tips(show_tips: boolean): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
* @param data_destroy destroy notifier for @sort_data, or %NULL
*/
set_sort_func(sort_func: RecentSortFunc, data_destroy?: GLib.DestroyNotify | null): void;
/**
* Changes the sorting order of the recently used resources list displayed by
* `chooser`.
* @param sort_type sort order that the chooser should use
*/
set_sort_type(sort_type: RecentSortType | null): void;
/**
* Unselects all the items inside `chooser`.
*/
unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
unselect_uri(uri: string): void;
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
vfunc_add_filter(filter: RecentFilter): void;
/**
* Gets the URI currently selected by `chooser`.
*/
vfunc_get_current_uri(): string;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
*/
vfunc_get_items(): RecentInfo[];
vfunc_item_activated(): void;
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
*/
vfunc_list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
vfunc_remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
vfunc_select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_select_uri(uri: string): boolean;
vfunc_selection_changed(): void;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
*/
vfunc_set_current_uri(uri: string): boolean;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
*/
vfunc_set_sort_func(sort_func: RecentSortFunc): void;
/**
* Unselects all the items inside `chooser`.
*/
vfunc_unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_unselect_uri(uri: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace RecentChooserMenu {
// Constructor properties interface
interface ConstructorProps
extends Menu.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps,
RecentChooser.ConstructorProps {
show_numbers: boolean;
showNumbers: boolean;
}
}
class RecentChooserMenu extends Menu implements Atk.ImplementorIface, Activatable, Buildable, RecentChooser {
static $gtype: GObject.GType<RecentChooserMenu>;
// Properties
/**
* Whether the first ten items in the menu should be prepended by
* a number acting as a unique mnemonic.
*/
get show_numbers(): boolean;
set show_numbers(val: boolean);
/**
* Whether the first ten items in the menu should be prepended by
* a number acting as a unique mnemonic.
*/
get showNumbers(): boolean;
set showNumbers(val: boolean);
// Constructors
constructor(properties?: Partial<RecentChooserMenu.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): RecentChooserMenu;
static new_for_manager(manager: RecentManager): RecentChooserMenu;
// Methods
/**
* Returns the value set by gtk_recent_chooser_menu_set_show_numbers().
* @returns %TRUE if numbers should be shown.
*/
get_show_numbers(): boolean;
/**
* Sets whether a number should be added to the items of `menu`. The
* numbers are shown to provide a unique character for a mnemonic to
* be used inside ten menu item's label. Only the first the items
* get a number to avoid clashes.
* @param show_numbers whether to show numbers
*/
set_show_numbers(show_numbers: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
/**
* The #GtkRecentFilter object to be used when displaying
* the recently used resources.
*/
get filter(): RecentFilter;
set filter(val: RecentFilter);
/**
* The maximum number of recently used resources to be displayed,
* or -1 to display all items. By default, the
* GtkSetting:gtk-recent-files-limit setting is respected: you can
* override that limit on a particular instance of #GtkRecentChooser
* by setting this property.
*/
get limit(): number;
set limit(val: number);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get local_only(): boolean;
set local_only(val: boolean);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get localOnly(): boolean;
set localOnly(val: boolean);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recent_manager(val: RecentManager);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recentManager(val: RecentManager);
/**
* Allow the user to select multiple resources.
*/
get select_multiple(): boolean;
set select_multiple(val: boolean);
/**
* Allow the user to select multiple resources.
*/
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get show_icons(): boolean;
set show_icons(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get showIcons(): boolean;
set showIcons(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get show_not_found(): boolean;
set show_not_found(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get showNotFound(): boolean;
set showNotFound(val: boolean);
get show_private(): boolean;
set show_private(val: boolean);
get showPrivate(): boolean;
set showPrivate(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get show_tips(): boolean;
set show_tips(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get showTips(): boolean;
set showTips(val: boolean);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sort_type(): RecentSortType;
set sort_type(val: RecentSortType);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sortType(): RecentSortType;
set sortType(val: RecentSortType);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
add_filter(filter: RecentFilter): void;
/**
* Gets the #GtkRecentInfo currently selected by `chooser`.
* @returns a #GtkRecentInfo. Use gtk_recent_info_unref() when when you have finished using it.
*/
get_current_item(): RecentInfo;
/**
* Gets the URI currently selected by `chooser`.
* @returns a newly allocated string holding a URI.
*/
get_current_uri(): string;
/**
* Gets the #GtkRecentFilter object currently used by `chooser` to affect
* the display of the recently used resources.
* @returns a #GtkRecentFilter object.
*/
get_filter(): RecentFilter;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
* @returns A newly allocated list of #GtkRecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().
*/
get_items(): RecentInfo[];
/**
* Gets the number of items returned by gtk_recent_chooser_get_items()
* and gtk_recent_chooser_get_uris().
* @returns A positive integer, or -1 meaning that all items are returned.
*/
get_limit(): number;
/**
* Gets whether only local resources should be shown in the recently used
* resources selector. See gtk_recent_chooser_set_local_only()
* @returns %TRUE if only local resources should be shown.
*/
get_local_only(): boolean;
/**
* Gets whether `chooser` can select multiple items.
* @returns %TRUE if @chooser can select more than one item.
*/
get_select_multiple(): boolean;
/**
* Retrieves whether `chooser` should show an icon near the resource.
* @returns %TRUE if the icons should be displayed, %FALSE otherwise.
*/
get_show_icons(): boolean;
/**
* Retrieves whether `chooser` should show the recently used resources that
* were not found.
* @returns %TRUE if the resources not found should be displayed, and %FALSE otheriwse.
*/
get_show_not_found(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* registered as private.
* @returns %TRUE if the recent chooser should show private items, %FALSE otherwise.
*/
get_show_private(): boolean;
/**
* Gets whether `chooser` should display tooltips containing the full path
* of a recently user resource.
* @returns %TRUE if the recent chooser should show tooltips, %FALSE otherwise.
*/
get_show_tips(): boolean;
/**
* Gets the value set by gtk_recent_chooser_set_sort_type().
* @returns the sorting order of the @chooser.
*/
get_sort_type(): RecentSortType;
/**
* Gets the URI of the recently used resources.
*
* The return value of this function is affected by the "sort-type" and "limit"
* properties of `chooser`.
*
* Since the returned array is %NULL terminated, `length` may be %NULL.
* @returns A newly allocated, %NULL-terminated array of strings. Use g_strfreev() to free it.
*/
get_uris(): string[];
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
* @returns A singly linked list of #GtkRecentFilter objects. You should just free the returned list using g_slist_free().
*/
list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
* @returns %TRUE if @uri was found.
*/
select_uri(uri: string): boolean;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
* @returns %TRUE if the URI was found.
*/
set_current_uri(uri: string): boolean;
/**
* Sets `filter` as the current #GtkRecentFilter object used by `chooser`
* to affect the displayed recently used resources.
* @param filter a #GtkRecentFilter
*/
set_filter(filter: RecentFilter): void;
/**
* Sets the number of items that should be returned by
* gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
* @param limit a positive integer, or -1 for all items
*/
set_limit(limit: number): void;
/**
* Sets whether only local resources, that is resources using the file:// URI
* scheme, should be shown in the recently used resources selector. If
* `local_only` is %TRUE (the default) then the shown resources are guaranteed
* to be accessible through the operating system native file system.
* @param local_only %TRUE if only local files can be shown
*/
set_local_only(local_only: boolean): void;
/**
* Sets whether `chooser` can select multiple items.
* @param select_multiple %TRUE if @chooser can select more than one item
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether `chooser` should show an icon near the resource when
* displaying it.
* @param show_icons whether to show an icon near the resource
*/
set_show_icons(show_icons: boolean): void;
/**
* Sets whether `chooser` should display the recently used resources that
* it didn't find. This only applies to local resources.
* @param show_not_found whether to show the local items we didn't find
*/
set_show_not_found(show_not_found: boolean): void;
/**
* Whether to show recently used resources marked registered as private.
* @param show_private %TRUE to show private items, %FALSE otherwise
*/
set_show_private(show_private: boolean): void;
/**
* Sets whether to show a tooltips containing the full path of each
* recently used resource in a #GtkRecentChooser widget.
* @param show_tips %TRUE if tooltips should be shown
*/
set_show_tips(show_tips: boolean): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
* @param data_destroy destroy notifier for @sort_data, or %NULL
*/
set_sort_func(sort_func: RecentSortFunc, data_destroy?: GLib.DestroyNotify | null): void;
/**
* Changes the sorting order of the recently used resources list displayed by
* `chooser`.
* @param sort_type sort order that the chooser should use
*/
set_sort_type(sort_type: RecentSortType | null): void;
/**
* Unselects all the items inside `chooser`.
*/
unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
unselect_uri(uri: string): void;
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
vfunc_add_filter(filter: RecentFilter): void;
/**
* Gets the URI currently selected by `chooser`.
*/
vfunc_get_current_uri(): string;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
*/
vfunc_get_items(): RecentInfo[];
vfunc_item_activated(): void;
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
*/
vfunc_list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
vfunc_remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
vfunc_select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_select_uri(uri: string): boolean;
vfunc_selection_changed(): void;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
*/
vfunc_set_current_uri(uri: string): boolean;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
*/
vfunc_set_sort_func(sort_func: RecentSortFunc): void;
/**
* Unselects all the items inside `chooser`.
*/
vfunc_unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_unselect_uri(uri: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace RecentChooserWidget {
// Constructor properties interface
interface ConstructorProps
extends VBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps,
RecentChooser.ConstructorProps {}
}
class RecentChooserWidget extends VBox implements Atk.ImplementorIface, Buildable, Orientable, RecentChooser {
static $gtype: GObject.GType<RecentChooserWidget>;
// Constructors
constructor(properties?: Partial<RecentChooserWidget.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): RecentChooserWidget;
static new_for_manager(manager: RecentManager): RecentChooserWidget;
// Inherited properties
/**
* The #GtkRecentFilter object to be used when displaying
* the recently used resources.
*/
get filter(): RecentFilter;
set filter(val: RecentFilter);
/**
* The maximum number of recently used resources to be displayed,
* or -1 to display all items. By default, the
* GtkSetting:gtk-recent-files-limit setting is respected: you can
* override that limit on a particular instance of #GtkRecentChooser
* by setting this property.
*/
get limit(): number;
set limit(val: number);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get local_only(): boolean;
set local_only(val: boolean);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get localOnly(): boolean;
set localOnly(val: boolean);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recent_manager(val: RecentManager);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recentManager(val: RecentManager);
/**
* Allow the user to select multiple resources.
*/
get select_multiple(): boolean;
set select_multiple(val: boolean);
/**
* Allow the user to select multiple resources.
*/
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get show_icons(): boolean;
set show_icons(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get showIcons(): boolean;
set showIcons(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get show_not_found(): boolean;
set show_not_found(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get showNotFound(): boolean;
set showNotFound(val: boolean);
get show_private(): boolean;
set show_private(val: boolean);
get showPrivate(): boolean;
set showPrivate(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get show_tips(): boolean;
set show_tips(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get showTips(): boolean;
set showTips(val: boolean);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sort_type(): RecentSortType;
set sort_type(val: RecentSortType);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sortType(): RecentSortType;
set sortType(val: RecentSortType);
// Inherited methods
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
add_filter(filter: RecentFilter): void;
/**
* Gets the #GtkRecentInfo currently selected by `chooser`.
* @returns a #GtkRecentInfo. Use gtk_recent_info_unref() when when you have finished using it.
*/
get_current_item(): RecentInfo;
/**
* Gets the URI currently selected by `chooser`.
* @returns a newly allocated string holding a URI.
*/
get_current_uri(): string;
/**
* Gets the #GtkRecentFilter object currently used by `chooser` to affect
* the display of the recently used resources.
* @returns a #GtkRecentFilter object.
*/
get_filter(): RecentFilter;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
* @returns A newly allocated list of #GtkRecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().
*/
get_items(): RecentInfo[];
/**
* Gets the number of items returned by gtk_recent_chooser_get_items()
* and gtk_recent_chooser_get_uris().
* @returns A positive integer, or -1 meaning that all items are returned.
*/
get_limit(): number;
/**
* Gets whether only local resources should be shown in the recently used
* resources selector. See gtk_recent_chooser_set_local_only()
* @returns %TRUE if only local resources should be shown.
*/
get_local_only(): boolean;
/**
* Gets whether `chooser` can select multiple items.
* @returns %TRUE if @chooser can select more than one item.
*/
get_select_multiple(): boolean;
/**
* Retrieves whether `chooser` should show an icon near the resource.
* @returns %TRUE if the icons should be displayed, %FALSE otherwise.
*/
get_show_icons(): boolean;
/**
* Retrieves whether `chooser` should show the recently used resources that
* were not found.
* @returns %TRUE if the resources not found should be displayed, and %FALSE otheriwse.
*/
get_show_not_found(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* prepended by a unique number.
* @returns %TRUE if the recent chooser should show display numbers, %FALSE otherwise.
*/
get_show_numbers(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* registered as private.
* @returns %TRUE if the recent chooser should show private items, %FALSE otherwise.
*/
get_show_private(): boolean;
/**
* Gets whether `chooser` should display tooltips containing the full path
* of a recently user resource.
* @returns %TRUE if the recent chooser should show tooltips, %FALSE otherwise.
*/
get_show_tips(): boolean;
/**
* Gets the value set by gtk_recent_chooser_set_sort_type().
* @returns the sorting order of the @chooser.
*/
get_sort_type(): RecentSortType;
/**
* Gets the URI of the recently used resources.
*
* The return value of this function is affected by the "sort-type" and "limit"
* properties of `chooser`.
*
* Since the returned array is %NULL terminated, `length` may be %NULL.
* @returns A newly allocated, %NULL-terminated array of strings. Use g_strfreev() to free it.
*/
get_uris(): string[];
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
* @returns A singly linked list of #GtkRecentFilter objects. You should just free the returned list using g_slist_free().
*/
list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
* @returns %TRUE if @uri was found.
*/
select_uri(uri: string): boolean;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
* @returns %TRUE if the URI was found.
*/
set_current_uri(uri: string): boolean;
/**
* Sets `filter` as the current #GtkRecentFilter object used by `chooser`
* to affect the displayed recently used resources.
* @param filter a #GtkRecentFilter
*/
set_filter(filter: RecentFilter): void;
/**
* Sets the number of items that should be returned by
* gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
* @param limit a positive integer, or -1 for all items
*/
set_limit(limit: number): void;
/**
* Sets whether only local resources, that is resources using the file:// URI
* scheme, should be shown in the recently used resources selector. If
* `local_only` is %TRUE (the default) then the shown resources are guaranteed
* to be accessible through the operating system native file system.
* @param local_only %TRUE if only local files can be shown
*/
set_local_only(local_only: boolean): void;
/**
* Sets whether `chooser` can select multiple items.
* @param select_multiple %TRUE if @chooser can select more than one item
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether `chooser` should show an icon near the resource when
* displaying it.
* @param show_icons whether to show an icon near the resource
*/
set_show_icons(show_icons: boolean): void;
/**
* Sets whether `chooser` should display the recently used resources that
* it didn't find. This only applies to local resources.
* @param show_not_found whether to show the local items we didn't find
*/
set_show_not_found(show_not_found: boolean): void;
/**
* Whether to show recently used resources prepended by a unique number.
* @param show_numbers %TRUE to show numbers, %FALSE otherwise
*/
set_show_numbers(show_numbers: boolean): void;
/**
* Whether to show recently used resources marked registered as private.
* @param show_private %TRUE to show private items, %FALSE otherwise
*/
set_show_private(show_private: boolean): void;
/**
* Sets whether to show a tooltips containing the full path of each
* recently used resource in a #GtkRecentChooser widget.
* @param show_tips %TRUE if tooltips should be shown
*/
set_show_tips(show_tips: boolean): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
* @param data_destroy destroy notifier for @sort_data, or %NULL
*/
set_sort_func(sort_func: RecentSortFunc, data_destroy?: GLib.DestroyNotify | null): void;
/**
* Changes the sorting order of the recently used resources list displayed by
* `chooser`.
* @param sort_type sort order that the chooser should use
*/
set_sort_type(sort_type: RecentSortType | null): void;
/**
* Unselects all the items inside `chooser`.
*/
unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
unselect_uri(uri: string): void;
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
vfunc_add_filter(filter: RecentFilter): void;
/**
* Gets the URI currently selected by `chooser`.
*/
vfunc_get_current_uri(): string;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
*/
vfunc_get_items(): RecentInfo[];
vfunc_item_activated(): void;
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
*/
vfunc_list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
vfunc_remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
vfunc_select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_select_uri(uri: string): boolean;
vfunc_selection_changed(): void;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
*/
vfunc_set_current_uri(uri: string): boolean;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
*/
vfunc_set_sort_func(sort_func: RecentSortFunc): void;
/**
* Unselects all the items inside `chooser`.
*/
vfunc_unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_unselect_uri(uri: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace RecentFilter {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
class RecentFilter extends Object {
static $gtype: GObject.GType<RecentFilter>;
// Constructors
constructor(properties?: Partial<RecentFilter.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): RecentFilter;
// Methods
/**
* Adds a rule that allows resources based on their age - that is, the number
* of days elapsed since they were last modified.
* @param days number of days
*/
add_age(days: number): void;
/**
* Adds a rule that allows resources based on the name of the application
* that has registered them.
* @param application an application name
*/
add_application(application: string): void;
/**
* Adds a rule to a filter that allows resources based on a custom callback
* function. The bitfield `needed` which is passed in provides information
* about what sorts of information that the filter function needs;
* this allows GTK+ to avoid retrieving expensive information when
* it isn't needed by the filter.
* @param needed bitfield of flags indicating the information that the custom filter function needs.
* @param func callback function; if the function returns %TRUE, then the file will be displayed.
*/
add_custom(needed: RecentFilterFlags | null, func: RecentFilterFunc): void;
/**
* Adds a rule that allows resources based on the name of the group
* to which they belong
* @param group a group name
*/
add_group(group: string): void;
/**
* Adds a rule that allows resources based on their registered MIME type.
* @param mime_type a MIME type
*/
add_mime_type(mime_type: string): void;
/**
* Adds a rule that allows resources based on a pattern matching their
* display name.
* @param pattern a file pattern
*/
add_pattern(pattern: string): void;
/**
* Adds a rule allowing image files in the formats supported
* by GdkPixbuf.
*/
add_pixbuf_formats(): void;
/**
* Tests whether a file should be displayed according to `filter`.
* The #GtkRecentFilterInfo structure `filter_info` should include
* the fields returned from gtk_recent_filter_get_needed().
*
* This function will not typically be used by applications; it
* is intended principally for use in the implementation of
* #GtkRecentChooser.
* @param filter_info a #GtkRecentFilterInfo structure containing information about a recently used resource
* @returns %TRUE if the file should be displayed
*/
filter(filter_info: RecentFilterInfo): boolean;
/**
* Gets the human-readable name for the filter.
* See gtk_recent_filter_set_name().
* @returns the name of the filter, or %NULL. The returned string is owned by the filter object and should not be freed.
*/
get_name(): string;
/**
* Gets the fields that need to be filled in for the structure
* passed to gtk_recent_filter_filter()
*
* This function will not typically be used by applications; it
* is intended principally for use in the implementation of
* #GtkRecentChooser.
* @returns bitfield of flags indicating needed fields when calling gtk_recent_filter_filter()
*/
get_needed(): RecentFilterFlags;
/**
* Sets the human-readable name of the filter; this is the string
* that will be displayed in the recently used resources selector
* user interface if there is a selectable list of filters.
* @param name then human readable name of @filter
*/
set_name(name: string): void;
}
namespace RecentManager {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
filename: string;
limit: number;
size: number;
}
}
class RecentManager extends GObject.Object {
static $gtype: GObject.GType<RecentManager>;
// Properties
/**
* The full path to the file to be used to store and read the recently
* used resources list
*/
get filename(): string;
/**
* The maximum number of items to be returned by the
* gtk_recent_manager_get_items() function.
*/
get limit(): number;
set limit(val: number);
/**
* The size of the recently used resources list.
*/
get size(): number;
// Constructors
constructor(properties?: Partial<RecentManager.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): RecentManager;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Static methods
/**
* Gets a unique instance of #GtkRecentManager, that you can share
* in your application without caring about memory management. The
* returned instance will be freed when you application terminates.
*/
static get_default(): RecentManager;
// Virtual methods
vfunc_changed(): void;
// Methods
/**
* Adds a new resource, pointed by `uri,` into the recently used
* resources list, using the metadata specified inside the #GtkRecentData
* structure passed in `recent_data`.
*
* The passed URI will be used to identify this resource inside the
* list.
*
* In order to register the new recently used resource, metadata about
* the resource must be passed as well as the URI; the metadata is
* stored in a #GtkRecentData structure, which must contain the MIME
* type of the resource pointed by the URI; the name of the application
* that is registering the item, and a command line to be used when
* launching the item.
*
* Optionally, a #GtkRecentData structure might contain a UTF-8 string
* to be used when viewing the item instead of the last component of the
* URI; a short description of the item; whether the item should be
* considered private - that is, should be displayed only by the
* applications that have registered it.
* @param uri a valid URI
* @param recent_data metadata of the resource
* @returns %TRUE if the new item was successfully added to the recently used resources list, %FALSE otherwise.
*/
add_full(uri: string, recent_data: RecentData): boolean;
/**
* Adds a new resource, pointed by `uri,` into the recently used
* resources list.
*
* This function automatically retrieves some of the needed
* metadata and setting other metadata to common default values; it
* then feeds the data to gtk_recent_manager_add_full().
*
* See gtk_recent_manager_add_full() if you want to explicitly
* define the metadata for the resource pointed by `uri`.
* @param uri a valid URI
* @returns %TRUE if the new item was successfully added to the recently used resources list
*/
add_item(uri: string): boolean;
/**
* Gets the list of recently used resources.
* @returns a list of newly allocated #GtkRecentInfo objects. Use gtk_recent_info_unref() on each item inside the list, and then free the list itself using g_list_free().
*/
get_items(): RecentInfo[];
/**
* Gets the maximum number of items that the gtk_recent_manager_get_items()
* function should return.
* @returns the number of items to return, or -1 for every item.
*/
get_limit(): number;
/**
* Checks whether there is a recently used resource registered
* with `uri` inside the recent manager.
* @param uri a URI
* @returns %TRUE if the resource was found, %FALSE otherwise.
*/
has_item(uri: string): boolean;
/**
* Searches for a URI inside the recently used resources list, and
* returns a structure containing informations about the resource
* like its MIME type, or its display name.
* @param uri a URI
* @returns a #GtkRecentInfo structure containing information about the resource pointed by @uri, or %NULL if the URI was not registered in the recently used resources list. Free with gtk_recent_info_unref().
*/
lookup_item(uri: string): RecentInfo;
/**
* Changes the location of a recently used resource from `uri` to `new_uri`.
*
* Please note that this function will not affect the resource pointed
* by the URIs, but only the URI used in the recently used resources list.
* @param uri the URI of a recently used resource
* @param new_uri the new URI of the recently used resource, or %NULL to remove the item pointed by @uri in the list
* @returns %TRUE on success.
*/
move_item(uri: string, new_uri?: string | null): boolean;
/**
* Purges every item from the recently used resources list.
* @returns the number of items that have been removed from the recently used resources list.
*/
purge_items(): number;
/**
* Removes a resource pointed by `uri` from the recently used resources
* list handled by a recent manager.
* @param uri the URI of the item you wish to remove
* @returns %TRUE if the item pointed by @uri has been successfully removed by the recently used resources list, and %FALSE otherwise.
*/
remove_item(uri: string): boolean;
/**
* Sets the maximum number of item that the gtk_recent_manager_get_items()
* function should return. If `limit` is set to -1, then return all the
* items.
* @param limit the maximum number of items to return, or -1.
*/
set_limit(limit: number): void;
/**
* Sets the screen for a recent manager; the screen is used to
* track the user's currently configured recently used documents
* storage.
* @param screen a #GdkScreen
*/
set_screen(screen: Gdk.Screen): void;
}
namespace Ruler {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
lower: number;
max_size: number;
maxSize: number;
metric: MetricType;
position: number;
upper: number;
}
}
class Ruler extends Widget implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Ruler>;
// Properties
get lower(): number;
set lower(val: number);
get max_size(): number;
set max_size(val: number);
get maxSize(): number;
set maxSize(val: number);
/**
* The metric used for the ruler.
*/
get metric(): MetricType;
set metric(val: MetricType);
get position(): number;
set position(val: number);
get upper(): number;
set upper(val: number);
// Fields
widget: Widget;
backing_store: Gdk.Pixmap;
non_gr_exp_gc: Gdk.GC;
xsrc: number;
ysrc: number;
slider_size: number;
// Constructors
constructor(properties?: Partial<Ruler.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Virtual methods
vfunc_draw_pos(): void;
vfunc_draw_ticks(): void;
// Methods
draw_pos(): void;
draw_ticks(): void;
/**
* Gets the units used for a #GtkRuler. See gtk_ruler_set_metric().
* @returns the units currently used for @ruler
*/
get_metric(): MetricType;
/**
* Retrieves values indicating the range and current position of a #GtkRuler.
* See gtk_ruler_set_range().
* @param lower location to store lower limit of the ruler, or %NULL
* @param upper location to store upper limit of the ruler, or %NULL
* @param position location to store the current position of the mark on the ruler, or %NULL
* @param max_size location to store the maximum size of the ruler used when calculating the space to leave for the text, or %NULL.
*/
get_range(lower: number | null, upper: number | null, position: number | null, max_size: number): void;
set_metric(metric: MetricType | null): void;
/**
* This sets the range of the ruler.
* @param lower the lower limit of the ruler
* @param upper the upper limit of the ruler
* @param position the mark on the ruler
* @param max_size the maximum size of the ruler used when calculating the space to leave for the text
*/
set_range(lower: number, upper: number, position: number, max_size: number): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Scale {
// Signal callback interfaces
interface FormatValue {
(value: number): string;
}
// Constructor properties interface
interface ConstructorProps
extends Range.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
digits: number;
draw_value: boolean;
drawValue: boolean;
value_pos: PositionType;
valuePos: PositionType;
}
}
abstract class Scale extends Range implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Scale>;
// Properties
get digits(): number;
set digits(val: number);
get draw_value(): boolean;
set draw_value(val: boolean);
get drawValue(): boolean;
set drawValue(val: boolean);
get value_pos(): PositionType;
set value_pos(val: PositionType);
get valuePos(): PositionType;
set valuePos(val: PositionType);
// Fields
range: Range;
// Constructors
constructor(properties?: Partial<Scale.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'format-value', callback: (_source: this, value: number) => string): number;
connect_after(signal: 'format-value', callback: (_source: this, value: number) => string): number;
emit(signal: 'format-value', value: number): void;
// Virtual methods
vfunc_draw_value(): void;
vfunc_format_value(value: number): string;
/**
* Obtains the coordinates where the scale will draw the
* #PangoLayout representing the text in the scale. Remember
* when using the #PangoLayout function you need to convert to
* and from pixels using PANGO_PIXELS() or #PANGO_SCALE.
*
* If the #GtkScale:draw-value property is %FALSE, the return
* values are undefined.
*/
vfunc_get_layout_offsets(): [number, number];
// Methods
/**
* Adds a mark at `value`.
*
* A mark is indicated visually by drawing a tick mark next to the scale,
* and GTK+ makes it easy for the user to position the scale exactly at the
* marks value.
*
* If `markup` is not %NULL, text is shown next to the tick mark.
*
* To remove marks from a scale, use gtk_scale_clear_marks().
* @param value the value at which the mark is placed, must be between the lower and upper limits of the scales' adjustment
* @param position where to draw the mark. For a horizontal scale, #GTK_POS_TOP is drawn above the scale, anything else below. For a vertical scale, #GTK_POS_LEFT is drawn to the left of the scale, anything else to the right.
* @param markup Text to be shown at the mark, using <link linkend="PangoMarkupFormat">Pango markup</link>, or %NULL
*/
add_mark(value: number, position: PositionType | null, markup?: string | null): void;
/**
* Removes any marks that have been added with gtk_scale_add_mark().
*/
clear_marks(): void;
/**
* Gets the number of decimal places that are displayed in the value.
* @returns the number of decimal places that are displayed
*/
get_digits(): number;
/**
* Returns whether the current value is displayed as a string
* next to the slider.
* @returns whether the current value is displayed as a string
*/
get_draw_value(): boolean;
/**
* Gets the #PangoLayout used to display the scale. The returned
* object is owned by the scale so does not need to be freed by
* the caller.
* @returns the #PangoLayout for this scale, or %NULL if the #GtkScale:draw-value property is %FALSE.
*/
get_layout(): Pango.Layout;
/**
* Obtains the coordinates where the scale will draw the
* #PangoLayout representing the text in the scale. Remember
* when using the #PangoLayout function you need to convert to
* and from pixels using PANGO_PIXELS() or #PANGO_SCALE.
*
* If the #GtkScale:draw-value property is %FALSE, the return
* values are undefined.
*/
get_layout_offsets(): [number, number];
/**
* Gets the position in which the current value is displayed.
* @returns the position in which the current value is displayed
*/
get_value_pos(): PositionType;
/**
* Sets the number of decimal places that are displayed in the value. Also
* causes the value of the adjustment to be rounded to this number of digits,
* so the retrieved value matches the displayed one, if #GtkScale:draw-value is
* %TRUE when the value changes. If you want to enforce rounding the value when
* #GtkScale:draw-value is %FALSE, you can set #GtkRange:round-digits instead.
* @param digits the number of decimal places to display, e.g. use 1 to display 1.0, 2 to display 1.00, etc
*/
set_digits(digits: number): void;
/**
* Specifies whether the current value is displayed as a string next
* to the slider.
* @param draw_value %TRUE to draw the value
*/
set_draw_value(draw_value: boolean): void;
/**
* Sets the position in which the current value is displayed.
* @param pos the position in which the current value is displayed
*/
set_value_pos(pos: PositionType | null): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
// This accessor conflicts with a property or field in a parent class or interface.
orientation: Orientation | any;
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ScaleButton {
// Signal callback interfaces
interface Popdown {
(): void;
}
interface Popup {
(): void;
}
interface ValueChanged {
(value: number): void;
}
// Constructor properties interface
interface ConstructorProps
extends Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
adjustment: Adjustment;
icons: string[];
size: IconSize;
value: number;
}
}
class ScaleButton extends Button implements Atk.ImplementorIface, Activatable, Buildable, Orientable {
static $gtype: GObject.GType<ScaleButton>;
// Properties
get adjustment(): Adjustment;
set adjustment(val: Adjustment);
/**
* The names of the icons to be used by the scale button.
* The first item in the array will be used in the button
* when the current value is the lowest value, the second
* item for the highest value. All the subsequent icons will
* be used for all the other values, spread evenly over the
* range of values.
*
* If there's only one icon name in the `icons` array, it will
* be used for all the values. If only two icon names are in
* the `icons` array, the first one will be used for the bottom
* 50% of the scale, and the second one for the top 50%.
*
* It is recommended to use at least 3 icons so that the
* #GtkScaleButton reflects the current value of the scale
* better for the users.
*/
get icons(): string[];
set icons(val: string[]);
get size(): IconSize;
set size(val: IconSize);
get value(): number;
set value(val: number);
// Fields
plus_button: Widget;
minus_button: Widget;
// Constructors
constructor(properties?: Partial<ScaleButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](
size: IconSize,
min: number,
max: number,
step: number,
icons?: string[] | null,
): ScaleButton;
// Conflicted with Gtk.Button.new
static ['new'](...args: never[]): any;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'popdown', callback: (_source: this) => void): number;
connect_after(signal: 'popdown', callback: (_source: this) => void): number;
emit(signal: 'popdown'): void;
connect(signal: 'popup', callback: (_source: this) => void): number;
connect_after(signal: 'popup', callback: (_source: this) => void): number;
emit(signal: 'popup'): void;
connect(signal: 'value-changed', callback: (_source: this, value: number) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this, value: number) => void): number;
emit(signal: 'value-changed', value: number): void;
// Virtual methods
vfunc_value_changed(value: number): void;
// Methods
/**
* Gets the #GtkAdjustment associated with the #GtkScaleButton's scale.
* See gtk_range_get_adjustment() for details.
* @returns the adjustment associated with the scale
*/
get_adjustment(): Adjustment;
/**
* Retrieves the minus button of the #GtkScaleButton.
* @returns the minus button of the #GtkScaleButton
*/
get_minus_button(): Widget;
/**
* Gets the orientation of the #GtkScaleButton's popup window.
* @returns the #GtkScaleButton's orientation.
*/
get_orientation(): Orientation;
/**
* Retrieves the plus button of the #GtkScaleButton.
* @returns the plus button of the #GtkScaleButton
*/
get_plus_button(): Widget;
/**
* Retrieves the popup of the #GtkScaleButton.
* @returns the popup of the #GtkScaleButton
*/
get_popup(): Widget;
/**
* Gets the current value of the scale button.
* @returns current value of the scale button
*/
get_value(): number;
/**
* Sets the #GtkAdjustment to be used as a model
* for the #GtkScaleButton's scale.
* See gtk_range_set_adjustment() for details.
* @param adjustment a #GtkAdjustment
*/
set_adjustment(adjustment: Adjustment): void;
/**
* Sets the icons to be used by the scale button.
* For details, see the #GtkScaleButton:icons property.
* @param icons a %NULL-terminated array of icon names
*/
set_icons(icons: string[]): void;
/**
* Sets the orientation of the #GtkScaleButton's popup window.
* @param orientation the new orientation
*/
set_orientation(orientation: Orientation | null): void;
/**
* Sets the current value of the scale; if the value is outside
* the minimum or maximum range values, it will be clamped to fit
* inside them. The scale button emits the #GtkScaleButton::value-changed
* signal if the value changes.
* @param value new value of the scale button
*/
set_value(value: number): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Scrollbar {
// Constructor properties interface
interface ConstructorProps
extends Range.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
abstract class Scrollbar extends Range implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Scrollbar>;
// Fields
range: Range;
// Constructors
constructor(properties?: Partial<Scrollbar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
// This accessor conflicts with a property or field in a parent class or interface.
orientation: Orientation | any;
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ScrolledWindow {
// Signal callback interfaces
interface MoveFocusOut {
(object: DirectionType): void;
}
interface ScrollChild {
(scroll: ScrollType, horizontal: boolean): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
hadjustment: Adjustment;
hscrollbar_policy: PolicyType;
hscrollbarPolicy: PolicyType;
shadow_type: ShadowType;
shadowType: ShadowType;
vadjustment: Adjustment;
vscrollbar_policy: PolicyType;
vscrollbarPolicy: PolicyType;
window_placement: CornerType;
windowPlacement: CornerType;
window_placement_set: boolean;
windowPlacementSet: boolean;
}
}
class ScrolledWindow extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<ScrolledWindow>;
// Properties
get hadjustment(): Adjustment;
set hadjustment(val: Adjustment);
get hscrollbar_policy(): PolicyType;
set hscrollbar_policy(val: PolicyType);
get hscrollbarPolicy(): PolicyType;
set hscrollbarPolicy(val: PolicyType);
get shadow_type(): ShadowType;
set shadow_type(val: ShadowType);
get shadowType(): ShadowType;
set shadowType(val: ShadowType);
get vadjustment(): Adjustment;
set vadjustment(val: Adjustment);
get vscrollbar_policy(): PolicyType;
set vscrollbar_policy(val: PolicyType);
get vscrollbarPolicy(): PolicyType;
set vscrollbarPolicy(val: PolicyType);
get window_placement(): CornerType;
set window_placement(val: CornerType);
get windowPlacement(): CornerType;
set windowPlacement(val: CornerType);
/**
* Whether "window-placement" should be used to determine the location
* of the contents with respect to the scrollbars. Otherwise, the
* "gtk-scrolled-window-placement" setting is used.
*/
get window_placement_set(): boolean;
set window_placement_set(val: boolean);
/**
* Whether "window-placement" should be used to determine the location
* of the contents with respect to the scrollbars. Otherwise, the
* "gtk-scrolled-window-placement" setting is used.
*/
get windowPlacementSet(): boolean;
set windowPlacementSet(val: boolean);
// Fields
container: Bin;
hscrollbar: Widget;
vscrollbar: Widget;
// Constructors
constructor(properties?: Partial<ScrolledWindow.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): ScrolledWindow;
// 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: 'move-focus-out', callback: (_source: this, object: DirectionType) => void): number;
connect_after(signal: 'move-focus-out', callback: (_source: this, object: DirectionType) => void): number;
emit(signal: 'move-focus-out', object: DirectionType): void;
connect(
signal: 'scroll-child',
callback: (_source: this, scroll: ScrollType, horizontal: boolean) => boolean,
): number;
connect_after(
signal: 'scroll-child',
callback: (_source: this, scroll: ScrollType, horizontal: boolean) => boolean,
): number;
emit(signal: 'scroll-child', scroll: ScrollType, horizontal: boolean): void;
// Virtual methods
vfunc_move_focus_out(direction: DirectionType): void;
vfunc_scroll_child(scroll: ScrollType, horizontal: boolean): boolean;
// Methods
/**
* Used to add children without native scrolling capabilities. This
* is simply a convenience function; it is equivalent to adding the
* unscrollable child to a viewport, then adding the viewport to the
* scrolled window. If a child has native scrolling, use
* gtk_container_add() instead of this function.
*
* The viewport scrolls the child by moving its #GdkWindow, and takes
* the size of the child to be the size of its toplevel #GdkWindow.
* This will be very wrong for most widgets that support native scrolling;
* for example, if you add a widget such as #GtkTreeView with a viewport,
* the whole widget will scroll, including the column headings. Thus,
* widgets with native scrolling support should not be used with the
* #GtkViewport proxy.
*
* A widget supports scrolling natively if the
* set_scroll_adjustments_signal field in #GtkWidgetClass is non-zero,
* i.e. has been filled in with a valid signal identifier.
* @param child the widget you want to scroll
*/
add_with_viewport(child: Widget): void;
/**
* Returns the horizontal scrollbar's adjustment, used to connect the
* horizontal scrollbar to the child widget's horizontal scroll
* functionality.
* @returns the horizontal #GtkAdjustment
*/
get_hadjustment(): Adjustment;
/**
* Returns the horizontal scrollbar of `scrolled_window`.
* @returns the horizontal scrollbar of the scrolled window, or %NULL if it does not have one.
*/
get_hscrollbar(): Widget;
/**
* Gets the placement of the contents with respect to the scrollbars
* for the scrolled window. See gtk_scrolled_window_set_placement().
* @returns the current placement value. See also gtk_scrolled_window_set_placement() and gtk_scrolled_window_unset_placement().
*/
get_placement(): CornerType;
/**
* Retrieves the current policy values for the horizontal and vertical
* scrollbars. See gtk_scrolled_window_set_policy().
*/
get_policy(): [PolicyType | null, PolicyType | null];
/**
* Gets the shadow type of the scrolled window. See
* gtk_scrolled_window_set_shadow_type().
* @returns the current shadow type
*/
get_shadow_type(): ShadowType;
/**
* Returns the vertical scrollbar's adjustment, used to connect the
* vertical scrollbar to the child widget's vertical scroll functionality.
* @returns the vertical #GtkAdjustment
*/
get_vadjustment(): Adjustment;
/**
* Returns the vertical scrollbar of `scrolled_window`.
* @returns the vertical scrollbar of the scrolled window, or %NULL if it does not have one.
*/
get_vscrollbar(): Widget;
/**
* Sets the #GtkAdjustment for the horizontal scrollbar.
* @param hadjustment horizontal scroll adjustment
*/
set_hadjustment(hadjustment: Adjustment): void;
/**
* Sets the placement of the contents with respect to the scrollbars
* for the scrolled window.
*
* The default is %GTK_CORNER_TOP_LEFT, meaning the child is
* in the top left, with the scrollbars underneath and to the right.
* Other values in #GtkCornerType are %GTK_CORNER_TOP_RIGHT,
* %GTK_CORNER_BOTTOM_LEFT, and %GTK_CORNER_BOTTOM_RIGHT.
*
* See also gtk_scrolled_window_get_placement() and
* gtk_scrolled_window_unset_placement().
* @param window_placement position of the child window
*/
set_placement(window_placement: CornerType | null): void;
/**
* Sets the scrollbar policy for the horizontal and vertical scrollbars.
*
* The policy determines when the scrollbar should appear; it is a value
* from the #GtkPolicyType enumeration. If %GTK_POLICY_ALWAYS, the
* scrollbar is always present; if %GTK_POLICY_NEVER, the scrollbar is
* never present; if %GTK_POLICY_AUTOMATIC, the scrollbar is present only
* if needed (that is, if the slider part of the bar would be smaller
* than the trough - the display is larger than the page size).
* @param hscrollbar_policy policy for horizontal bar
* @param vscrollbar_policy policy for vertical bar
*/
set_policy(hscrollbar_policy: PolicyType | null, vscrollbar_policy: PolicyType | null): void;
/**
* Changes the type of shadow drawn around the contents of
* `scrolled_window`.
* @param type kind of shadow to draw around scrolled window contents
*/
set_shadow_type(type: ShadowType | null): void;
/**
* Sets the #GtkAdjustment for the vertical scrollbar.
* @param vadjustment vertical scroll adjustment
*/
set_vadjustment(vadjustment: Adjustment): void;
/**
* Unsets the placement of the contents with respect to the scrollbars
* for the scrolled window. If no window placement is set for a scrolled
* window, it obeys the "gtk-scrolled-window-placement" XSETTING.
*
* See also gtk_scrolled_window_set_placement() and
* gtk_scrolled_window_get_placement().
*/
unset_placement(): 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 Separator {
// Constructor properties interface
interface ConstructorProps
extends Widget.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
abstract class Separator extends Widget implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Separator>;
// Fields
widget: Widget;
// Constructors
constructor(properties?: Partial<Separator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace SeparatorMenuItem {
// Constructor properties interface
interface ConstructorProps
extends MenuItem.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {}
}
class SeparatorMenuItem extends MenuItem implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<SeparatorMenuItem>;
// Fields
menu_item: MenuItem;
// Constructors
constructor(properties?: Partial<SeparatorMenuItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): SeparatorMenuItem;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace SeparatorToolItem {
// Constructor properties interface
interface ConstructorProps
extends ToolItem.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
draw: boolean | any;
}
}
class SeparatorToolItem extends ToolItem implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<SeparatorToolItem>;
// Properties
// This accessor conflicts with a property or field in a parent class or interface.
draw: boolean | any;
// Constructors
constructor(properties?: Partial<SeparatorToolItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): SeparatorToolItem;
// Methods
/**
* Returns whether `item` is drawn as a line, or just blank.
* See gtk_separator_tool_item_set_draw().
* @returns %TRUE if @item is drawn as a line, or just blank.
*/
get_draw(): boolean;
/**
* Whether `item` is drawn as a vertical line, or just blank.
* Setting this to %FALSE along with gtk_tool_item_set_expand() is useful
* to create an item that forces following items to the end of the toolbar.
* @param draw whether @item is drawn as a vertical line
*/
set_draw(draw: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Settings {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
color_hash: GLib.HashTable<any, any>;
colorHash: GLib.HashTable<any, any>;
gtk_alternative_button_order: boolean;
gtkAlternativeButtonOrder: boolean;
gtk_alternative_sort_arrows: boolean;
gtkAlternativeSortArrows: boolean;
gtk_auto_mnemonics: boolean;
gtkAutoMnemonics: boolean;
gtk_button_images: boolean;
gtkButtonImages: boolean;
gtk_can_change_accels: boolean;
gtkCanChangeAccels: boolean;
gtk_color_palette: string;
gtkColorPalette: string;
gtk_color_scheme: string;
gtkColorScheme: string;
gtk_cursor_blink: boolean;
gtkCursorBlink: boolean;
gtk_cursor_blink_time: number;
gtkCursorBlinkTime: number;
gtk_cursor_blink_timeout: number;
gtkCursorBlinkTimeout: number;
gtk_cursor_theme_name: string;
gtkCursorThemeName: string;
gtk_cursor_theme_size: number;
gtkCursorThemeSize: number;
gtk_dnd_drag_threshold: number;
gtkDndDragThreshold: number;
gtk_double_click_distance: number;
gtkDoubleClickDistance: number;
gtk_double_click_time: number;
gtkDoubleClickTime: number;
gtk_enable_accels: boolean;
gtkEnableAccels: boolean;
gtk_enable_animations: boolean;
gtkEnableAnimations: boolean;
gtk_enable_event_sounds: boolean;
gtkEnableEventSounds: boolean;
gtk_enable_input_feedback_sounds: boolean;
gtkEnableInputFeedbackSounds: boolean;
gtk_enable_mnemonics: boolean;
gtkEnableMnemonics: boolean;
gtk_enable_tooltips: boolean;
gtkEnableTooltips: boolean;
gtk_entry_password_hint_timeout: number;
gtkEntryPasswordHintTimeout: number;
gtk_entry_select_on_focus: boolean;
gtkEntrySelectOnFocus: boolean;
gtk_error_bell: boolean;
gtkErrorBell: boolean;
gtk_fallback_icon_theme: string;
gtkFallbackIconTheme: string;
gtk_file_chooser_backend: string;
gtkFileChooserBackend: string;
gtk_font_name: string;
gtkFontName: string;
gtk_fontconfig_timestamp: number;
gtkFontconfigTimestamp: number;
gtk_icon_sizes: string;
gtkIconSizes: string;
gtk_icon_theme_name: string;
gtkIconThemeName: string;
gtk_im_module: string;
gtkImModule: string;
gtk_im_preedit_style: IMPreeditStyle;
gtkImPreeditStyle: IMPreeditStyle;
gtk_im_status_style: IMStatusStyle;
gtkImStatusStyle: IMStatusStyle;
gtk_key_theme_name: string;
gtkKeyThemeName: string;
gtk_keynav_cursor_only: boolean;
gtkKeynavCursorOnly: boolean;
gtk_keynav_wrap_around: boolean;
gtkKeynavWrapAround: boolean;
gtk_label_select_on_focus: boolean;
gtkLabelSelectOnFocus: boolean;
gtk_menu_bar_accel: string;
gtkMenuBarAccel: string;
gtk_menu_bar_popup_delay: number;
gtkMenuBarPopupDelay: number;
gtk_menu_images: boolean;
gtkMenuImages: boolean;
gtk_menu_popdown_delay: number;
gtkMenuPopdownDelay: number;
gtk_menu_popup_delay: number;
gtkMenuPopupDelay: number;
gtk_modules: string;
gtkModules: string;
gtk_primary_button_warps_slider: boolean;
gtkPrimaryButtonWarpsSlider: boolean;
gtk_print_backends: string;
gtkPrintBackends: string;
gtk_print_preview_command: string;
gtkPrintPreviewCommand: string;
gtk_recent_files_limit: number;
gtkRecentFilesLimit: number;
gtk_recent_files_max_age: number;
gtkRecentFilesMaxAge: number;
gtk_scrolled_window_placement: CornerType;
gtkScrolledWindowPlacement: CornerType;
gtk_show_input_method_menu: boolean;
gtkShowInputMethodMenu: boolean;
gtk_show_unicode_menu: boolean;
gtkShowUnicodeMenu: boolean;
gtk_sound_theme_name: string;
gtkSoundThemeName: string;
gtk_split_cursor: boolean;
gtkSplitCursor: boolean;
gtk_theme_name: string;
gtkThemeName: string;
gtk_timeout_expand: number;
gtkTimeoutExpand: number;
gtk_timeout_initial: number;
gtkTimeoutInitial: number;
gtk_timeout_repeat: number;
gtkTimeoutRepeat: number;
gtk_toolbar_icon_size: IconSize;
gtkToolbarIconSize: IconSize;
gtk_toolbar_style: ToolbarStyle;
gtkToolbarStyle: ToolbarStyle;
gtk_tooltip_browse_mode_timeout: number;
gtkTooltipBrowseModeTimeout: number;
gtk_tooltip_browse_timeout: number;
gtkTooltipBrowseTimeout: number;
gtk_tooltip_timeout: number;
gtkTooltipTimeout: number;
gtk_touchscreen_mode: boolean;
gtkTouchscreenMode: boolean;
gtk_xft_antialias: number;
gtkXftAntialias: number;
gtk_xft_dpi: number;
gtkXftDpi: number;
gtk_xft_hinting: number;
gtkXftHinting: number;
gtk_xft_hintstyle: string;
gtkXftHintstyle: string;
gtk_xft_rgba: string;
gtkXftRgba: string;
}
}
class Settings extends GObject.Object {
static $gtype: GObject.GType<Settings>;
// Properties
/**
* Holds a hash table representation of the #GtkSettings:gtk-color-scheme
* setting, mapping color names to #GdkColor<!-- -->s.
*/
get color_hash(): GLib.HashTable<any, any>;
/**
* Holds a hash table representation of the #GtkSettings:gtk-color-scheme
* setting, mapping color names to #GdkColor<!-- -->s.
*/
get colorHash(): GLib.HashTable<any, any>;
get gtk_alternative_button_order(): boolean;
set gtk_alternative_button_order(val: boolean);
get gtkAlternativeButtonOrder(): boolean;
set gtkAlternativeButtonOrder(val: boolean);
/**
* Controls the direction of the sort indicators in sorted list and tree
* views. By default an arrow pointing down means the column is sorted
* in ascending order. When set to %TRUE, this order will be inverted.
*/
get gtk_alternative_sort_arrows(): boolean;
set gtk_alternative_sort_arrows(val: boolean);
/**
* Controls the direction of the sort indicators in sorted list and tree
* views. By default an arrow pointing down means the column is sorted
* in ascending order. When set to %TRUE, this order will be inverted.
*/
get gtkAlternativeSortArrows(): boolean;
set gtkAlternativeSortArrows(val: boolean);
/**
* Whether mnemonics should be automatically shown and hidden when the user
* presses the mnemonic activator.
*/
get gtk_auto_mnemonics(): boolean;
set gtk_auto_mnemonics(val: boolean);
/**
* Whether mnemonics should be automatically shown and hidden when the user
* presses the mnemonic activator.
*/
get gtkAutoMnemonics(): boolean;
set gtkAutoMnemonics(val: boolean);
get gtk_button_images(): boolean;
set gtk_button_images(val: boolean);
get gtkButtonImages(): boolean;
set gtkButtonImages(val: boolean);
get gtk_can_change_accels(): boolean;
set gtk_can_change_accels(val: boolean);
get gtkCanChangeAccels(): boolean;
set gtkCanChangeAccels(val: boolean);
get gtk_color_palette(): string;
set gtk_color_palette(val: string);
get gtkColorPalette(): string;
set gtkColorPalette(val: string);
/**
* A palette of named colors for use in themes. The format of the string is
* <programlisting>
* name1: color1
* name2: color2
* ...
* </programlisting>
* Color names must be acceptable as identifiers in the
* <link linkend="gtk-Resource-Files">gtkrc</link> syntax, and
* color specifications must be in the format accepted by
* gdk_color_parse().
*
* Note that due to the way the color tables from different sources are
* merged, color specifications will be converted to hexadecimal form
* when getting this property.
*
* Starting with GTK+ 2.12, the entries can alternatively be separated
* by ';' instead of newlines:
* <programlisting>
* name1: color1; name2: color2; ...
* </programlisting>
*/
get gtk_color_scheme(): string;
set gtk_color_scheme(val: string);
/**
* A palette of named colors for use in themes. The format of the string is
* <programlisting>
* name1: color1
* name2: color2
* ...
* </programlisting>
* Color names must be acceptable as identifiers in the
* <link linkend="gtk-Resource-Files">gtkrc</link> syntax, and
* color specifications must be in the format accepted by
* gdk_color_parse().
*
* Note that due to the way the color tables from different sources are
* merged, color specifications will be converted to hexadecimal form
* when getting this property.
*
* Starting with GTK+ 2.12, the entries can alternatively be separated
* by ';' instead of newlines:
* <programlisting>
* name1: color1; name2: color2; ...
* </programlisting>
*/
get gtkColorScheme(): string;
set gtkColorScheme(val: string);
/**
* Whether the cursor should blink.
*
* Also see the #GtkSettings:gtk-cursor-blink-timeout setting,
* which allows more flexible control over cursor blinking.
*/
get gtk_cursor_blink(): boolean;
set gtk_cursor_blink(val: boolean);
/**
* Whether the cursor should blink.
*
* Also see the #GtkSettings:gtk-cursor-blink-timeout setting,
* which allows more flexible control over cursor blinking.
*/
get gtkCursorBlink(): boolean;
set gtkCursorBlink(val: boolean);
get gtk_cursor_blink_time(): number;
set gtk_cursor_blink_time(val: number);
get gtkCursorBlinkTime(): number;
set gtkCursorBlinkTime(val: number);
/**
* Time after which the cursor stops blinking, in seconds.
* The timer is reset after each user interaction.
*
* Setting this to zero has the same effect as setting
* #GtkSettings:gtk-cursor-blink to %FALSE.
*/
get gtk_cursor_blink_timeout(): number;
set gtk_cursor_blink_timeout(val: number);
/**
* Time after which the cursor stops blinking, in seconds.
* The timer is reset after each user interaction.
*
* Setting this to zero has the same effect as setting
* #GtkSettings:gtk-cursor-blink to %FALSE.
*/
get gtkCursorBlinkTimeout(): number;
set gtkCursorBlinkTimeout(val: number);
get gtk_cursor_theme_name(): string;
set gtk_cursor_theme_name(val: string);
get gtkCursorThemeName(): string;
set gtkCursorThemeName(val: string);
get gtk_cursor_theme_size(): number;
set gtk_cursor_theme_size(val: number);
get gtkCursorThemeSize(): number;
set gtkCursorThemeSize(val: number);
get gtk_dnd_drag_threshold(): number;
set gtk_dnd_drag_threshold(val: number);
get gtkDndDragThreshold(): number;
set gtkDndDragThreshold(val: number);
get gtk_double_click_distance(): number;
set gtk_double_click_distance(val: number);
get gtkDoubleClickDistance(): number;
set gtkDoubleClickDistance(val: number);
get gtk_double_click_time(): number;
set gtk_double_click_time(val: number);
get gtkDoubleClickTime(): number;
set gtkDoubleClickTime(val: number);
/**
* Whether menu items should have visible accelerators which can be
* activated.
*/
get gtk_enable_accels(): boolean;
set gtk_enable_accels(val: boolean);
/**
* Whether menu items should have visible accelerators which can be
* activated.
*/
get gtkEnableAccels(): boolean;
set gtkEnableAccels(val: boolean);
get gtk_enable_animations(): boolean;
set gtk_enable_animations(val: boolean);
get gtkEnableAnimations(): boolean;
set gtkEnableAnimations(val: boolean);
/**
* Whether to play any event sounds at all.
*
* See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink>
* for more information on event sounds and sound themes.
*
* GTK+ itself does not support event sounds, you have to use a loadable
* module like the one that comes with libcanberra.
*/
get gtk_enable_event_sounds(): boolean;
set gtk_enable_event_sounds(val: boolean);
/**
* Whether to play any event sounds at all.
*
* See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink>
* for more information on event sounds and sound themes.
*
* GTK+ itself does not support event sounds, you have to use a loadable
* module like the one that comes with libcanberra.
*/
get gtkEnableEventSounds(): boolean;
set gtkEnableEventSounds(val: boolean);
/**
* Whether to play event sounds as feedback to user input.
*
* See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink>
* for more information on event sounds and sound themes.
*
* GTK+ itself does not support event sounds, you have to use a loadable
* module like the one that comes with libcanberra.
*/
get gtk_enable_input_feedback_sounds(): boolean;
set gtk_enable_input_feedback_sounds(val: boolean);
/**
* Whether to play event sounds as feedback to user input.
*
* See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink>
* for more information on event sounds and sound themes.
*
* GTK+ itself does not support event sounds, you have to use a loadable
* module like the one that comes with libcanberra.
*/
get gtkEnableInputFeedbackSounds(): boolean;
set gtkEnableInputFeedbackSounds(val: boolean);
/**
* Whether labels and menu items should have visible mnemonics which
* can be activated.
*/
get gtk_enable_mnemonics(): boolean;
set gtk_enable_mnemonics(val: boolean);
/**
* Whether labels and menu items should have visible mnemonics which
* can be activated.
*/
get gtkEnableMnemonics(): boolean;
set gtkEnableMnemonics(val: boolean);
/**
* Whether tooltips should be shown on widgets.
*/
get gtk_enable_tooltips(): boolean;
set gtk_enable_tooltips(val: boolean);
/**
* Whether tooltips should be shown on widgets.
*/
get gtkEnableTooltips(): boolean;
set gtkEnableTooltips(val: boolean);
/**
* How long to show the last input character in hidden
* entries. This value is in milliseconds. 0 disables showing the
* last char. 600 is a good value for enabling it.
*/
get gtk_entry_password_hint_timeout(): number;
set gtk_entry_password_hint_timeout(val: number);
/**
* How long to show the last input character in hidden
* entries. This value is in milliseconds. 0 disables showing the
* last char. 600 is a good value for enabling it.
*/
get gtkEntryPasswordHintTimeout(): number;
set gtkEntryPasswordHintTimeout(val: number);
get gtk_entry_select_on_focus(): boolean;
set gtk_entry_select_on_focus(val: boolean);
get gtkEntrySelectOnFocus(): boolean;
set gtkEntrySelectOnFocus(val: boolean);
/**
* When %TRUE, keyboard navigation and other input-related errors
* will cause a beep. Since the error bell is implemented using
* gdk_window_beep(), the windowing system may offer ways to
* configure the error bell in many ways, such as flashing the
* window or similar visual effects.
*/
get gtk_error_bell(): boolean;
set gtk_error_bell(val: boolean);
/**
* When %TRUE, keyboard navigation and other input-related errors
* will cause a beep. Since the error bell is implemented using
* gdk_window_beep(), the windowing system may offer ways to
* configure the error bell in many ways, such as flashing the
* window or similar visual effects.
*/
get gtkErrorBell(): boolean;
set gtkErrorBell(val: boolean);
get gtk_fallback_icon_theme(): string;
set gtk_fallback_icon_theme(val: string);
get gtkFallbackIconTheme(): string;
set gtkFallbackIconTheme(val: string);
get gtk_file_chooser_backend(): string;
set gtk_file_chooser_backend(val: string);
get gtkFileChooserBackend(): string;
set gtkFileChooserBackend(val: string);
get gtk_font_name(): string;
set gtk_font_name(val: string);
get gtkFontName(): string;
set gtkFontName(val: string);
get gtk_fontconfig_timestamp(): number;
set gtk_fontconfig_timestamp(val: number);
get gtkFontconfigTimestamp(): number;
set gtkFontconfigTimestamp(val: number);
/**
* A list of icon sizes. The list is separated by colons, and
* item has the form:
*
* <replaceable>size-name</replaceable> = <replaceable>width</replaceable> , <replaceable>height</replaceable>
*
* E.g. "gtk-menu=16,16:gtk-button=20,20:gtk-dialog=48,48".
* GTK+ itself use the following named icon sizes: gtk-menu,
* gtk-button, gtk-small-toolbar, gtk-large-toolbar, gtk-dnd,
* gtk-dialog. Applications can register their own named icon
* sizes with gtk_icon_size_register().
*/
get gtk_icon_sizes(): string;
set gtk_icon_sizes(val: string);
/**
* A list of icon sizes. The list is separated by colons, and
* item has the form:
*
* <replaceable>size-name</replaceable> = <replaceable>width</replaceable> , <replaceable>height</replaceable>
*
* E.g. "gtk-menu=16,16:gtk-button=20,20:gtk-dialog=48,48".
* GTK+ itself use the following named icon sizes: gtk-menu,
* gtk-button, gtk-small-toolbar, gtk-large-toolbar, gtk-dnd,
* gtk-dialog. Applications can register their own named icon
* sizes with gtk_icon_size_register().
*/
get gtkIconSizes(): string;
set gtkIconSizes(val: string);
get gtk_icon_theme_name(): string;
set gtk_icon_theme_name(val: string);
get gtkIconThemeName(): string;
set gtkIconThemeName(val: string);
/**
* Which IM (input method) module should be used by default. This is the
* input method that will be used if the user has not explicitly chosen
* another input method from the IM context menu.
* This also can be a colon-separated list of input methods, which GTK+
* will try in turn until it finds one available on the system.
*
* See #GtkIMContext and see the #GtkSettings:gtk-show-input-method-menu property.
*/
get gtk_im_module(): string;
set gtk_im_module(val: string);
/**
* Which IM (input method) module should be used by default. This is the
* input method that will be used if the user has not explicitly chosen
* another input method from the IM context menu.
* This also can be a colon-separated list of input methods, which GTK+
* will try in turn until it finds one available on the system.
*
* See #GtkIMContext and see the #GtkSettings:gtk-show-input-method-menu property.
*/
get gtkImModule(): string;
set gtkImModule(val: string);
get gtk_im_preedit_style(): IMPreeditStyle;
set gtk_im_preedit_style(val: IMPreeditStyle);
get gtkImPreeditStyle(): IMPreeditStyle;
set gtkImPreeditStyle(val: IMPreeditStyle);
get gtk_im_status_style(): IMStatusStyle;
set gtk_im_status_style(val: IMStatusStyle);
get gtkImStatusStyle(): IMStatusStyle;
set gtkImStatusStyle(val: IMStatusStyle);
get gtk_key_theme_name(): string;
set gtk_key_theme_name(val: string);
get gtkKeyThemeName(): string;
set gtkKeyThemeName(val: string);
/**
* When %TRUE, keyboard navigation should be able to reach all widgets
* by using the cursor keys only. Tab, Shift etc. keys can't be expected
* to be present on the used input device.
*/
get gtk_keynav_cursor_only(): boolean;
set gtk_keynav_cursor_only(val: boolean);
/**
* When %TRUE, keyboard navigation should be able to reach all widgets
* by using the cursor keys only. Tab, Shift etc. keys can't be expected
* to be present on the used input device.
*/
get gtkKeynavCursorOnly(): boolean;
set gtkKeynavCursorOnly(val: boolean);
/**
* When %TRUE, some widgets will wrap around when doing keyboard
* navigation, such as menus, menubars and notebooks.
*/
get gtk_keynav_wrap_around(): boolean;
set gtk_keynav_wrap_around(val: boolean);
/**
* When %TRUE, some widgets will wrap around when doing keyboard
* navigation, such as menus, menubars and notebooks.
*/
get gtkKeynavWrapAround(): boolean;
set gtkKeynavWrapAround(val: boolean);
get gtk_label_select_on_focus(): boolean;
set gtk_label_select_on_focus(val: boolean);
get gtkLabelSelectOnFocus(): boolean;
set gtkLabelSelectOnFocus(val: boolean);
get gtk_menu_bar_accel(): string;
set gtk_menu_bar_accel(val: string);
get gtkMenuBarAccel(): string;
set gtkMenuBarAccel(val: string);
get gtk_menu_bar_popup_delay(): number;
set gtk_menu_bar_popup_delay(val: number);
get gtkMenuBarPopupDelay(): number;
set gtkMenuBarPopupDelay(val: number);
get gtk_menu_images(): boolean;
set gtk_menu_images(val: boolean);
get gtkMenuImages(): boolean;
set gtkMenuImages(val: boolean);
get gtk_menu_popdown_delay(): number;
set gtk_menu_popdown_delay(val: number);
get gtkMenuPopdownDelay(): number;
set gtkMenuPopdownDelay(val: number);
get gtk_menu_popup_delay(): number;
set gtk_menu_popup_delay(val: number);
get gtkMenuPopupDelay(): number;
set gtkMenuPopupDelay(val: number);
get gtk_modules(): string;
set gtk_modules(val: string);
get gtkModules(): string;
set gtkModules(val: string);
/**
* Whether a click in a #GtkRange trough should scroll to the click position or
* scroll by a single page in the respective direction.
*/
get gtk_primary_button_warps_slider(): boolean;
set gtk_primary_button_warps_slider(val: boolean);
/**
* Whether a click in a #GtkRange trough should scroll to the click position or
* scroll by a single page in the respective direction.
*/
get gtkPrimaryButtonWarpsSlider(): boolean;
set gtkPrimaryButtonWarpsSlider(val: boolean);
/**
* A comma-separated list of print backends to use in the print
* dialog. Available print backends depend on the GTK+ installation,
* and may include "file", "cups", "lpr" or "papi".
*/
get gtk_print_backends(): string;
set gtk_print_backends(val: string);
/**
* A comma-separated list of print backends to use in the print
* dialog. Available print backends depend on the GTK+ installation,
* and may include "file", "cups", "lpr" or "papi".
*/
get gtkPrintBackends(): string;
set gtkPrintBackends(val: string);
/**
* A command to run for displaying the print preview. The command
* should contain a %f placeholder, which will get replaced by
* the path to the pdf file. The command may also contain a %s
* placeholder, which will get replaced by the path to a file
* containing the print settings in the format produced by
* gtk_print_settings_to_file().
*
* The preview application is responsible for removing the pdf file
* and the print settings file when it is done.
*/
get gtk_print_preview_command(): string;
set gtk_print_preview_command(val: string);
/**
* A command to run for displaying the print preview. The command
* should contain a %f placeholder, which will get replaced by
* the path to the pdf file. The command may also contain a %s
* placeholder, which will get replaced by the path to a file
* containing the print settings in the format produced by
* gtk_print_settings_to_file().
*
* The preview application is responsible for removing the pdf file
* and the print settings file when it is done.
*/
get gtkPrintPreviewCommand(): string;
set gtkPrintPreviewCommand(val: string);
/**
* The number of recently used files that should be displayed by default by
* #GtkRecentChooser implementations and by the #GtkFileChooser. A value of
* -1 means every recently used file stored.
*/
get gtk_recent_files_limit(): number;
set gtk_recent_files_limit(val: number);
/**
* The number of recently used files that should be displayed by default by
* #GtkRecentChooser implementations and by the #GtkFileChooser. A value of
* -1 means every recently used file stored.
*/
get gtkRecentFilesLimit(): number;
set gtkRecentFilesLimit(val: number);
/**
* The maximum age, in days, of the items inside the recently used
* resources list. Items older than this setting will be excised
* from the list. If set to 0, the list will always be empty; if
* set to -1, no item will be removed.
*/
get gtk_recent_files_max_age(): number;
set gtk_recent_files_max_age(val: number);
/**
* The maximum age, in days, of the items inside the recently used
* resources list. Items older than this setting will be excised
* from the list. If set to 0, the list will always be empty; if
* set to -1, no item will be removed.
*/
get gtkRecentFilesMaxAge(): number;
set gtkRecentFilesMaxAge(val: number);
/**
* Where the contents of scrolled windows are located with respect to the
* scrollbars, if not overridden by the scrolled window's own placement.
*/
get gtk_scrolled_window_placement(): CornerType;
set gtk_scrolled_window_placement(val: CornerType);
/**
* Where the contents of scrolled windows are located with respect to the
* scrollbars, if not overridden by the scrolled window's own placement.
*/
get gtkScrolledWindowPlacement(): CornerType;
set gtkScrolledWindowPlacement(val: CornerType);
get gtk_show_input_method_menu(): boolean;
set gtk_show_input_method_menu(val: boolean);
get gtkShowInputMethodMenu(): boolean;
set gtkShowInputMethodMenu(val: boolean);
get gtk_show_unicode_menu(): boolean;
set gtk_show_unicode_menu(val: boolean);
get gtkShowUnicodeMenu(): boolean;
set gtkShowUnicodeMenu(val: boolean);
/**
* The XDG sound theme to use for event sounds.
*
* See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink>
* for more information on event sounds and sound themes.
*
* GTK+ itself does not support event sounds, you have to use a loadable
* module like the one that comes with libcanberra.
*/
get gtk_sound_theme_name(): string;
set gtk_sound_theme_name(val: string);
/**
* The XDG sound theme to use for event sounds.
*
* See the <ulink url="http://www.freedesktop.org/wiki/Specifications/sound-theme-spec">Sound Theme spec</ulink>
* for more information on event sounds and sound themes.
*
* GTK+ itself does not support event sounds, you have to use a loadable
* module like the one that comes with libcanberra.
*/
get gtkSoundThemeName(): string;
set gtkSoundThemeName(val: string);
get gtk_split_cursor(): boolean;
set gtk_split_cursor(val: boolean);
get gtkSplitCursor(): boolean;
set gtkSplitCursor(val: boolean);
get gtk_theme_name(): string;
set gtk_theme_name(val: string);
get gtkThemeName(): string;
set gtkThemeName(val: string);
get gtk_timeout_expand(): number;
set gtk_timeout_expand(val: number);
get gtkTimeoutExpand(): number;
set gtkTimeoutExpand(val: number);
get gtk_timeout_initial(): number;
set gtk_timeout_initial(val: number);
get gtkTimeoutInitial(): number;
set gtkTimeoutInitial(val: number);
get gtk_timeout_repeat(): number;
set gtk_timeout_repeat(val: number);
get gtkTimeoutRepeat(): number;
set gtkTimeoutRepeat(val: number);
get gtk_toolbar_icon_size(): IconSize;
set gtk_toolbar_icon_size(val: IconSize);
get gtkToolbarIconSize(): IconSize;
set gtkToolbarIconSize(val: IconSize);
get gtk_toolbar_style(): ToolbarStyle;
set gtk_toolbar_style(val: ToolbarStyle);
get gtkToolbarStyle(): ToolbarStyle;
set gtkToolbarStyle(val: ToolbarStyle);
/**
* Amount of time, in milliseconds, after which the browse mode
* will be disabled.
*
* See #GtkSettings:gtk-tooltip-browse-timeout for more information
* about browse mode.
*/
get gtk_tooltip_browse_mode_timeout(): number;
set gtk_tooltip_browse_mode_timeout(val: number);
/**
* Amount of time, in milliseconds, after which the browse mode
* will be disabled.
*
* See #GtkSettings:gtk-tooltip-browse-timeout for more information
* about browse mode.
*/
get gtkTooltipBrowseModeTimeout(): number;
set gtkTooltipBrowseModeTimeout(val: number);
/**
* Controls the time after which tooltips will appear when
* browse mode is enabled, in milliseconds.
*
* Browse mode is enabled when the mouse pointer moves off an object
* where a tooltip was currently being displayed. If the mouse pointer
* hits another object before the browse mode timeout expires (see
* #GtkSettings:gtk-tooltip-browse-mode-timeout), it will take the
* amount of milliseconds specified by this setting to popup the tooltip
* for the new object.
*/
get gtk_tooltip_browse_timeout(): number;
set gtk_tooltip_browse_timeout(val: number);
/**
* Controls the time after which tooltips will appear when
* browse mode is enabled, in milliseconds.
*
* Browse mode is enabled when the mouse pointer moves off an object
* where a tooltip was currently being displayed. If the mouse pointer
* hits another object before the browse mode timeout expires (see
* #GtkSettings:gtk-tooltip-browse-mode-timeout), it will take the
* amount of milliseconds specified by this setting to popup the tooltip
* for the new object.
*/
get gtkTooltipBrowseTimeout(): number;
set gtkTooltipBrowseTimeout(val: number);
/**
* Time, in milliseconds, after which a tooltip could appear if the
* cursor is hovering on top of a widget.
*/
get gtk_tooltip_timeout(): number;
set gtk_tooltip_timeout(val: number);
/**
* Time, in milliseconds, after which a tooltip could appear if the
* cursor is hovering on top of a widget.
*/
get gtkTooltipTimeout(): number;
set gtkTooltipTimeout(val: number);
/**
* When %TRUE, there are no motion notify events delivered on this screen,
* and widgets can't use the pointer hovering them for any essential
* functionality.
*/
get gtk_touchscreen_mode(): boolean;
set gtk_touchscreen_mode(val: boolean);
/**
* When %TRUE, there are no motion notify events delivered on this screen,
* and widgets can't use the pointer hovering them for any essential
* functionality.
*/
get gtkTouchscreenMode(): boolean;
set gtkTouchscreenMode(val: boolean);
get gtk_xft_antialias(): number;
set gtk_xft_antialias(val: number);
get gtkXftAntialias(): number;
set gtkXftAntialias(val: number);
get gtk_xft_dpi(): number;
set gtk_xft_dpi(val: number);
get gtkXftDpi(): number;
set gtkXftDpi(val: number);
get gtk_xft_hinting(): number;
set gtk_xft_hinting(val: number);
get gtkXftHinting(): number;
set gtkXftHinting(val: number);
get gtk_xft_hintstyle(): string;
set gtk_xft_hintstyle(val: string);
get gtkXftHintstyle(): string;
set gtkXftHintstyle(val: string);
get gtk_xft_rgba(): string;
set gtk_xft_rgba(val: string);
get gtkXftRgba(): string;
set gtkXftRgba(val: string);
// Fields
screen: Gdk.Screen;
// Constructors
constructor(properties?: Partial<Settings.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Gets the #GtkSettings object for the default GDK screen, creating
* it if necessary. See gtk_settings_get_for_screen().
*/
static get_default(): Settings;
/**
* Gets the #GtkSettings object for `screen,` creating it if necessary.
* @param screen a #GdkScreen.
*/
static get_for_screen(screen: Gdk.Screen): Settings;
static install_property(pspec: GObject.ParamSpec): void;
// Conflicted with GObject.Object.install_property
static install_property(...args: never[]): any;
// Methods
set_double_property(name: string, v_double: number, origin: string): void;
set_long_property(name: string, v_long: number, origin: string): void;
set_property_value(name: string, svalue: SettingsValue): void;
set_string_property(name: string, v_string: string, origin: string): void;
}
namespace SizeGroup {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps {
ignore_hidden: boolean;
ignoreHidden: boolean;
mode: SizeGroupMode;
}
}
class SizeGroup extends GObject.Object implements Buildable {
static $gtype: GObject.GType<SizeGroup>;
// Properties
/**
* If %TRUE, unmapped widgets are ignored when determining
* the size of the group.
*/
get ignore_hidden(): boolean;
set ignore_hidden(val: boolean);
/**
* If %TRUE, unmapped widgets are ignored when determining
* the size of the group.
*/
get ignoreHidden(): boolean;
set ignoreHidden(val: boolean);
get mode(): SizeGroupMode;
set mode(val: SizeGroupMode);
// Constructors
constructor(properties?: Partial<SizeGroup.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](mode: SizeGroupMode): SizeGroup;
// Methods
/**
* Adds a widget to a #GtkSizeGroup. In the future, the requisition
* of the widget will be determined as the maximum of its requisition
* and the requisition of the other widgets in the size group.
* Whether this applies horizontally, vertically, or in both directions
* depends on the mode of the size group. See gtk_size_group_set_mode().
*
* When the widget is destroyed or no longer referenced elsewhere, it will
* be removed from the size group.
* @param widget the #GtkWidget to add
*/
add_widget(widget: Widget): void;
/**
* Returns if invisible widgets are ignored when calculating the size.
* @returns %TRUE if invisible widgets are ignored.
*/
get_ignore_hidden(): boolean;
/**
* Gets the current mode of the size group. See gtk_size_group_set_mode().
* @returns the current mode of the size group.
*/
get_mode(): SizeGroupMode;
/**
* Returns the list of widgets associated with `size_group`.
* @returns a #GSList of widgets. The list is owned by GTK+ and should not be modified.
*/
get_widgets(): Widget[];
/**
* Removes a widget from a #GtkSizeGroup.
* @param widget the #GtkWidget to remove
*/
remove_widget(widget: Widget): void;
/**
* Sets whether unmapped widgets should be ignored when
* calculating the size.
* @param ignore_hidden whether unmapped widgets should be ignored when calculating the size
*/
set_ignore_hidden(ignore_hidden: boolean): void;
/**
* Sets the #GtkSizeGroupMode of the size group. The mode of the size
* group determines whether the widgets in the size group should
* all have the same horizontal requisition (%GTK_SIZE_GROUP_MODE_HORIZONTAL)
* all have the same vertical requisition (%GTK_SIZE_GROUP_MODE_VERTICAL),
* or should all have the same requisition in both directions
* (%GTK_SIZE_GROUP_MODE_BOTH).
* @param mode the mode to set for the size group.
*/
set_mode(mode: SizeGroupMode | null): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Socket {
// Signal callback interfaces
interface PlugAdded {
(): void;
}
interface PlugRemoved {
(): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {}
}
/**
* Together with #GtkPlug, #GtkSocket provides the ability
* to embed widgets from one process into another process
* in a fashion that is transparent to the user. One
* process creates a #GtkSocket widget and passes
* that widget's window ID to the other process,
* which then creates a #GtkPlug with that window ID.
* Any widgets contained in the #GtkPlug then will appear
* inside the first application's window.
*
* The socket's window ID is obtained by using
* gtk_socket_get_id(). Before using this function,
* the socket must have been realized, and for hence,
* have been added to its parent.
*
* <example>
* <title>Obtaining the window ID of a socket.</title>
* <programlisting>
* GtkWidget *socket = gtk_socket_new (<!-- -->);
* gtk_widget_show (socket);
* gtk_container_add (GTK_CONTAINER (parent), socket);
*
* /<!---->* The following call is only necessary if one of
* * the ancestors of the socket is not yet visible.
* *<!---->/
* gtk_widget_realize (socket);
* g_print ("The ID of the sockets window is %#x\n",
* gtk_socket_get_id (socket));
* </programlisting>
* </example>
*
* Note that if you pass the window ID of the socket to another
* process that will create a plug in the socket, you
* must make sure that the socket widget is not destroyed
* until that plug is created. Violating this rule will
* cause unpredictable consequences, the most likely
* consequence being that the plug will appear as a
* separate toplevel window. You can check if the plug
* has been created by using gtk_socket_get_plug_window(). If
* it returns a non-%NULL value, then the plug has been
* successfully created inside of the socket.
*
* When GTK+ is notified that the embedded window has been
* destroyed, then it will destroy the socket as well. You
* should always, therefore, be prepared for your sockets
* to be destroyed at any time when the main event loop
* is running. To prevent this from happening, you can
* connect to the #GtkSocket::plug-removed signal.
*
* The communication between a #GtkSocket and a #GtkPlug follows the
* <ulink url="http://www.freedesktop.org/Standards/xembed-spec">XEmbed</ulink>
* protocol. This protocol has also been implemented in other toolkits, e.g.
* <application>Qt</application>, allowing the same level of integration
* when embedding a <application>Qt</application> widget in GTK or vice versa.
*
* A socket can also be used to swallow arbitrary
* pre-existing top-level windows using gtk_socket_steal(),
* though the integration when this is done will not be as close
* as between a #GtkPlug and a #GtkSocket.
*
* <note>
* The #GtkPlug and #GtkSocket widgets are currently not available
* on all platforms supported by GTK+.
* </note>
*/
class Socket extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Socket>;
// Fields
container: Container;
request_width: number;
request_height: number;
current_width: number;
current_height: number;
plug_window: Gdk.Window;
plug_widget: Widget;
xembed_version: number;
same_app: number;
focus_in: number;
have_size: number;
need_map: number;
is_mapped: number;
active: number;
accel_group: AccelGroup;
toplevel: Widget;
// Constructors
constructor(properties?: Partial<Socket.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Socket;
// 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: 'plug-added', callback: (_source: this) => void): number;
connect_after(signal: 'plug-added', callback: (_source: this) => void): number;
emit(signal: 'plug-added'): void;
connect(signal: 'plug-removed', callback: (_source: this) => boolean): number;
connect_after(signal: 'plug-removed', callback: (_source: this) => boolean): number;
emit(signal: 'plug-removed'): void;
// Virtual methods
vfunc_plug_added(): void;
vfunc_plug_removed(): boolean;
// Methods
/**
* Adds an XEMBED client, such as a #GtkPlug, to the #GtkSocket. The
* client may be in the same process or in a different process.
*
* To embed a #GtkPlug in a #GtkSocket, you can either create the
* #GtkPlug with <literal>gtk_plug_new (0)</literal>, call
* gtk_plug_get_id() to get the window ID of the plug, and then pass that to the
* gtk_socket_add_id(), or you can call gtk_socket_get_id() to get the
* window ID for the socket, and call gtk_plug_new() passing in that
* ID.
*
* The #GtkSocket must have already be added into a toplevel window
* before you can make this call.
* @param window_id the window ID of a client participating in the XEMBED protocol.
*/
add_id(window_id: Gdk.NativeWindow): void;
/**
* Gets the window ID of a #GtkSocket widget, which can then
* be used to create a client embedded inside the socket, for
* instance with gtk_plug_new().
*
* The #GtkSocket must have already be added into a toplevel window
* before you can make this call.
* @returns the window ID for the socket
*/
get_id(): Gdk.NativeWindow;
/**
* Retrieves the window of the plug. Use this to check if the plug has
* been created inside of the socket.
* @returns the window of the plug if available, or %NULL
*/
get_plug_window(): Gdk.Window;
/**
* Reparents a pre-existing toplevel window into a #GtkSocket. This is
* meant to embed clients that do not know about embedding into a
* #GtkSocket, however doing so is inherently unreliable, and using
* this function is not recommended.
*
* The #GtkSocket must have already be added into a toplevel window
* before you can make this call.
* @param wid the window ID of an existing toplevel window.
*/
steal(wid: Gdk.NativeWindow): 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 SpinButton {
// Signal callback interfaces
interface ChangeValue {
(object: ScrollType): void;
}
interface Input {
(object?: any | null): number;
}
interface Output {
(): boolean;
}
interface ValueChanged {
(): void;
}
interface Wrapped {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Entry.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
CellEditable.ConstructorProps,
Editable.ConstructorProps {
adjustment: Adjustment;
climb_rate: number;
climbRate: number;
digits: number;
numeric: boolean;
snap_to_ticks: boolean;
snapToTicks: boolean;
update_policy: SpinButtonUpdatePolicy;
updatePolicy: SpinButtonUpdatePolicy;
value: number;
wrap: boolean;
}
}
class SpinButton extends Entry implements Atk.ImplementorIface, Buildable, CellEditable, Editable {
static $gtype: GObject.GType<SpinButton>;
// Properties
get adjustment(): Adjustment;
set adjustment(val: Adjustment);
get climb_rate(): number;
set climb_rate(val: number);
get climbRate(): number;
set climbRate(val: number);
get digits(): number;
set digits(val: number);
get numeric(): boolean;
set numeric(val: boolean);
get snap_to_ticks(): boolean;
set snap_to_ticks(val: boolean);
get snapToTicks(): boolean;
set snapToTicks(val: boolean);
get update_policy(): SpinButtonUpdatePolicy;
set update_policy(val: SpinButtonUpdatePolicy);
get updatePolicy(): SpinButtonUpdatePolicy;
set updatePolicy(val: SpinButtonUpdatePolicy);
get value(): number;
set value(val: number);
get wrap(): boolean;
set wrap(val: boolean);
// Fields
entry: Entry;
panel: Gdk.Window;
timer: number;
timer_step: number;
in_child: number;
click_child: number;
button: number;
need_timer: number;
timer_calls: number;
// Constructors
constructor(properties?: Partial<SpinButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](adjustment: Adjustment, climb_rate: number, digits: number): SpinButton;
// Conflicted with Gtk.Entry.new
static ['new'](...args: never[]): any;
static new_with_range(min: number, max: number, step: number): SpinButton;
// 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: 'change-value', callback: (_source: this, object: ScrollType) => void): number;
connect_after(signal: 'change-value', callback: (_source: this, object: ScrollType) => void): number;
emit(signal: 'change-value', object: ScrollType): void;
connect(signal: 'input', callback: (_source: this, object: any | null) => number): number;
connect_after(signal: 'input', callback: (_source: this, object: any | null) => number): number;
emit(signal: 'input', object?: any | null): void;
connect(signal: 'output', callback: (_source: this) => boolean): number;
connect_after(signal: 'output', callback: (_source: this) => boolean): number;
emit(signal: 'output'): void;
connect(signal: 'value-changed', callback: (_source: this) => void): number;
connect_after(signal: 'value-changed', callback: (_source: this) => void): number;
emit(signal: 'value-changed'): void;
connect(signal: 'wrapped', callback: (_source: this) => void): number;
connect_after(signal: 'wrapped', callback: (_source: this) => void): number;
emit(signal: 'wrapped'): void;
// Virtual methods
vfunc_change_value(scroll: ScrollType): void;
vfunc_input(new_value: number): number;
vfunc_output(): number;
vfunc_value_changed(): void;
vfunc_wrapped(): void;
// Methods
/**
* Changes the properties of an existing spin button. The adjustment, climb rate,
* and number of decimal places are all changed accordingly, after this function call.
* @param adjustment a #GtkAdjustment.
* @param climb_rate the new climb rate.
* @param digits the number of decimal places to display in the spin button.
*/
configure(adjustment: Adjustment | null, climb_rate: number, digits: number): void;
/**
* Get the adjustment associated with a #GtkSpinButton
* @returns the #GtkAdjustment of @spin_button
*/
get_adjustment(): Adjustment;
/**
* Fetches the precision of `spin_button`. See gtk_spin_button_set_digits().
* @returns the current precision
*/
get_digits(): number;
/**
* Gets the current step and page the increments used by `spin_button`. See
* gtk_spin_button_set_increments().
*/
get_increments(): [number, number];
/**
* Returns whether non-numeric text can be typed into the spin button.
* See gtk_spin_button_set_numeric().
* @returns %TRUE if only numeric text can be entered
*/
get_numeric(): boolean;
/**
* Gets the range allowed for `spin_button`. See
* gtk_spin_button_set_range().
*/
get_range(): [number, number];
/**
* Returns whether the values are corrected to the nearest step. See
* gtk_spin_button_set_snap_to_ticks().
* @returns %TRUE if values are snapped to the nearest step.
*/
get_snap_to_ticks(): boolean;
/**
* Gets the update behavior of a spin button. See
* gtk_spin_button_set_update_policy().
* @returns the current update policy
*/
get_update_policy(): SpinButtonUpdatePolicy;
/**
* Get the value in the `spin_button`.
* @returns the value of @spin_button
*/
get_value(): number;
/**
* Get the value `spin_button` represented as an integer.
* @returns the value of @spin_button
*/
get_value_as_int(): number;
/**
* Returns whether the spin button's value wraps around to the
* opposite limit when the upper or lower limit of the range is
* exceeded. See gtk_spin_button_set_wrap().
* @returns %TRUE if the spin button wraps around
*/
get_wrap(): boolean;
/**
* Replaces the #GtkAdjustment associated with `spin_button`.
* @param adjustment a #GtkAdjustment to replace the existing adjustment
*/
set_adjustment(adjustment: Adjustment): void;
/**
* Set the precision to be displayed by `spin_button`. Up to 20 digit precision
* is allowed.
* @param digits the number of digits after the decimal point to be displayed for the spin button's value
*/
set_digits(digits: number): void;
/**
* Sets the step and page increments for spin_button. This affects how
* quickly the value changes when the spin button's arrows are activated.
* @param step increment applied for a button 1 press.
* @param page increment applied for a button 2 press.
*/
set_increments(step: number, page: number): void;
/**
* Sets the flag that determines if non-numeric text can be typed into
* the spin button.
* @param numeric flag indicating if only numeric entry is allowed.
*/
set_numeric(numeric: boolean): void;
/**
* Sets the minimum and maximum allowable values for `spin_button`
* @param min minimum allowable value
* @param max maximum allowable value
*/
set_range(min: number, max: number): void;
/**
* Sets the policy as to whether values are corrected to the nearest step
* increment when a spin button is activated after providing an invalid value.
* @param snap_to_ticks a flag indicating if invalid values should be corrected.
*/
set_snap_to_ticks(snap_to_ticks: boolean): void;
/**
* Sets the update behavior of a spin button. This determines whether the
* spin button is always updated or only when a valid value is set.
* @param policy a #GtkSpinButtonUpdatePolicy value
*/
set_update_policy(policy: SpinButtonUpdatePolicy | null): void;
/**
* Set the value of `spin_button`.
* @param value the new value
*/
set_value(value: number): void;
/**
* Sets the flag that determines if a spin button value wraps around to the
* opposite limit when the upper or lower limit of the range is exceeded.
* @param wrap a flag indicating if wrapping behavior is performed.
*/
set_wrap(wrap: boolean): void;
/**
* Increment or decrement a spin button's value in a specified direction
* by a specified amount.
* @param direction a #GtkSpinType indicating the direction to spin.
* @param increment step increment to apply in the specified direction.
*/
spin(direction: SpinType | null, increment: number): void;
/**
* Manually force an update of the spin button.
*/
update(): void;
// Inherited properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
get app_paintable(): boolean;
set app_paintable(val: boolean);
get appPaintable(): boolean;
set appPaintable(val: boolean);
get can_default(): boolean;
set can_default(val: boolean);
get canDefault(): boolean;
set canDefault(val: boolean);
get can_focus(): boolean;
set can_focus(val: boolean);
get canFocus(): boolean;
set canFocus(val: boolean);
get composite_child(): boolean;
get compositeChild(): boolean;
/**
* Whether or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
// This accessor conflicts with a property or field in a parent class or interface.
visible: boolean | any;
get width_request(): number;
set width_request(val: number);
get widthRequest(): number;
set widthRequest(val: number);
/**
* The widget's window if it is realized, %NULL otherwise.
*/
get window(): Gdk.Window;
// Inherited methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
start_editing(event?: Gdk.Event | null): void;
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
/**
* Copies the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
copy_clipboard(): void;
/**
* Removes the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
cut_clipboard(): void;
/**
* Deletes the currently selected text of the editable.
* This call doesn't do anything if there is no selected text.
*/
delete_selection(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
delete_text(start_pos: number, end_pos: number): void;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
* @returns a pointer to the contents of the widget as a string. This string is allocated by the #GtkEditable implementation and should be freed by the caller.
*/
get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves whether `editable` is editable. See
* gtk_editable_set_editable().
* @returns %TRUE if @editable is editable.
*/
get_editable(): boolean;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
* @returns the cursor position
*/
get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
* @returns %TRUE if an area is selected, %FALSE otherwise
*/
get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Pastes the content of the clipboard to the current position of the
* cursor in the editable.
*/
paste_clipboard(): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the
* characters selected are those characters from `start_pos` to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of region
* @param end_pos end of region
*/
select_region(start_pos: number, end_pos: number): void;
/**
* Determines if the user can edit the text in the editable
* widget or not.
* @param is_editable %TRUE if the user is allowed to edit the text in the widget
*/
set_editable(is_editable: boolean): void;
/**
* Sets the cursor position in the editable to the given value.
*
* The cursor is displayed before the character with the given (base 0)
* index in the contents of the editable. The value must be less than or
* equal to the number of characters in the editable. A value of -1
* indicates that the position should be set after the last character
* of the editable. Note that `position` is in characters, not in bytes.
* @param position the position of the cursor
*/
set_position(position: number): void;
/**
* 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace Spinner {
// Constructor properties interface
interface ConstructorProps
extends DrawingArea.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
active: boolean;
}
}
/**
* A GtkSpinner widget displays an icon-size spinning animation.
* It is often used as an alternative to a #GtkProgressBar for
* displaying indefinite activity, instead of actual progress.
*
* To start the animation, use gtk_spinner_start(), to stop it
* use gtk_spinner_stop().
*/
class Spinner extends DrawingArea implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Spinner>;
// Properties
get active(): boolean;
set active(val: boolean);
// Constructors
constructor(properties?: Partial<Spinner.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Spinner;
// Methods
/**
* Starts the animation of the spinner.
*/
start(): void;
/**
* Stops the animation of the spinner.
*/
stop(): 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 StatusIcon {
// Signal callback interfaces
interface Activate {
(): void;
}
interface ButtonPressEvent {
(event: Gdk.Event): boolean;
}
interface ButtonReleaseEvent {
(event: Gdk.Event): boolean;
}
interface PopupMenu {
(button: number, activate_time: number): void;
}
interface QueryTooltip {
(x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip): boolean;
}
interface ScrollEvent {
(event: Gdk.Event): boolean;
}
interface SizeChanged {
(size: number): boolean;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
blinking: boolean;
embedded: boolean;
file: string;
gicon: Gio.Icon;
has_tooltip: boolean;
hasTooltip: boolean;
icon_name: string;
iconName: string;
orientation: Orientation;
pixbuf: GdkPixbuf.Pixbuf;
screen: Gdk.Screen;
size: number;
stock: string;
storage_type: ImageType;
storageType: ImageType;
title: string;
tooltip_markup: string;
tooltipMarkup: string;
tooltip_text: string;
tooltipText: string;
visible: boolean;
}
}
class StatusIcon extends GObject.Object {
static $gtype: GObject.GType<StatusIcon>;
// Properties
/**
* Whether or not the status icon is blinking.
*/
get blinking(): boolean;
set blinking(val: boolean);
/**
* %TRUE if the statusicon is embedded in a notification area.
*/
get embedded(): boolean;
set file(val: string);
/**
* The #GIcon displayed in the #GtkStatusIcon. For themed icons,
* the image will be updated automatically if the theme changes.
*/
get gicon(): Gio.Icon;
set gicon(val: Gio.Icon);
/**
* Enables or disables the emission of #GtkStatusIcon::query-tooltip on
* `status_icon`. A value of %TRUE indicates that `status_icon` can have a
* tooltip, in this case the status icon will be queried using
* #GtkStatusIcon::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 windows of this status icon to include leave-notify
* and motion-notify events. This will not be undone when the property is set
* to %FALSE again.
*
* Whether this property is respected is platform dependent.
* For plain text tooltips, use #GtkStatusIcon:tooltip-text in preference.
*/
get has_tooltip(): boolean;
set has_tooltip(val: boolean);
/**
* Enables or disables the emission of #GtkStatusIcon::query-tooltip on
* `status_icon`. A value of %TRUE indicates that `status_icon` can have a
* tooltip, in this case the status icon will be queried using
* #GtkStatusIcon::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 windows of this status icon to include leave-notify
* and motion-notify events. This will not be undone when the property is set
* to %FALSE again.
*
* Whether this property is respected is platform dependent.
* For plain text tooltips, use #GtkStatusIcon:tooltip-text in preference.
*/
get hasTooltip(): boolean;
set hasTooltip(val: boolean);
get icon_name(): string;
set icon_name(val: string);
get iconName(): string;
set iconName(val: string);
/**
* The orientation of the tray in which the statusicon
* is embedded.
*/
get orientation(): Orientation;
get pixbuf(): GdkPixbuf.Pixbuf;
set pixbuf(val: GdkPixbuf.Pixbuf);
get screen(): Gdk.Screen;
set screen(val: Gdk.Screen);
get size(): number;
get stock(): string;
set stock(val: string);
get storage_type(): ImageType;
get storageType(): ImageType;
/**
* The title of this tray icon. This should be a short, human-readable,
* localized string describing the tray icon. It may be used by tools
* like screen readers to render the tray icon.
*/
get title(): string;
set title(val: string);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup
* language</link>. 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.
* #GtkStatusIcon:has-tooltip will automatically be set to %TRUE and
* the default handler for the #GtkStatusIcon::query-tooltip signal
* will take care of displaying the tooltip.
*
* On some platforms, embedded markup will be ignored.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup
* language</link>. 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.
* #GtkStatusIcon:has-tooltip will automatically be set to %TRUE and
* the default handler for the #GtkStatusIcon::query-tooltip signal
* will take care of displaying the tooltip.
*
* On some platforms, embedded markup will be ignored.
*/
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.
* #GtkStatusIcon:has-tooltip will automatically be set to %TRUE and
* the default handler for the #GtkStatusIcon::query-tooltip signal
* will take care of displaying the tooltip.
*
* Note that some platforms have limitations on the length of tooltips
* that they allow on status icons, e.g. Windows only shows the first
* 64 characters.
*/
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.
* #GtkStatusIcon:has-tooltip will automatically be set to %TRUE and
* the default handler for the #GtkStatusIcon::query-tooltip signal
* will take care of displaying the tooltip.
*
* Note that some platforms have limitations on the length of tooltips
* that they allow on status icons, e.g. Windows only shows the first
* 64 characters.
*/
get tooltipText(): string;
set tooltipText(val: string);
get visible(): boolean;
set visible(val: boolean);
// Constructors
constructor(properties?: Partial<StatusIcon.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): StatusIcon;
static new_from_file(filename: string): StatusIcon;
static new_from_gicon(icon: Gio.Icon): StatusIcon;
static new_from_icon_name(icon_name: string): StatusIcon;
static new_from_pixbuf(pixbuf: GdkPixbuf.Pixbuf): StatusIcon;
static new_from_stock(stock_id: string): StatusIcon;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate', callback: (_source: this) => void): number;
connect_after(signal: 'activate', callback: (_source: this) => void): number;
emit(signal: 'activate'): void;
connect(signal: 'button-press-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(signal: 'button-press-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
emit(signal: 'button-press-event', event: Gdk.Event): void;
connect(signal: 'button-release-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(
signal: 'button-release-event',
callback: (_source: this, event: Gdk.Event) => boolean,
): number;
emit(signal: 'button-release-event', event: Gdk.Event): void;
connect(
signal: 'popup-menu',
callback: (_source: this, button: number, activate_time: number) => void,
): number;
connect_after(
signal: 'popup-menu',
callback: (_source: this, button: number, activate_time: number) => void,
): number;
emit(signal: 'popup-menu', button: number, activate_time: number): void;
connect(
signal: 'query-tooltip',
callback: (_source: this, x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip) => boolean,
): number;
connect_after(
signal: 'query-tooltip',
callback: (_source: this, x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip) => boolean,
): number;
emit(signal: 'query-tooltip', x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip): void;
connect(signal: 'scroll-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(signal: 'scroll-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
emit(signal: 'scroll-event', event: Gdk.Event): void;
connect(signal: 'size-changed', callback: (_source: this, size: number) => boolean): number;
connect_after(signal: 'size-changed', callback: (_source: this, size: number) => boolean): number;
emit(signal: 'size-changed', size: number): void;
// Static methods
/**
* Menu positioning function to use with gtk_menu_popup()
* to position `menu` aligned to the status icon `user_data`.
* @param menu the #GtkMenu
* @param x return location for the x position
* @param y return location for the y position
* @param push_in whether the first menu item should be offset (pushed in) to be aligned with the menu popup position (only useful for GtkOptionMenu).
* @param user_data the status icon to position the menu on
*/
static position_menu(menu: Menu, x: number, y: number, push_in: boolean, user_data?: any | null): void;
// Virtual methods
vfunc_activate(): void;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
vfunc_button_release_event(event: Gdk.EventButton): boolean;
vfunc_popup_menu(button: number, activate_time: number): void;
vfunc_query_tooltip(x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip): boolean;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_size_changed(size: number): boolean;
// Methods
/**
* Returns whether the icon is blinking, see
* gtk_status_icon_set_blinking().
* @returns %TRUE if the icon is blinking
*/
get_blinking(): boolean;
/**
* Obtains information about the location of the status icon
* on screen. This information can be used to e.g. position
* popups like notification bubbles.
*
* See gtk_status_icon_position_menu() for a more convenient
* alternative for positioning menus.
*
* Note that some platforms do not allow GTK+ to provide
* this information, and even on platforms that do allow it,
* the information is not reliable unless the status icon
* is embedded in a notification area, see
* gtk_status_icon_is_embedded().
* @returns %TRUE if the location information has been filled in
*/
get_geometry(): [boolean, Gdk.Screen | null, Gdk.Rectangle | null, Orientation | null];
/**
* Retrieves the #GIcon being displayed by the #GtkStatusIcon.
* The storage type of the status icon must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_GICON (see gtk_status_icon_get_storage_type()).
* The caller of this function does not own a reference to the
* returned #GIcon.
*
* If this function fails, `icon` is left unchanged;
* @returns the displayed icon, or %NULL if the image is empty
*/
get_gicon(): Gio.Icon;
/**
* Returns the current value of the has-tooltip property.
* See #GtkStatusIcon:has-tooltip for more information.
* @returns current value of has-tooltip on @status_icon.
*/
get_has_tooltip(): boolean;
/**
* Gets the name of the icon being displayed by the #GtkStatusIcon.
* The storage type of the status icon must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_ICON_NAME (see gtk_status_icon_get_storage_type()).
* The returned string is owned by the #GtkStatusIcon and should not
* be freed or modified.
* @returns name of the displayed icon, or %NULL if the image is empty.
*/
get_icon_name(): string;
/**
* Gets the #GdkPixbuf being displayed by the #GtkStatusIcon.
* The storage type of the status icon must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_PIXBUF (see gtk_status_icon_get_storage_type()).
* The caller of this function does not own a reference to the
* returned pixbuf.
* @returns the displayed pixbuf, or %NULL if the image is empty.
*/
get_pixbuf(): GdkPixbuf.Pixbuf;
/**
* Returns the #GdkScreen associated with `status_icon`.
* @returns a #GdkScreen.
*/
get_screen(): Gdk.Screen;
/**
* Gets the size in pixels that is available for the image.
* Stock icons and named icons adapt their size automatically
* if the size of the notification area changes. For other
* storage types, the size-changed signal can be used to
* react to size changes.
*
* Note that the returned size is only meaningful while the
* status icon is embedded (see gtk_status_icon_is_embedded()).
* @returns the size that is available for the image
*/
get_size(): number;
/**
* Gets the id of the stock icon being displayed by the #GtkStatusIcon.
* The storage type of the status icon must be %GTK_IMAGE_EMPTY or
* %GTK_IMAGE_STOCK (see gtk_status_icon_get_storage_type()).
* The returned string is owned by the #GtkStatusIcon and should not
* be freed or modified.
* @returns stock id of the displayed stock icon, or %NULL if the image is empty.
*/
get_stock(): string;
/**
* Gets the type of representation being used by the #GtkStatusIcon
* to store image data. If the #GtkStatusIcon has no image data,
* the return value will be %GTK_IMAGE_EMPTY.
* @returns the image representation being used
*/
get_storage_type(): ImageType;
/**
* Gets the title of this tray icon. See gtk_status_icon_set_title().
* @returns the title of the status icon
*/
get_title(): string;
/**
* Gets the contents of the tooltip for `status_icon`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_markup(): string;
/**
* Gets the contents of the tooltip for `status_icon`.
* @returns the tooltip text, or %NULL. You should free the returned string with g_free() when done.
*/
get_tooltip_text(): string;
/**
* Returns whether the status icon is visible or not.
* Note that being visible does not guarantee that
* the user can actually see the icon, see also
* gtk_status_icon_is_embedded().
* @returns %TRUE if the status icon is visible
*/
get_visible(): boolean;
/**
* This function is only useful on the X11/freedesktop.org platform.
* It returns a window ID for the widget in the underlying
* status icon implementation. This is useful for the Galago
* notification service, which can send a window ID in the protocol
* in order for the server to position notification windows
* pointing to a status icon reliably.
*
* This function is not intended for other use cases which are
* more likely to be met by one of the non-X11 specific methods, such
* as gtk_status_icon_position_menu().
* @returns An 32 bit unsigned integer identifier for the underlying X11 Window
*/
get_x11_window_id(): number;
/**
* Returns whether the status icon is embedded in a notification
* area.
* @returns %TRUE if the status icon is embedded in a notification area.
*/
is_embedded(): boolean;
/**
* Makes the status icon start or stop blinking.
* Note that blinking user interface elements may be problematic
* for some users, and thus may be turned off, in which case
* this setting has no effect.
* @param blinking %TRUE to turn blinking on, %FALSE to turn it off
*/
set_blinking(blinking: boolean): void;
/**
* Makes `status_icon` display the file `filename`.
* See gtk_status_icon_new_from_file() for details.
* @param filename a filename
*/
set_from_file(filename: string): void;
/**
* Makes `status_icon` display the #GIcon.
* See gtk_status_icon_new_from_gicon() for details.
* @param icon a GIcon
*/
set_from_gicon(icon: Gio.Icon): void;
/**
* Makes `status_icon` display the icon named `icon_name` from the
* current icon theme.
* See gtk_status_icon_new_from_icon_name() for details.
* @param icon_name an icon name
*/
set_from_icon_name(icon_name: string): void;
/**
* Makes `status_icon` display `pixbuf`.
* See gtk_status_icon_new_from_pixbuf() for details.
* @param pixbuf a #GdkPixbuf or %NULL
*/
set_from_pixbuf(pixbuf?: GdkPixbuf.Pixbuf | null): void;
/**
* Makes `status_icon` display the stock icon with the id `stock_id`.
* See gtk_status_icon_new_from_stock() for details.
* @param stock_id a stock icon id
*/
set_from_stock(stock_id: string): void;
/**
* Sets the has-tooltip property on `status_icon` to `has_tooltip`.
* See #GtkStatusIcon:has-tooltip for more information.
* @param has_tooltip whether or not @status_icon has a tooltip
*/
set_has_tooltip(has_tooltip: boolean): void;
/**
* Sets the name of this tray icon.
* This should be a string identifying this icon. It is may be
* used for sorting the icons in the tray and will not be shown to
* the user.
* @param name the name
*/
set_name(name: string): void;
/**
* Sets the #GdkScreen where `status_icon` is displayed; if
* the icon is already mapped, it will be unmapped, and
* then remapped on the new screen.
* @param screen a #GdkScreen
*/
set_screen(screen: Gdk.Screen): void;
/**
* Sets the title of this tray icon.
* This should be a short, human-readable, localized string
* describing the tray icon. It may be used by tools like screen
* readers to render the tray icon.
* @param title the title
*/
set_title(title: string): void;
/**
* Sets the tooltip of the status icon.
* @param tooltip_text the tooltip text, or %NULL
*/
set_tooltip(tooltip_text?: string | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* This function will take care of setting #GtkStatusIcon:has-tooltip to %TRUE
* and of the default handler for the #GtkStatusIcon::query-tooltip signal.
*
* See also the #GtkStatusIcon:tooltip-markup property and
* gtk_tooltip_set_markup().
* @param markup the contents of the tooltip for @status_icon, or %NULL
*/
set_tooltip_markup(markup?: string | null): void;
/**
* Sets `text` as the contents of the tooltip.
*
* This function will take care of setting #GtkStatusIcon:has-tooltip to
* %TRUE and of the default handler for the #GtkStatusIcon::query-tooltip
* signal.
*
* See also the #GtkStatusIcon:tooltip-text property and
* gtk_tooltip_set_text().
* @param text the contents of the tooltip for @status_icon
*/
set_tooltip_text(text: string): void;
/**
* Shows or hides a status icon.
* @param visible %TRUE to show the status icon, %FALSE to hide it
*/
set_visible(visible: boolean): void;
}
namespace Statusbar {
// Signal callback interfaces
interface TextPopped {
(context_id: number, text: string): void;
}
interface TextPushed {
(context_id: number, text: string): void;
}
// Constructor properties interface
interface ConstructorProps
extends HBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
has_resize_grip: boolean;
hasResizeGrip: boolean;
}
}
class Statusbar extends HBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<Statusbar>;
// Properties
/**
* Whether the statusbar has a grip for resizing the toplevel window.
*/
get has_resize_grip(): boolean;
set has_resize_grip(val: boolean);
/**
* Whether the statusbar has a grip for resizing the toplevel window.
*/
get hasResizeGrip(): boolean;
set hasResizeGrip(val: boolean);
// Fields
parent_widget: HBox;
frame: Widget;
label: Widget;
messages: any[];
keys: any[];
seq_context_id: number;
seq_message_id: number;
grip_window: Gdk.Window;
// Constructors
constructor(properties?: Partial<Statusbar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Statusbar;
// 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: 'text-popped', callback: (_source: this, context_id: number, text: string) => void): number;
connect_after(
signal: 'text-popped',
callback: (_source: this, context_id: number, text: string) => void,
): number;
emit(signal: 'text-popped', context_id: number, text: string): void;
connect(signal: 'text-pushed', callback: (_source: this, context_id: number, text: string) => void): number;
connect_after(
signal: 'text-pushed',
callback: (_source: this, context_id: number, text: string) => void,
): number;
emit(signal: 'text-pushed', context_id: number, text: string): void;
// Virtual methods
vfunc_text_popped(context_id: number, text: string): void;
vfunc_text_pushed(context_id: number, text: string): void;
// Methods
/**
* Returns a new context identifier, given a description
* of the actual context. Note that the description is
* <emphasis>not</emphasis> shown in the UI.
* @param context_description textual description of what context the new message is being used in
* @returns an integer id
*/
get_context_id(context_description: string): number;
/**
* Returns whether the statusbar has a resize grip.
* @returns %TRUE if the statusbar has a resize grip.
*/
get_has_resize_grip(): boolean;
/**
* Retrieves the box containing the label widget.
* @returns a #GtkBox
*/
get_message_area(): Widget;
/**
* Removes the first message in the #GtkStatusBar's stack
* with the given context id.
*
* Note that this may not change the displayed message, if
* the message at the top of the stack has a different
* context id.
* @param context_id a context identifier
*/
pop(context_id: number): void;
/**
* Pushes a new message onto a statusbar's stack.
* @param context_id the message's context id, as returned by gtk_statusbar_get_context_id()
* @param text the message to add to the statusbar
* @returns a message id that can be used with gtk_statusbar_remove().
*/
push(context_id: number, text: string): number;
/**
* Forces the removal of a message from a statusbar's stack.
* The exact `context_id` and `message_id` must be specified.
* @param context_id a context identifier
* @param message_id a message identifier, as returned by gtk_statusbar_push()
*/
remove(context_id: number, message_id: number): void;
// Conflicted with Gtk.Container.remove
remove(...args: never[]): any;
/**
* Forces the removal of all messages from a statusbar's
* stack with the exact `context_id`.
* @param context_id a context identifier
*/
remove_all(context_id: number): void;
/**
* Sets whether the statusbar has a resize grip.
* %TRUE by default.
* @param setting %TRUE to have a resize grip
*/
set_has_resize_grip(setting: 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 Style {
// Signal callback interfaces
interface Realize {
(): void;
}
interface Unrealize {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class Style extends GObject.Object {
static $gtype: GObject.GType<Style>;
// Fields
fg: Gdk.Color[];
bg: Gdk.Color[];
light: Gdk.Color[];
dark: Gdk.Color[];
mid: Gdk.Color[];
text: Gdk.Color[];
base: Gdk.Color[];
text_aa: Gdk.Color[];
black: Gdk.Color;
white: Gdk.Color;
xthickness: number;
ythickness: number;
fg_gc: Gdk.GC[];
bg_gc: Gdk.GC[];
light_gc: Gdk.GC[];
dark_gc: Gdk.GC[];
mid_gc: Gdk.GC[];
text_gc: Gdk.GC[];
base_gc: Gdk.GC[];
text_aa_gc: Gdk.GC[];
black_gc: Gdk.GC;
white_gc: Gdk.GC;
bg_pixmap: Gdk.Pixmap[];
// Constructors
constructor(properties?: Partial<Style.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Style;
// 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: 'realize', callback: (_source: this) => void): number;
connect_after(signal: 'realize', callback: (_source: this) => void): number;
emit(signal: 'realize'): void;
connect(signal: 'unrealize', callback: (_source: this) => void): number;
connect_after(signal: 'unrealize', callback: (_source: this) => void): number;
emit(signal: 'unrealize'): void;
// Virtual methods
vfunc_copy(src: Style): void;
vfunc_draw_arrow(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
arrow_type: ArrowType,
fill: boolean,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_box(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_box_gap(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType,
gap_x: number,
gap_width: number,
): void;
vfunc_draw_check(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_diamond(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_expander(
window: Gdk.Window,
state_type: StateType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
expander_style: ExpanderStyle,
): void;
vfunc_draw_extension(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType,
): void;
vfunc_draw_flat_box(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_focus(
window: Gdk.Window,
state_type: StateType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_handle(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
orientation: Orientation,
): void;
vfunc_draw_hline(
window: Gdk.Window,
state_type: StateType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x1: number,
x2: number,
y: number,
): void;
vfunc_draw_layout(
window: Gdk.Window,
state_type: StateType,
use_text: boolean,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
layout: Pango.Layout,
): void;
vfunc_draw_option(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_polygon(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
point: Gdk.Point,
npoints: number,
fill: boolean,
): void;
vfunc_draw_resize_grip(
window: Gdk.Window,
state_type: StateType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
edge: Gdk.WindowEdge,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_shadow(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_shadow_gap(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
gap_side: PositionType,
gap_x: number,
gap_width: number,
): void;
vfunc_draw_slider(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
orientation: Orientation,
): void;
vfunc_draw_spinner(
window: Gdk.Window,
state_type: StateType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
step: number,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_string(
window: Gdk.Window,
state_type: StateType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
string: string,
): void;
vfunc_draw_tab(
window: Gdk.Window,
state_type: StateType,
shadow_type: ShadowType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
x: number,
y: number,
width: number,
height: number,
): void;
vfunc_draw_vline(
window: Gdk.Window,
state_type: StateType,
area: Gdk.Rectangle,
widget: Widget,
detail: string,
y1_: number,
y2_: number,
x: number,
): void;
vfunc_init_from_rc(rc_style: RcStyle): void;
vfunc_realize(): void;
/**
* Renders the icon specified by `source` at the given `size`
* according to the given parameters and returns the result in a
* pixbuf.
* @param source the #GtkIconSource specifying the icon to render
* @param direction a text direction
* @param state a state
* @param size the size to render the icon at. A size of (GtkIconSize)-1 means render at the size of the source and don't scale.
* @param widget the widget
* @param detail a style detail
*/
vfunc_render_icon(
source: IconSource,
direction: TextDirection,
state: StateType,
size: number,
widget?: Widget | null,
detail?: string | null,
): GdkPixbuf.Pixbuf;
/**
* Sets the background of `window` to the background color or pixmap
* specified by `style` for the given state.
* @param window a #GdkWindow
* @param state_type a state
*/
vfunc_set_background(window: Gdk.Window, state_type: StateType): void;
vfunc_unrealize(): void;
// Methods
apply_default_background(
window: Gdk.Window,
set_bg: boolean,
state_type: StateType | null,
area: Gdk.Rectangle | null,
x: number,
y: number,
width: number,
height: number,
): void;
/**
* Creates a copy of the passed in #GtkStyle object.
* @returns a copy of @style
*/
copy(): Style;
/**
* Detaches a style from a window. If the style is not attached
* to any windows anymore, it is unrealized. See gtk_style_attach().
*/
detach(): void;
/**
* Gets the #GdkFont to use for the given style. This is
* meant only as a replacement for direct access to `style->`font
* and should not be used in new code. New code should
* use `style->`font_desc instead.
* @returns the #GdkFont for the style. This font is owned by the style; if you want to keep around a copy, you must call gdk_font_ref().
*/
get_font(): Gdk.Font;
/**
* Queries the value of a style property corresponding to a
* widget class is in the given style.
* @param widget_type the #GType of a descendant of #GtkWidget
* @param property_name the name of the style property to get
* @param value a #GValue where the value of the property being queried will be stored
*/
get_style_property(widget_type: GObject.GType, property_name: string, value: GObject.Value | any): void;
/**
* Looks up `color_name` in the style's logical color mappings,
* filling in `color` and returning %TRUE if found, otherwise
* returning %FALSE. Do not cache the found mapping, because
* it depends on the #GtkStyle and might change when a theme
* switch occurs.
* @param color_name the name of the logical color to look up
* @returns %TRUE if the mapping was found.
*/
lookup_color(color_name: string): [boolean, Gdk.Color];
/**
* Looks up `stock_id` in the icon factories associated with `style`
* and the default icon factory, returning an icon set if found,
* otherwise %NULL.
* @param stock_id an icon name
* @returns icon set of @stock_id
*/
lookup_icon_set(stock_id: string): IconSet;
/**
* Renders the icon specified by `source` at the given `size`
* according to the given parameters and returns the result in a
* pixbuf.
* @param source the #GtkIconSource specifying the icon to render
* @param direction a text direction
* @param state a state
* @param size the size to render the icon at. A size of (GtkIconSize)-1 means render at the size of the source and don't scale.
* @param widget the widget
* @param detail a style detail
* @returns a newly-created #GdkPixbuf containing the rendered icon
*/
render_icon(
source: IconSource,
direction: TextDirection | null,
state: StateType | null,
size: number,
widget?: Widget | null,
detail?: string | null,
): GdkPixbuf.Pixbuf;
/**
* Sets the background of `window` to the background color or pixmap
* specified by `style` for the given state.
* @param window a #GdkWindow
* @param state_type a state
*/
set_background(window: Gdk.Window, state_type: StateType | null): void;
/**
* Sets the #GdkFont to use for a given style. This is
* meant only as a replacement for direct access to style->font
* and should not be used in new code. New code should
* use style->font_desc instead.
* @param font a #GdkFont, or %NULL to use the #GdkFont corresponding to style->font_desc.
*/
set_font(font?: Gdk.Font | null): void;
/**
* Decrease the reference count of `style`.
*/
unref(): void;
}
namespace Table {
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
column_spacing: number;
columnSpacing: number;
homogeneous: boolean;
n_columns: number;
nColumns: number;
n_rows: number;
nRows: number;
row_spacing: number;
rowSpacing: number;
}
}
class Table extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Table>;
// Properties
get column_spacing(): number;
set column_spacing(val: number);
get columnSpacing(): number;
set columnSpacing(val: number);
get homogeneous(): boolean;
set homogeneous(val: boolean);
get n_columns(): number;
set n_columns(val: number);
get nColumns(): number;
set nColumns(val: number);
get n_rows(): number;
set n_rows(val: number);
get nRows(): number;
set nRows(val: number);
get row_spacing(): number;
set row_spacing(val: number);
get rowSpacing(): number;
set rowSpacing(val: number);
// Fields
container: Container;
children: any[];
rows: TableRowCol;
cols: TableRowCol;
nrows: number;
ncols: number;
// Constructors
constructor(properties?: Partial<Table.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](rows: number, columns: number, homogeneous: boolean): Table;
// Methods
attach(
child: Widget,
left_attach: number,
right_attach: number,
top_attach: number,
bottom_attach: number,
xoptions: AttachOptions | null,
yoptions: AttachOptions | null,
xpadding: number,
ypadding: number,
): void;
attach_defaults(
widget: Widget,
left_attach: number,
right_attach: number,
top_attach: number,
bottom_attach: number,
): void;
/**
* Gets the amount of space between column `col,` and
* column `col` + 1. See gtk_table_set_col_spacing().
* @param column a column in the table, 0 indicates the first column
* @returns the column spacing
*/
get_col_spacing(column: number): number;
/**
* Gets the default column spacing for the table. This is
* the spacing that will be used for newly added columns.
* (See gtk_table_set_col_spacings())
* @returns the default column spacing
*/
get_default_col_spacing(): number;
/**
* Gets the default row spacing for the table. This is
* the spacing that will be used for newly added rows.
* (See gtk_table_set_row_spacings())
* @returns the default row spacing
*/
get_default_row_spacing(): number;
/**
* Returns whether the table cells are all constrained to the same
* width and height. (See gtk_table_set_homogenous ())
* @returns %TRUE if the cells are all constrained to the same size
*/
get_homogeneous(): boolean;
/**
* Gets the amount of space between row `row,` and
* row `row` + 1. See gtk_table_set_row_spacing().
* @param row a row in the table, 0 indicates the first row
* @returns the row spacing
*/
get_row_spacing(row: number): number;
/**
* Returns the number of rows and columns in the table.
*/
get_size(): [number, number];
resize(rows: number, columns: number): void;
set_col_spacing(column: number, spacing: number): void;
set_col_spacings(spacing: number): void;
set_homogeneous(homogeneous: boolean): void;
set_row_spacing(row: number, spacing: number): void;
set_row_spacings(spacing: 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 TearoffMenuItem {
// Constructor properties interface
interface ConstructorProps
extends MenuItem.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {}
}
class TearoffMenuItem extends MenuItem implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<TearoffMenuItem>;
// Fields
menu_item: MenuItem;
torn_off: number;
// Constructors
constructor(properties?: Partial<TearoffMenuItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TearoffMenuItem;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace TextBuffer {
// Signal callback interfaces
interface ApplyTag {
(tag: TextTag, start: TextIter, end: TextIter): void;
}
interface BeginUserAction {
(): void;
}
interface Changed {
(): void;
}
interface DeleteRange {
(start: TextIter, end: TextIter): void;
}
interface EndUserAction {
(): void;
}
interface InsertChildAnchor {
(location: TextIter, anchor: TextChildAnchor): void;
}
interface InsertPixbuf {
(location: TextIter, pixbuf: GdkPixbuf.Pixbuf): void;
}
interface InsertText {
(location: TextIter, text: string, len: number): void;
}
interface MarkDeleted {
(mark: TextMark): void;
}
interface MarkSet {
(location: TextIter, mark: TextMark): void;
}
interface ModifiedChanged {
(): void;
}
interface PasteDone {
(object: Clipboard): void;
}
interface RemoveTag {
(tag: TextTag, start: TextIter, end: TextIter): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
copy_target_list: TargetList;
copyTargetList: TargetList;
cursor_position: number;
cursorPosition: number;
has_selection: boolean;
hasSelection: boolean;
paste_target_list: TargetList;
pasteTargetList: TargetList;
tag_table: TextTagTable;
tagTable: TextTagTable;
text: string;
}
}
class TextBuffer extends GObject.Object {
static $gtype: GObject.GType<TextBuffer>;
// Properties
/**
* The list of targets this buffer supports for clipboard copying
* and as DND source.
*/
get copy_target_list(): TargetList;
/**
* The list of targets this buffer supports for clipboard copying
* and as DND source.
*/
get copyTargetList(): TargetList;
/**
* The position of the insert mark (as offset from the beginning
* of the buffer). It is useful for getting notified when the
* cursor moves.
*/
get cursor_position(): number;
/**
* The position of the insert mark (as offset from the beginning
* of the buffer). It is useful for getting notified when the
* cursor moves.
*/
get cursorPosition(): number;
/**
* Whether the buffer has some text currently selected.
*/
get has_selection(): boolean;
/**
* Whether the buffer has some text currently selected.
*/
get hasSelection(): boolean;
/**
* The list of targets this buffer supports for clipboard pasting
* and as DND destination.
*/
get paste_target_list(): TargetList;
/**
* The list of targets this buffer supports for clipboard pasting
* and as DND destination.
*/
get pasteTargetList(): TargetList;
get tag_table(): TextTagTable;
get tagTable(): TextTagTable;
/**
* The text content of the buffer. Without child widgets and images,
* see gtk_text_buffer_get_text() for more information.
*/
get text(): string;
set text(val: string);
// Fields
clipboard_contents_buffers: any[];
selection_clipboards: any[];
user_action_count: number;
modified: number;
// Constructors
constructor(properties?: Partial<TextBuffer.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](table?: TextTagTable | null): TextBuffer;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(
signal: 'apply-tag',
callback: (_source: this, tag: TextTag, start: TextIter, end: TextIter) => void,
): number;
connect_after(
signal: 'apply-tag',
callback: (_source: this, tag: TextTag, start: TextIter, end: TextIter) => void,
): number;
emit(signal: 'apply-tag', tag: TextTag, start: TextIter, end: TextIter): void;
connect(signal: 'begin-user-action', callback: (_source: this) => void): number;
connect_after(signal: 'begin-user-action', callback: (_source: this) => void): number;
emit(signal: 'begin-user-action'): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'delete-range', callback: (_source: this, start: TextIter, end: TextIter) => void): number;
connect_after(
signal: 'delete-range',
callback: (_source: this, start: TextIter, end: TextIter) => void,
): number;
emit(signal: 'delete-range', start: TextIter, end: TextIter): void;
connect(signal: 'end-user-action', callback: (_source: this) => void): number;
connect_after(signal: 'end-user-action', callback: (_source: this) => void): number;
emit(signal: 'end-user-action'): void;
connect(
signal: 'insert-child-anchor',
callback: (_source: this, location: TextIter, anchor: TextChildAnchor) => void,
): number;
connect_after(
signal: 'insert-child-anchor',
callback: (_source: this, location: TextIter, anchor: TextChildAnchor) => void,
): number;
emit(signal: 'insert-child-anchor', location: TextIter, anchor: TextChildAnchor): void;
connect(
signal: 'insert-pixbuf',
callback: (_source: this, location: TextIter, pixbuf: GdkPixbuf.Pixbuf) => void,
): number;
connect_after(
signal: 'insert-pixbuf',
callback: (_source: this, location: TextIter, pixbuf: GdkPixbuf.Pixbuf) => void,
): number;
emit(signal: 'insert-pixbuf', location: TextIter, pixbuf: GdkPixbuf.Pixbuf): void;
connect(
signal: 'insert-text',
callback: (_source: this, location: TextIter, text: string, len: number) => void,
): number;
connect_after(
signal: 'insert-text',
callback: (_source: this, location: TextIter, text: string, len: number) => void,
): number;
emit(signal: 'insert-text', location: TextIter, text: string, len: number): void;
connect(signal: 'mark-deleted', callback: (_source: this, mark: TextMark) => void): number;
connect_after(signal: 'mark-deleted', callback: (_source: this, mark: TextMark) => void): number;
emit(signal: 'mark-deleted', mark: TextMark): void;
connect(signal: 'mark-set', callback: (_source: this, location: TextIter, mark: TextMark) => void): number;
connect_after(
signal: 'mark-set',
callback: (_source: this, location: TextIter, mark: TextMark) => void,
): number;
emit(signal: 'mark-set', location: TextIter, mark: TextMark): void;
connect(signal: 'modified-changed', callback: (_source: this) => void): number;
connect_after(signal: 'modified-changed', callback: (_source: this) => void): number;
emit(signal: 'modified-changed'): void;
connect(signal: 'paste-done', callback: (_source: this, object: Clipboard) => void): number;
connect_after(signal: 'paste-done', callback: (_source: this, object: Clipboard) => void): number;
emit(signal: 'paste-done', object: Clipboard): void;
connect(
signal: 'remove-tag',
callback: (_source: this, tag: TextTag, start: TextIter, end: TextIter) => void,
): number;
connect_after(
signal: 'remove-tag',
callback: (_source: this, tag: TextTag, start: TextIter, end: TextIter) => void,
): number;
emit(signal: 'remove-tag', tag: TextTag, start: TextIter, end: TextIter): void;
// Virtual methods
/**
* Emits the "apply-tag" signal on `buffer`. The default
* handler for the signal applies `tag` to the given range.
* `start` and `end` do not have to be in order.
* @param tag a #GtkTextTag
* @param start_char
* @param end_char
*/
vfunc_apply_tag(tag: TextTag, start_char: TextIter, end_char: TextIter): void;
/**
* Called to indicate that the buffer operations between here and a
* call to gtk_text_buffer_end_user_action() are part of a single
* user-visible operation. The operations between
* gtk_text_buffer_begin_user_action() and
* gtk_text_buffer_end_user_action() can then be grouped when creating
* an undo stack. #GtkTextBuffer maintains a count of calls to
* gtk_text_buffer_begin_user_action() that have not been closed with
* a call to gtk_text_buffer_end_user_action(), and emits the
* "begin-user-action" and "end-user-action" signals only for the
* outermost pair of calls. This allows you to build user actions
* from other user actions.
*
* The "interactive" buffer mutation functions, such as
* gtk_text_buffer_insert_interactive(), automatically call begin/end
* user action around the buffer operations they perform, so there's
* no need to add extra calls if you user action consists solely of a
* single call to one of those functions.
*/
vfunc_begin_user_action(): void;
vfunc_changed(): void;
vfunc_delete_range(start: TextIter, end: TextIter): void;
/**
* Should be paired with a call to gtk_text_buffer_begin_user_action().
* See that function for a full explanation.
*/
vfunc_end_user_action(): void;
/**
* Inserts a child widget anchor into the text buffer at `iter`. The
* anchor will be counted as one character in character counts, and
* when obtaining the buffer contents as a string, will be represented
* by the Unicode "object replacement character" 0xFFFC. Note that the
* "slice" variants for obtaining portions of the buffer as a string
* include this character for child anchors, but the "text" variants do
* not. E.g. see gtk_text_buffer_get_slice() and
* gtk_text_buffer_get_text(). Consider
* gtk_text_buffer_create_child_anchor() as a more convenient
* alternative to this function. The buffer will add a reference to
* the anchor, so you can unref it after insertion.
* @param pos
* @param anchor a #GtkTextChildAnchor
*/
vfunc_insert_child_anchor(pos: TextIter, anchor: TextChildAnchor): void;
/**
* Inserts an image into the text buffer at `iter`. The image will be
* counted as one character in character counts, and when obtaining
* the buffer contents as a string, will be represented by the Unicode
* "object replacement character" 0xFFFC. Note that the "slice"
* variants for obtaining portions of the buffer as a string include
* this character for pixbufs, but the "text" variants do
* not. e.g. see gtk_text_buffer_get_slice() and
* gtk_text_buffer_get_text().
* @param pos
* @param pixbuf a #GdkPixbuf
*/
vfunc_insert_pixbuf(pos: TextIter, pixbuf: GdkPixbuf.Pixbuf): void;
vfunc_insert_text(pos: TextIter, text: string, length: number): void;
vfunc_mark_deleted(mark: TextMark): void;
vfunc_mark_set(location: TextIter, mark: TextMark): void;
vfunc_modified_changed(): void;
vfunc_paste_done(clipboard: Clipboard): void;
/**
* Emits the "remove-tag" signal. The default handler for the signal
* removes all occurrences of `tag` from the given range. `start` and
* `end` don't have to be in order.
* @param tag a #GtkTextTag
* @param start_char
* @param end_char
*/
vfunc_remove_tag(tag: TextTag, start_char: TextIter, end_char: TextIter): void;
// Methods
/**
* Adds the mark at position `where`. The mark must not be added to
* another buffer, and if its name is not %NULL then there must not
* be another mark in the buffer with the same name.
*
* Emits the "mark-set" signal as notification of the mark's initial
* placement.
* @param mark the mark to add
* @param where location to place mark
*/
add_mark(mark: TextMark, where: TextIter): void;
/**
* Adds `clipboard` to the list of clipboards in which the selection
* contents of `buffer` are available. In most cases, `clipboard` will be
* the #GtkClipboard of type %GDK_SELECTION_PRIMARY for a view of `buffer`.
* @param clipboard a #GtkClipboard
*/
add_selection_clipboard(clipboard: Clipboard): void;
/**
* Emits the "apply-tag" signal on `buffer`. The default
* handler for the signal applies `tag` to the given range.
* `start` and `end` do not have to be in order.
* @param tag a #GtkTextTag
* @param start one bound of range to be tagged
* @param end other bound of range to be tagged
*/
apply_tag(tag: TextTag, start: TextIter, end: TextIter): void;
/**
* Calls gtk_text_tag_table_lookup() on the buffer's tag table to
* get a #GtkTextTag, then calls gtk_text_buffer_apply_tag().
* @param name name of a named #GtkTextTag
* @param start one bound of range to be tagged
* @param end other bound of range to be tagged
*/
apply_tag_by_name(name: string, start: TextIter, end: TextIter): void;
/**
* Performs the appropriate action as if the user hit the delete
* key with the cursor at the position specified by `iter`. In the
* normal case a single character will be deleted, but when
* combining accents are involved, more than one character can
* be deleted, and when precomposed character and accent combinations
* are involved, less than one character will be deleted.
*
* Because the buffer is modified, all outstanding iterators become
* invalid after calling this function; however, the `iter` will be
* re-initialized to point to the location where text was deleted.
* @param iter a position in @buffer
* @param interactive whether the deletion is caused by user interaction
* @param default_editable whether the buffer is editable by default
* @returns %TRUE if the buffer was modified
*/
backspace(iter: TextIter, interactive: boolean, default_editable: boolean): boolean;
/**
* Called to indicate that the buffer operations between here and a
* call to gtk_text_buffer_end_user_action() are part of a single
* user-visible operation. The operations between
* gtk_text_buffer_begin_user_action() and
* gtk_text_buffer_end_user_action() can then be grouped when creating
* an undo stack. #GtkTextBuffer maintains a count of calls to
* gtk_text_buffer_begin_user_action() that have not been closed with
* a call to gtk_text_buffer_end_user_action(), and emits the
* "begin-user-action" and "end-user-action" signals only for the
* outermost pair of calls. This allows you to build user actions
* from other user actions.
*
* The "interactive" buffer mutation functions, such as
* gtk_text_buffer_insert_interactive(), automatically call begin/end
* user action around the buffer operations they perform, so there's
* no need to add extra calls if you user action consists solely of a
* single call to one of those functions.
*/
begin_user_action(): void;
/**
* Copies the currently-selected text to a clipboard.
* @param clipboard the #GtkClipboard object to copy to
*/
copy_clipboard(clipboard: Clipboard): void;
/**
* This is a convenience function which simply creates a child anchor
* with gtk_text_child_anchor_new() and inserts it into the buffer
* with gtk_text_buffer_insert_child_anchor(). The new anchor is
* owned by the buffer; no reference count is returned to
* the caller of gtk_text_buffer_create_child_anchor().
* @param iter location in the buffer
* @returns the created child anchor
*/
create_child_anchor(iter: TextIter): TextChildAnchor;
/**
* Creates a mark at position `where`. If `mark_name` is %NULL, the mark
* is anonymous; otherwise, the mark can be retrieved by name using
* gtk_text_buffer_get_mark(). If a mark has left gravity, and text is
* inserted at the mark's current location, the mark will be moved to
* the left of the newly-inserted text. If the mark has right gravity
* (`left_gravity` = %FALSE), the mark will end up on the right of
* newly-inserted text. The standard left-to-right cursor is a mark
* with right gravity (when you type, the cursor stays on the right
* side of the text you're typing).
*
* The caller of this function does <emphasis>not</emphasis> own a
* reference to the returned #GtkTextMark, so you can ignore the
* return value if you like. Marks are owned by the buffer and go
* away when the buffer does.
*
* Emits the "mark-set" signal as notification of the mark's initial
* placement.
* @param mark_name name for mark, or %NULL
* @param where location to place mark
* @param left_gravity whether the mark has left gravity
* @returns the new #GtkTextMark object
*/
create_mark(mark_name: string | null, where: TextIter, left_gravity: boolean): TextMark;
/**
* Copies the currently-selected text to a clipboard, then deletes
* said text if it's editable.
* @param clipboard the #GtkClipboard object to cut to
* @param default_editable default editability of the buffer
*/
cut_clipboard(clipboard: Clipboard, default_editable: boolean): void;
/**
* Deletes text between `start` and `end`. The order of `start` and `end`
* is not actually relevant; gtk_text_buffer_delete() will reorder
* them. This function actually emits the "delete-range" signal, and
* the default handler of that signal deletes the text. Because the
* buffer is modified, all outstanding iterators become invalid after
* calling this function; however, the `start` and `end` will be
* re-initialized to point to the location where text was deleted.
* @param start a position in @buffer
* @param end another position in @buffer
*/
['delete'](start: TextIter, end: TextIter): void;
/**
* Deletes all <emphasis>editable</emphasis> text in the given range.
* Calls gtk_text_buffer_delete() for each editable sub-range of
* [`start,``end)`. `start` and `end` are revalidated to point to
* the location of the last deleted range, or left untouched if
* no text was deleted.
* @param start_iter start of range to delete
* @param end_iter end of range
* @param default_editable whether the buffer is editable by default
* @returns whether some text was actually deleted
*/
delete_interactive(start_iter: TextIter, end_iter: TextIter, default_editable: boolean): boolean;
/**
* Deletes `mark,` so that it's no longer located anywhere in the
* buffer. Removes the reference the buffer holds to the mark, so if
* you haven't called g_object_ref() on the mark, it will be freed. Even
* if the mark isn't freed, most operations on `mark` become
* invalid, until it gets added to a buffer again with
* gtk_text_buffer_add_mark(). Use gtk_text_mark_get_deleted() to
* find out if a mark has been removed from its buffer.
* The "mark-deleted" signal will be emitted as notification after
* the mark is deleted.
* @param mark a #GtkTextMark in @buffer
*/
delete_mark(mark: TextMark): void;
/**
* Deletes the mark named `name;` the mark must exist. See
* gtk_text_buffer_delete_mark() for details.
* @param name name of a mark in @buffer
*/
delete_mark_by_name(name: string): void;
/**
* Deletes the range between the "insert" and "selection_bound" marks,
* that is, the currently-selected text. If `interactive` is %TRUE,
* the editability of the selection will be considered (users can't delete
* uneditable text).
* @param interactive whether the deletion is caused by user interaction
* @param default_editable whether the buffer is editable by default
* @returns whether there was a non-empty selection to delete
*/
delete_selection(interactive: boolean, default_editable: boolean): boolean;
/**
* This function deserializes rich text in format `format` and inserts
* it at `iter`.
*
* `format<`!-- -->s to be used must be registered using
* gtk_text_buffer_register_deserialize_format() or
* gtk_text_buffer_register_deserialize_tagset() beforehand.
* @param content_buffer the #GtkTextBuffer to deserialize into
* @param format the rich text format to use for deserializing
* @param iter insertion point for the deserialized text
* @param data data to deserialize
* @returns %TRUE on success, %FALSE otherwise.
*/
deserialize(
content_buffer: TextBuffer,
format: Gdk.Atom,
iter: TextIter,
data: Uint8Array | string,
): boolean;
/**
* This functions returns the value set with
* gtk_text_buffer_deserialize_set_can_create_tags()
* @param format a #GdkAtom representing a registered rich text format
* @returns whether deserializing this format may create tags
*/
deserialize_get_can_create_tags(format: Gdk.Atom): boolean;
/**
* Use this function to allow a rich text deserialization function to
* create new tags in the receiving buffer. Note that using this
* function is almost always a bad idea, because the rich text
* functions you register should know how to map the rich text format
* they handler to your text buffers set of tags.
*
* The ability of creating new (arbitrary!) tags in the receiving buffer
* is meant for special rich text formats like the internal one that
* is registered using gtk_text_buffer_register_deserialize_tagset(),
* because that format is essentially a dump of the internal structure
* of the source buffer, including its tag names.
*
* You should allow creation of tags only if you know what you are
* doing, e.g. if you defined a tagset name for your application
* suite's text buffers and you know that it's fine to receive new
* tags from these buffers, because you know that your application can
* handle the newly created tags.
* @param format a #GdkAtom representing a registered rich text format
* @param can_create_tags whether deserializing this format may create tags
*/
deserialize_set_can_create_tags(format: Gdk.Atom, can_create_tags: boolean): void;
/**
* Should be paired with a call to gtk_text_buffer_begin_user_action().
* See that function for a full explanation.
*/
end_user_action(): void;
/**
* Retrieves the first and last iterators in the buffer, i.e. the
* entire buffer lies within the range [`start,``end)`.
*/
get_bounds(): [TextIter, TextIter];
/**
* Gets the number of characters in the buffer; note that characters
* and bytes are not the same, you can't e.g. expect the contents of
* the buffer in string form to be this many bytes long. The character
* count is cached, so this function is very fast.
* @returns number of characters in the buffer
*/
get_char_count(): number;
/**
* This function returns the list of targets this text buffer can
* provide for copying and as DND source. The targets in the list are
* added with %info values from the #GtkTextBufferTargetInfo enum,
* using gtk_target_list_add_rich_text_targets() and
* gtk_target_list_add_text_targets().
* @returns the #GtkTargetList
*/
get_copy_target_list(): TargetList;
/**
* This function returns the rich text deserialize formats registered
* with `buffer` using gtk_text_buffer_register_deserialize_format() or
* gtk_text_buffer_register_deserialize_tagset()
* @returns an array of #GdkAtom<!-- -->s representing the registered formats.
*/
get_deserialize_formats(): Gdk.Atom[];
/**
* Initializes `iter` with the "end iterator," one past the last valid
* character in the text buffer. If dereferenced with
* gtk_text_iter_get_char(), the end iterator has a character value of
* 0. The entire buffer lies in the range from the first position in
* the buffer (call gtk_text_buffer_get_start_iter() to get
* character position 0) to the end iterator.
*/
get_end_iter(): TextIter;
/**
* Indicates whether the buffer has some text currently selected.
* @returns %TRUE if the there is text selected
*/
get_has_selection(): boolean;
/**
* Returns the mark that represents the cursor (insertion point).
* Equivalent to calling gtk_text_buffer_get_mark() to get the mark
* named "insert", but very slightly more efficient, and involves less
* typing.
* @returns insertion point mark
*/
get_insert(): TextMark;
/**
* Obtains the location of `anchor` within `buffer`.
* @param anchor a child anchor that appears in @buffer
*/
get_iter_at_child_anchor(anchor: TextChildAnchor): TextIter;
/**
* Initializes `iter` to the start of the given line.
* @param line_number line number counting from 0
*/
get_iter_at_line(line_number: number): TextIter;
/**
* Obtains an iterator pointing to `byte_index` within the given line.
* `byte_index` must be the start of a UTF-8 character, and must not be
* beyond the end of the line. Note <emphasis>bytes</emphasis>, not
* characters; UTF-8 may encode one character as multiple bytes.
* @param line_number line number counting from 0
* @param byte_index byte index from start of line
*/
get_iter_at_line_index(line_number: number, byte_index: number): TextIter;
/**
* Obtains an iterator pointing to `char_offset` within the given
* line. The `char_offset` must exist, offsets off the end of the line
* are not allowed. Note <emphasis>characters</emphasis>, not bytes;
* UTF-8 may encode one character as multiple bytes.
* @param line_number line number counting from 0
* @param char_offset char offset from start of line
*/
get_iter_at_line_offset(line_number: number, char_offset: number): TextIter;
/**
* Initializes `iter` with the current position of `mark`.
* @param mark a #GtkTextMark in @buffer
*/
get_iter_at_mark(mark: TextMark): TextIter;
/**
* Initializes `iter` to a position `char_offset` chars from the start
* of the entire buffer. If `char_offset` is -1 or greater than the number
* of characters in the buffer, `iter` is initialized to the end iterator,
* the iterator one past the last valid character in the buffer.
* @param char_offset char offset from start of buffer, counting from 0, or -1
*/
get_iter_at_offset(char_offset: number): TextIter;
/**
* Obtains the number of lines in the buffer. This value is cached, so
* the function is very fast.
* @returns number of lines in the buffer
*/
get_line_count(): number;
/**
* Returns the mark named `name` in buffer `buffer,` or %NULL if no such
* mark exists in the buffer.
* @param name a mark name
* @returns a #GtkTextMark, or %NULL
*/
get_mark(name: string): TextMark;
/**
* Indicates whether the buffer has been modified since the last call
* to gtk_text_buffer_set_modified() set the modification flag to
* %FALSE. Used for example to enable a "save" function in a text
* editor.
* @returns %TRUE if the buffer has been modified
*/
get_modified(): boolean;
/**
* This function returns the list of targets this text buffer supports
* for pasting and as DND destination. The targets in the list are
* added with %info values from the #GtkTextBufferTargetInfo enum,
* using gtk_target_list_add_rich_text_targets() and
* gtk_target_list_add_text_targets().
* @returns the #GtkTargetList
*/
get_paste_target_list(): TargetList;
/**
* Returns the mark that represents the selection bound. Equivalent
* to calling gtk_text_buffer_get_mark() to get the mark named
* "selection_bound", but very slightly more efficient, and involves
* less typing.
*
* The currently-selected text in `buffer` is the region between the
* "selection_bound" and "insert" marks. If "selection_bound" and
* "insert" are in the same place, then there is no current selection.
* gtk_text_buffer_get_selection_bounds() is another convenient function
* for handling the selection, if you just want to know whether there's a
* selection and what its bounds are.
* @returns selection bound mark
*/
get_selection_bound(): TextMark;
/**
* Returns %TRUE if some text is selected; places the bounds
* of the selection in `start` and `end` (if the selection has length 0,
* then `start` and `end` are filled in with the same value).
* `start` and `end` will be in ascending order. If `start` and `end` are
* NULL, then they are not filled in, but the return value still indicates
* whether text is selected.
* @returns whether the selection has nonzero length
*/
get_selection_bounds(): [boolean, TextIter, TextIter];
/**
* This function returns the rich text serialize formats registered
* with `buffer` using gtk_text_buffer_register_serialize_format() or
* gtk_text_buffer_register_serialize_tagset()
* @returns an array of #GdkAtom<!-- -->s representing the registered formats.
*/
get_serialize_formats(): Gdk.Atom[];
/**
* Returns the text in the range [`start,``end)`. Excludes undisplayed
* text (text marked with tags that set the invisibility attribute) if
* `include_hidden_chars` is %FALSE. The returned string includes a
* 0xFFFC character whenever the buffer contains
* embedded images, so byte and character indexes into
* the returned string <emphasis>do</emphasis> correspond to byte
* and character indexes into the buffer. Contrast with
* gtk_text_buffer_get_text(). Note that 0xFFFC can occur in normal
* text as well, so it is not a reliable indicator that a pixbuf or
* widget is in the buffer.
* @param start start of a range
* @param end end of a range
* @param include_hidden_chars whether to include invisible text
* @returns an allocated UTF-8 string
*/
get_slice(start: TextIter, end: TextIter, include_hidden_chars: boolean): string;
/**
* Initialized `iter` with the first position in the text buffer. This
* is the same as using gtk_text_buffer_get_iter_at_offset() to get
* the iter at character offset 0.
*/
get_start_iter(): TextIter;
/**
* Get the #GtkTextTagTable associated with this buffer.
* @returns the buffer's tag table
*/
get_tag_table(): TextTagTable;
/**
* Returns the text in the range [`start,``end)`. Excludes undisplayed
* text (text marked with tags that set the invisibility attribute) if
* `include_hidden_chars` is %FALSE. Does not include characters
* representing embedded images, so byte and character indexes into
* the returned string do <emphasis>not</emphasis> correspond to byte
* and character indexes into the buffer. Contrast with
* gtk_text_buffer_get_slice().
* @param start start of a range
* @param end end of a range
* @param include_hidden_chars whether to include invisible text
* @returns an allocated UTF-8 string
*/
get_text(start: TextIter, end: TextIter, include_hidden_chars: boolean): string;
/**
* Inserts `len` bytes of `text` at position `iter`. If `len` is -1,
* `text` must be nul-terminated and will be inserted in its
* entirety. Emits the "insert-text" signal; insertion actually occurs
* in the default handler for the signal. `iter` is invalidated when
* insertion occurs (because the buffer contents change), but the
* default signal handler revalidates it to point to the end of the
* inserted text.
* @param iter a position in the buffer
* @param text text in UTF-8 format
* @param len length of text in bytes, or -1
*/
insert(iter: TextIter, text: string, len: number): void;
/**
* Simply calls gtk_text_buffer_insert(), using the current
* cursor position as the insertion point.
* @param text text in UTF-8 format
* @param len length of text, in bytes
*/
insert_at_cursor(text: string, len: number): void;
/**
* Inserts a child widget anchor into the text buffer at `iter`. The
* anchor will be counted as one character in character counts, and
* when obtaining the buffer contents as a string, will be represented
* by the Unicode "object replacement character" 0xFFFC. Note that the
* "slice" variants for obtaining portions of the buffer as a string
* include this character for child anchors, but the "text" variants do
* not. E.g. see gtk_text_buffer_get_slice() and
* gtk_text_buffer_get_text(). Consider
* gtk_text_buffer_create_child_anchor() as a more convenient
* alternative to this function. The buffer will add a reference to
* the anchor, so you can unref it after insertion.
* @param iter location to insert the anchor
* @param anchor a #GtkTextChildAnchor
*/
insert_child_anchor(iter: TextIter, anchor: TextChildAnchor): void;
/**
* Like gtk_text_buffer_insert(), but the insertion will not occur if
* `iter` is at a non-editable location in the buffer. Usually you
* want to prevent insertions at ineditable locations if the insertion
* results from a user action (is interactive).
*
* `default_editable` indicates the editability of text that doesn't
* have a tag affecting editability applied to it. Typically the
* result of gtk_text_view_get_editable() is appropriate here.
* @param iter a position in @buffer
* @param text some UTF-8 text
* @param len length of text in bytes, or -1
* @param default_editable default editability of buffer
* @returns whether text was actually inserted
*/
insert_interactive(iter: TextIter, text: string, len: number, default_editable: boolean): boolean;
/**
* Calls gtk_text_buffer_insert_interactive() at the cursor
* position.
*
* `default_editable` indicates the editability of text that doesn't
* have a tag affecting editability applied to it. Typically the
* result of gtk_text_view_get_editable() is appropriate here.
* @param text text in UTF-8 format
* @param len length of text in bytes, or -1
* @param default_editable default editability of buffer
* @returns whether text was actually inserted
*/
insert_interactive_at_cursor(text: string, len: number, default_editable: boolean): boolean;
/**
* Inserts an image into the text buffer at `iter`. The image will be
* counted as one character in character counts, and when obtaining
* the buffer contents as a string, will be represented by the Unicode
* "object replacement character" 0xFFFC. Note that the "slice"
* variants for obtaining portions of the buffer as a string include
* this character for pixbufs, but the "text" variants do
* not. e.g. see gtk_text_buffer_get_slice() and
* gtk_text_buffer_get_text().
* @param iter location to insert the pixbuf
* @param pixbuf a #GdkPixbuf
*/
insert_pixbuf(iter: TextIter, pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Copies text, tags, and pixbufs between `start` and `end` (the order
* of `start` and `end` doesn't matter) and inserts the copy at `iter`.
* Used instead of simply getting/inserting text because it preserves
* images and tags. If `start` and `end` are in a different buffer from
* `buffer,` the two buffers must share the same tag table.
*
* Implemented via emissions of the insert_text and apply_tag signals,
* so expect those.
* @param iter a position in @buffer
* @param start a position in a #GtkTextBuffer
* @param end another position in the same buffer as @start
*/
insert_range(iter: TextIter, start: TextIter, end: TextIter): void;
/**
* Same as gtk_text_buffer_insert_range(), but does nothing if the
* insertion point isn't editable. The `default_editable` parameter
* indicates whether the text is editable at `iter` if no tags
* enclosing `iter` affect editability. Typically the result of
* gtk_text_view_get_editable() is appropriate here.
* @param iter a position in @buffer
* @param start a position in a #GtkTextBuffer
* @param end another position in the same buffer as @start
* @param default_editable default editability of the buffer
* @returns whether an insertion was possible at @iter
*/
insert_range_interactive(
iter: TextIter,
start: TextIter,
end: TextIter,
default_editable: boolean,
): boolean;
/**
* Moves `mark` to the new location `where`. Emits the "mark-set" signal
* as notification of the move.
* @param mark a #GtkTextMark
* @param where new location for @mark in @buffer
*/
move_mark(mark: TextMark, where: TextIter): void;
/**
* Moves the mark named `name` (which must exist) to location `where`.
* See gtk_text_buffer_move_mark() for details.
* @param name name of a mark
* @param where new location for mark
*/
move_mark_by_name(name: string, where: TextIter): void;
/**
* Pastes the contents of a clipboard at the insertion point, or
* at `override_location`. (Note: pasting is asynchronous, that is,
* we'll ask for the paste data and return, and at some point later
* after the main loop runs, the paste data will be inserted.)
* @param clipboard the #GtkClipboard to paste from
* @param override_location location to insert pasted text, or %NULL for at the cursor
* @param default_editable whether the buffer is editable by default
*/
paste_clipboard(clipboard: Clipboard, override_location: TextIter | null, default_editable: boolean): void;
/**
* This function moves the "insert" and "selection_bound" marks
* simultaneously. If you move them to the same place in two steps
* with gtk_text_buffer_move_mark(), you will temporarily select a
* region in between their old and new locations, which can be pretty
* inefficient since the temporarily-selected region will force stuff
* to be recalculated. This function moves them as a unit, which can
* be optimized.
* @param where where to put the cursor
*/
place_cursor(where: TextIter): void;
/**
* This function registers a rich text deserialization `function` along with
* its `mime_type` with the passed `buffer`.
* @param mime_type the format's mime-type
* @param _function the deserialize function to register
* @returns the #GdkAtom that corresponds to the newly registered format's mime-type.
*/
register_deserialize_format(mime_type: string, _function: TextBufferDeserializeFunc): Gdk.Atom;
/**
* This function registers GTK+'s internal rich text serialization
* format with the passed `buffer`. See
* gtk_text_buffer_register_serialize_tagset() for details.
* @param tagset_name an optional tagset name, on %NULL
* @returns the #GdkAtom that corresponds to the newly registered format's mime-type.
*/
register_deserialize_tagset(tagset_name?: string | null): Gdk.Atom;
/**
* This function registers a rich text serialization `function` along with
* its `mime_type` with the passed `buffer`.
* @param mime_type the format's mime-type
* @param _function the serialize function to register
* @returns the #GdkAtom that corresponds to the newly registered format's mime-type.
*/
register_serialize_format(mime_type: string, _function: TextBufferSerializeFunc): Gdk.Atom;
/**
* This function registers GTK+'s internal rich text serialization
* format with the passed `buffer`. The internal format does not comply
* to any standard rich text format and only works between #GtkTextBuffer
* instances. It is capable of serializing all of a text buffer's tags
* and embedded pixbufs.
*
* This function is just a wrapper around
* gtk_text_buffer_register_serialize_format(). The mime type used
* for registering is "application/x-gtk-text-buffer-rich-text", or
* "application/x-gtk-text-buffer-rich-text;format=`tagset_name"` if a
* `tagset_name` was passed.
*
* The `tagset_name` can be used to restrict the transfer of rich text
* to buffers with compatible sets of tags, in order to avoid unknown
* tags from being pasted. It is probably the common case to pass an
* identifier != %NULL here, since the %NULL tagset requires the
* receiving buffer to deal with with pasting of arbitrary tags.
* @param tagset_name an optional tagset name, on %NULL
* @returns the #GdkAtom that corresponds to the newly registered format's mime-type.
*/
register_serialize_tagset(tagset_name?: string | null): Gdk.Atom;
/**
* Removes all tags in the range between `start` and `end`. Be careful
* with this function; it could remove tags added in code unrelated to
* the code you're currently writing. That is, using this function is
* probably a bad idea if you have two or more unrelated code sections
* that add tags.
* @param start one bound of range to be untagged
* @param end other bound of range to be untagged
*/
remove_all_tags(start: TextIter, end: TextIter): void;
/**
* Removes a #GtkClipboard added with
* gtk_text_buffer_add_selection_clipboard().
* @param clipboard a #GtkClipboard added to @buffer by gtk_text_buffer_add_selection_clipboard()
*/
remove_selection_clipboard(clipboard: Clipboard): void;
/**
* Emits the "remove-tag" signal. The default handler for the signal
* removes all occurrences of `tag` from the given range. `start` and
* `end` don't have to be in order.
* @param tag a #GtkTextTag
* @param start one bound of range to be untagged
* @param end other bound of range to be untagged
*/
remove_tag(tag: TextTag, start: TextIter, end: TextIter): void;
/**
* Calls gtk_text_tag_table_lookup() on the buffer's tag table to
* get a #GtkTextTag, then calls gtk_text_buffer_remove_tag().
* @param name name of a #GtkTextTag
* @param start one bound of range to be untagged
* @param end other bound of range to be untagged
*/
remove_tag_by_name(name: string, start: TextIter, end: TextIter): void;
/**
* This function moves the "insert" and "selection_bound" marks
* simultaneously. If you move them in two steps
* with gtk_text_buffer_move_mark(), you will temporarily select a
* region in between their old and new locations, which can be pretty
* inefficient since the temporarily-selected region will force stuff
* to be recalculated. This function moves them as a unit, which can
* be optimized.
* @param ins where to put the "insert" mark
* @param bound where to put the "selection_bound" mark
*/
select_range(ins: TextIter, bound: TextIter): void;
/**
* This function serializes the portion of text between `start`
* and `end` in the rich text format represented by `format`.
*
* `format<`!-- -->s to be used must be registered using
* gtk_text_buffer_register_serialize_format() or
* gtk_text_buffer_register_serialize_tagset() beforehand.
* @param content_buffer the #GtkTextBuffer to serialize
* @param format the rich text format to use for serializing
* @param start start of block of text to serialize
* @param end end of block of test to serialize
* @returns the serialized data, encoded as @format
*/
serialize(content_buffer: TextBuffer, format: Gdk.Atom, start: TextIter, end: TextIter): Uint8Array;
/**
* Used to keep track of whether the buffer has been modified since the
* last time it was saved. Whenever the buffer is saved to disk, call
* gtk_text_buffer_set_modified (`buffer,` FALSE). When the buffer is modified,
* it will automatically toggled on the modified bit again. When the modified
* bit flips, the buffer emits a "modified-changed" signal.
* @param setting modification flag setting
*/
set_modified(setting: boolean): void;
/**
* Deletes current contents of `buffer,` and inserts `text` instead. If
* `len` is -1, `text` must be nul-terminated. `text` must be valid UTF-8.
* @param text UTF-8 text to insert
* @param len length of @text in bytes
*/
set_text(text: string, len: number): void;
/**
* This function unregisters a rich text format that was previously
* registered using gtk_text_buffer_register_deserialize_format() or
* gtk_text_buffer_register_deserialize_tagset().
* @param format a #GdkAtom representing a registered rich text format.
*/
unregister_deserialize_format(format: Gdk.Atom): void;
/**
* This function unregisters a rich text format that was previously
* registered using gtk_text_buffer_register_serialize_format() or
* gtk_text_buffer_register_serialize_tagset()
* @param format a #GdkAtom representing a registered rich text format.
*/
unregister_serialize_format(format: Gdk.Atom): void;
}
namespace TextChildAnchor {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class TextChildAnchor extends GObject.Object {
static $gtype: GObject.GType<TextChildAnchor>;
// Fields
segment: any;
// Constructors
constructor(properties?: Partial<TextChildAnchor.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TextChildAnchor;
// Methods
/**
* Determines whether a child anchor has been deleted from
* the buffer. Keep in mind that the child anchor will be
* unreferenced when removed from the buffer, so you need to
* hold your own reference (with g_object_ref()) if you plan
* to use this function &mdash; otherwise all deleted child anchors
* will also be finalized.
* @returns %TRUE if the child anchor has been deleted from its buffer
*/
get_deleted(): boolean;
/**
* Gets a list of all widgets anchored at this child anchor.
* The returned list should be freed with g_list_free().
* @returns list of widgets anchored at @anchor
*/
get_widgets(): Widget[];
queue_resize(layout: TextLayout): void;
register_child(child: Widget, layout: TextLayout): void;
unregister_child(child: Widget): void;
}
namespace TextLayout {
// Signal callback interfaces
interface AllocateChild {
(object: Object, p0: number, p1: number): void;
}
interface Changed {
(object: number, p0: number, p1: number): void;
}
interface Invalidated {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class TextLayout extends GObject.Object {
static $gtype: GObject.GType<TextLayout>;
// Fields
screen_width: number;
width: number;
height: number;
buffer: TextBuffer;
ltr_context: Pango.Context;
rtl_context: Pango.Context;
wrap_loop_count: number;
cursor_visible: number;
cursor_direction: number;
keyboard_direction: number;
preedit_string: string;
preedit_len: number;
preedit_cursor: number;
overwrite_mode: number;
// Constructors
constructor(properties?: Partial<TextLayout.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TextLayout;
// 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: 'allocate-child',
callback: (_source: this, object: Object, p0: number, p1: number) => void,
): number;
connect_after(
signal: 'allocate-child',
callback: (_source: this, object: Object, p0: number, p1: number) => void,
): number;
emit(signal: 'allocate-child', object: Object, p0: number, p1: number): void;
connect(
signal: 'changed',
callback: (_source: this, object: number, p0: number, p1: number) => void,
): number;
connect_after(
signal: 'changed',
callback: (_source: this, object: number, p0: number, p1: number) => void,
): number;
emit(signal: 'changed', object: number, p0: number, p1: number): void;
connect(signal: 'invalidated', callback: (_source: this) => void): number;
connect_after(signal: 'invalidated', callback: (_source: this) => void): number;
emit(signal: 'invalidated'): void;
// Virtual methods
vfunc_allocate_child(child: Widget, x: number, y: number): void;
vfunc_changed(y: number, old_height: number, new_height: number): void;
vfunc_free_line_data(line: TextLine, line_data: TextLineData): void;
vfunc_get_log_attrs(line: TextLine, attrs: Pango.LogAttr, n_attrs: number): void;
vfunc_invalidate(start: TextIter, end: TextIter): void;
vfunc_invalidate_cursors(start: TextIter, end: TextIter): void;
vfunc_invalidated(): void;
// Methods
changed(y: number, old_height: number, new_height: number): void;
/**
* If the iterator is not fully in the range `top` <= y < `bottom,`
* then, if possible, move it the minimum distance so that the
* iterator in this range.
* @param iter a #GtkTextIter
* @param top the top of the range
* @param bottom the bottom the range
* @returns %TRUE if the iterator was moved, otherwise %FALSE.
*/
clamp_iter_to_vrange(iter: TextIter, top: number, bottom: number): boolean;
cursors_changed(y: number, old_height: number, new_height: number): void;
default_style_changed(): void;
free_line_data(line: TextLine, line_data: TextLineData): void;
free_line_display(display: TextLineDisplay): void;
/**
* Given an iterator within a text layout, determine the positions of the
* strong and weak cursors if the insertion point is at that
* iterator. The position of each cursor is stored as a zero-width
* rectangle. The strong cursor location is the location where
* characters of the directionality equal to the base direction of the
* paragraph are inserted. The weak cursor location is the location
* where characters of the directionality opposite to the base
* direction of the paragraph are inserted.
* @param iter a #GtkTextIter
* @param strong_pos location to store the strong cursor position (may be %NULL)
* @param weak_pos location to store the weak cursor position (may be %NULL)
*/
get_cursor_locations(
iter: TextIter,
strong_pos?: Gdk.Rectangle | null,
weak_pos?: Gdk.Rectangle | null,
): void;
/**
* Returns whether the insertion cursor will be shown.
* @returns if %FALSE, the insertion cursor will not be shown, even if the text is editable.
*/
get_cursor_visible(): boolean;
get_iter_at_line(iter: TextIter, line: TextLine, byte_offset: number): void;
get_iter_at_pixel(iter: TextIter, x: number, y: number): void;
get_iter_at_position(iter: TextIter, trailing: number, x: number, y: number): void;
get_iter_location(iter: TextIter, rect: Gdk.Rectangle): void;
/**
* Get the iter at the beginning of the line which is displayed
* at the given y.
* @param target_iter the iterator in which the result is stored
* @param y the y positition
* @param line_top location to store the y coordinate of the top of the line. (Can by %NULL)
*/
get_line_at_y(target_iter: TextIter, y: number, line_top: number): void;
/**
* Find the range of y coordinates for the paragraph containing
* the given iter.
* @param iter a #GtkTextIter
* @param y location to store the top of the paragraph in pixels, or %NULL. @height location to store the height of the paragraph in pixels, or %NULL.
* @param height
*/
get_line_yrange(iter: TextIter, y: number, height: number): void;
get_lines(top_y: number, bottom_y: number, first_line_y: number): TextLine[];
get_size(width: number, height: number): void;
invalidate(start: TextIter, end: TextIter): void;
invalidate_cursors(start: TextIter, end: TextIter): void;
/**
* Check if there are any invalid regions in a #GtkTextLayout's buffer
* @returns %TRUE if any invalid regions were found
*/
is_valid(): boolean;
/**
* Tests whether an iterator is at the start of a display line.
* @param iter iterator to test
*/
iter_starts_line(iter: TextIter): boolean;
/**
* Move to the beginning or end of a display line.
* @param iter
* @param direction if negative, move to beginning of line, otherwise move to end of line.
*/
move_iter_to_line_end(iter: TextIter, direction: number): boolean;
/**
* Move the iterator to the beginning of the next line. The
* lines of a wrapped paragraph are treated as distinct for
* this operation.
* @param iter a #GtkTextIter
*/
move_iter_to_next_line(iter: TextIter): boolean;
/**
* Move the iterator to the beginning of the previous line. The lines
* of a wrapped paragraph are treated as distinct for this operation.
* @param iter a #GtkTextIter
*/
move_iter_to_previous_line(iter: TextIter): boolean;
/**
* Keeping the iterator on the same line of the layout, move it to the
* specified X coordinate. The lines of a wrapped paragraph are
* treated as distinct for this operation.
* @param iter a #GtkTextIter
* @param x X coordinate
*/
move_iter_to_x(iter: TextIter, x: number): void;
/**
* Move the iterator a given number of characters visually, treating
* it as the strong cursor position. If `count` is positive, then the
* new strong cursor position will be `count` positions to the right of
* the old cursor position. If `count` is negative then the new strong
* cursor position will be `count` positions to the left of the old
* cursor position.
*
* In the presence of bidirection text, the correspondence
* between logical and visual order will depend on the direction
* of the current run, and there may be jumps when the cursor
* is moved off of the end of a run.
* @param iter a #GtkTextIter
* @param count number of characters to move (negative moves left, positive moves right)
*/
move_iter_visually(iter: TextIter, count: number): boolean;
set_buffer(buffer?: TextBuffer | null): void;
set_contexts(ltr_context: Pango.Context, rtl_context: Pango.Context): void;
/**
* Sets which text directions (left-to-right and/or right-to-left) for
* which cursors will be drawn for the insertion point. The visual
* point at which new text is inserted depends on whether the new
* text is right-to-left or left-to-right, so it may be desired to
* make the drawn position of the cursor depend on the keyboard state.
* @param direction the new direction(s) for which to draw cursors. %GTK_TEXT_DIR_NONE means draw cursors for both left-to-right insertion and right-to-left insertion. (The two cursors will be visually distinguished.)
*/
set_cursor_direction(direction: TextDirection | null): void;
/**
* Sets whether the insertion cursor should be shown. Generally,
* widgets using #GtkTextLayout will hide the cursor when the
* widget does not have the input focus.
* @param cursor_visible If %FALSE, then the insertion cursor will not be shown, even if the text is editable.
*/
set_cursor_visible(cursor_visible: boolean): void;
set_default_style(values: TextAttributes): void;
/**
* Sets the keyboard direction; this is used as for the bidirectional
* base direction for the line with the cursor if the line contains
* only neutral characters.
* @param keyboard_dir the current direction of the keyboard.
*/
set_keyboard_direction(keyboard_dir: TextDirection | null): void;
/**
* Sets overwrite mode
* @param overwrite overwrite mode
*/
set_overwrite_mode(overwrite: boolean): void;
/**
* Set the preedit string and attributes. The preedit string is a
* string showing text that is currently being edited and not
* yet committed into the buffer.
* @param preedit_string a string to display at the insertion point
* @param preedit_attrs a #PangoAttrList of attributes that apply to @preedit_string
* @param cursor_pos position of cursor within preedit string in chars
*/
set_preedit_string(preedit_string: string, preedit_attrs: Pango.AttrList, cursor_pos: number): void;
set_screen_width(width: number): void;
spew(): void;
/**
* Validate regions of a #GtkTextLayout. The ::changed signal will
* be emitted for each region validated.
* @param max_pixels the maximum number of pixels to validate. (No more than one paragraph beyond this limit will be validated)
*/
validate(max_pixels: number): void;
/**
* Ensure that a region of a #GtkTextLayout is valid. The ::changed
* signal will be emitted if any lines are validated.
* @param anchor_line
* @param y0_ offset from the top of the line pointed to by @anchor at which to begin validation. (The offset here is in pixels after validation.)
* @param y1_ offset from the top of the line pointed to by @anchor at which to end validation. (The offset here is in pixels after validation.)
*/
validate_yrange(anchor_line: TextIter, y0_: number, y1_: number): void;
wrap_loop_end(): void;
wrap_loop_start(): void;
}
namespace TextMark {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
left_gravity: boolean;
leftGravity: boolean;
name: string;
}
}
class TextMark extends GObject.Object {
static $gtype: GObject.GType<TextMark>;
// Properties
get left_gravity(): boolean;
get leftGravity(): boolean;
get name(): string;
// Fields
segment: any;
// Constructors
constructor(properties?: Partial<TextMark.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string | null, left_gravity: boolean): TextMark;
// Methods
/**
* Gets the buffer this mark is located inside,
* or %NULL if the mark is deleted.
* @returns the mark's #GtkTextBuffer
*/
get_buffer(): TextBuffer;
/**
* Returns %TRUE if the mark has been removed from its buffer
* with gtk_text_buffer_delete_mark(). See gtk_text_buffer_add_mark()
* for a way to add it to a buffer again.
* @returns whether the mark is deleted
*/
get_deleted(): boolean;
/**
* Determines whether the mark has left gravity.
* @returns %TRUE if the mark has left gravity, %FALSE otherwise
*/
get_left_gravity(): boolean;
/**
* Returns the mark name; returns NULL for anonymous marks.
* @returns mark name
*/
get_name(): string;
/**
* Returns %TRUE if the mark is visible (i.e. a cursor is displayed
* for it).
* @returns %TRUE if visible
*/
get_visible(): boolean;
/**
* Sets the visibility of `mark;` the insertion point is normally
* visible, i.e. you can see it as a vertical bar. Also, the text
* widget uses a visible mark to indicate where a drop will occur when
* dragging-and-dropping text. Most other marks are not visible.
* Marks are not visible by default.
* @param setting visibility of mark
*/
set_visible(setting: boolean): void;
}
namespace TextTag {
// Signal callback interfaces
interface Event {
(object: GObject.Object, event: Gdk.Event, iter: TextIter): boolean;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
accumulative_margin: boolean;
accumulativeMargin: boolean;
background: string;
background_full_height: boolean;
backgroundFullHeight: boolean;
background_full_height_set: boolean;
backgroundFullHeightSet: boolean;
background_gdk: Gdk.Color;
backgroundGdk: Gdk.Color;
background_set: boolean;
backgroundSet: boolean;
background_stipple: Gdk.Pixmap;
backgroundStipple: Gdk.Pixmap;
background_stipple_set: boolean;
backgroundStippleSet: boolean;
direction: TextDirection;
editable: boolean;
editable_set: boolean;
editableSet: boolean;
family: string;
family_set: boolean;
familySet: boolean;
font: string;
font_desc: Pango.FontDescription;
fontDesc: Pango.FontDescription;
foreground: string;
foreground_gdk: Gdk.Color;
foregroundGdk: Gdk.Color;
foreground_set: boolean;
foregroundSet: boolean;
foreground_stipple: Gdk.Pixmap;
foregroundStipple: Gdk.Pixmap;
foreground_stipple_set: boolean;
foregroundStippleSet: boolean;
indent: number;
indent_set: boolean;
indentSet: boolean;
invisible: boolean;
invisible_set: boolean;
invisibleSet: boolean;
justification: Justification;
justification_set: boolean;
justificationSet: boolean;
language: string;
language_set: boolean;
languageSet: boolean;
left_margin: number;
leftMargin: number;
left_margin_set: boolean;
leftMarginSet: boolean;
name: string;
paragraph_background: string;
paragraphBackground: string;
paragraph_background_gdk: Gdk.Color;
paragraphBackgroundGdk: Gdk.Color;
paragraph_background_set: boolean;
paragraphBackgroundSet: boolean;
pixels_above_lines: number;
pixelsAboveLines: number;
pixels_above_lines_set: boolean;
pixelsAboveLinesSet: boolean;
pixels_below_lines: number;
pixelsBelowLines: number;
pixels_below_lines_set: boolean;
pixelsBelowLinesSet: boolean;
pixels_inside_wrap: number;
pixelsInsideWrap: number;
pixels_inside_wrap_set: boolean;
pixelsInsideWrapSet: boolean;
right_margin: number;
rightMargin: number;
right_margin_set: boolean;
rightMarginSet: boolean;
rise: number;
rise_set: boolean;
riseSet: boolean;
scale: number;
scale_set: boolean;
scaleSet: boolean;
size: number;
size_points: number;
sizePoints: number;
size_set: boolean;
sizeSet: boolean;
stretch: Pango.Stretch;
stretch_set: boolean;
stretchSet: boolean;
strikethrough: boolean;
strikethrough_set: boolean;
strikethroughSet: boolean;
style: Pango.Style;
style_set: boolean;
styleSet: boolean;
tabs: Pango.TabArray;
tabs_set: boolean;
tabsSet: boolean;
underline: Pango.Underline;
underline_set: boolean;
underlineSet: boolean;
variant: Pango.Variant;
variant_set: boolean;
variantSet: boolean;
weight: number;
weight_set: boolean;
weightSet: boolean;
wrap_mode: WrapMode;
wrapMode: WrapMode;
wrap_mode_set: boolean;
wrapModeSet: boolean;
}
}
class TextTag extends GObject.Object {
static $gtype: GObject.GType<TextTag>;
// Properties
/**
* Whether the margins accumulate or override each other.
*
* When set to %TRUE the margins of this tag are added to the margins
* of any other non-accumulative margins present. When set to %FALSE
* the margins override one another (the default).
*/
get accumulative_margin(): boolean;
set accumulative_margin(val: boolean);
/**
* Whether the margins accumulate or override each other.
*
* When set to %TRUE the margins of this tag are added to the margins
* of any other non-accumulative margins present. When set to %FALSE
* the margins override one another (the default).
*/
get accumulativeMargin(): boolean;
set accumulativeMargin(val: boolean);
set background(val: string);
get background_full_height(): boolean;
set background_full_height(val: boolean);
get backgroundFullHeight(): boolean;
set backgroundFullHeight(val: boolean);
get background_full_height_set(): boolean;
set background_full_height_set(val: boolean);
get backgroundFullHeightSet(): boolean;
set backgroundFullHeightSet(val: boolean);
get background_gdk(): Gdk.Color;
set background_gdk(val: Gdk.Color);
get backgroundGdk(): Gdk.Color;
set backgroundGdk(val: Gdk.Color);
get background_set(): boolean;
set background_set(val: boolean);
get backgroundSet(): boolean;
set backgroundSet(val: boolean);
get background_stipple(): Gdk.Pixmap;
set background_stipple(val: Gdk.Pixmap);
get backgroundStipple(): Gdk.Pixmap;
set backgroundStipple(val: Gdk.Pixmap);
get background_stipple_set(): boolean;
set background_stipple_set(val: boolean);
get backgroundStippleSet(): boolean;
set backgroundStippleSet(val: boolean);
get direction(): TextDirection;
set direction(val: TextDirection);
get editable(): boolean;
set editable(val: boolean);
get editable_set(): boolean;
set editable_set(val: boolean);
get editableSet(): boolean;
set editableSet(val: boolean);
get family(): string;
set family(val: string);
get family_set(): boolean;
set family_set(val: boolean);
get familySet(): boolean;
set familySet(val: boolean);
/**
* Font description as string, e.g. \"Sans Italic 12\".
*
* Note that the initial value of this property depends on
* the internals of #PangoFontDescription.
*/
get font(): string;
set font(val: string);
get font_desc(): Pango.FontDescription;
set font_desc(val: Pango.FontDescription);
get fontDesc(): Pango.FontDescription;
set fontDesc(val: Pango.FontDescription);
set foreground(val: string);
get foreground_gdk(): Gdk.Color;
set foreground_gdk(val: Gdk.Color);
get foregroundGdk(): Gdk.Color;
set foregroundGdk(val: Gdk.Color);
get foreground_set(): boolean;
set foreground_set(val: boolean);
get foregroundSet(): boolean;
set foregroundSet(val: boolean);
get foreground_stipple(): Gdk.Pixmap;
set foreground_stipple(val: Gdk.Pixmap);
get foregroundStipple(): Gdk.Pixmap;
set foregroundStipple(val: Gdk.Pixmap);
get foreground_stipple_set(): boolean;
set foreground_stipple_set(val: boolean);
get foregroundStippleSet(): boolean;
set foregroundStippleSet(val: boolean);
get indent(): number;
set indent(val: number);
get indent_set(): boolean;
set indent_set(val: boolean);
get indentSet(): boolean;
set indentSet(val: boolean);
/**
* Whether this text is hidden.
*
* Note that there may still be problems with the support for invisible
* text, in particular when navigating programmatically inside a buffer
* containing invisible segments.
*/
get invisible(): boolean;
set invisible(val: boolean);
get invisible_set(): boolean;
set invisible_set(val: boolean);
get invisibleSet(): boolean;
set invisibleSet(val: boolean);
get justification(): Justification;
set justification(val: Justification);
get justification_set(): boolean;
set justification_set(val: boolean);
get justificationSet(): boolean;
set justificationSet(val: boolean);
/**
* The language this text is in, as an ISO code. Pango can use this as a
* hint when rendering the text. If not set, an appropriate default will be
* used.
*
* Note that the initial value of this property depends on the current
* locale, see also gtk_get_default_language().
*/
get language(): string;
set language(val: string);
get language_set(): boolean;
set language_set(val: boolean);
get languageSet(): boolean;
set languageSet(val: boolean);
get left_margin(): number;
set left_margin(val: number);
get leftMargin(): number;
set leftMargin(val: number);
get left_margin_set(): boolean;
set left_margin_set(val: boolean);
get leftMarginSet(): boolean;
set leftMarginSet(val: boolean);
get name(): string;
/**
* The paragraph background color as a string.
*/
set paragraph_background(val: string);
/**
* The paragraph background color as a string.
*/
set paragraphBackground(val: string);
/**
* The paragraph background color as a as a (possibly unallocated)
* #GdkColor.
*/
get paragraph_background_gdk(): Gdk.Color;
set paragraph_background_gdk(val: Gdk.Color);
/**
* The paragraph background color as a as a (possibly unallocated)
* #GdkColor.
*/
get paragraphBackgroundGdk(): Gdk.Color;
set paragraphBackgroundGdk(val: Gdk.Color);
get paragraph_background_set(): boolean;
set paragraph_background_set(val: boolean);
get paragraphBackgroundSet(): boolean;
set paragraphBackgroundSet(val: boolean);
get pixels_above_lines(): number;
set pixels_above_lines(val: number);
get pixelsAboveLines(): number;
set pixelsAboveLines(val: number);
get pixels_above_lines_set(): boolean;
set pixels_above_lines_set(val: boolean);
get pixelsAboveLinesSet(): boolean;
set pixelsAboveLinesSet(val: boolean);
get pixels_below_lines(): number;
set pixels_below_lines(val: number);
get pixelsBelowLines(): number;
set pixelsBelowLines(val: number);
get pixels_below_lines_set(): boolean;
set pixels_below_lines_set(val: boolean);
get pixelsBelowLinesSet(): boolean;
set pixelsBelowLinesSet(val: boolean);
get pixels_inside_wrap(): number;
set pixels_inside_wrap(val: number);
get pixelsInsideWrap(): number;
set pixelsInsideWrap(val: number);
get pixels_inside_wrap_set(): boolean;
set pixels_inside_wrap_set(val: boolean);
get pixelsInsideWrapSet(): boolean;
set pixelsInsideWrapSet(val: boolean);
get right_margin(): number;
set right_margin(val: number);
get rightMargin(): number;
set rightMargin(val: number);
get right_margin_set(): boolean;
set right_margin_set(val: boolean);
get rightMarginSet(): boolean;
set rightMarginSet(val: boolean);
get rise(): number;
set rise(val: number);
get rise_set(): boolean;
set rise_set(val: boolean);
get riseSet(): boolean;
set riseSet(val: boolean);
get scale(): number;
set scale(val: number);
get scale_set(): boolean;
set scale_set(val: boolean);
get scaleSet(): boolean;
set scaleSet(val: boolean);
get size(): number;
set size(val: number);
get size_points(): number;
set size_points(val: number);
get sizePoints(): number;
set sizePoints(val: number);
get size_set(): boolean;
set size_set(val: boolean);
get sizeSet(): boolean;
set sizeSet(val: boolean);
get stretch(): Pango.Stretch;
set stretch(val: Pango.Stretch);
get stretch_set(): boolean;
set stretch_set(val: boolean);
get stretchSet(): boolean;
set stretchSet(val: boolean);
get strikethrough(): boolean;
set strikethrough(val: boolean);
get strikethrough_set(): boolean;
set strikethrough_set(val: boolean);
get strikethroughSet(): boolean;
set strikethroughSet(val: boolean);
get style(): Pango.Style;
set style(val: Pango.Style);
get style_set(): boolean;
set style_set(val: boolean);
get styleSet(): boolean;
set styleSet(val: boolean);
get tabs(): Pango.TabArray;
set tabs(val: Pango.TabArray);
get tabs_set(): boolean;
set tabs_set(val: boolean);
get tabsSet(): boolean;
set tabsSet(val: boolean);
get underline(): Pango.Underline;
set underline(val: Pango.Underline);
get underline_set(): boolean;
set underline_set(val: boolean);
get underlineSet(): boolean;
set underlineSet(val: boolean);
get variant(): Pango.Variant;
set variant(val: Pango.Variant);
get variant_set(): boolean;
set variant_set(val: boolean);
get variantSet(): boolean;
set variantSet(val: boolean);
get weight(): number;
set weight(val: number);
get weight_set(): boolean;
set weight_set(val: boolean);
get weightSet(): boolean;
set weightSet(val: boolean);
get wrap_mode(): WrapMode;
set wrap_mode(val: WrapMode);
get wrapMode(): WrapMode;
set wrapMode(val: WrapMode);
get wrap_mode_set(): boolean;
set wrap_mode_set(val: boolean);
get wrapModeSet(): boolean;
set wrapModeSet(val: boolean);
// Fields
table: TextTagTable;
priority: number;
bg_color_set: number;
bg_stipple_set: number;
fg_color_set: number;
fg_stipple_set: number;
bg_full_height_set: number;
pg_bg_color_set: number;
pad1: number;
// Constructors
constructor(properties?: Partial<TextTag.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name?: string | null): TextTag;
// 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: 'event',
callback: (_source: this, object: GObject.Object, event: Gdk.Event, iter: TextIter) => boolean,
): number;
connect_after(
signal: 'event',
callback: (_source: this, object: GObject.Object, event: Gdk.Event, iter: TextIter) => boolean,
): number;
emit(signal: 'event', object: GObject.Object, event: Gdk.Event, iter: TextIter): void;
// Virtual methods
/**
* Emits the "event" signal on the #GtkTextTag.
* @param event_object object that received the event, such as a widget
* @param event the event
* @param iter location where the event was received
*/
vfunc_event(event_object: GObject.Object, event: Gdk.Event, iter: TextIter): boolean;
// Methods
/**
* Emits the "event" signal on the #GtkTextTag.
* @param event_object object that received the event, such as a widget
* @param event the event
* @param iter location where the event was received
* @returns result of signal emission (whether the event was handled)
*/
event(event_object: GObject.Object, event: Gdk.Event, iter: TextIter): boolean;
/**
* Get the tag priority.
* @returns The tag's priority.
*/
get_priority(): number;
/**
* Sets the priority of a #GtkTextTag. Valid priorities are
* start at 0 and go to one less than gtk_text_tag_table_get_size().
* Each tag in a table has a unique priority; setting the priority
* of one tag shifts the priorities of all the other tags in the
* table to maintain a unique priority for each tag. Higher priority
* tags "win" if two tags both set the same text attribute. When adding
* a tag to a tag table, it will be assigned the highest priority in
* the table by default; so normally the precedence of a set of tags
* is the order in which they were added to the table, or created with
* gtk_text_buffer_create_tag(), which adds the tag to the buffer's table
* automatically.
* @param priority the new priority
*/
set_priority(priority: number): void;
}
namespace TextTagTable {
// Signal callback interfaces
interface TagAdded {
(object: TextTag): void;
}
interface TagChanged {
(object: TextTag, p0: boolean): void;
}
interface TagRemoved {
(object: TextTag): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps {}
}
/**
* You may wish to begin by reading the <link linkend="TextWidget">text widget
* conceptual overview</link> which gives an overview of all the objects and data
* types related to the text widget and how they work together.
*
* <refsect2 id="GtkTextTagTable-BUILDER-UI">
* <title>GtkTextTagTables as GtkBuildable</title>
* <para>
* The GtkTextTagTable implementation of the GtkBuildable interface
* supports adding tags by specifying "tag" as the "type"
* attribute of a &lt;child&gt; element.
* </para>
* <example>
* <title>A UI definition fragment specifying tags</title>
* <programlisting><![CDATA[
* <object class="GtkTextTagTable">
* <child type="tag">
* <object class="GtkTextTag"/>
* </child>
* </object>
* ]]></programlisting>
* </example>
* </refsect2>
*/
class TextTagTable extends GObject.Object implements Buildable {
static $gtype: GObject.GType<TextTagTable>;
// Fields
anonymous: any[];
anon_count: number;
buffers: any[];
// Constructors
constructor(properties?: Partial<TextTagTable.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TextTagTable;
// 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: 'tag-added', callback: (_source: this, object: TextTag) => void): number;
connect_after(signal: 'tag-added', callback: (_source: this, object: TextTag) => void): number;
emit(signal: 'tag-added', object: TextTag): void;
connect(signal: 'tag-changed', callback: (_source: this, object: TextTag, p0: boolean) => void): number;
connect_after(
signal: 'tag-changed',
callback: (_source: this, object: TextTag, p0: boolean) => void,
): number;
emit(signal: 'tag-changed', object: TextTag, p0: boolean): void;
connect(signal: 'tag-removed', callback: (_source: this, object: TextTag) => void): number;
connect_after(signal: 'tag-removed', callback: (_source: this, object: TextTag) => void): number;
emit(signal: 'tag-removed', object: TextTag): void;
// Virtual methods
vfunc_tag_added(tag: TextTag): void;
vfunc_tag_changed(tag: TextTag, size_changed: boolean): void;
vfunc_tag_removed(tag: TextTag): void;
// Methods
/**
* Add a tag to the table. The tag is assigned the highest priority
* in the table.
*
* `tag` must not be in a tag table already, and may not have
* the same name as an already-added tag.
* @param tag a #GtkTextTag
*/
add(tag: TextTag): void;
/**
* Calls `func` on each tag in `table,` with user data `data`.
* Note that the table may not be modified while iterating
* over it (you can't add/remove tags).
* @param func a function to call on each tag
*/
foreach(func: TextTagTableForeach): void;
/**
* Returns the size of the table (number of tags)
* @returns number of tags in @table
*/
get_size(): number;
/**
* Look up a named tag.
* @param name name of a tag
* @returns The tag, or %NULL if none by that name is in the table.
*/
lookup(name: string): TextTag;
/**
* Remove a tag from the table. This will remove the table's
* reference to the tag, so be careful - the tag will end
* up destroyed if you don't have a reference to it.
* @param tag a #GtkTextTag
*/
remove(tag: TextTag): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace TextView {
// Signal callback interfaces
interface Backspace {
(): void;
}
interface CopyClipboard {
(): void;
}
interface CutClipboard {
(): void;
}
interface DeleteFromCursor {
(type: DeleteType, count: number): void;
}
interface InsertAtCursor {
(string: string): void;
}
interface MoveCursor {
(step: MovementStep, count: number, extend_selection: boolean): void;
}
interface MoveViewport {
(step: ScrollStep, count: number): void;
}
interface PageHorizontally {
(count: number, extend_selection: boolean): void;
}
interface PasteClipboard {
(): void;
}
interface PopulatePopup {
(menu: Menu): void;
}
interface PreeditChanged {
(preedit: string): void;
}
interface SelectAll {
(select: boolean): void;
}
interface SetAnchor {
(): void;
}
interface SetScrollAdjustments {
(object: Adjustment, p0: Adjustment): void;
}
interface ToggleCursorVisible {
(): void;
}
interface ToggleOverwrite {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
accepts_tab: boolean;
acceptsTab: boolean;
buffer: TextBuffer;
cursor_visible: boolean;
cursorVisible: boolean;
editable: boolean;
im_module: string;
imModule: string;
indent: number;
justification: Justification;
left_margin: number;
leftMargin: number;
overwrite: boolean;
pixels_above_lines: number;
pixelsAboveLines: number;
pixels_below_lines: number;
pixelsBelowLines: number;
pixels_inside_wrap: number;
pixelsInsideWrap: number;
right_margin: number;
rightMargin: number;
tabs: Pango.TabArray;
wrap_mode: WrapMode;
wrapMode: WrapMode;
}
}
class TextView extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<TextView>;
// Properties
get accepts_tab(): boolean;
set accepts_tab(val: boolean);
get acceptsTab(): boolean;
set acceptsTab(val: boolean);
get buffer(): TextBuffer;
set buffer(val: TextBuffer);
get cursor_visible(): boolean;
set cursor_visible(val: boolean);
get cursorVisible(): boolean;
set cursorVisible(val: boolean);
get editable(): boolean;
set editable(val: boolean);
/**
* Which IM (input method) module should be used for this entry.
* See #GtkIMContext.
*
* Setting this to a non-%NULL value overrides the
* system-wide IM module setting. See the GtkSettings
* #GtkSettings:gtk-im-module property.
*/
get im_module(): string;
set im_module(val: string);
/**
* Which IM (input method) module should be used for this entry.
* See #GtkIMContext.
*
* Setting this to a non-%NULL value overrides the
* system-wide IM module setting. See the GtkSettings
* #GtkSettings:gtk-im-module property.
*/
get imModule(): string;
set imModule(val: string);
get indent(): number;
set indent(val: number);
get justification(): Justification;
set justification(val: Justification);
get left_margin(): number;
set left_margin(val: number);
get leftMargin(): number;
set leftMargin(val: number);
get overwrite(): boolean;
set overwrite(val: boolean);
get pixels_above_lines(): number;
set pixels_above_lines(val: number);
get pixelsAboveLines(): number;
set pixelsAboveLines(val: number);
get pixels_below_lines(): number;
set pixels_below_lines(val: number);
get pixelsBelowLines(): number;
set pixelsBelowLines(val: number);
get pixels_inside_wrap(): number;
set pixels_inside_wrap(val: number);
get pixelsInsideWrap(): number;
set pixelsInsideWrap(val: number);
get right_margin(): number;
set right_margin(val: number);
get rightMargin(): number;
set rightMargin(val: number);
get tabs(): Pango.TabArray;
set tabs(val: Pango.TabArray);
get wrap_mode(): WrapMode;
set wrap_mode(val: WrapMode);
get wrapMode(): WrapMode;
set wrapMode(val: WrapMode);
// Fields
layout: any;
selection_drag_handler: number;
scroll_timeout: number;
justify: Justification;
overwrite_mode: number;
need_im_reset: number;
width_changed: number;
onscreen_validated: number;
mouse_cursor_obscured: number;
hadjustment: Adjustment;
vadjustment: Adjustment;
xoffset: number;
yoffset: number;
width: number;
height: number;
virtual_cursor_x: number;
virtual_cursor_y: number;
first_para_mark: TextMark;
first_para_pixels: number;
dnd_mark: TextMark;
blink_timeout: number;
first_validate_idle: number;
incremental_validate_idle: number;
im_context: IMContext;
popup_menu: Widget;
drag_start_x: number;
drag_start_y: number;
children: any[];
pending_place_cursor_button: number;
// Constructors
constructor(properties?: Partial<TextView.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TextView;
static new_with_buffer(buffer: TextBuffer): TextView;
// 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: 'backspace', callback: (_source: this) => void): number;
connect_after(signal: 'backspace', callback: (_source: this) => void): number;
emit(signal: 'backspace'): void;
connect(signal: 'copy-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'copy-clipboard', callback: (_source: this) => void): number;
emit(signal: 'copy-clipboard'): void;
connect(signal: 'cut-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'cut-clipboard', callback: (_source: this) => void): number;
emit(signal: 'cut-clipboard'): void;
connect(
signal: 'delete-from-cursor',
callback: (_source: this, type: DeleteType, count: number) => void,
): number;
connect_after(
signal: 'delete-from-cursor',
callback: (_source: this, type: DeleteType, count: number) => void,
): number;
emit(signal: 'delete-from-cursor', type: DeleteType, count: number): void;
connect(signal: 'insert-at-cursor', callback: (_source: this, string: string) => void): number;
connect_after(signal: 'insert-at-cursor', callback: (_source: this, string: string) => void): number;
emit(signal: 'insert-at-cursor', string: string): void;
connect(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number, extend_selection: boolean) => void,
): number;
connect_after(
signal: 'move-cursor',
callback: (_source: this, step: MovementStep, count: number, extend_selection: boolean) => void,
): number;
emit(signal: 'move-cursor', step: MovementStep, count: number, extend_selection: boolean): void;
connect(
signal: 'move-viewport',
callback: (_source: this, step: ScrollStep, count: number) => void,
): number;
connect_after(
signal: 'move-viewport',
callback: (_source: this, step: ScrollStep, count: number) => void,
): number;
emit(signal: 'move-viewport', step: ScrollStep, count: number): void;
connect(
signal: 'page-horizontally',
callback: (_source: this, count: number, extend_selection: boolean) => void,
): number;
connect_after(
signal: 'page-horizontally',
callback: (_source: this, count: number, extend_selection: boolean) => void,
): number;
emit(signal: 'page-horizontally', count: number, extend_selection: boolean): void;
connect(signal: 'paste-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'paste-clipboard', callback: (_source: this) => void): number;
emit(signal: 'paste-clipboard'): void;
connect(signal: 'populate-popup', callback: (_source: this, menu: Menu) => void): number;
connect_after(signal: 'populate-popup', callback: (_source: this, menu: Menu) => void): number;
emit(signal: 'populate-popup', menu: Menu): void;
connect(signal: 'preedit-changed', callback: (_source: this, preedit: string) => void): number;
connect_after(signal: 'preedit-changed', callback: (_source: this, preedit: string) => void): number;
emit(signal: 'preedit-changed', preedit: string): void;
connect(signal: 'select-all', callback: (_source: this, select: boolean) => void): number;
connect_after(signal: 'select-all', callback: (_source: this, select: boolean) => void): number;
emit(signal: 'select-all', select: boolean): void;
connect(signal: 'set-anchor', callback: (_source: this) => void): number;
connect_after(signal: 'set-anchor', callback: (_source: this) => void): number;
emit(signal: 'set-anchor'): void;
connect(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
connect_after(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
emit(signal: 'set-scroll-adjustments', object: Adjustment, p0: Adjustment): void;
connect(signal: 'toggle-cursor-visible', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-cursor-visible', callback: (_source: this) => void): number;
emit(signal: 'toggle-cursor-visible'): void;
connect(signal: 'toggle-overwrite', callback: (_source: this) => void): number;
connect_after(signal: 'toggle-overwrite', callback: (_source: this) => void): number;
emit(signal: 'toggle-overwrite'): void;
// Virtual methods
vfunc_backspace(): void;
vfunc_copy_clipboard(): void;
vfunc_cut_clipboard(): void;
vfunc_delete_from_cursor(type: DeleteType, count: number): void;
vfunc_insert_at_cursor(str: string): void;
vfunc_move_cursor(step: MovementStep, count: number, extend_selection: boolean): void;
vfunc_move_focus(direction: DirectionType): void;
vfunc_page_horizontally(count: number, extend_selection: boolean): void;
vfunc_paste_clipboard(): void;
vfunc_populate_popup(menu: Menu): void;
vfunc_set_anchor(): void;
vfunc_set_scroll_adjustments(hadjustment: Adjustment, vadjustment: Adjustment): void;
vfunc_toggle_overwrite(): void;
// Methods
/**
* Adds a child widget in the text buffer, at the given `anchor`.
* @param child a #GtkWidget
* @param anchor a #GtkTextChildAnchor in the #GtkTextBuffer for @text_view
*/
add_child_at_anchor(child: Widget, anchor: TextChildAnchor): void;
/**
* Adds a child at fixed coordinates in one of the text widget's
* windows. The window must have nonzero size (see
* gtk_text_view_set_border_window_size()). Note that the child
* coordinates are given relative to the #GdkWindow in question, and
* that these coordinates have no sane relationship to scrolling. When
* placing a child in #GTK_TEXT_WINDOW_WIDGET, scrolling is
* irrelevant, the child floats above all scrollable areas. But when
* placing a child in one of the scrollable windows (border windows or
* text window), you'll need to compute the child's correct position
* in buffer coordinates any time scrolling occurs or buffer changes
* occur, and then call gtk_text_view_move_child() to update the
* child's position. Unfortunately there's no good way to detect that
* scrolling has occurred, using the current API; a possible hack
* would be to update all child positions when the scroll adjustments
* change or the text buffer changes. See bug 64518 on
* bugzilla.gnome.org for status of fixing this issue.
* @param child a #GtkWidget
* @param which_window which window the child should appear in
* @param xpos X position of child in window coordinates
* @param ypos Y position of child in window coordinates
*/
add_child_in_window(child: Widget, which_window: TextWindowType | null, xpos: number, ypos: number): void;
/**
* Moves the given `iter` backward by one display (wrapped) line.
* A display line is different from a paragraph. Paragraphs are
* separated by newlines or other paragraph separator characters.
* Display lines are created by line-wrapping a paragraph. If
* wrapping is turned off, display lines and paragraphs will be the
* same. Display lines are divided differently for each view, since
* they depend on the view's width; paragraphs are the same in all
* views, since they depend on the contents of the #GtkTextBuffer.
* @param iter a #GtkTextIter
* @returns %TRUE if @iter was moved and is not on the end iterator
*/
backward_display_line(iter: TextIter): boolean;
/**
* Moves the given `iter` backward to the next display line start.
* A display line is different from a paragraph. Paragraphs are
* separated by newlines or other paragraph separator characters.
* Display lines are created by line-wrapping a paragraph. If
* wrapping is turned off, display lines and paragraphs will be the
* same. Display lines are divided differently for each view, since
* they depend on the view's width; paragraphs are the same in all
* views, since they depend on the contents of the #GtkTextBuffer.
* @param iter a #GtkTextIter
* @returns %TRUE if @iter was moved and is not on the end iterator
*/
backward_display_line_start(iter: TextIter): boolean;
/**
* Converts coordinate (`buffer_x,` `buffer_y)` to coordinates for the window
* `win,` and stores the result in (`window_x,` `window_y)`.
*
* Note that you can't convert coordinates for a nonexisting window (see
* gtk_text_view_set_border_window_size()).
* @param win a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE
* @param buffer_x buffer x coordinate
* @param buffer_y buffer y coordinate
*/
buffer_to_window_coords(win: TextWindowType | null, buffer_x: number, buffer_y: number): [number, number];
/**
* Moves the given `iter` forward by one display (wrapped) line.
* A display line is different from a paragraph. Paragraphs are
* separated by newlines or other paragraph separator characters.
* Display lines are created by line-wrapping a paragraph. If
* wrapping is turned off, display lines and paragraphs will be the
* same. Display lines are divided differently for each view, since
* they depend on the view's width; paragraphs are the same in all
* views, since they depend on the contents of the #GtkTextBuffer.
* @param iter a #GtkTextIter
* @returns %TRUE if @iter was moved and is not on the end iterator
*/
forward_display_line(iter: TextIter): boolean;
/**
* Moves the given `iter` forward to the next display line end.
* A display line is different from a paragraph. Paragraphs are
* separated by newlines or other paragraph separator characters.
* Display lines are created by line-wrapping a paragraph. If
* wrapping is turned off, display lines and paragraphs will be the
* same. Display lines are divided differently for each view, since
* they depend on the view's width; paragraphs are the same in all
* views, since they depend on the contents of the #GtkTextBuffer.
* @param iter a #GtkTextIter
* @returns %TRUE if @iter was moved and is not on the end iterator
*/
forward_display_line_end(iter: TextIter): boolean;
/**
* Returns whether pressing the Tab key inserts a tab characters.
* gtk_text_view_set_accepts_tab().
* @returns %TRUE if pressing the Tab key inserts a tab character, %FALSE if pressing the Tab key moves the keyboard focus.
*/
get_accepts_tab(): boolean;
/**
* Gets the width of the specified border window. See
* gtk_text_view_set_border_window_size().
* @param type window to return size from
* @returns width of window
*/
get_border_window_size(type: TextWindowType | null): number;
/**
* Returns the #GtkTextBuffer being displayed by this text view.
* The reference count on the buffer is not incremented; the caller
* of this function won't own a new reference.
* @returns a #GtkTextBuffer
*/
get_buffer(): TextBuffer;
/**
* Find out whether the cursor is being displayed.
* @returns whether the insertion mark is visible
*/
get_cursor_visible(): boolean;
/**
* Obtains a copy of the default text attributes. These are the
* attributes used for text unless a tag overrides them.
* You'd typically pass the default attributes in to
* gtk_text_iter_get_attributes() in order to get the
* attributes in effect at a given text position.
*
* The return value is a copy owned by the caller of this function,
* and should be freed.
* @returns a new #GtkTextAttributes
*/
get_default_attributes(): TextAttributes;
/**
* Returns the default editability of the #GtkTextView. Tags in the
* buffer may override this setting for some ranges of text.
* @returns whether text is editable by default
*/
get_editable(): boolean;
/**
* Gets the horizontal-scrolling #GtkAdjustment.
* @returns pointer to the horizontal #GtkAdjustment
*/
get_hadjustment(): Adjustment;
/**
* Gets the default indentation of paragraphs in `text_view`.
* Tags in the view's buffer may override the default.
* The indentation may be negative.
* @returns number of pixels of indentation
*/
get_indent(): number;
/**
* Retrieves the iterator at buffer coordinates `x` and `y`. Buffer
* coordinates are coordinates for the entire buffer, not just the
* currently-displayed portion. If you have coordinates from an
* event, you have to convert those to buffer coordinates with
* gtk_text_view_window_to_buffer_coords().
* @param x x position, in buffer coordinates
* @param y y position, in buffer coordinates
*/
get_iter_at_location(x: number, y: number): TextIter;
/**
* Retrieves the iterator pointing to the character at buffer
* coordinates `x` and `y`. Buffer coordinates are coordinates for
* the entire buffer, not just the currently-displayed portion.
* If you have coordinates from an event, you have to convert
* those to buffer coordinates with
* gtk_text_view_window_to_buffer_coords().
*
* Note that this is different from gtk_text_view_get_iter_at_location(),
* which returns cursor locations, i.e. positions <emphasis>between</emphasis>
* characters.
* @param x x position, in buffer coordinates
* @param y y position, in buffer coordinates
*/
get_iter_at_position(x: number, y: number): [TextIter, number];
/**
* Gets a rectangle which roughly contains the character at `iter`.
* The rectangle position is in buffer coordinates; use
* gtk_text_view_buffer_to_window_coords() to convert these
* coordinates to coordinates for one of the windows in the text view.
* @param iter a #GtkTextIter
*/
get_iter_location(iter: TextIter): Gdk.Rectangle;
/**
* Gets the default justification of paragraphs in `text_view`.
* Tags in the buffer may override the default.
* @returns default justification
*/
get_justification(): Justification;
/**
* Gets the default left margin size of paragraphs in the `text_view`.
* Tags in the buffer may override the default.
* @returns left margin in pixels
*/
get_left_margin(): number;
/**
* Gets the #GtkTextIter at the start of the line containing
* the coordinate `y`. `y` is in buffer coordinates, convert from
* window coordinates with gtk_text_view_window_to_buffer_coords().
* If non-%NULL, `line_top` will be filled with the coordinate of the top
* edge of the line.
* @param y a y coordinate
*/
get_line_at_y(y: number): [TextIter, number];
/**
* Gets the y coordinate of the top of the line containing `iter,`
* and the height of the line. The coordinate is a buffer coordinate;
* convert to window coordinates with gtk_text_view_buffer_to_window_coords().
* @param iter a #GtkTextIter
*/
get_line_yrange(iter: TextIter): [number, number];
/**
* Returns whether the #GtkTextView is in overwrite mode or not.
* @returns whether @text_view is in overwrite mode or not.
*/
get_overwrite(): boolean;
/**
* Gets the default number of pixels to put above paragraphs.
* @returns default number of pixels above paragraphs
*/
get_pixels_above_lines(): number;
/**
* Gets the value set by gtk_text_view_set_pixels_below_lines().
* @returns default number of blank pixels below paragraphs
*/
get_pixels_below_lines(): number;
/**
* Gets the value set by gtk_text_view_set_pixels_inside_wrap().
* @returns default number of pixels of blank space between wrapped lines
*/
get_pixels_inside_wrap(): number;
/**
* Gets the default right margin for text in `text_view`. Tags
* in the buffer may override the default.
* @returns right margin in pixels
*/
get_right_margin(): number;
/**
* Gets the default tabs for `text_view`. Tags in the buffer may
* override the defaults. The returned array will be %NULL if
* "standard" (8-space) tabs are used. Free the return value
* with pango_tab_array_free().
* @returns copy of default tab array, or %NULL if "standard" tabs are used; must be freed with pango_tab_array_free().
*/
get_tabs(): Pango.TabArray;
/**
* Gets the vertical-scrolling #GtkAdjustment.
* @returns pointer to the vertical #GtkAdjustment
*/
get_vadjustment(): Adjustment;
/**
* Fills `visible_rect` with the currently-visible
* region of the buffer, in buffer coordinates. Convert to window coordinates
* with gtk_text_view_buffer_to_window_coords().
*/
get_visible_rect(): Gdk.Rectangle;
/**
* Retrieves the #GdkWindow corresponding to an area of the text view;
* possible windows include the overall widget window, child windows
* on the left, right, top, bottom, and the window that displays the
* text buffer. Windows are %NULL and nonexistent if their width or
* height is 0, and are nonexistent before the widget has been
* realized.
* @param win window to get
* @returns a #GdkWindow, or %NULL
*/
get_window(win: TextWindowType | null): Gdk.Window;
// Conflicted with Gtk.Widget.get_window
get_window(...args: never[]): any;
/**
* Usually used to find out which window an event corresponds to.
* If you connect to an event signal on `text_view,` this function
* should be called on <literal>event-&gt;window</literal> to
* see which window it was.
* @param window a window type
* @returns the window type.
*/
get_window_type(window: Gdk.Window): TextWindowType;
/**
* Gets the line wrapping for the view.
* @returns the line wrap setting
*/
get_wrap_mode(): WrapMode;
/**
* Allow the #GtkTextView input method to internally handle key press
* and release events. If this function returns %TRUE, then no further
* processing should be done for this key event. See
* gtk_im_context_filter_keypress().
*
* Note that you are expected to call this function from your handler
* when overriding key event handling. This is needed in the case when
* you need to insert your own key handling between the input method
* and the default key event handling of the #GtkTextView.
*
*
* ```
* static gboolean
* gtk_foo_bar_key_press_event (GtkWidget *widget,
* GdkEventKey *event)
* {
* if ((key->keyval == GDK_Return || key->keyval == GDK_KP_Enter))
* {
* if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event))
* return TRUE;
* }
*
* /&ast; Do some stuff &ast;/
*
* return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
* }
* ```
*
* @param event the key event
* @returns %TRUE if the input method handled the key event.
*/
im_context_filter_keypress(event: Gdk.EventKey): boolean;
/**
* Updates the position of a child, as for gtk_text_view_add_child_in_window().
* @param child child widget already added to the text view
* @param xpos new X position in window coordinates
* @param ypos new Y position in window coordinates
*/
move_child(child: Widget, xpos: number, ypos: number): void;
/**
* Moves a mark within the buffer so that it's
* located within the currently-visible text area.
* @param mark a #GtkTextMark
* @returns %TRUE if the mark moved (wasn't already onscreen)
*/
move_mark_onscreen(mark: TextMark): boolean;
/**
* Move the iterator a given number of characters visually, treating
* it as the strong cursor position. If `count` is positive, then the
* new strong cursor position will be `count` positions to the right of
* the old cursor position. If `count` is negative then the new strong
* cursor position will be `count` positions to the left of the old
* cursor position.
*
* In the presence of bi-directional text, the correspondence
* between logical and visual order will depend on the direction
* of the current run, and there may be jumps when the cursor
* is moved off of the end of a run.
* @param iter a #GtkTextIter
* @param count number of characters to move (negative moves left, positive moves right)
* @returns %TRUE if @iter moved and is not on the end iterator
*/
move_visually(iter: TextIter, count: number): boolean;
/**
* Moves the cursor to the currently visible region of the
* buffer, it it isn't there already.
* @returns %TRUE if the cursor had to be moved.
*/
place_cursor_onscreen(): boolean;
/**
* Reset the input method context of the text view if needed.
*
* This can be necessary in the case where modifying the buffer
* would confuse on-going input method behavior.
*/
reset_im_context(): void;
/**
* Scrolls `text_view` the minimum distance such that `mark` is contained
* within the visible area of the widget.
* @param mark a mark in the buffer for @text_view
*/
scroll_mark_onscreen(mark: TextMark): void;
/**
* Scrolls `text_view` so that `iter` is on the screen in the position
* indicated by `xalign` and `yalign`. An alignment of 0.0 indicates
* left or top, 1.0 indicates right or bottom, 0.5 means center.
* If `use_align` is %FALSE, the text scrolls the minimal distance to
* get the mark onscreen, possibly not scrolling at all. The effective
* screen for purposes of this function is reduced by a margin of size
* `within_margin`.
*
* Note that this function uses the currently-computed height of the
* lines in the text buffer. Line heights are computed in an idle
* handler; so this function may not have the desired effect if it's
* called before the height computations. To avoid oddness, consider
* using gtk_text_view_scroll_to_mark() which saves a point to be
* scrolled to after line validation.
* @param iter a #GtkTextIter
* @param within_margin margin as a [0.0,0.5) fraction of screen size
* @param use_align whether to use alignment arguments (if %FALSE, just get the mark onscreen)
* @param xalign horizontal alignment of mark within visible area
* @param yalign vertical alignment of mark within visible area
* @returns %TRUE if scrolling occurred
*/
scroll_to_iter(
iter: TextIter,
within_margin: number,
use_align: boolean,
xalign: number,
yalign: number,
): boolean;
/**
* Scrolls `text_view` so that `mark` is on the screen in the position
* indicated by `xalign` and `yalign`. An alignment of 0.0 indicates
* left or top, 1.0 indicates right or bottom, 0.5 means center.
* If `use_align` is %FALSE, the text scrolls the minimal distance to
* get the mark onscreen, possibly not scrolling at all. The effective
* screen for purposes of this function is reduced by a margin of size
* `within_margin`.
* @param mark a #GtkTextMark
* @param within_margin margin as a [0.0,0.5) fraction of screen size
* @param use_align whether to use alignment arguments (if %FALSE, just get the mark onscreen)
* @param xalign horizontal alignment of mark within visible area
* @param yalign vertical alignment of mark within visible area
*/
scroll_to_mark(
mark: TextMark,
within_margin: number,
use_align: boolean,
xalign: number,
yalign: number,
): void;
/**
* Sets the behavior of the text widget when the Tab key is pressed.
* If `accepts_tab` is %TRUE, a tab character is inserted. If `accepts_tab`
* is %FALSE the keyboard focus is moved to the next widget in the focus
* chain.
* @param accepts_tab %TRUE if pressing the Tab key should insert a tab character, %FALSE, if pressing the Tab key should move the keyboard focus.
*/
set_accepts_tab(accepts_tab: boolean): void;
/**
* Sets the width of %GTK_TEXT_WINDOW_LEFT or %GTK_TEXT_WINDOW_RIGHT,
* or the height of %GTK_TEXT_WINDOW_TOP or %GTK_TEXT_WINDOW_BOTTOM.
* Automatically destroys the corresponding window if the size is set
* to 0, and creates the window if the size is set to non-zero. This
* function can only be used for the "border windows," it doesn't work
* with #GTK_TEXT_WINDOW_WIDGET, #GTK_TEXT_WINDOW_TEXT, or
* #GTK_TEXT_WINDOW_PRIVATE.
* @param type window to affect
* @param size width or height of the window
*/
set_border_window_size(type: TextWindowType | null, size: number): void;
/**
* Sets `buffer` as the buffer being displayed by `text_view`. The previous
* buffer displayed by the text view is unreferenced, and a reference is
* added to `buffer`. If you owned a reference to `buffer` before passing it
* to this function, you must remove that reference yourself; #GtkTextView
* will not "adopt" it.
* @param buffer a #GtkTextBuffer
*/
set_buffer(buffer?: TextBuffer | null): void;
/**
* Toggles whether the insertion point is displayed. A buffer with no editable
* text probably shouldn't have a visible cursor, so you may want to turn
* the cursor off.
* @param setting whether to show the insertion cursor
*/
set_cursor_visible(setting: boolean): void;
/**
* Sets the default editability of the #GtkTextView. You can override
* this default setting with tags in the buffer, using the "editable"
* attribute of tags.
* @param setting whether it's editable
*/
set_editable(setting: boolean): void;
/**
* Sets the default indentation for paragraphs in `text_view`.
* Tags in the buffer may override the default.
* @param indent indentation in pixels
*/
set_indent(indent: number): void;
/**
* Sets the default justification of text in `text_view`.
* Tags in the view's buffer may override the default.
* @param justification justification
*/
set_justification(justification: Justification | null): void;
/**
* Sets the default left margin for text in `text_view`.
* Tags in the buffer may override the default.
* @param left_margin left margin in pixels
*/
set_left_margin(left_margin: number): void;
/**
* Changes the #GtkTextView overwrite mode.
* @param overwrite %TRUE to turn on overwrite mode, %FALSE to turn it off
*/
set_overwrite(overwrite: boolean): void;
/**
* Sets the default number of blank pixels above paragraphs in `text_view`.
* Tags in the buffer for `text_view` may override the defaults.
* @param pixels_above_lines pixels above paragraphs
*/
set_pixels_above_lines(pixels_above_lines: number): void;
/**
* Sets the default number of pixels of blank space
* to put below paragraphs in `text_view`. May be overridden
* by tags applied to `text_view'`s buffer.
* @param pixels_below_lines pixels below paragraphs
*/
set_pixels_below_lines(pixels_below_lines: number): void;
/**
* Sets the default number of pixels of blank space to leave between
* display/wrapped lines within a paragraph. May be overridden by
* tags in `text_view'`s buffer.
* @param pixels_inside_wrap default number of pixels between wrapped lines
*/
set_pixels_inside_wrap(pixels_inside_wrap: number): void;
/**
* Sets the default right margin for text in the text view.
* Tags in the buffer may override the default.
* @param right_margin right margin in pixels
*/
set_right_margin(right_margin: number): void;
/**
* Sets the default tab stops for paragraphs in `text_view`.
* Tags in the buffer may override the default.
* @param tabs tabs as a #PangoTabArray
*/
set_tabs(tabs: Pango.TabArray): void;
/**
* Sets the line wrapping for the view.
* @param wrap_mode a #GtkWrapMode
*/
set_wrap_mode(wrap_mode: WrapMode | null): void;
/**
* Determines whether `iter` is at the start of a display line.
* See gtk_text_view_forward_display_line() for an explanation of
* display lines vs. paragraphs.
* @param iter a #GtkTextIter
* @returns %TRUE if @iter begins a wrapped line
*/
starts_display_line(iter: TextIter): boolean;
/**
* Converts coordinates on the window identified by `win` to buffer
* coordinates, storing the result in (`buffer_x,``buffer_y)`.
*
* Note that you can't convert coordinates for a nonexisting window (see
* gtk_text_view_set_border_window_size()).
* @param win a #GtkTextWindowType except #GTK_TEXT_WINDOW_PRIVATE
* @param window_x window x coordinate
* @param window_y window y coordinate
*/
window_to_buffer_coords(win: TextWindowType | null, window_x: number, window_y: number): [number, number];
// Inherited methods
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace TipsQuery {
// Signal callback interfaces
interface StartQuery {
(): void;
}
interface StopQuery {
(): void;
}
interface WidgetEntered {
(object: Widget, p0: string, p1: string): void;
}
interface WidgetSelected {
(object: Widget, p0: string, p1: string, p2: Gdk.Event): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends Label.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
caller: Widget;
emit_always: boolean;
emitAlways: boolean;
label_inactive: string;
labelInactive: string;
label_no_tip: string;
labelNoTip: string;
}
}
class TipsQuery extends Label implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<TipsQuery>;
// Properties
get caller(): Widget;
set caller(val: Widget);
get emit_always(): boolean;
set emit_always(val: boolean);
get emitAlways(): boolean;
set emitAlways(val: boolean);
get label_inactive(): string;
set label_inactive(val: string);
get labelInactive(): string;
set labelInactive(val: string);
get label_no_tip(): string;
set label_no_tip(val: string);
get labelNoTip(): string;
set labelNoTip(val: string);
// Fields
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
label: Label;
in_query: number;
last_crossed: Widget;
// Constructors
constructor(properties?: Partial<TipsQuery.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TipsQuery;
// 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: 'start-query', callback: (_source: this) => void): number;
connect_after(signal: 'start-query', callback: (_source: this) => void): number;
emit(signal: 'start-query'): void;
connect(signal: 'stop-query', callback: (_source: this) => void): number;
connect_after(signal: 'stop-query', callback: (_source: this) => void): number;
emit(signal: 'stop-query'): void;
connect(
signal: 'widget-entered',
callback: (_source: this, object: Widget, p0: string, p1: string) => void,
): number;
connect_after(
signal: 'widget-entered',
callback: (_source: this, object: Widget, p0: string, p1: string) => void,
): number;
emit(signal: 'widget-entered', object: Widget, p0: string, p1: string): void;
connect(
signal: 'widget-selected',
callback: (_source: this, object: Widget, p0: string, p1: string, p2: Gdk.Event) => boolean,
): number;
connect_after(
signal: 'widget-selected',
callback: (_source: this, object: Widget, p0: string, p1: string, p2: Gdk.Event) => boolean,
): number;
emit(signal: 'widget-selected', object: Widget, p0: string, p1: string, p2: Gdk.Event): void;
// Virtual methods
vfunc_start_query(): void;
vfunc_stop_query(): void;
vfunc_widget_entered(widget: Widget, tip_text: string, tip_private: string): void;
vfunc_widget_selected(
widget: Widget,
tip_text: string,
tip_private: string,
event: Gdk.EventButton,
): number;
// Methods
set_caller(caller: Widget): void;
set_labels(label_inactive: string, label_no_tip: string): void;
start_query(): void;
stop_query(): 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 ToggleAction {
// Signal callback interfaces
interface Toggled {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends Action.ConstructorProps, Buildable.ConstructorProps {
active: boolean;
draw_as_radio: boolean;
drawAsRadio: boolean;
}
}
class ToggleAction extends Action implements Buildable {
static $gtype: GObject.GType<ToggleAction>;
// Properties
/**
* If the toggle action should be active in or not.
*/
get active(): boolean;
set active(val: boolean);
/**
* Whether the proxies for this action look like radio action proxies.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get draw_as_radio(): boolean;
set draw_as_radio(val: boolean);
/**
* Whether the proxies for this action look like radio action proxies.
*
* This is an appearance property and thus only applies if
* #GtkActivatable:use-action-appearance is %TRUE.
*/
get drawAsRadio(): boolean;
set drawAsRadio(val: boolean);
// Constructors
constructor(properties?: Partial<ToggleAction.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string, label: string | null, tooltip: string | null, stock_id: string): ToggleAction;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'toggled', callback: (_source: this) => void): number;
connect_after(signal: 'toggled', callback: (_source: this) => void): number;
emit(signal: 'toggled'): void;
// Virtual methods
/**
* Emits the "toggled" signal on the toggle action.
*/
vfunc_toggled(): void;
// Methods
/**
* Returns the checked state of the toggle action.
* @returns the checked state of the toggle action
*/
get_active(): boolean;
/**
* Returns whether the action should have proxies like a radio action.
* @returns whether the action should have proxies like a radio action.
*/
get_draw_as_radio(): boolean;
/**
* Sets the checked state on the toggle action.
* @param is_active whether the action should be checked or not
*/
set_active(is_active: boolean): void;
/**
* Sets whether the action should have proxies like a radio action.
* @param draw_as_radio whether the action should have proxies like a radio action
*/
set_draw_as_radio(draw_as_radio: boolean): void;
/**
* Emits the "toggled" signal on the toggle action.
*/
toggled(): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ToggleButton {
// Signal callback interfaces
interface Toggled {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Button.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
active: boolean;
draw_indicator: boolean;
drawIndicator: boolean;
inconsistent: boolean;
}
}
class ToggleButton extends Button implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<ToggleButton>;
// Properties
get active(): boolean;
set active(val: boolean);
get draw_indicator(): boolean;
set draw_indicator(val: boolean);
get drawIndicator(): boolean;
set drawIndicator(val: boolean);
get inconsistent(): boolean;
set inconsistent(val: boolean);
// Fields
button: Button;
// Constructors
constructor(properties?: Partial<ToggleButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ToggleButton;
static new_with_label(label: string): ToggleButton;
static new_with_mnemonic(label: string): ToggleButton;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'toggled', callback: (_source: this) => void): number;
connect_after(signal: 'toggled', callback: (_source: this) => void): number;
emit(signal: 'toggled'): void;
// Virtual methods
vfunc_toggled(): void;
// Methods
get_active(): boolean;
/**
* Gets the value set by gtk_toggle_button_set_inconsistent().
* @returns %TRUE if the button is displayed as inconsistent, %FALSE otherwise
*/
get_inconsistent(): boolean;
/**
* Retrieves whether the button is displayed as a separate indicator
* and label. See gtk_toggle_button_set_mode().
* @returns %TRUE if the togglebutton is drawn as a separate indicator and label.
*/
get_mode(): boolean;
set_active(is_active: boolean): void;
/**
* If the user has selected a range of elements (such as some text or
* spreadsheet cells) that are affected by a toggle button, and the
* current values in that range are inconsistent, you may want to
* display the toggle in an "in between" state. This function turns on
* "in between" display. Normally you would turn off the inconsistent
* state again if the user toggles the toggle button. This has to be
* done manually, gtk_toggle_button_set_inconsistent() only affects
* visual appearance, it doesn't affect the semantics of the button.
* @param setting %TRUE if state is inconsistent
*/
set_inconsistent(setting: boolean): void;
/**
* Sets whether the button is displayed as a separate indicator and label.
* You can call this function on a checkbutton or a radiobutton with
* `draw_indicator` = %FALSE to make the button look like a normal button
*
* This function only affects instances of classes like #GtkCheckButton
* and #GtkRadioButton that derive from #GtkToggleButton,
* not instances of #GtkToggleButton itself.
* @param draw_indicator if %TRUE, draw the button as a separate indicator and label; if %FALSE, draw the button like a normal button
*/
set_mode(draw_indicator: boolean): void;
toggled(): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ToggleToolButton {
// Signal callback interfaces
interface Toggled {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends ToolButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
active: boolean;
}
}
class ToggleToolButton extends ToolButton implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<ToggleToolButton>;
// Properties
/**
* If the toggle tool button should be pressed in or not.
*/
get active(): boolean;
set active(val: boolean);
// Constructors
constructor(properties?: Partial<ToggleToolButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ToggleToolButton;
static new_from_stock(stock_id: string): ToggleToolButton;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'toggled', callback: (_source: this) => void): number;
connect_after(signal: 'toggled', callback: (_source: this) => void): number;
emit(signal: 'toggled'): void;
// Virtual methods
vfunc_toggled(): void;
// Methods
/**
* Queries a #GtkToggleToolButton and returns its current state.
* Returns %TRUE if the toggle button is pressed in and %FALSE if it is raised.
* @returns %TRUE if the toggle tool button is pressed in, %FALSE if not
*/
get_active(): boolean;
/**
* Sets the status of the toggle tool button. Set to %TRUE if you
* want the GtkToggleButton to be 'pressed in', and %FALSE to raise it.
* This action causes the toggled signal to be emitted.
* @param is_active whether @button should be active
*/
set_active(is_active: 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 ToolButton {
// Signal callback interfaces
interface Clicked {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends ToolItem.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
icon_name: string;
iconName: string;
icon_widget: Widget;
iconWidget: Widget;
label: string;
label_widget: Widget;
labelWidget: Widget;
stock_id: string;
stockId: string;
use_underline: boolean;
useUnderline: boolean;
}
}
class ToolButton extends ToolItem implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<ToolButton>;
// Properties
/**
* The name of the themed icon displayed on the item.
* This property only has an effect if not overridden by "label",
* "icon_widget" or "stock_id" properties.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of the themed icon displayed on the item.
* This property only has an effect if not overridden by "label",
* "icon_widget" or "stock_id" properties.
*/
get iconName(): string;
set iconName(val: string);
get icon_widget(): Widget;
set icon_widget(val: Widget);
get iconWidget(): Widget;
set iconWidget(val: Widget);
get label(): string;
set label(val: string);
get label_widget(): Widget;
set label_widget(val: Widget);
get labelWidget(): Widget;
set labelWidget(val: Widget);
get stock_id(): string;
set stock_id(val: string);
get stockId(): string;
set stockId(val: string);
get use_underline(): boolean;
set use_underline(val: boolean);
get useUnderline(): boolean;
set useUnderline(val: boolean);
// Constructors
constructor(properties?: Partial<ToolButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](icon_widget?: Widget | null, label?: string | null): ToolButton;
// Conflicted with Gtk.ToolItem.new
static ['new'](...args: never[]): any;
static new_from_stock(stock_id: string): ToolButton;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'clicked', callback: (_source: this) => void): number;
connect_after(signal: 'clicked', callback: (_source: this) => void): number;
emit(signal: 'clicked'): void;
// Virtual methods
vfunc_clicked(): void;
// Methods
/**
* Returns the name of the themed icon for the tool button,
* see gtk_tool_button_set_icon_name().
* @returns the icon name or %NULL if the tool button has no themed icon
*/
get_icon_name(): string;
/**
* Return the widget used as icon widget on `button`.
* See gtk_tool_button_set_icon_widget().
* @returns The widget used as icon on @button, or %NULL.
*/
get_icon_widget(): Widget;
/**
* Returns the label used by the tool button, or %NULL if the tool button
* doesn't have a label. or uses a the label from a stock item. The returned
* string is owned by GTK+, and must not be modified or freed.
* @returns The label, or %NULL
*/
get_label(): string;
/**
* Returns the widget used as label on `button`.
* See gtk_tool_button_set_label_widget().
* @returns The widget used as label on @button, or %NULL.
*/
get_label_widget(): Widget;
/**
* Returns the name of the stock item. See gtk_tool_button_set_stock_id().
* The returned string is owned by GTK+ and must not be freed or modifed.
* @returns the name of the stock item for @button.
*/
get_stock_id(): string;
/**
* Returns whether underscores in the label property are used as mnemonics
* on menu items on the overflow menu. See gtk_tool_button_set_use_underline().
* @returns %TRUE if underscores in the label property are used as mnemonics on menu items on the overflow menu.
*/
get_use_underline(): boolean;
/**
* Sets the icon for the tool button from a named themed icon.
* See the docs for #GtkIconTheme for more details.
* The "icon_name" property only has an effect if not
* overridden by non-%NULL "label", "icon_widget" and "stock_id"
* properties.
* @param icon_name the name of the themed icon
*/
set_icon_name(icon_name?: string | null): void;
/**
* Sets `icon` as the widget used as icon on `button`. If `icon_widget` is
* %NULL the icon is determined by the "stock_id" property. If the
* "stock_id" property is also %NULL, `button` will not have an icon.
* @param icon_widget the widget used as icon, or %NULL
*/
set_icon_widget(icon_widget?: Widget | null): void;
/**
* Sets `label` as the label used for the tool button. The "label" property
* only has an effect if not overridden by a non-%NULL "label_widget" property.
* If both the "label_widget" and "label" properties are %NULL, the label
* is determined by the "stock_id" property. If the "stock_id" property is also
* %NULL, `button` will not have a label.
* @param label a string that will be used as label, or %NULL.
*/
set_label(label?: string | null): void;
/**
* Sets `label_widget` as the widget that will be used as the label
* for `button`. If `label_widget` is %NULL the "label" property is used
* as label. If "label" is also %NULL, the label in the stock item
* determined by the "stock_id" property is used as label. If
* "stock_id" is also %NULL, `button` does not have a label.
* @param label_widget the widget used as label, or %NULL
*/
set_label_widget(label_widget?: Widget | null): void;
/**
* Sets the name of the stock item. See gtk_tool_button_new_from_stock().
* The stock_id property only has an effect if not
* overridden by non-%NULL "label" and "icon_widget" properties.
* @param stock_id a name of a stock item, or %NULL
*/
set_stock_id(stock_id?: string | null): void;
/**
* If set, an underline in the label property indicates that the next character
* should be used for the mnemonic accelerator key in the overflow menu. For
* example, if the label property is "_Open" and `use_underline` is %TRUE,
* the label on the tool button will be "Open" and the item on the overflow
* menu will have an underlined 'O'.
*
* Labels shown on tool buttons never have mnemonics on them; this property
* only affects the menu item on the overflow menu.
* @param use_underline whether the button label has the form "_Open"
*/
set_use_underline(use_underline: boolean): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ToolItem {
// Signal callback interfaces
interface CreateMenuProxy {
(): boolean;
}
interface SetTooltip {
(tooltips: Tooltips, tip_text: string, tip_private: string): boolean;
}
interface ToolbarReconfigured {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps {
is_important: boolean;
isImportant: boolean;
visible_horizontal: boolean;
visibleHorizontal: boolean;
visible_vertical: boolean;
visibleVertical: boolean;
}
}
/**
* #GtkToolItem<!-- -->s are widgets that can appear on a toolbar. To
* create a toolbar item that contain something else than a button, use
* gtk_tool_item_new(). Use gtk_container_add() to add a child
* widget to the tool item.
*
* For toolbar items that contain buttons, see the #GtkToolButton,
* #GtkToggleToolButton and #GtkRadioToolButton classes.
*
* See the #GtkToolbar class for a description of the toolbar widget, and
* #GtkToolShell for a description of the tool shell interface.
*/
class ToolItem extends Bin implements Atk.ImplementorIface, Activatable, Buildable {
static $gtype: GObject.GType<ToolItem>;
// Properties
get is_important(): boolean;
set is_important(val: boolean);
get isImportant(): boolean;
set isImportant(val: boolean);
get visible_horizontal(): boolean;
set visible_horizontal(val: boolean);
get visibleHorizontal(): boolean;
set visibleHorizontal(val: boolean);
get visible_vertical(): boolean;
set visible_vertical(val: boolean);
get visibleVertical(): boolean;
set visibleVertical(val: boolean);
// Constructors
constructor(properties?: Partial<ToolItem.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ToolItem;
// 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: 'create-menu-proxy', callback: (_source: this) => boolean): number;
connect_after(signal: 'create-menu-proxy', callback: (_source: this) => boolean): number;
emit(signal: 'create-menu-proxy'): void;
connect(
signal: 'set-tooltip',
callback: (_source: this, tooltips: Tooltips, tip_text: string, tip_private: string) => boolean,
): number;
connect_after(
signal: 'set-tooltip',
callback: (_source: this, tooltips: Tooltips, tip_text: string, tip_private: string) => boolean,
): number;
emit(signal: 'set-tooltip', tooltips: Tooltips, tip_text: string, tip_private: string): void;
connect(signal: 'toolbar-reconfigured', callback: (_source: this) => void): number;
connect_after(signal: 'toolbar-reconfigured', callback: (_source: this) => void): number;
emit(signal: 'toolbar-reconfigured'): void;
// Virtual methods
vfunc_create_menu_proxy(): boolean;
vfunc_set_tooltip(tooltips: Tooltips, tip_text: string, tip_private: string): boolean;
/**
* Emits the signal #GtkToolItem::toolbar_reconfigured on `tool_item`.
* #GtkToolbar and other #GtkToolShell implementations use this function
* to notify children, when some aspect of their configuration changes.
*/
vfunc_toolbar_reconfigured(): void;
// Methods
/**
* Returns the ellipsize mode used for `tool_item`. Custom subclasses of
* #GtkToolItem should call this function to find out how text should
* be ellipsized.
* @returns a #PangoEllipsizeMode indicating how text in @tool_item should be ellipsized.
*/
get_ellipsize_mode(): Pango.EllipsizeMode;
/**
* Returns whether `tool_item` is allocated extra space.
* See gtk_tool_item_set_expand().
* @returns %TRUE if @tool_item is allocated extra space.
*/
get_expand(): boolean;
/**
* Returns whether `tool_item` is the same size as other homogeneous
* items. See gtk_tool_item_set_homogeneous().
* @returns %TRUE if the item is the same size as other homogeneous items.
*/
get_homogeneous(): boolean;
/**
* Returns the icon size used for `tool_item`. Custom subclasses of
* #GtkToolItem should call this function to find out what size icons
* they should use.
* @returns a #GtkIconSize indicating the icon size used for @tool_item
*/
get_icon_size(): number;
/**
* Returns whether `tool_item` is considered important. See
* gtk_tool_item_set_is_important()
* @returns %TRUE if @tool_item is considered important.
*/
get_is_important(): boolean;
/**
* Returns the orientation used for `tool_item`. Custom subclasses of
* #GtkToolItem should call this function to find out what size icons
* they should use.
* @returns a #GtkOrientation indicating the orientation used for @tool_item
*/
get_orientation(): Orientation;
/**
* If `menu_item_id` matches the string passed to
* gtk_tool_item_set_proxy_menu_item() return the corresponding #GtkMenuItem.
*
* Custom subclasses of #GtkToolItem should use this function to
* update their menu item when the #GtkToolItem changes. That the
* `menu_item_id<`!-- -->s must match ensures that a #GtkToolItem
* will not inadvertently change a menu item that they did not create.
* @param menu_item_id a string used to identify the menu item
* @returns The #GtkMenuItem passed to gtk_tool_item_set_proxy_menu_item(), if the @menu_item_id<!-- -->s match.
*/
get_proxy_menu_item(menu_item_id: string): Widget;
/**
* Returns the relief style of `tool_item`. See gtk_button_set_relief_style().
* Custom subclasses of #GtkToolItem should call this function in the handler
* of the #GtkToolItem::toolbar_reconfigured signal to find out the
* relief style of buttons.
* @returns a #GtkReliefStyle indicating the relief style used for @tool_item.
*/
get_relief_style(): ReliefStyle;
/**
* Returns the text alignment used for `tool_item`. Custom subclasses of
* #GtkToolItem should call this function to find out how text should
* be aligned.
* @returns a #gfloat indicating the horizontal text alignment used for @tool_item
*/
get_text_alignment(): number;
/**
* Returns the text orientation used for `tool_item`. Custom subclasses of
* #GtkToolItem should call this function to find out how text should
* be orientated.
* @returns a #GtkOrientation indicating the text orientation used for @tool_item
*/
get_text_orientation(): Orientation;
/**
* Returns the size group used for labels in `tool_item`.
* Custom subclasses of #GtkToolItem should call this function
* and use the size group for labels.
* @returns a #GtkSizeGroup
*/
get_text_size_group(): SizeGroup;
/**
* Returns the toolbar style used for `tool_item`. Custom subclasses of
* #GtkToolItem should call this function in the handler of the
* GtkToolItem::toolbar_reconfigured signal to find out in what style
* the toolbar is displayed and change themselves accordingly
*
* Possibilities are:
* <itemizedlist>
* <listitem> GTK_TOOLBAR_BOTH, meaning the tool item should show
* both an icon and a label, stacked vertically </listitem>
* <listitem> GTK_TOOLBAR_ICONS, meaning the toolbar shows
* only icons </listitem>
* <listitem> GTK_TOOLBAR_TEXT, meaning the tool item should only
* show text</listitem>
* <listitem> GTK_TOOLBAR_BOTH_HORIZ, meaning the tool item should show
* both an icon and a label, arranged horizontally (however, note the
* #GtkToolButton::has_text_horizontally that makes tool buttons not
* show labels when the toolbar style is GTK_TOOLBAR_BOTH_HORIZ.
* </listitem>
* </itemizedlist>
* @returns A #GtkToolbarStyle indicating the toolbar style used for @tool_item.
*/
get_toolbar_style(): ToolbarStyle;
/**
* Returns whether `tool_item` has a drag window. See
* gtk_tool_item_set_use_drag_window().
* @returns %TRUE if @tool_item uses a drag window.
*/
get_use_drag_window(): boolean;
/**
* Returns whether the `tool_item` is visible on toolbars that are
* docked horizontally.
* @returns %TRUE if @tool_item is visible on toolbars that are docked horizontally.
*/
get_visible_horizontal(): boolean;
/**
* Returns whether `tool_item` is visible when the toolbar is docked vertically.
* See gtk_tool_item_set_visible_vertical().
* @returns Whether @tool_item is visible when the toolbar is docked vertically
*/
get_visible_vertical(): boolean;
/**
* Calling this function signals to the toolbar that the
* overflow menu item for `tool_item` has changed. If the
* overflow menu is visible when this function it called,
* the menu will be rebuilt.
*
* The function must be called when the tool item changes what it
* will do in response to the #GtkToolItem::create-menu-proxy signal.
*/
rebuild_menu(): void;
/**
* Returns the #GtkMenuItem that was last set by
* gtk_tool_item_set_proxy_menu_item(), ie. the #GtkMenuItem
* that is going to appear in the overflow menu.
* @returns The #GtkMenuItem that is going to appear in the overflow menu for @tool_item.
*/
retrieve_proxy_menu_item(): Widget;
/**
* Sets whether `tool_item` is allocated extra space when there
* is more room on the toolbar then needed for the items. The
* effect is that the item gets bigger when the toolbar gets bigger
* and smaller when the toolbar gets smaller.
* @param expand Whether @tool_item is allocated extra space
*/
set_expand(expand: boolean): void;
/**
* Sets whether `tool_item` is to be allocated the same size as other
* homogeneous items. The effect is that all homogeneous items will have
* the same width as the widest of the items.
* @param homogeneous whether @tool_item is the same size as other homogeneous items
*/
set_homogeneous(homogeneous: boolean): void;
/**
* Sets whether `tool_item` should be considered important. The #GtkToolButton
* class uses this property to determine whether to show or hide its label
* when the toolbar style is %GTK_TOOLBAR_BOTH_HORIZ. The result is that
* only tool buttons with the "is_important" property set have labels, an
* effect known as "priority text"
* @param is_important whether the tool item should be considered important
*/
set_is_important(is_important: boolean): void;
/**
* Sets the #GtkMenuItem used in the toolbar overflow menu. The
* `menu_item_id` is used to identify the caller of this function and
* should also be used with gtk_tool_item_get_proxy_menu_item().
*
* See also #GtkToolItem::create-menu-proxy.
* @param menu_item_id a string used to identify @menu_item
* @param menu_item a #GtkMenuItem to be used in the overflow menu
*/
set_proxy_menu_item(menu_item_id: string, menu_item: Widget): void;
/**
* Sets the #GtkTooltips object to be used for `tool_item,` the
* text to be displayed as tooltip on the item and the private text
* to be used. See gtk_tooltips_set_tip().
* @param tooltips The #GtkTooltips object to be used
* @param tip_text text to be used as tooltip text for @tool_item
* @param tip_private text to be used as private tooltip text
*/
set_tooltip(tooltips: Tooltips, tip_text?: string | null, tip_private?: string | null): void;
/**
* Sets the markup text to be displayed as tooltip on the item.
* See gtk_widget_set_tooltip_markup().
* @param markup markup text to be used as tooltip for @tool_item
*/
set_tooltip_markup(markup: string): void;
// Conflicted with Gtk.Widget.set_tooltip_markup
set_tooltip_markup(...args: never[]): any;
/**
* Sets the text to be displayed as tooltip on the item.
* See gtk_widget_set_tooltip_text().
* @param text text to be used as tooltip for @tool_item
*/
set_tooltip_text(text: string): void;
/**
* Sets whether `tool_item` has a drag window. When %TRUE the
* toolitem can be used as a drag source through gtk_drag_source_set().
* When `tool_item` has a drag window it will intercept all events,
* even those that would otherwise be sent to a child of `tool_item`.
* @param use_drag_window Whether @tool_item has a drag window.
*/
set_use_drag_window(use_drag_window: boolean): void;
/**
* Sets whether `tool_item` is visible when the toolbar is docked horizontally.
* @param visible_horizontal Whether @tool_item is visible when in horizontal mode
*/
set_visible_horizontal(visible_horizontal: boolean): void;
/**
* Sets whether `tool_item` is visible when the toolbar is docked
* vertically. Some tool items, such as text entries, are too wide to be
* useful on a vertically docked toolbar. If `visible_vertical` is %FALSE
* `tool_item` will not appear on toolbars that are docked vertically.
* @param visible_vertical whether @tool_item is visible when the toolbar is in vertical mode
*/
set_visible_vertical(visible_vertical: boolean): void;
/**
* Emits the signal #GtkToolItem::toolbar_reconfigured on `tool_item`.
* #GtkToolbar and other #GtkToolShell implementations use this function
* to notify children, when some aspect of their configuration changes.
*/
toolbar_reconfigured(): void;
// Inherited properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Inherited methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ToolItemGroup {
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
ToolShell.ConstructorProps {
collapsed: boolean;
ellipsize: Pango.EllipsizeMode;
header_relief: ReliefStyle;
headerRelief: ReliefStyle;
label: string;
label_widget: Widget;
labelWidget: Widget;
}
}
/**
* A #GtkToolItemGroup is used together with #GtkToolPalette to add
* #GtkToolItem<!-- -->s to a palette like container with different
* categories and drag and drop support.
*/
class ToolItemGroup extends Container implements Atk.ImplementorIface, Buildable, ToolShell {
static $gtype: GObject.GType<ToolItemGroup>;
// Properties
get collapsed(): boolean;
set collapsed(val: boolean);
get ellipsize(): Pango.EllipsizeMode;
set ellipsize(val: Pango.EllipsizeMode);
get header_relief(): ReliefStyle;
set header_relief(val: ReliefStyle);
get headerRelief(): ReliefStyle;
set headerRelief(val: ReliefStyle);
get label(): string;
set label(val: string);
get label_widget(): Widget;
set label_widget(val: Widget);
get labelWidget(): Widget;
set labelWidget(val: Widget);
// Constructors
constructor(properties?: Partial<ToolItemGroup.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](label: string): ToolItemGroup;
// Methods
/**
* Gets whether `group` is collapsed or expanded.
* @returns %TRUE if @group is collapsed, %FALSE if it is expanded
*/
get_collapsed(): boolean;
/**
* Gets the tool item at position (x, y).
* @param x the x position
* @param y the y position
* @returns the #GtkToolItem at position (x, y)
*/
get_drop_item(x: number, y: number): ToolItem;
/**
* Gets the ellipsization mode of `group`.
* @returns the #PangoEllipsizeMode of @group
*/
get_ellipsize(): Pango.EllipsizeMode;
/**
* Gets the relief mode of the header button of `group`.
* @returns the #GtkReliefStyle
*/
get_header_relief(): ReliefStyle;
/**
* Gets the position of `item` in `group` as index.
* @param item a #GtkToolItem
* @returns the index of @item in @group or -1 if @item is no child of @group
*/
get_item_position(item: ToolItem): number;
/**
* Gets the label of `group`.
* @returns the label of @group. The label is an internal string of @group and must not be modified. Note that %NULL is returned if a custom label has been set with gtk_tool_item_group_set_label_widget()
*/
get_label(): string;
/**
* Gets the label widget of `group`.
* See gtk_tool_item_group_set_label_widget().
* @returns the label widget of @group
*/
get_label_widget(): Widget;
/**
* Gets the number of tool items in `group`.
* @returns the number of tool items in @group
*/
get_n_items(): number;
/**
* Gets the tool item at `index` in group.
* @param index the index
* @returns the #GtkToolItem at index
*/
get_nth_item(index: number): ToolItem;
/**
* Inserts `item` at `position` in the list of children of `group`.
* @param item the #GtkToolItem to insert into @group
* @param position the position of @item in @group, starting with 0. The position -1 means end of list.
*/
insert(item: ToolItem, position: number): void;
/**
* Sets whether the `group` should be collapsed or expanded.
* @param collapsed whether the @group should be collapsed or expanded
*/
set_collapsed(collapsed: boolean): void;
/**
* Sets the ellipsization mode which should be used by labels in `group`.
* @param ellipsize the #PangoEllipsizeMode labels in @group should use
*/
set_ellipsize(ellipsize: Pango.EllipsizeMode | null): void;
/**
* Set the button relief of the group header.
* See gtk_button_set_relief() for details.
* @param style the #GtkReliefStyle
*/
set_header_relief(style: ReliefStyle | null): void;
/**
* Sets the position of `item` in the list of children of `group`.
* @param item the #GtkToolItem to move to a new position, should be a child of @group.
* @param position the new position of @item in @group, starting with 0. The position -1 means end of list.
*/
set_item_position(item: ToolItem, position: number): void;
/**
* Sets the label of the tool item group. The label is displayed in the header
* of the group.
* @param label the new human-readable label of of the group
*/
set_label(label: string): void;
/**
* Sets the label of the tool item group.
* The label widget is displayed in the header of the group, in place
* of the usual label.
* @param label_widget the widget to be displayed in place of the usual label
*/
set_label_widget(label_widget: Widget): 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 or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
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 current ellipsize mode for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
* instead.
* @returns the current ellipsize mode of @shell
*/
get_ellipsize_mode(): Pango.EllipsizeMode;
/**
* Retrieves the icon size for the tool shell. Tool items must not call this
* function directly, but rely on gtk_tool_item_get_icon_size() instead.
* @returns the current size for icons of @shell
*/
get_icon_size(): number;
/**
* Retrieves the current orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_orientation()
* instead.
* @returns the current orientation of @shell
*/
get_orientation(): Orientation;
/**
* Returns the relief style of buttons on `shell`. Tool items must not call this
* function directly, but rely on gtk_tool_item_get_relief_style() instead.
* @returns The relief style of buttons on @shell.
*/
get_relief_style(): ReliefStyle;
/**
* Retrieves whether the tool shell has text, icons, or both. Tool items must
* not call this function directly, but rely on gtk_tool_item_get_style()
* instead.
* @returns the current style of @shell
*/
get_style(): ToolbarStyle;
// Conflicted with Gtk.Widget.get_style
get_style(...args: never[]): any;
/**
* Retrieves the current text alignment for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_alignment()
* instead.
* @returns the current text alignment of @shell
*/
get_text_alignment(): number;
/**
* Retrieves the current text orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_orientation()
* instead.
* @returns the current text orientation of @shell
*/
get_text_orientation(): Orientation;
/**
* Retrieves the current text size group for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_size_group()
* instead.
* @returns the current text size group of @shell
*/
get_text_size_group(): SizeGroup;
/**
* Calling this function signals the tool shell that the overflow menu item for
* tool items have changed. If there is an overflow menu and if it is visible
* when this function it called, the menu will be rebuilt.
*
* Tool items must not call this function directly, but rely on
* gtk_tool_item_rebuild_menu() instead.
*/
rebuild_menu(): void;
/**
* Retrieves the current ellipsize mode for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
* instead.
*/
vfunc_get_ellipsize_mode(): Pango.EllipsizeMode;
/**
* mandatory implementation of gtk_tool_shell_get_icon_size().
*/
vfunc_get_icon_size(): IconSize;
/**
* Retrieves the current orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_orientation()
* instead.
*/
vfunc_get_orientation(): Orientation;
/**
* Returns the relief style of buttons on `shell`. Tool items must not call this
* function directly, but rely on gtk_tool_item_get_relief_style() instead.
*/
vfunc_get_relief_style(): ReliefStyle;
/**
* Retrieves whether the tool shell has text, icons, or both. Tool items must
* not call this function directly, but rely on gtk_tool_item_get_style()
* instead.
*/
vfunc_get_style(): ToolbarStyle;
/**
* Retrieves the current text alignment for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_alignment()
* instead.
*/
vfunc_get_text_alignment(): number;
/**
* Retrieves the current text orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_orientation()
* instead.
*/
vfunc_get_text_orientation(): Orientation;
/**
* Retrieves the current text size group for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_size_group()
* instead.
*/
vfunc_get_text_size_group(): SizeGroup;
/**
* Calling this function signals the tool shell that the overflow menu item for
* tool items have changed. If there is an overflow menu and if it is visible
* when this function it called, the menu will be rebuilt.
*
* Tool items must not call this function directly, but rely on
* gtk_tool_item_rebuild_menu() instead.
*/
vfunc_rebuild_menu(): 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace ToolPalette {
// Signal callback interfaces
interface SetScrollAdjustments {
(hadjustment: Adjustment, vadjustment: Adjustment): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {
icon_size: IconSize;
iconSize: IconSize;
icon_size_set: boolean;
iconSizeSet: boolean;
toolbar_style: ToolbarStyle;
toolbarStyle: ToolbarStyle;
}
}
/**
* A #GtkToolPalette allows you to add #GtkToolItem<!-- -->s to a palette-like
* container with different categories and drag and drop support.
*
* A #GtkToolPalette is created with a call to gtk_tool_palette_new().
*
* #GtkToolItem<!-- -->s cannot be added directly to a #GtkToolPalette -
* instead they are added to a #GtkToolItemGroup which can than be added
* to a #GtkToolPalette. To add a #GtkToolItemGroup to a #GtkToolPalette,
* use gtk_container_add().
*
*
* ```
* GtkWidget *palette, *group;
* GtkToolItem *item;
*
* palette = gtk_tool_palette_new ();
* group = gtk_tool_item_group_new (_("Test Category"));
* gtk_container_add (GTK_CONTAINER (palette), group);
*
* item = gtk_tool_button_new_from_stock (GTK_STOCK_OK);
* gtk_tool_item_group_insert (GTK_TOOL_ITEM_GROUP (group), item, -1);
* ```
*
*
* The easiest way to use drag and drop with #GtkToolPalette is to call
* gtk_tool_palette_add_drag_dest() with the desired drag source `palette`
* and the desired drag target `widget`. Then gtk_tool_palette_get_drag_item()
* can be used to get the dragged item in the #GtkWidget::drag-data-received
* signal handler of the drag target.
*
*
* ```
* static void
* passive_canvas_drag_data_received (GtkWidget *widget,
* GdkDragContext *context,
* gint x,
* gint y,
* GtkSelectionData *selection,
* guint info,
* guint time,
* gpointer data)
* {
* GtkWidget *palette;
* GtkWidget *item;
*
* /<!-- -->* Get the dragged item *<!-- -->/
* palette = gtk_widget_get_ancestor (gtk_drag_get_source_widget (context),
* GTK_TYPE_TOOL_PALETTE);
* if (palette != NULL)
* item = gtk_tool_palette_get_drag_item (GTK_TOOL_PALETTE (palette),
* selection);
*
* /<!-- -->* Do something with item *<!-- -->/
* }
*
* GtkWidget *target, palette;
*
* palette = gtk_tool_palette_new ();
* target = gtk_drawing_area_new ();
*
* g_signal_connect (G_OBJECT (target), "drag-data-received",
* G_CALLBACK (passive_canvas_drag_data_received), NULL);
* gtk_tool_palette_add_drag_dest (GTK_TOOL_PALETTE (palette), target,
* GTK_DEST_DEFAULT_ALL,
* GTK_TOOL_PALETTE_DRAG_ITEMS,
* GDK_ACTION_COPY);
* ```
*
*/
class ToolPalette extends Container implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<ToolPalette>;
// Properties
/**
* The size of the icons in a tool palette is normally determined by
* the #GtkSettings:toolbar-icon-size setting. When this property is set,
* it overrides the setting.
*
* This should only be used for special-purpose tool palettes, normal
* application tool palettes should respect the user preferences for the
* size of icons.
*/
get icon_size(): IconSize;
set icon_size(val: IconSize);
/**
* The size of the icons in a tool palette is normally determined by
* the #GtkSettings:toolbar-icon-size setting. When this property is set,
* it overrides the setting.
*
* This should only be used for special-purpose tool palettes, normal
* application tool palettes should respect the user preferences for the
* size of icons.
*/
get iconSize(): IconSize;
set iconSize(val: IconSize);
/**
* Is %TRUE if the #GtkToolPalette:icon-size property has been set.
*/
get icon_size_set(): boolean;
set icon_size_set(val: boolean);
/**
* Is %TRUE if the #GtkToolPalette:icon-size property has been set.
*/
get iconSizeSet(): boolean;
set iconSizeSet(val: boolean);
/**
* The style of items in the tool palette.
*/
get toolbar_style(): ToolbarStyle;
set toolbar_style(val: ToolbarStyle);
/**
* The style of items in the tool palette.
*/
get toolbarStyle(): ToolbarStyle;
set toolbarStyle(val: ToolbarStyle);
// Constructors
constructor(properties?: Partial<ToolPalette.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ToolPalette;
// 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: 'set-scroll-adjustments',
callback: (_source: this, hadjustment: Adjustment, vadjustment: Adjustment) => void,
): number;
connect_after(
signal: 'set-scroll-adjustments',
callback: (_source: this, hadjustment: Adjustment, vadjustment: Adjustment) => void,
): number;
emit(signal: 'set-scroll-adjustments', hadjustment: Adjustment, vadjustment: Adjustment): void;
// Static methods
/**
* Get the target entry for a dragged #GtkToolItemGroup.
*/
static get_drag_target_group(): TargetEntry;
/**
* Gets the target entry for a dragged #GtkToolItem.
*/
static get_drag_target_item(): TargetEntry;
// Methods
/**
* Sets `palette` as drag source (see gtk_tool_palette_set_drag_source())
* and sets `widget` as a drag destination for drags from `palette`.
* See gtk_drag_dest_set().
* @param widget a #GtkWidget which should be a drag destination for @palette
* @param flags the flags that specify what actions GTK+ should take for drops on that widget
* @param targets the #GtkToolPaletteDragTarget<!-- -->s which the widget should support
* @param actions the #GdkDragAction<!-- -->s which the widget should suppport
*/
add_drag_dest(
widget: Widget,
flags: DestDefaults | null,
targets: ToolPaletteDragTargets | null,
actions: Gdk.DragAction | null,
): void;
/**
* Get the dragged item from the selection.
* This could be a #GtkToolItem or a #GtkToolItemGroup.
* @param selection a #GtkSelectionData
* @returns the dragged item in selection
*/
get_drag_item(selection: SelectionData): Widget;
/**
* Gets the group at position (x, y).
* @param x the x position
* @param y the y position
* @returns the #GtkToolItemGroup at position or %NULL if there is no such group
*/
get_drop_group(x: number, y: number): ToolItemGroup;
/**
* Gets the item at position (x, y).
* See gtk_tool_palette_get_drop_group().
* @param x the x position
* @param y the y position
* @returns the #GtkToolItem at position or %NULL if there is no such item
*/
get_drop_item(x: number, y: number): ToolItem;
/**
* Gets whether `group` is exclusive or not.
* See gtk_tool_palette_set_exclusive().
* @param group a #GtkToolItemGroup which is a child of palette
* @returns %TRUE if @group is exclusive
*/
get_exclusive(group: ToolItemGroup): boolean;
/**
* Gets whether group should be given extra space.
* See gtk_tool_palette_set_expand().
* @param group a #GtkToolItemGroup which is a child of palette
* @returns %TRUE if group should be given extra space, %FALSE otherwise
*/
get_expand(group: ToolItemGroup): boolean;
/**
* Gets the position of `group` in `palette` as index.
* See gtk_tool_palette_set_group_position().
* @param group a #GtkToolItemGroup
* @returns the index of group or -1 if @group is not a child of @palette
*/
get_group_position(group: ToolItemGroup): number;
/**
* Gets the horizontal adjustment of the tool palette.
* @returns the horizontal adjustment of @palette
*/
get_hadjustment(): Adjustment;
/**
* Gets the size of icons in the tool palette.
* See gtk_tool_palette_set_icon_size().
* @returns the #GtkIconSize of icons in the tool palette
*/
get_icon_size(): number;
/**
* Gets the style (icons, text or both) of items in the tool palette.
* @returns the #GtkToolbarStyle of items in the tool palette.
*/
get_style(): ToolbarStyle;
// Conflicted with Gtk.Widget.get_style
get_style(...args: never[]): any;
/**
* Gets the vertical adjustment of the tool palette.
* @returns the vertical adjustment of @palette
*/
get_vadjustment(): Adjustment;
/**
* Sets the tool palette as a drag source.
* Enables all groups and items in the tool palette as drag sources
* on button 1 and button 3 press with copy and move actions.
* See gtk_drag_source_set().
* @param targets the #GtkToolPaletteDragTarget<!-- -->s which the widget should support
*/
set_drag_source(targets: ToolPaletteDragTargets | null): void;
/**
* Sets whether the group should be exclusive or not.
* If an exclusive group is expanded all other groups are collapsed.
* @param group a #GtkToolItemGroup which is a child of palette
* @param exclusive whether the group should be exclusive or not
*/
set_exclusive(group: ToolItemGroup, exclusive: boolean): void;
/**
* Sets whether the group should be given extra space.
* @param group a #GtkToolItemGroup which is a child of palette
* @param expand whether the group should be given extra space
*/
set_expand(group: ToolItemGroup, expand: boolean): void;
/**
* Sets the position of the group as an index of the tool palette.
* If position is 0 the group will become the first child, if position is
* -1 it will become the last child.
* @param group a #GtkToolItemGroup which is a child of palette
* @param position a new index for group
*/
set_group_position(group: ToolItemGroup, position: number): void;
/**
* Sets the size of icons in the tool palette.
* @param icon_size the #GtkIconSize that icons in the tool palette shall have
*/
set_icon_size(icon_size: number): void;
/**
* Sets the style (text, icons or both) of items in the tool palette.
* @param style the #GtkToolbarStyle that items in the tool palette shall have
*/
set_style(style: ToolbarStyle | null): void;
// Conflicted with Gtk.Widget.set_style
set_style(...args: never[]): any;
/**
* Unsets the tool palette icon size set with gtk_tool_palette_set_icon_size(),
* so that user preferences will be used to determine the icon size.
*/
unset_icon_size(): void;
/**
* Unsets a toolbar style set with gtk_tool_palette_set_style(),
* so that user preferences will be used to determine the toolbar style.
*/
unset_style(): void;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Toolbar {
// Signal callback interfaces
interface FocusHomeOrEnd {
(focus_home: boolean): boolean;
}
interface OrientationChanged {
(orientation: Orientation): void;
}
interface PopupContextMenu {
(x: number, y: number, button: number): boolean;
}
interface StyleChanged {
(style: ToolbarStyle): void;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps,
ToolShell.ConstructorProps {
icon_size: number;
iconSize: number;
icon_size_set: boolean;
iconSizeSet: boolean;
show_arrow: boolean;
showArrow: boolean;
toolbar_style: ToolbarStyle;
toolbarStyle: ToolbarStyle;
tooltips: boolean;
}
}
class Toolbar extends Container implements Atk.ImplementorIface, Buildable, Orientable, ToolShell {
static $gtype: GObject.GType<Toolbar>;
// Properties
/**
* The size of the icons in a toolbar is normally determined by
* the toolbar-icon-size setting. When this property is set, it
* overrides the setting.
*
* This should only be used for special-purpose toolbars, normal
* application toolbars should respect the user preferences for the
* size of icons.
*/
get icon_size(): number;
set icon_size(val: number);
/**
* The size of the icons in a toolbar is normally determined by
* the toolbar-icon-size setting. When this property is set, it
* overrides the setting.
*
* This should only be used for special-purpose toolbars, normal
* application toolbars should respect the user preferences for the
* size of icons.
*/
get iconSize(): number;
set iconSize(val: number);
/**
* Is %TRUE if the icon-size property has been set.
*/
get icon_size_set(): boolean;
set icon_size_set(val: boolean);
/**
* Is %TRUE if the icon-size property has been set.
*/
get iconSizeSet(): boolean;
set iconSizeSet(val: boolean);
get show_arrow(): boolean;
set show_arrow(val: boolean);
get showArrow(): boolean;
set showArrow(val: boolean);
get toolbar_style(): ToolbarStyle;
set toolbar_style(val: ToolbarStyle);
get toolbarStyle(): ToolbarStyle;
set toolbarStyle(val: ToolbarStyle);
/**
* If the tooltips of the toolbar should be active or not.
*/
get tooltips(): boolean;
set tooltips(val: boolean);
// Fields
container: Container;
num_children: number;
children: any[];
orientation: Orientation;
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
style: ToolbarStyle;
// Constructors
constructor(properties?: Partial<Toolbar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Toolbar;
// 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: 'focus-home-or-end', callback: (_source: this, focus_home: boolean) => boolean): number;
connect_after(
signal: 'focus-home-or-end',
callback: (_source: this, focus_home: boolean) => boolean,
): number;
emit(signal: 'focus-home-or-end', focus_home: boolean): void;
connect(signal: 'orientation-changed', callback: (_source: this, orientation: Orientation) => void): number;
connect_after(
signal: 'orientation-changed',
callback: (_source: this, orientation: Orientation) => void,
): number;
emit(signal: 'orientation-changed', orientation: Orientation): void;
connect(
signal: 'popup-context-menu',
callback: (_source: this, x: number, y: number, button: number) => boolean,
): number;
connect_after(
signal: 'popup-context-menu',
callback: (_source: this, x: number, y: number, button: number) => boolean,
): number;
emit(signal: 'popup-context-menu', x: number, y: number, button: number): void;
connect(signal: 'style-changed', callback: (_source: this, style: ToolbarStyle) => void): number;
connect_after(signal: 'style-changed', callback: (_source: this, style: ToolbarStyle) => void): number;
emit(signal: 'style-changed', style: ToolbarStyle): void;
// Virtual methods
vfunc_orientation_changed(orientation: Orientation): void;
vfunc_popup_context_menu(x: number, y: number, button_number: number): boolean;
vfunc_style_changed(style: ToolbarStyle): void;
// Methods
/**
* Adds a new space to the end of the toolbar.
*/
append_space(): void;
/**
* Adds a widget to the end of the given toolbar.
* @param widget a #GtkWidget to add to the toolbar.
* @param tooltip_text the element's tooltip.
* @param tooltip_private_text used for context-sensitive help about this toolbar element.
*/
append_widget(widget: Widget, tooltip_text?: string | null, tooltip_private_text?: string | null): void;
/**
* Returns the position corresponding to the indicated point on
* `toolbar`. This is useful when dragging items to the toolbar:
* this function returns the position a new item should be
* inserted.
*
* `x` and `y` are in `toolbar` coordinates.
* @param x x coordinate of a point on the toolbar
* @param y y coordinate of a point on the toolbar
* @returns The position corresponding to the point (@x, @y) on the toolbar.
*/
get_drop_index(x: number, y: number): number;
/**
* Retrieves the icon size for the toolbar. See gtk_toolbar_set_icon_size().
* @returns the current icon size for the icons on the toolbar.
*/
get_icon_size(): number;
/**
* Returns the position of `item` on the toolbar, starting from 0.
* It is an error if `item` is not a child of the toolbar.
* @param item a #GtkToolItem that is a child of @toolbar
* @returns the position of item on the toolbar.
*/
get_item_index(item: ToolItem): number;
/**
* Returns the number of items on the toolbar.
* @returns the number of items on the toolbar
*/
get_n_items(): number;
/**
* Returns the `n<`!-- -->'th item on `toolbar,` or %NULL if the
* toolbar does not contain an `n<`!-- -->'th item.
* @param n A position on the toolbar
* @returns The @n<!-- -->'th #GtkToolItem on @toolbar, or %NULL if there isn't an @n<!-- -->'th item.
*/
get_nth_item(n: number): ToolItem;
/**
* Retrieves the current orientation of the toolbar. See
* gtk_toolbar_set_orientation().
* @returns the orientation
*/
get_orientation(): Orientation;
/**
* Returns the relief style of buttons on `toolbar`. See
* gtk_button_set_relief().
* @returns The relief style of buttons on @toolbar.
*/
get_relief_style(): ReliefStyle;
/**
* Returns whether the toolbar has an overflow menu.
* See gtk_toolbar_set_show_arrow().
* @returns %TRUE if the toolbar has an overflow menu.
*/
get_show_arrow(): boolean;
/**
* Retrieves whether the toolbar has text, icons, or both . See
* gtk_toolbar_set_style().
* @returns the current style of @toolbar
*/
get_style(): ToolbarStyle;
// Conflicted with Gtk.Widget.get_style
get_style(...args: never[]): any;
/**
* Retrieves whether tooltips are enabled. See
* gtk_toolbar_set_tooltips().
* @returns %TRUE if tooltips are enabled
*/
get_tooltips(): boolean;
/**
* Insert a #GtkToolItem into the toolbar at position `pos`. If `pos` is
* 0 the item is prepended to the start of the toolbar. If `pos` is
* negative, the item is appended to the end of the toolbar.
* @param item a #GtkToolItem
* @param pos the position of the new item
*/
insert(item: ToolItem, pos: number): void;
/**
* Inserts a new space in the toolbar at the specified position.
* @param position the number of widgets after which a space should be inserted.
*/
insert_space(position: number): void;
/**
* Inserts a widget in the toolbar at the given position.
* @param widget a #GtkWidget to add to the toolbar.
* @param tooltip_text the element's tooltip.
* @param tooltip_private_text used for context-sensitive help about this toolbar element.
* @param position the number of widgets to insert this widget after.
*/
insert_widget(
widget: Widget,
tooltip_text: string | null,
tooltip_private_text: string | null,
position: number,
): void;
/**
* Adds a new space to the beginning of the toolbar.
*/
prepend_space(): void;
/**
* Adds a widget to the beginning of the given toolbar.
* @param widget a #GtkWidget to add to the toolbar.
* @param tooltip_text the element's tooltip.
* @param tooltip_private_text used for context-sensitive help about this toolbar element.
*/
prepend_widget(widget: Widget, tooltip_text?: string | null, tooltip_private_text?: string | null): void;
/**
* Removes a space from the specified position.
* @param position the index of the space to remove.
*/
remove_space(position: number): void;
/**
* Highlights `toolbar` to give an idea of what it would look like
* if `item` was added to `toolbar` at the position indicated by `index_`.
* If `item` is %NULL, highlighting is turned off. In that case `index_`
* is ignored.
*
* The `tool_item` passed to this function must not be part of any widget
* hierarchy. When an item is set as drop highlight item it can not
* added to any widget hierarchy or used as highlight item for another
* toolbar.
* @param tool_item a #GtkToolItem, or %NULL to turn of highlighting
* @param index_ a position on @toolbar
*/
set_drop_highlight_item(tool_item: ToolItem | null, index_: number): void;
/**
* This function sets the size of stock icons in the toolbar. You
* can call it both before you add the icons and after they've been
* added. The size you set will override user preferences for the default
* icon size.
*
* This should only be used for special-purpose toolbars, normal
* application toolbars should respect the user preferences for the
* size of icons.
* @param icon_size The #GtkIconSize that stock icons in the toolbar shall have.
*/
set_icon_size(icon_size: number): void;
/**
* Sets whether a toolbar should appear horizontally or vertically.
* @param orientation a new #GtkOrientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Sets whether to show an overflow menu when `toolbar` isnt allocated enough
* size to show all of its items. If %TRUE, items which cant fit in `toolbar,`
* and which have a proxy menu item set by gtk_tool_item_set_proxy_menu_item()
* or #GtkToolItem::create-menu-proxy, will be available in an overflow menu,
* which can be opened by an added arrow button. If %FALSE, `toolbar` will
* request enough size to fit all of its child items without any overflow.
* @param show_arrow Whether to show an overflow menu
*/
set_show_arrow(show_arrow: boolean): void;
/**
* Alters the view of `toolbar` to display either icons only, text only, or both.
* @param style the new style for @toolbar.
*/
set_style(style: ToolbarStyle | null): void;
// Conflicted with Gtk.Widget.set_style
set_style(...args: never[]): any;
/**
* Sets if the tooltips of a toolbar should be active or not.
* @param enable set to %FALSE to disable the tooltips, or %TRUE to enable them.
*/
set_tooltips(enable: boolean): void;
/**
* Unsets toolbar icon size set with gtk_toolbar_set_icon_size(), so that
* user preferences will be used to determine the icon size.
*/
unset_icon_size(): void;
/**
* Unsets a toolbar style set with gtk_toolbar_set_style(), so that
* user preferences will be used to determine the toolbar style.
*/
unset_style(): 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 or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
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 current ellipsize mode for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
* instead.
* @returns the current ellipsize mode of @shell
*/
get_ellipsize_mode(): Pango.EllipsizeMode;
/**
* Retrieves the current text alignment for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_alignment()
* instead.
* @returns the current text alignment of @shell
*/
get_text_alignment(): number;
/**
* Retrieves the current text orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_orientation()
* instead.
* @returns the current text orientation of @shell
*/
get_text_orientation(): Orientation;
/**
* Retrieves the current text size group for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_size_group()
* instead.
* @returns the current text size group of @shell
*/
get_text_size_group(): SizeGroup;
/**
* Calling this function signals the tool shell that the overflow menu item for
* tool items have changed. If there is an overflow menu and if it is visible
* when this function it called, the menu will be rebuilt.
*
* Tool items must not call this function directly, but rely on
* gtk_tool_item_rebuild_menu() instead.
*/
rebuild_menu(): void;
/**
* Retrieves the current ellipsize mode for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
* instead.
*/
vfunc_get_ellipsize_mode(): Pango.EllipsizeMode;
/**
* mandatory implementation of gtk_tool_shell_get_icon_size().
*/
vfunc_get_icon_size(): IconSize;
/**
* Retrieves the current orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_orientation()
* instead.
*/
vfunc_get_orientation(): Orientation;
/**
* Returns the relief style of buttons on `shell`. Tool items must not call this
* function directly, but rely on gtk_tool_item_get_relief_style() instead.
*/
vfunc_get_relief_style(): ReliefStyle;
/**
* Retrieves whether the tool shell has text, icons, or both. Tool items must
* not call this function directly, but rely on gtk_tool_item_get_style()
* instead.
*/
vfunc_get_style(): ToolbarStyle;
/**
* Retrieves the current text alignment for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_alignment()
* instead.
*/
vfunc_get_text_alignment(): number;
/**
* Retrieves the current text orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_orientation()
* instead.
*/
vfunc_get_text_orientation(): Orientation;
/**
* Retrieves the current text size group for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_size_group()
* instead.
*/
vfunc_get_text_size_group(): SizeGroup;
/**
* Calling this function signals the tool shell that the overflow menu item for
* tool items have changed. If there is an overflow menu and if it is visible
* when this function it called, the menu will be rebuilt.
*
* Tool items must not call this function directly, but rely on
* gtk_tool_item_rebuild_menu() instead.
*/
vfunc_rebuild_menu(): 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
}
namespace Tooltip {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class Tooltip extends GObject.Object {
static $gtype: GObject.GType<Tooltip>;
// Constructors
constructor(properties?: Partial<Tooltip.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* Triggers a new tooltip query on `display,` in order to update the current
* visible tooltip, or to show/hide the current tooltip. This function is
* useful to call when, for example, the state of the widget changed by a
* key press.
* @param display a #GdkDisplay
*/
static trigger_tooltip_query(display: Gdk.Display): void;
// Methods
/**
* Replaces the widget packed into the tooltip with
* `custom_widget`. `custom_widget` does not get destroyed when the tooltip goes
* away.
* By default a box with a #GtkImage and #GtkLabel is embedded in
* the tooltip, which can be configured using gtk_tooltip_set_markup()
* and gtk_tooltip_set_icon().
* @param custom_widget a #GtkWidget, or %NULL to unset the old custom widget.
*/
set_custom(custom_widget?: Widget | null): void;
/**
* Sets the icon of the tooltip (which is in front of the text) to be
* `pixbuf`. If `pixbuf` is %NULL, the image will be hidden.
* @param pixbuf a #GdkPixbuf, or %NULL
*/
set_icon(pixbuf?: GdkPixbuf.Pixbuf | null): void;
/**
* Sets the icon of the tooltip (which is in front of the text)
* to be the icon indicated by `gicon` with the size indicated
* by `size`. If `gicon` is %NULL, the image will be hidden.
* @param gicon a #GIcon representing the icon, or %NULL
* @param size a stock icon size
*/
set_icon_from_gicon(gicon: Gio.Icon | null, size: number): void;
/**
* Sets the icon of the tooltip (which is in front of the text) to be
* the icon indicated by `icon_name` with the size indicated
* by `size`. If `icon_name` is %NULL, the image will be hidden.
* @param icon_name an icon name, or %NULL
* @param size a stock icon size
*/
set_icon_from_icon_name(icon_name: string | null, size: number): void;
/**
* Sets the icon of the tooltip (which is in front of the text) to be
* the stock item indicated by `stock_id` with the size indicated
* by `size`. If `stock_id` is %NULL, the image will be hidden.
* @param stock_id a stock id, or %NULL
* @param size a stock icon size
*/
set_icon_from_stock(stock_id: string | null, size: number): void;
/**
* Sets the text of the tooltip to be `markup,` which is marked up
* with the <link
* linkend="PangoMarkupFormat">Pango text markup language</link>.
* If `markup` is %NULL, the label will be hidden.
* @param markup a markup string (see <link linkend="PangoMarkupFormat">Pango markup format</link>) or %NULL
*/
set_markup(markup?: string | null): void;
/**
* Sets the text of the tooltip to be `text`. If `text` is %NULL, the label
* will be hidden. See also gtk_tooltip_set_markup().
* @param text a text string or %NULL
*/
set_text(text?: string | null): void;
/**
* Sets the area of the widget, where the contents of this tooltip apply,
* to be `rect` (in widget coordinates). This is especially useful for
* properly setting tooltips on #GtkTreeView rows and cells, #GtkIconViews,
* etc.
*
* For setting tooltips on #GtkTreeView, please refer to the convenience
* functions for this: gtk_tree_view_set_tooltip_row() and
* gtk_tree_view_set_tooltip_cell().
* @param rect a #GdkRectangle
*/
set_tip_area(rect: Gdk.Rectangle): void;
}
namespace Tooltips {
// Constructor properties interface
interface ConstructorProps extends Object.ConstructorProps {}
}
class Tooltips extends Object {
static $gtype: GObject.GType<Tooltips>;
// Constructors
constructor(properties?: Partial<Tooltips.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Tooltips;
// Static methods
/**
* Determines the tooltips and the widget they belong to from the window in
* which they are displayed.
*
* This function is mostly intended for use by accessibility technologies;
* applications should have little use for it.
* @param tip_window a #GtkWindow
* @param tooltips the return location for the tooltips which are displayed in @tip_window, or %NULL
* @param current_widget the return location for the widget whose tooltips are displayed, or %NULL
*/
static get_info_from_tip_window(tip_window: Window, tooltips: Tooltips, current_widget: Widget): boolean;
// Methods
disable(): void;
enable(): void;
force_window(): void;
set_delay(delay: number): void;
/**
* Adds a tooltip containing the message `tip_text` to the specified #GtkWidget.
* @param widget the #GtkWidget you wish to associate the tip with.
* @param tip_text a string containing the tip itself.
* @param tip_private a string of any further information that may be useful if the user gets stuck.
*/
set_tip(widget: Widget, tip_text?: string | null, tip_private?: string | null): void;
}
namespace TreeModelFilter {
// Constructor properties interface
interface ConstructorProps
extends GObject.Object.ConstructorProps,
TreeDragSource.ConstructorProps,
TreeModel.ConstructorProps {
child_model: TreeModel;
childModel: TreeModel;
virtual_root: TreePath;
virtualRoot: TreePath;
}
}
class TreeModelFilter extends GObject.Object implements TreeDragSource, TreeModel {
static $gtype: GObject.GType<TreeModelFilter>;
// Properties
get child_model(): TreeModel;
get childModel(): TreeModel;
get virtual_root(): TreePath;
get virtualRoot(): TreePath;
// Constructors
constructor(properties?: Partial<TreeModelFilter.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* This function should almost never be called. It clears the `filter`
* of any cached iterators that haven't been reffed with
* gtk_tree_model_ref_node(). This might be useful if the child model
* being filtered is static (and doesn't change often) and there has been
* a lot of unreffed access to nodes. As a side effect of this function,
* all unreffed iters will be invalid.
*/
clear_cache(): void;
/**
* Sets `filter_iter` to point to the row in `filter` that corresponds to the
* row pointed at by `child_iter`. If `filter_iter` was not set, %FALSE is
* returned.
* @param child_iter A valid #GtkTreeIter pointing to a row on the child model.
* @returns %TRUE, if @filter_iter was set, i.e. if @child_iter is a valid iterator pointing to a visible row in child model.
*/
convert_child_iter_to_iter(child_iter: TreeIter): [boolean, TreeIter];
/**
* Converts `child_path` to a path relative to `filter`. That is, `child_path`
* points to a path in the child model. The rerturned path will point to the
* same row in the filtered model. If `child_path` isn't a valid path on the
* child model or points to a row which is not visible in `filter,` then %NULL
* is returned.
* @param child_path A #GtkTreePath to convert.
* @returns A newly allocated #GtkTreePath, or %NULL.
*/
convert_child_path_to_path(child_path: TreePath): TreePath;
/**
* Sets `child_iter` to point to the row pointed to by `filter_iter`.
* @param filter_iter A valid #GtkTreeIter pointing to a row on @filter.
*/
convert_iter_to_child_iter(filter_iter: TreeIter): TreeIter;
/**
* Converts `filter_path` to a path on the child model of `filter`. That is,
* `filter_path` points to a location in `filter`. The returned path will
* point to the same location in the model not being filtered. If `filter_path`
* does not point to a location in the child model, %NULL is returned.
* @param filter_path A #GtkTreePath to convert.
* @returns A newly allocated #GtkTreePath, or %NULL.
*/
convert_path_to_child_path(filter_path: TreePath): TreePath;
/**
* Returns a pointer to the child model of `filter`.
* @returns A pointer to a #GtkTreeModel.
*/
get_model(): TreeModel;
/**
* Emits ::row_changed for each row in the child model, which causes
* the filter to re-evaluate whether a row is visible or not.
*/
refilter(): void;
/**
* With the `n_columns` and `types` parameters, you give an array of column
* types for this model (which will be exposed to the parent model/view).
* The `func,` `data` and `destroy` parameters are for specifying the modify
* function. The modify function will get called for <emphasis>each</emphasis>
* data access, the goal of the modify function is to return the data which
* should be displayed at the location specified using the parameters of the
* modify function.
* @param types The #GType<!-- -->s of the columns.
* @param func A #GtkTreeModelFilterModifyFunc
* @param destroy Destroy notifier of @data, or %NULL.
*/
set_modify_func(
types: GObject.GType[],
func: TreeModelFilterModifyFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Sets `column` of the child_model to be the column where `filter` should
* look for visibility information. `columns` should be a column of type
* %G_TYPE_BOOLEAN, where %TRUE means that a row is visible, and %FALSE
* if not.
* @param column A #gint which is the column containing the visible information.
*/
set_visible_column(column: number): void;
/**
* Sets the visible function used when filtering the `filter` to be `func`. The
* function should return %TRUE if the given row should be visible and
* %FALSE otherwise.
*
* If the condition calculated by the function changes over time (e.g. because
* it depends on some global parameters), you must call
* gtk_tree_model_filter_refilter() to keep the visibility information of
* the model uptodate.
*
* Note that `func` is called whenever a row is inserted, when it may still be
* empty. The visible function should therefore take special care of empty
* rows, like in the example below.
*
* <informalexample><programlisting>
* static gboolean
* visible_func (GtkTreeModel *model,
* GtkTreeIter *iter,
* gpointer data)
* {
* /&ast; Visible if row is non-empty and first column is "HI" &ast;/
* gchar *str;
* gboolean visible = FALSE;
*
* gtk_tree_model_get (model, iter, 0, &str, -1);
* if (str && strcmp (str, "HI") == 0)
* visible = TRUE;
* g_free (str);
*
* return visible;
* }
* </programlisting></informalexample>
* @param func A #GtkTreeModelFilterVisibleFunc, the visible function.
* @param destroy Destroy notifier of @data, or %NULL.
*/
set_visible_func(func: TreeModelFilterVisibleFunc, destroy?: GLib.DestroyNotify | null): void;
// Inherited methods
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
* @returns %TRUE if the row was successfully deleted
*/
drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @returns %TRUE if data of the required type was provided
*/
drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
* @returns %TRUE if the row can be dragged
*/
row_draggable(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
*/
vfunc_drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
*/
vfunc_drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
*/
vfunc_row_draggable(path: TreePath): boolean;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: TreePath | null): TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
* If `func` returns %TRUE, then the tree ceases to be walked, and
* gtk_tree_model_foreach() returns.
* @param func A function to be called on each row
*/
foreach(func: TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ The column index.
* @returns The type of the column.
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
* @returns The flags supported by this interface.
*/
get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter(path: TreePath): [boolean, TreeIter];
/**
* Initializes `iter` with the first iterator in the tree (the one at the path
* "0") and returns %TRUE. Returns %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set.
*/
get_iter_first(): [boolean, TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string A string representation of a #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter_from_string(path_string: string): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns The number of columns.
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
* @returns a newly-created #GtkTreePath.
*/
get_path(iter: TreeIter): TreePath;
/**
* Generates a string representation of the iter. This string is a ':'
* separated list of numbers. For example, "4:10:0:3" would be an
* acceptable return value for this string.
* @param iter An #GtkTreeIter.
* @returns A newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
* @returns %TRUE, if @child has been set to the first child.
*/
iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
* @returns %TRUE if @iter has children.
*/
iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
* @returns The number of children of @iter.
*/
iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
* @returns %TRUE if @iter has been changed to the next node.
*/
iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
* @returns %TRUE, if @parent has an @n<!-- -->th child.
*/
iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
* @returns %TRUE, if @iter is set to the parent of @child.
*/
iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child model.
* @returns A new #GtkTreeModel.
*/
sort_new_with_model(): TreeModel;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
unref_node(iter: TreeIter): void;
/**
* Returns the type of the column.
* @param index_ The column index.
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
*/
vfunc_get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
*/
vfunc_get_iter(path: TreePath): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
*/
vfunc_get_path(iter: TreeIter): TreePath;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
vfunc_get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
*/
vfunc_iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
*/
vfunc_iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
*/
vfunc_iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
*/
vfunc_iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
*/
vfunc_iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
*/
vfunc_iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
vfunc_ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
vfunc_row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
vfunc_row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
vfunc_rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
vfunc_unref_node(iter: TreeIter): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace TreeModelSort {
// Constructor properties interface
interface ConstructorProps
extends GObject.Object.ConstructorProps,
TreeDragSource.ConstructorProps,
TreeModel.ConstructorProps,
TreeSortable.ConstructorProps {
model: TreeModel;
}
}
class TreeModelSort extends GObject.Object implements TreeDragSource, TreeModel, TreeSortable {
static $gtype: GObject.GType<TreeModelSort>;
// Properties
get model(): TreeModel;
// Constructors
constructor(properties?: Partial<TreeModelSort.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* This function should almost never be called. It clears the `tree_model_sort`
* of any cached iterators that haven't been reffed with
* gtk_tree_model_ref_node(). This might be useful if the child model being
* sorted is static (and doesn't change often) and there has been a lot of
* unreffed access to nodes. As a side effect of this function, all unreffed
* iters will be invalid.
*/
clear_cache(): void;
/**
* Sets `sort_iter` to point to the row in `tree_model_sort` that corresponds to
* the row pointed at by `child_iter`. If `sort_iter` was not set, %FALSE
* is returned. Note: a boolean is only returned since 2.14.
* @param child_iter A valid #GtkTreeIter pointing to a row on the child model
* @returns %TRUE, if @sort_iter was set, i.e. if @sort_iter is a valid iterator pointer to a visible row in the child model.
*/
convert_child_iter_to_iter(child_iter: TreeIter): [boolean, TreeIter];
/**
* Converts `child_path` to a path relative to `tree_model_sort`. That is,
* `child_path` points to a path in the child model. The returned path will
* point to the same row in the sorted model. If `child_path` isn't a valid
* path on the child model, then %NULL is returned.
* @param child_path A #GtkTreePath to convert
* @returns A newly allocated #GtkTreePath, or %NULL
*/
convert_child_path_to_path(child_path: TreePath): TreePath;
/**
* Sets `child_iter` to point to the row pointed to by `sorted_iter`.
* @param sorted_iter A valid #GtkTreeIter pointing to a row on @tree_model_sort.
*/
convert_iter_to_child_iter(sorted_iter: TreeIter): TreeIter;
/**
* Converts `sorted_path` to a path on the child model of `tree_model_sort`.
* That is, `sorted_path` points to a location in `tree_model_sort`. The
* returned path will point to the same location in the model not being
* sorted. If `sorted_path` does not point to a location in the child model,
* %NULL is returned.
* @param sorted_path A #GtkTreePath to convert
* @returns A newly allocated #GtkTreePath, or %NULL
*/
convert_path_to_child_path(sorted_path: TreePath): TreePath;
/**
* Returns the model the #GtkTreeModelSort is sorting.
* @returns the "child model" being sorted
*/
get_model(): TreeModel;
/**
* <warning><para>
* This function is slow. Only use it for debugging and/or testing purposes.
* </para></warning>
*
* Checks if the given iter is a valid iter for this #GtkTreeModelSort.
* @param iter A #GtkTreeIter.
* @returns %TRUE if the iter is valid, %FALSE if the iter is invalid.
*/
iter_is_valid(iter: TreeIter): boolean;
/**
* This resets the default sort function to be in the 'unsorted' state. That
* is, it is in the same order as the child model. It will re-sort the model
* to be in the same order as the child model only if the #GtkTreeModelSort
* is in 'unsorted' state.
*/
reset_default_sort_func(): void;
// Inherited methods
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
* @returns %TRUE if the row was successfully deleted
*/
drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @returns %TRUE if data of the required type was provided
*/
drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
* @returns %TRUE if the row can be dragged
*/
row_draggable(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
*/
vfunc_drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
*/
vfunc_drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
*/
vfunc_row_draggable(path: TreePath): boolean;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: TreePath | null): TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
* If `func` returns %TRUE, then the tree ceases to be walked, and
* gtk_tree_model_foreach() returns.
* @param func A function to be called on each row
*/
foreach(func: TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ The column index.
* @returns The type of the column.
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
* @returns The flags supported by this interface.
*/
get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter(path: TreePath): [boolean, TreeIter];
/**
* Initializes `iter` with the first iterator in the tree (the one at the path
* "0") and returns %TRUE. Returns %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set.
*/
get_iter_first(): [boolean, TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string A string representation of a #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter_from_string(path_string: string): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns The number of columns.
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
* @returns a newly-created #GtkTreePath.
*/
get_path(iter: TreeIter): TreePath;
/**
* Generates a string representation of the iter. This string is a ':'
* separated list of numbers. For example, "4:10:0:3" would be an
* acceptable return value for this string.
* @param iter An #GtkTreeIter.
* @returns A newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
* @returns %TRUE, if @child has been set to the first child.
*/
iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
* @returns %TRUE if @iter has children.
*/
iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
* @returns The number of children of @iter.
*/
iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
* @returns %TRUE if @iter has been changed to the next node.
*/
iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
* @returns %TRUE, if @parent has an @n<!-- -->th child.
*/
iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
* @returns %TRUE, if @iter is set to the parent of @child.
*/
iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child model.
* @returns A new #GtkTreeModel.
*/
sort_new_with_model(): TreeModel;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
unref_node(iter: TreeIter): void;
/**
* Returns the type of the column.
* @param index_ The column index.
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
*/
vfunc_get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
*/
vfunc_get_iter(path: TreePath): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
*/
vfunc_get_path(iter: TreeIter): TreePath;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
vfunc_get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
*/
vfunc_iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
*/
vfunc_iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
*/
vfunc_iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
*/
vfunc_iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
*/
vfunc_iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
*/
vfunc_iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
vfunc_ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
vfunc_row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
vfunc_row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
vfunc_rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
vfunc_unref_node(iter: TreeIter): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
* @returns %TRUE if the sort column is not one of the special sort column ids.
*/
get_sort_column_id(sort_column_id: number, order: SortType | null): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
* @returns %TRUE, if the model has a default sort function
*/
has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_default_sort_func(sort_func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
set_sort_column_id(sort_column_id: number, order: SortType | null): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_sort_func(
sort_column_id: number,
sort_func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
sort_column_changed(): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
*/
vfunc_get_sort_column_id(sort_column_id: number, order: SortType): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
*/
vfunc_has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_default_sort_func(func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
vfunc_set_sort_column_id(sort_column_id: number, order: SortType): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_sort_func(
sort_column_id: number,
func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
vfunc_sort_column_changed(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* 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 TreeSelection {
// Signal callback interfaces
interface Changed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class TreeSelection extends GObject.Object {
static $gtype: GObject.GType<TreeSelection>;
// Constructors
constructor(properties?: Partial<TreeSelection.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
// Virtual methods
vfunc_changed(): void;
// Methods
/**
* Returns the number of rows that have been selected in `tree`.
* @returns The number of rows selected.
*/
count_selected_rows(): number;
/**
* Gets the selection mode for `selection`. See
* gtk_tree_selection_set_mode().
* @returns the current selection mode
*/
get_mode(): SelectionMode;
/**
* Sets `iter` to the currently selected node if `selection` is set to
* #GTK_SELECTION_SINGLE or #GTK_SELECTION_BROWSE. `iter` may be NULL if you
* just want to test if `selection` has any selected nodes. `model` is filled
* with the current model as a convenience. This function will not work if you
* use `selection` is #GTK_SELECTION_MULTIPLE.
* @returns TRUE, if there is a selected node.
*/
get_selected(): [boolean, TreeModel | null, TreeIter | null];
/**
* Creates a list of path of all selected rows. Additionally, if you are
* planning on modifying the model after calling this function, you may
* want to convert the returned list into a list of #GtkTreeRowReference<!-- -->s.
* To do this, you can use gtk_tree_row_reference_new().
*
* To free the return value, use:
*
* ```
* g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
* g_list_free (list);
* ```
*
* @returns A #GList containing a #GtkTreePath for each selected row.
*/
get_selected_rows(): [TreePath[], TreeModel | null];
/**
* Returns the tree view associated with `selection`.
* @returns A #GtkTreeView
*/
get_tree_view(): TreeView;
/**
* Returns %TRUE if the row at `iter` is currently selected.
* @param iter A valid #GtkTreeIter
* @returns %TRUE, if @iter is selected
*/
iter_is_selected(iter: TreeIter): boolean;
/**
* Returns %TRUE if the row pointed to by `path` is currently selected. If `path`
* does not point to a valid location, %FALSE is returned
* @param path A #GtkTreePath to check selection on.
* @returns %TRUE if @path is selected.
*/
path_is_selected(path: TreePath): boolean;
/**
* Selects all the nodes. `selection` must be set to #GTK_SELECTION_MULTIPLE
* mode.
*/
select_all(): void;
/**
* Selects the specified iterator.
* @param iter The #GtkTreeIter to be selected.
*/
select_iter(iter: TreeIter): void;
/**
* Select the row at `path`.
* @param path The #GtkTreePath to be selected.
*/
select_path(path: TreePath): void;
/**
* Selects a range of nodes, determined by `start_path` and `end_path` inclusive.
* `selection` must be set to #GTK_SELECTION_MULTIPLE mode.
* @param start_path The initial node of the range.
* @param end_path The final node of the range.
*/
select_range(start_path: TreePath, end_path: TreePath): void;
/**
* Calls a function for each selected node. Note that you cannot modify
* the tree or selection from within this function. As a result,
* gtk_tree_selection_get_selected_rows() might be more useful.
* @param func The function to call for each selected node.
*/
selected_foreach(func: TreeSelectionForeachFunc): void;
/**
* Sets the selection mode of the `selection`. If the previous type was
* #GTK_SELECTION_MULTIPLE, then the anchor is kept selected, if it was
* previously selected.
* @param type The selection mode
*/
set_mode(type: SelectionMode | null): void;
/**
* Sets the selection function. If set, this function is called before any node
* is selected or unselected, giving some control over which nodes are selected.
* The select function should return %TRUE if the state of the node may be toggled,
* and %FALSE if the state of the node should be left unchanged.
* @param func The selection function.
*/
set_select_function(func: TreeSelectionFunc): void;
/**
* Unselects all the nodes.
*/
unselect_all(): void;
/**
* Unselects the specified iterator.
* @param iter The #GtkTreeIter to be unselected.
*/
unselect_iter(iter: TreeIter): void;
/**
* Unselects the row at `path`.
* @param path The #GtkTreePath to be unselected.
*/
unselect_path(path: TreePath): void;
/**
* Unselects a range of nodes, determined by `start_path` and `end_path`
* inclusive.
* @param start_path The initial node of the range.
* @param end_path The initial node of the range.
*/
unselect_range(start_path: TreePath, end_path: TreePath): void;
}
namespace TreeStore {
// Constructor properties interface
interface ConstructorProps
extends GObject.Object.ConstructorProps,
Buildable.ConstructorProps,
TreeDragDest.ConstructorProps,
TreeDragSource.ConstructorProps,
TreeModel.ConstructorProps,
TreeSortable.ConstructorProps {}
}
class TreeStore
extends GObject.Object
implements Buildable, TreeDragDest, TreeDragSource, TreeModel, TreeSortable
{
static $gtype: GObject.GType<TreeStore>;
// Fields
stamp: number;
root: any;
last: any;
n_columns: number;
sort_column_id: number;
sort_list: any[];
order: SortType;
column_headers: GObject.GType;
default_sort_func: TreeIterCompareFunc;
default_sort_data: any;
default_sort_destroy: GLib.DestroyNotify;
columns_dirty: number;
// Constructors
constructor(properties?: Partial<TreeStore.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static newv(types: GObject.GType[]): TreeStore;
// Conflicted with GObject.Object.newv
static newv(...args: never[]): any;
// Methods
/**
* Appends a new row to `tree_store`. If `parent` is non-%NULL, then it will append the
* new row after the last child of `parent,` otherwise it will append a row to
* the top level. `iter` will be changed to point to this new row. The row will
* be empty after this function is called. To fill in values, you need to call
* gtk_tree_store_set() or gtk_tree_store_set_value().
* @param parent A valid #GtkTreeIter, or %NULL
*/
append(parent?: TreeIter | null): TreeIter;
/**
* Removes all rows from `tree_store`
*/
clear(): void;
/**
* Creates a new row at `position`. If parent is non-%NULL, then the row will be
* made a child of `parent`. Otherwise, the row will be created at the toplevel.
* If `position` is larger than the number of rows at that level, then the new
* row will be inserted to the end of the list. `iter` will be changed to point
* to this new row. The row will be empty after this function is called. To
* fill in values, you need to call gtk_tree_store_set() or
* gtk_tree_store_set_value().
* @param parent A valid #GtkTreeIter, or %NULL
* @param position position to insert the new row
*/
insert(parent: TreeIter | null, position: number): TreeIter;
/**
* Inserts a new row after `sibling`. If `sibling` is %NULL, then the row will be
* prepended to `parent` 's children. If `parent` and `sibling` are %NULL, then
* the row will be prepended to the toplevel. If both `sibling` and `parent` are
* set, then `parent` must be the parent of `sibling`. When `sibling` is set,
* `parent` is optional.
*
* `iter` will be changed to point to this new row. The row will be empty after
* this function is called. To fill in values, you need to call
* gtk_tree_store_set() or gtk_tree_store_set_value().
* @param parent A valid #GtkTreeIter, or %NULL
* @param sibling A valid #GtkTreeIter, or %NULL
*/
insert_after(parent?: TreeIter | null, sibling?: TreeIter | null): TreeIter;
/**
* Inserts a new row before `sibling`. If `sibling` is %NULL, then the row will
* be appended to `parent` 's children. If `parent` and `sibling` are %NULL, then
* the row will be appended to the toplevel. If both `sibling` and `parent` are
* set, then `parent` must be the parent of `sibling`. When `sibling` is set,
* `parent` is optional.
*
* `iter` will be changed to point to this new row. The row will be empty after
* this function is called. To fill in values, you need to call
* gtk_tree_store_set() or gtk_tree_store_set_value().
* @param parent A valid #GtkTreeIter, or %NULL
* @param sibling A valid #GtkTreeIter, or %NULL
*/
insert_before(parent?: TreeIter | null, sibling?: TreeIter | null): TreeIter;
/**
* A variant of gtk_tree_store_insert_with_values() which takes
* the columns and values as two arrays, instead of varargs. This
* function is mainly intended for language bindings.
* @param parent A valid #GtkTreeIter, or %NULL
* @param position position to insert the new row
* @param columns an array of column numbers
* @param values an array of GValues
*/
insert_with_valuesv(
parent: TreeIter | null,
position: number,
columns: number[],
values: (GObject.Value | any)[],
): TreeIter | null;
/**
* Returns %TRUE if `iter` is an ancestor of `descendant`. That is, `iter` is the
* parent (or grandparent or great-grandparent) of `descendant`.
* @param iter A valid #GtkTreeIter
* @param descendant A valid #GtkTreeIter
* @returns %TRUE, if @iter is an ancestor of @descendant
*/
is_ancestor(iter: TreeIter, descendant: TreeIter): boolean;
/**
* Returns the depth of `iter`. This will be 0 for anything on the root level, 1
* for anything down a level, etc.
* @param iter A valid #GtkTreeIter
* @returns The depth of @iter
*/
iter_depth(iter: TreeIter): number;
/**
* WARNING: This function is slow. Only use it for debugging and/or testing
* purposes.
*
* Checks if the given iter is a valid iter for this #GtkTreeStore.
* @param iter A #GtkTreeIter.
* @returns %TRUE if the iter is valid, %FALSE if the iter is invalid.
*/
iter_is_valid(iter: TreeIter): boolean;
/**
* Moves `iter` in `tree_store` to the position after `position`. `iter` and
* `position` should be in the same level. Note that this function only
* works with unsorted stores. If `position` is %NULL, `iter` will be moved
* to the start of the level.
* @param iter A #GtkTreeIter.
* @param position A #GtkTreeIter.
*/
move_after(iter: TreeIter, position?: TreeIter | null): void;
/**
* Moves `iter` in `tree_store` to the position before `position`. `iter` and
* `position` should be in the same level. Note that this function only
* works with unsorted stores. If `position` is %NULL, `iter` will be
* moved to the end of the level.
* @param iter A #GtkTreeIter.
* @param position A #GtkTreeIter or %NULL.
*/
move_before(iter: TreeIter, position?: TreeIter | null): void;
/**
* Prepends a new row to `tree_store`. If `parent` is non-%NULL, then it will prepend
* the new row before the first child of `parent,` otherwise it will prepend a row
* to the top level. `iter` will be changed to point to this new row. The row
* will be empty after this function is called. To fill in values, you need to
* call gtk_tree_store_set() or gtk_tree_store_set_value().
* @param parent A valid #GtkTreeIter, or %NULL
*/
prepend(parent?: TreeIter | null): TreeIter;
/**
* Removes `iter` from `tree_store`. After being removed, `iter` is set to the
* next valid row at that level, or invalidated if it previously pointed to the
* last one.
* @param iter A valid #GtkTreeIter
* @returns %TRUE if @iter is still valid, %FALSE if not.
*/
remove(iter: TreeIter): boolean;
/**
* Reorders the children of `parent` in `tree_store` to follow the order
* indicated by `new_order`. Note that this function only works with
* unsorted stores.
* @param parent A #GtkTreeIter.
* @param new_order an array of integers mapping the new position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
reorder(parent: TreeIter, new_order: number[]): void;
/**
* This function is meant primarily for #GObjects that inherit from
* #GtkTreeStore, and should only be used when constructing a new
* #GtkTreeStore. It will not function after a row has been added,
* or a method on the #GtkTreeModel interface is called.
* @param types An array of #GType types, one for each column
*/
set_column_types(types: GObject.GType[]): void;
/**
* Sets the data in the cell specified by `iter` and `column`.
* The type of `value` must be convertible to the type of the
* column.
* @param iter A valid #GtkTreeIter for the row being modified
* @param column column number to modify
* @param value new value for the cell
*/
set_value(iter: TreeIter, column: number, value: GObject.Value | any): void;
/**
* A variant of gtk_tree_store_set_valist() which takes
* the columns and values as two arrays, instead of varargs. This
* function is mainly intended for language bindings or in case
* the number of columns to change is not known until run-time.
* @param iter A valid #GtkTreeIter for the row being modified
* @param columns an array of column numbers
* @param values an array of GValues
*/
set_valuesv(iter: TreeIter, columns: number[], values: (GObject.Value | any)[]): void;
/**
* Swaps `a` and `b` in the same level of `tree_store`. Note that this function
* only works with unsorted stores.
* @param a A #GtkTreeIter.
* @param b Another #GtkTreeIter.
*/
swap(a: TreeIter, b: TreeIter): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
* @returns whether a new row was created before position @dest
*/
drag_data_received(dest: TreePath, selection_data: SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn't exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
* @returns %TRUE if a drop is possible before @dest_path
*/
row_drop_possible(dest_path: TreePath, selection_data: SelectionData): boolean;
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
*/
vfunc_drag_data_received(dest: TreePath, selection_data: SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn't exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
*/
vfunc_row_drop_possible(dest_path: TreePath, selection_data: SelectionData): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
* @returns %TRUE if the row was successfully deleted
*/
drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @returns %TRUE if data of the required type was provided
*/
drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
* @returns %TRUE if the row can be dragged
*/
row_draggable(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
*/
vfunc_drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
*/
vfunc_drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
*/
vfunc_row_draggable(path: TreePath): boolean;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: TreePath | null): TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
* If `func` returns %TRUE, then the tree ceases to be walked, and
* gtk_tree_model_foreach() returns.
* @param func A function to be called on each row
*/
foreach(func: TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ The column index.
* @returns The type of the column.
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
* @returns The flags supported by this interface.
*/
get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter(path: TreePath): [boolean, TreeIter];
/**
* Initializes `iter` with the first iterator in the tree (the one at the path
* "0") and returns %TRUE. Returns %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set.
*/
get_iter_first(): [boolean, TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string A string representation of a #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter_from_string(path_string: string): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns The number of columns.
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
* @returns a newly-created #GtkTreePath.
*/
get_path(iter: TreeIter): TreePath;
/**
* Generates a string representation of the iter. This string is a ':'
* separated list of numbers. For example, "4:10:0:3" would be an
* acceptable return value for this string.
* @param iter An #GtkTreeIter.
* @returns A newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
* @returns %TRUE, if @child has been set to the first child.
*/
iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
* @returns %TRUE if @iter has children.
*/
iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
* @returns The number of children of @iter.
*/
iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
* @returns %TRUE if @iter has been changed to the next node.
*/
iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
* @returns %TRUE, if @parent has an @n<!-- -->th child.
*/
iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
* @returns %TRUE, if @iter is set to the parent of @child.
*/
iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child model.
* @returns A new #GtkTreeModel.
*/
sort_new_with_model(): TreeModel;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
unref_node(iter: TreeIter): void;
/**
* Returns the type of the column.
* @param index_ The column index.
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
*/
vfunc_get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
*/
vfunc_get_iter(path: TreePath): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
*/
vfunc_get_path(iter: TreeIter): TreePath;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
vfunc_get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
*/
vfunc_iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
*/
vfunc_iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
*/
vfunc_iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
*/
vfunc_iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
*/
vfunc_iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
*/
vfunc_iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
vfunc_ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
vfunc_row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
vfunc_row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
vfunc_rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
vfunc_unref_node(iter: TreeIter): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
* @returns %TRUE if the sort column is not one of the special sort column ids.
*/
get_sort_column_id(sort_column_id: number, order: SortType | null): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
* @returns %TRUE, if the model has a default sort function
*/
has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_default_sort_func(sort_func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
set_sort_column_id(sort_column_id: number, order: SortType | null): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_sort_func(
sort_column_id: number,
sort_func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
sort_column_changed(): void;
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
*/
vfunc_get_sort_column_id(sort_column_id: number, order: SortType): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
*/
vfunc_has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_default_sort_func(func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
vfunc_set_sort_column_id(sort_column_id: number, order: SortType): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_sort_func(
sort_column_id: number,
func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
vfunc_sort_column_changed(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* 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 TreeView {
// Signal callback interfaces
interface ColumnsChanged {
(): void;
}
interface CursorChanged {
(): void;
}
interface ExpandCollapseCursorRow {
(object: boolean, p0: boolean, p1: boolean): boolean;
}
interface MoveCursor {
(object: MovementStep, p0: number): boolean;
}
interface RowActivated {
(path: TreePath, column: TreeViewColumn): void;
}
interface RowCollapsed {
(iter: TreeIter, path: TreePath): void;
}
interface RowExpanded {
(iter: TreeIter, path: TreePath): void;
}
interface SelectAll {
(): boolean;
}
interface SelectCursorParent {
(): boolean;
}
interface SelectCursorRow {
(object: boolean): boolean;
}
interface SetScrollAdjustments {
(object: Adjustment, p0: Adjustment): void;
}
interface StartInteractiveSearch {
(): boolean;
}
interface TestCollapseRow {
(iter: TreeIter, path: TreePath): boolean;
}
interface TestExpandRow {
(iter: TreeIter, path: TreePath): boolean;
}
interface ToggleCursorRow {
(): boolean;
}
interface UnselectAll {
(): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends Container.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
enable_grid_lines: TreeViewGridLines;
enableGridLines: TreeViewGridLines;
enable_search: boolean;
enableSearch: boolean;
enable_tree_lines: boolean;
enableTreeLines: boolean;
expander_column: TreeViewColumn;
expanderColumn: TreeViewColumn;
fixed_height_mode: boolean;
fixedHeightMode: boolean;
hadjustment: Adjustment;
headers_clickable: boolean;
headersClickable: boolean;
headers_visible: boolean;
headersVisible: boolean;
hover_expand: boolean;
hoverExpand: boolean;
hover_selection: boolean;
hoverSelection: boolean;
level_indentation: number;
levelIndentation: number;
model: TreeModel;
reorderable: boolean;
rubber_banding: boolean;
rubberBanding: boolean;
rules_hint: boolean;
rulesHint: boolean;
search_column: number;
searchColumn: number;
show_expanders: boolean;
showExpanders: boolean;
tooltip_column: number;
tooltipColumn: number;
vadjustment: Adjustment;
}
}
class TreeView extends Container implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<TreeView>;
// Properties
get enable_grid_lines(): TreeViewGridLines;
set enable_grid_lines(val: TreeViewGridLines);
get enableGridLines(): TreeViewGridLines;
set enableGridLines(val: TreeViewGridLines);
get enable_search(): boolean;
set enable_search(val: boolean);
get enableSearch(): boolean;
set enableSearch(val: boolean);
get enable_tree_lines(): boolean;
set enable_tree_lines(val: boolean);
get enableTreeLines(): boolean;
set enableTreeLines(val: boolean);
get expander_column(): TreeViewColumn;
set expander_column(val: TreeViewColumn);
get expanderColumn(): TreeViewColumn;
set expanderColumn(val: TreeViewColumn);
/**
* Setting the ::fixed-height-mode property to %TRUE speeds up
* #GtkTreeView by assuming that all rows have the same height.
* Only enable this option if all rows are the same height.
* Please see gtk_tree_view_set_fixed_height_mode() for more
* information on this option.
*/
get fixed_height_mode(): boolean;
set fixed_height_mode(val: boolean);
/**
* Setting the ::fixed-height-mode property to %TRUE speeds up
* #GtkTreeView by assuming that all rows have the same height.
* Only enable this option if all rows are the same height.
* Please see gtk_tree_view_set_fixed_height_mode() for more
* information on this option.
*/
get fixedHeightMode(): boolean;
set fixedHeightMode(val: boolean);
get hadjustment(): Adjustment;
set hadjustment(val: Adjustment);
get headers_clickable(): boolean;
set headers_clickable(val: boolean);
get headersClickable(): boolean;
set headersClickable(val: boolean);
get headers_visible(): boolean;
set headers_visible(val: boolean);
get headersVisible(): boolean;
set headersVisible(val: boolean);
/**
* Enables of disables the hover expansion mode of `tree_view`.
* Hover expansion makes rows expand or collapse if the pointer moves
* over them.
*
* This mode is primarily intended for treeviews in popups, e.g.
* in #GtkComboBox or #GtkEntryCompletion.
*/
get hover_expand(): boolean;
set hover_expand(val: boolean);
/**
* Enables of disables the hover expansion mode of `tree_view`.
* Hover expansion makes rows expand or collapse if the pointer moves
* over them.
*
* This mode is primarily intended for treeviews in popups, e.g.
* in #GtkComboBox or #GtkEntryCompletion.
*/
get hoverExpand(): boolean;
set hoverExpand(val: boolean);
/**
* Enables of disables the hover selection mode of `tree_view`.
* Hover selection makes the selected row follow the pointer.
* Currently, this works only for the selection modes
* %GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE.
*
* This mode is primarily intended for treeviews in popups, e.g.
* in #GtkComboBox or #GtkEntryCompletion.
*/
get hover_selection(): boolean;
set hover_selection(val: boolean);
/**
* Enables of disables the hover selection mode of `tree_view`.
* Hover selection makes the selected row follow the pointer.
* Currently, this works only for the selection modes
* %GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE.
*
* This mode is primarily intended for treeviews in popups, e.g.
* in #GtkComboBox or #GtkEntryCompletion.
*/
get hoverSelection(): boolean;
set hoverSelection(val: boolean);
/**
* Extra indentation for each level.
*/
get level_indentation(): number;
set level_indentation(val: number);
/**
* Extra indentation for each level.
*/
get levelIndentation(): number;
set levelIndentation(val: number);
get model(): TreeModel;
set model(val: TreeModel);
get reorderable(): boolean;
set reorderable(val: boolean);
get rubber_banding(): boolean;
set rubber_banding(val: boolean);
get rubberBanding(): boolean;
set rubberBanding(val: boolean);
get rules_hint(): boolean;
set rules_hint(val: boolean);
get rulesHint(): boolean;
set rulesHint(val: boolean);
get search_column(): number;
set search_column(val: number);
get searchColumn(): number;
set searchColumn(val: number);
/**
* %TRUE if the view has expanders.
*/
get show_expanders(): boolean;
set show_expanders(val: boolean);
/**
* %TRUE if the view has expanders.
*/
get showExpanders(): boolean;
set showExpanders(val: boolean);
get tooltip_column(): number;
set tooltip_column(val: number);
get tooltipColumn(): number;
set tooltipColumn(val: number);
get vadjustment(): Adjustment;
set vadjustment(val: Adjustment);
// Constructors
constructor(properties?: Partial<TreeView.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TreeView;
static new_with_model(model: TreeModel): TreeView;
// 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: 'columns-changed', callback: (_source: this) => void): number;
connect_after(signal: 'columns-changed', callback: (_source: this) => void): number;
emit(signal: 'columns-changed'): void;
connect(signal: 'cursor-changed', callback: (_source: this) => void): number;
connect_after(signal: 'cursor-changed', callback: (_source: this) => void): number;
emit(signal: 'cursor-changed'): void;
connect(
signal: 'expand-collapse-cursor-row',
callback: (_source: this, object: boolean, p0: boolean, p1: boolean) => boolean,
): number;
connect_after(
signal: 'expand-collapse-cursor-row',
callback: (_source: this, object: boolean, p0: boolean, p1: boolean) => boolean,
): number;
emit(signal: 'expand-collapse-cursor-row', object: boolean, p0: boolean, p1: boolean): void;
connect(
signal: 'move-cursor',
callback: (_source: this, object: MovementStep, p0: number) => boolean,
): number;
connect_after(
signal: 'move-cursor',
callback: (_source: this, object: MovementStep, p0: number) => boolean,
): number;
emit(signal: 'move-cursor', object: MovementStep, p0: number): void;
connect(
signal: 'row-activated',
callback: (_source: this, path: TreePath, column: TreeViewColumn) => void,
): number;
connect_after(
signal: 'row-activated',
callback: (_source: this, path: TreePath, column: TreeViewColumn) => void,
): number;
emit(signal: 'row-activated', path: TreePath, column: TreeViewColumn): void;
connect(signal: 'row-collapsed', callback: (_source: this, iter: TreeIter, path: TreePath) => void): number;
connect_after(
signal: 'row-collapsed',
callback: (_source: this, iter: TreeIter, path: TreePath) => void,
): number;
emit(signal: 'row-collapsed', iter: TreeIter, path: TreePath): void;
connect(signal: 'row-expanded', callback: (_source: this, iter: TreeIter, path: TreePath) => void): number;
connect_after(
signal: 'row-expanded',
callback: (_source: this, iter: TreeIter, path: TreePath) => void,
): number;
emit(signal: 'row-expanded', iter: TreeIter, path: TreePath): void;
connect(signal: 'select-all', callback: (_source: this) => boolean): number;
connect_after(signal: 'select-all', callback: (_source: this) => boolean): number;
emit(signal: 'select-all'): void;
connect(signal: 'select-cursor-parent', callback: (_source: this) => boolean): number;
connect_after(signal: 'select-cursor-parent', callback: (_source: this) => boolean): number;
emit(signal: 'select-cursor-parent'): void;
connect(signal: 'select-cursor-row', callback: (_source: this, object: boolean) => boolean): number;
connect_after(signal: 'select-cursor-row', callback: (_source: this, object: boolean) => boolean): number;
emit(signal: 'select-cursor-row', object: boolean): void;
connect(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
connect_after(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
emit(signal: 'set-scroll-adjustments', object: Adjustment, p0: Adjustment): void;
connect(signal: 'start-interactive-search', callback: (_source: this) => boolean): number;
connect_after(signal: 'start-interactive-search', callback: (_source: this) => boolean): number;
emit(signal: 'start-interactive-search'): void;
connect(
signal: 'test-collapse-row',
callback: (_source: this, iter: TreeIter, path: TreePath) => boolean,
): number;
connect_after(
signal: 'test-collapse-row',
callback: (_source: this, iter: TreeIter, path: TreePath) => boolean,
): number;
emit(signal: 'test-collapse-row', iter: TreeIter, path: TreePath): void;
connect(
signal: 'test-expand-row',
callback: (_source: this, iter: TreeIter, path: TreePath) => boolean,
): number;
connect_after(
signal: 'test-expand-row',
callback: (_source: this, iter: TreeIter, path: TreePath) => boolean,
): number;
emit(signal: 'test-expand-row', iter: TreeIter, path: TreePath): void;
connect(signal: 'toggle-cursor-row', callback: (_source: this) => boolean): number;
connect_after(signal: 'toggle-cursor-row', callback: (_source: this) => boolean): number;
emit(signal: 'toggle-cursor-row'): void;
connect(signal: 'unselect-all', callback: (_source: this) => boolean): number;
connect_after(signal: 'unselect-all', callback: (_source: this) => boolean): number;
emit(signal: 'unselect-all'): void;
// Virtual methods
vfunc_columns_changed(): void;
vfunc_cursor_changed(): void;
vfunc_expand_collapse_cursor_row(logical: boolean, expand: boolean, open_all: boolean): boolean;
vfunc_move_cursor(step: MovementStep, count: number): boolean;
/**
* Activates the cell determined by `path` and `column`.
* @param path The #GtkTreePath to be activated.
* @param column The #GtkTreeViewColumn to be activated.
*/
vfunc_row_activated(path: TreePath, column: TreeViewColumn): void;
vfunc_row_collapsed(iter: TreeIter, path: TreePath): void;
vfunc_row_expanded(iter: TreeIter, path: TreePath): void;
vfunc_select_all(): boolean;
vfunc_select_cursor_parent(): boolean;
vfunc_select_cursor_row(start_editing: boolean): boolean;
vfunc_set_scroll_adjustments(hadjustment: Adjustment, vadjustment: Adjustment): void;
vfunc_start_interactive_search(): boolean;
vfunc_test_collapse_row(iter: TreeIter, path: TreePath): boolean;
vfunc_test_expand_row(iter: TreeIter, path: TreePath): boolean;
vfunc_toggle_cursor_row(): boolean;
vfunc_unselect_all(): boolean;
// Methods
/**
* Appends `column` to the list of columns. If `tree_view` has "fixed_height"
* mode enabled, then `column` must have its "sizing" property set to be
* GTK_TREE_VIEW_COLUMN_FIXED.
* @param column The #GtkTreeViewColumn to add.
* @returns The number of columns in @tree_view after appending.
*/
append_column(column: TreeViewColumn): number;
/**
* Recursively collapses all visible, expanded nodes in `tree_view`.
*/
collapse_all(): void;
/**
* Collapses a row (hides its child rows, if they exist).
* @param path path to a row in the @tree_view
* @returns %TRUE if the row was collapsed.
*/
collapse_row(path: TreePath): boolean;
/**
* Resizes all columns to their optimal width. Only works after the
* treeview has been realized.
*/
columns_autosize(): void;
/**
* Converts bin_window coordinates to coordinates for the
* tree (the full scrollable area of the tree).
* @param bx X coordinate relative to bin_window
* @param by Y coordinate relative to bin_window
*/
convert_bin_window_to_tree_coords(bx: number, by: number): [number, number];
/**
* Converts bin_window coordinates (see gtk_tree_view_get_bin_window())
* to widget relative coordinates.
* @param bx bin_window X coordinate
* @param by bin_window Y coordinate
*/
convert_bin_window_to_widget_coords(bx: number, by: number): [number, number];
/**
* Converts tree coordinates (coordinates in full scrollable area of the tree)
* to bin_window coordinates.
* @param tx tree X coordinate
* @param ty tree Y coordinate
*/
convert_tree_to_bin_window_coords(tx: number, ty: number): [number, number];
/**
* Converts tree coordinates (coordinates in full scrollable area of the tree)
* to widget coordinates.
* @param tx X coordinate relative to the tree
* @param ty Y coordinate relative to the tree
*/
convert_tree_to_widget_coords(tx: number, ty: number): [number, number];
/**
* Converts widget coordinates to coordinates for the bin_window
* (see gtk_tree_view_get_bin_window()).
* @param wx X coordinate relative to the widget
* @param wy Y coordinate relative to the widget
*/
convert_widget_to_bin_window_coords(wx: number, wy: number): [number, number];
/**
* Converts widget coordinates to coordinates for the
* tree (the full scrollable area of the tree).
* @param wx X coordinate relative to the widget
* @param wy Y coordinate relative to the widget
*/
convert_widget_to_tree_coords(wx: number, wy: number): [number, number];
/**
* Creates a #GdkPixmap representation of the row at `path`.
* This image is used for a drag icon.
* @param path a #GtkTreePath in @tree_view
* @returns a newly-allocated pixmap of the drag icon.
*/
create_row_drag_icon(path: TreePath): Gdk.Pixmap;
/**
* Turns `tree_view` into a drop destination for automatic DND. Calling
* this method sets #GtkTreeView:reorderable to %FALSE.
* @param targets the table of targets that the drag will support
* @param actions the bitmask of possible actions for a drag from this widget
*/
enable_model_drag_dest(targets: TargetEntry[], actions: Gdk.DragAction | null): void;
/**
* Turns `tree_view` into a drag source for automatic DND. Calling this
* method sets #GtkTreeView:reorderable to %FALSE.
* @param start_button_mask Mask of allowed buttons to start drag
* @param targets the table of targets that the drag will support
* @param actions the bitmask of possible actions for a drag from this widget
*/
enable_model_drag_source(
start_button_mask: Gdk.ModifierType | null,
targets: TargetEntry[],
actions: Gdk.DragAction | null,
): void;
/**
* Recursively expands all nodes in the `tree_view`.
*/
expand_all(): void;
/**
* Opens the row so its children are visible.
* @param path path to a row
* @param open_all whether to recursively expand, or just expand immediate children
* @returns %TRUE if the row existed and had children
*/
expand_row(path: TreePath, open_all: boolean): boolean;
/**
* Expands the row at `path`. This will also expand all parent rows of
* `path` as necessary.
* @param path path to a row.
*/
expand_to_path(path: TreePath): void;
/**
* Fills the bounding rectangle in bin_window coordinates for the cell at the
* row specified by `path` and the column specified by `column`. If `path` is
* %NULL, or points to a node not found in the tree, the `y` and `height` fields of
* the rectangle will be filled with 0. If `column` is %NULL, the `x` and `width`
* fields will be filled with 0. The returned rectangle is equivalent to the
* `background_area` passed to gtk_cell_renderer_render(). These background
* areas tile to cover the entire bin window. Contrast with the `cell_area,`
* returned by gtk_tree_view_get_cell_area(), which returns only the cell
* itself, excluding surrounding borders and the tree expander area.
* @param path a #GtkTreePath for the row, or %NULL to get only horizontal coordinates
* @param column a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordiantes
*/
get_background_area(path: TreePath | null, column: TreeViewColumn | null): Gdk.Rectangle;
/**
* Returns the window that `tree_view` renders to.
* This is used primarily to compare to <literal>event->window</literal>
* to confirm that the event on `tree_view` is on the right window.
* @returns A #GdkWindow, or %NULL when @tree_view hasn't been realized yet
*/
get_bin_window(): Gdk.Window;
/**
* Fills the bounding rectangle in bin_window coordinates for the cell at the
* row specified by `path` and the column specified by `column`. If `path` is
* %NULL, or points to a path not currently displayed, the `y` and `height` fields
* of the rectangle will be filled with 0. If `column` is %NULL, the `x` and `width`
* fields will be filled with 0. The sum of all cell rects does not cover the
* entire tree; there are extra pixels in between rows, for example. The
* returned rectangle is equivalent to the `cell_area` passed to
* gtk_cell_renderer_render(). This function is only valid if `tree_view` is
* realized.
* @param path a #GtkTreePath for the row, or %NULL to get only horizontal coordinates
* @param column a #GtkTreeViewColumn for the column, or %NULL to get only vertical coordinates
*/
get_cell_area(path: TreePath | null, column: TreeViewColumn | null): Gdk.Rectangle;
/**
* Gets the #GtkTreeViewColumn at the given position in the #tree_view.
* @param n The position of the column, counting from 0.
* @returns The #GtkTreeViewColumn, or %NULL if the position is outside the range of columns.
*/
get_column(n: number): TreeViewColumn;
/**
* Returns a #GList of all the #GtkTreeViewColumn s currently in `tree_view`.
* The returned list must be freed with g_list_free ().
* @returns A list of #GtkTreeViewColumn s
*/
get_columns(): TreeViewColumn[];
/**
* Fills in `path` and `focus_column` with the current path and focus column. If
* the cursor isn't currently set, then *`path` will be %NULL. If no column
* currently has focus, then *`focus_column` will be %NULL.
*
* The returned #GtkTreePath must be freed with gtk_tree_path_free() when
* you are done with it.
*/
get_cursor(): [TreePath | null, TreeViewColumn | null];
/**
* Determines the destination row for a given position. `drag_x` and
* `drag_y` are expected to be in widget coordinates. This function is only
* meaningful if `tree_view` is realized. Therefore this function will always
* return %FALSE if `tree_view` is not realized or does not have a model.
* @param drag_x the position to determine the destination row for
* @param drag_y the position to determine the destination row for
* @returns whether there is a row at the given position, %TRUE if this is indeed the case.
*/
get_dest_row_at_pos(
drag_x: number,
drag_y: number,
): [boolean, TreePath | null, TreeViewDropPosition | null];
/**
* Gets information about the row that is highlighted for feedback.
*/
get_drag_dest_row(): [TreePath | null, TreeViewDropPosition | null];
/**
* Returns whether or not the tree allows to start interactive searching
* by typing in text.
* @returns whether or not to let the user search interactively
*/
get_enable_search(): boolean;
/**
* Returns whether or not tree lines are drawn in `tree_view`.
* @returns %TRUE if tree lines are drawn in @tree_view, %FALSE otherwise.
*/
get_enable_tree_lines(): boolean;
/**
* Returns the column that is the current expander column.
* This column has the expander arrow drawn next to it.
* @returns The expander column.
*/
get_expander_column(): TreeViewColumn;
/**
* Returns whether fixed height mode is turned on for `tree_view`.
* @returns %TRUE if @tree_view is in fixed height mode
*/
get_fixed_height_mode(): boolean;
/**
* Returns which grid lines are enabled in `tree_view`.
* @returns a #GtkTreeViewGridLines value indicating which grid lines are enabled.
*/
get_grid_lines(): TreeViewGridLines;
/**
* Gets the #GtkAdjustment currently being used for the horizontal aspect.
* @returns A #GtkAdjustment object, or %NULL if none is currently being used.
*/
get_hadjustment(): Adjustment;
/**
* Returns whether all header columns are clickable.
* @returns %TRUE if all header columns are clickable, otherwise %FALSE
*/
get_headers_clickable(): boolean;
/**
* Returns %TRUE if the headers on the `tree_view` are visible.
* @returns Whether the headers are visible or not.
*/
get_headers_visible(): boolean;
/**
* Returns whether hover expansion mode is turned on for `tree_view`.
* @returns %TRUE if @tree_view is in hover expansion mode
*/
get_hover_expand(): boolean;
/**
* Returns whether hover selection mode is turned on for `tree_view`.
* @returns %TRUE if @tree_view is in hover selection mode
*/
get_hover_selection(): boolean;
/**
* Returns the amount, in pixels, of extra indentation for child levels
* in `tree_view`.
* @returns the amount of extra indentation for child levels in @tree_view. A return value of 0 means that this feature is disabled.
*/
get_level_indentation(): number;
/**
* Returns the model the #GtkTreeView is based on. Returns %NULL if the
* model is unset.
* @returns A #GtkTreeModel, or %NULL if none is currently being used.
*/
get_model(): TreeModel;
/**
* Finds the path at the point (`x,` `y)`, relative to bin_window coordinates
* (please see gtk_tree_view_get_bin_window()).
* That is, `x` and `y` are relative to an events coordinates. `x` and `y` must
* come from an event on the `tree_view` only where <literal>event->window ==
* gtk_tree_view_get_bin_window (<!-- -->)</literal>. It is primarily for
* things like popup menus. If `path` is non-%NULL, then it will be filled
* with the #GtkTreePath at that point. This path should be freed with
* gtk_tree_path_free(). If `column` is non-%NULL, then it will be filled
* with the column at that point. `cell_x` and `cell_y` return the coordinates
* relative to the cell background (i.e. the `background_area` passed to
* gtk_cell_renderer_render()). This function is only meaningful if
* `tree_view` is realized. Therefore this function will always return %FALSE
* if `tree_view` is not realized or does not have a model.
*
* For converting widget coordinates (eg. the ones you get from
* GtkWidget::query-tooltip), please see
* gtk_tree_view_convert_widget_to_bin_window_coords().
* @param x The x position to be identified (relative to bin_window).
* @param y The y position to be identified (relative to bin_window).
* @returns %TRUE if a row exists at that coordinate.
*/
get_path_at_pos(x: number, y: number): [boolean, TreePath | null, TreeViewColumn | null, number, number];
/**
* Retrieves whether the user can reorder the tree via drag-and-drop. See
* gtk_tree_view_set_reorderable().
* @returns %TRUE if the tree can be reordered.
*/
get_reorderable(): boolean;
/**
* Returns whether rubber banding is turned on for `tree_view`. If the
* selection mode is #GTK_SELECTION_MULTIPLE, rubber banding will allow the
* user to select multiple rows by dragging the mouse.
* @returns %TRUE if rubber banding in @tree_view is enabled.
*/
get_rubber_banding(): boolean;
/**
* Gets the setting set by gtk_tree_view_set_rules_hint().
* @returns %TRUE if rules are useful for the user of this tree
*/
get_rules_hint(): boolean;
/**
* Gets the column searched on by the interactive search code.
* @returns the column the interactive search code searches in.
*/
get_search_column(): number;
/**
* Returns the #GtkEntry which is currently in use as interactive search
* entry for `tree_view`. In case the built-in entry is being used, %NULL
* will be returned.
* @returns the entry currently in use as search entry.
*/
get_search_entry(): Entry;
/**
* Gets the #GtkTreeSelection associated with `tree_view`.
* @returns A #GtkTreeSelection object.
*/
get_selection(): TreeSelection;
/**
* Returns whether or not expanders are drawn in `tree_view`.
* @returns %TRUE if expanders are drawn in @tree_view, %FALSE otherwise.
*/
get_show_expanders(): boolean;
/**
* Returns the column of `tree_view'`s model which is being used for
* displaying tooltips on `tree_view'`s rows.
* @returns the index of the tooltip column that is currently being used, or -1 if this is disabled.
*/
get_tooltip_column(): number;
/**
* This function is supposed to be used in a #GtkWidget::query-tooltip
* signal handler for #GtkTreeView. The `x,` `y` and `keyboard_tip` values
* which are received in the signal handler, should be passed to this
* function without modification.
*
* The return value indicates whether there is a tree view row at the given
* coordinates (%TRUE) or not (%FALSE) for mouse tooltips. For keyboard
* tooltips the row returned will be the cursor row. When %TRUE, then any of
* `model,` `path` and `iter` which have been provided will be set to point to
* that row and the corresponding model. `x` and `y` will always be converted
* to be relative to `tree_view'`s bin_window if `keyboard_tooltip` is %FALSE.
* @param x the x coordinate (relative to widget coordinates)
* @param y the y coordinate (relative to widget coordinates)
* @param keyboard_tip whether this is a keyboard tooltip or not
* @returns whether or not the given tooltip context points to a row.
*/
get_tooltip_context(
x: number,
y: number,
keyboard_tip: boolean,
): [boolean, number, number, TreeModel | null, TreePath | null, TreeIter | null];
/**
* Gets the #GtkAdjustment currently being used for the vertical aspect.
* @returns A #GtkAdjustment object, or %NULL if none is currently being used.
*/
get_vadjustment(): Adjustment;
/**
* Sets `start_path` and `end_path` to be the first and last visible path.
* Note that there may be invisible paths in between.
*
* The paths should be freed with gtk_tree_path_free() after use.
* @returns %TRUE, if valid paths were placed in @start_path and @end_path.
*/
get_visible_range(): [boolean, TreePath | null, TreePath | null];
/**
* Fills `visible_rect` with the currently-visible region of the
* buffer, in tree coordinates. Convert to bin_window coordinates with
* gtk_tree_view_convert_tree_to_bin_window_coords().
* Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire
* scrollable area of the tree.
*/
get_visible_rect(): Gdk.Rectangle;
/**
* This inserts the `column` into the `tree_view` at `position`. If `position` is
* -1, then the column is inserted at the end. If `tree_view` has
* "fixed_height" mode enabled, then `column` must have its "sizing" property
* set to be GTK_TREE_VIEW_COLUMN_FIXED.
* @param column The #GtkTreeViewColumn to be inserted.
* @param position The position to insert @column in.
* @returns The number of columns in @tree_view after insertion.
*/
insert_column(column: TreeViewColumn, position: number): number;
/**
* Convenience function that inserts a new column into the #GtkTreeView
* with the given cell renderer and a #GtkCellDataFunc to set cell renderer
* attributes (normally using data from the model). See also
* gtk_tree_view_column_set_cell_data_func(), gtk_tree_view_column_pack_start().
* If `tree_view` has "fixed_height" mode enabled, then the new column will have its
* "sizing" property set to be GTK_TREE_VIEW_COLUMN_FIXED.
* @param position Position to insert, -1 for append
* @param title column title
* @param cell cell renderer for column
* @param func function to set attributes of cell renderer
* @returns number of columns in the tree view post-insert
*/
insert_column_with_data_func(
position: number,
title: string,
cell: CellRenderer,
func: TreeCellDataFunc,
): number;
/**
* Returns whether a rubber banding operation is currently being done
* in `tree_view`.
* @returns %TRUE if a rubber banding operation is currently being done in @tree_view.
*/
is_rubber_banding_active(): boolean;
/**
* Calls `func` on all expanded rows.
* @param func A function to be called
*/
map_expanded_rows(func: TreeViewMappingFunc): void;
/**
* Moves `column` to be after to `base_column`. If `base_column` is %NULL, then
* `column` is placed in the first position.
* @param column The #GtkTreeViewColumn to be moved.
* @param base_column The #GtkTreeViewColumn to be moved relative to, or %NULL.
*/
move_column_after(column: TreeViewColumn, base_column?: TreeViewColumn | null): void;
/**
* Removes `column` from `tree_view`.
* @param column The #GtkTreeViewColumn to remove.
* @returns The number of columns in @tree_view after removing.
*/
remove_column(column: TreeViewColumn): number;
/**
* Activates the cell determined by `path` and `column`.
* @param path The #GtkTreePath to be activated.
* @param column The #GtkTreeViewColumn to be activated.
*/
row_activated(path: TreePath, column: TreeViewColumn): void;
/**
* Returns %TRUE if the node pointed to by `path` is expanded in `tree_view`.
* @param path A #GtkTreePath to test expansion state.
* @returns %TRUE if #path is expanded.
*/
row_expanded(path: TreePath): boolean;
/**
* Moves the alignments of `tree_view` to the position specified by `column` and
* `path`. If `column` is %NULL, then no horizontal scrolling occurs. Likewise,
* if `path` is %NULL no vertical scrolling occurs. At a minimum, one of `column`
* or `path` need to be non-%NULL. `row_align` determines where the row is
* placed, and `col_align` determines where `column` is placed. Both are expected
* to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means
* right/bottom alignment, 0.5 means center.
*
* If `use_align` is %FALSE, then the alignment arguments are ignored, and the
* tree does the minimum amount of work to scroll the cell onto the screen.
* This means that the cell will be scrolled to the edge closest to its current
* position. If the cell is currently visible on the screen, nothing is done.
*
* This function only works if the model is set, and `path` is a valid row on the
* model. If the model changes before the `tree_view` is realized, the centered
* path will be modified to reflect this change.
* @param path The path of the row to move to, or %NULL.
* @param column The #GtkTreeViewColumn to move horizontally to, or %NULL.
* @param use_align whether to use alignment arguments, or %FALSE.
* @param row_align The vertical alignment of the row specified by @path.
* @param col_align The horizontal alignment of the column specified by @column.
*/
scroll_to_cell(
path: TreePath | null,
column: TreeViewColumn | null,
use_align: boolean,
row_align: number,
col_align: number,
): void;
/**
* Scrolls the tree view such that the top-left corner of the visible
* area is `tree_x,` `tree_y,` where `tree_x` and `tree_y` are specified
* in tree coordinates. The `tree_view` must be realized before
* this function is called. If it isn't, you probably want to be
* using gtk_tree_view_scroll_to_cell().
*
* If either `tree_x` or `tree_y` are -1, then that direction isn't scrolled.
* @param tree_x X coordinate of new top-left pixel of visible area, or -1
* @param tree_y Y coordinate of new top-left pixel of visible area, or -1
*/
scroll_to_point(tree_x: number, tree_y: number): void;
/**
* Sets a user function for determining where a column may be dropped when
* dragged. This function is called on every column pair in turn at the
* beginning of a column drag to determine where a drop can take place. The
* arguments passed to `func` are: the `tree_view,` the #GtkTreeViewColumn being
* dragged, the two #GtkTreeViewColumn s determining the drop spot, and
* `user_data`. If either of the #GtkTreeViewColumn arguments for the drop spot
* are %NULL, then they indicate an edge. If `func` is set to be %NULL, then
* `tree_view` reverts to the default behavior of allowing all columns to be
* dropped everywhere.
* @param func A function to determine which columns are reorderable, or %NULL.
* @param destroy Destroy notifier for @user_data, or %NULL
*/
set_column_drag_function(func?: TreeViewColumnDropFunc | null, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current keyboard focus to be at `path,` and selects it. This is
* useful when you want to focus the user's attention on a particular row. If
* `focus_column` is not %NULL, then focus is given to the column specified by
* it. Additionally, if `focus_column` is specified, and `start_editing` is
* %TRUE, then editing should be started in the specified cell.
* This function is often followed by `gtk_widget_grab_focus` (`tree_view)`
* in order to give keyboard focus to the widget. Please note that editing
* can only happen when the widget is realized.
*
* If `path` is invalid for `model,` the current cursor (if any) will be unset
* and the function will return without failing.
* @param path A #GtkTreePath
* @param focus_column A #GtkTreeViewColumn, or %NULL
* @param start_editing %TRUE if the specified cell should start being edited.
*/
set_cursor(path: TreePath, focus_column: TreeViewColumn | null, start_editing: boolean): void;
/**
* Sets the current keyboard focus to be at `path,` and selects it. This is
* useful when you want to focus the user's attention on a particular row. If
* `focus_column` is not %NULL, then focus is given to the column specified by
* it. If `focus_column` and `focus_cell` are not %NULL, and `focus_column`
* contains 2 or more editable or activatable cells, then focus is given to
* the cell specified by `focus_cell`. Additionally, if `focus_column` is
* specified, and `start_editing` is %TRUE, then editing should be started in
* the specified cell. This function is often followed by
* `gtk_widget_grab_focus` (`tree_view)` in order to give keyboard focus to the
* widget. Please note that editing can only happen when the widget is
* realized.
*
* If `path` is invalid for `model,` the current cursor (if any) will be unset
* and the function will return without failing.
* @param path A #GtkTreePath
* @param focus_column A #GtkTreeViewColumn, or %NULL
* @param focus_cell A #GtkCellRenderer, or %NULL
* @param start_editing %TRUE if the specified cell should start being edited.
*/
set_cursor_on_cell(
path: TreePath,
focus_column: TreeViewColumn | null,
focus_cell: CellRenderer | null,
start_editing: boolean,
): void;
/**
* This function should almost never be used. It is meant for private use by
* ATK for determining the number of visible children that are removed when the
* user collapses a row, or a row is deleted.
* @param func Function to be called when a view row is destroyed, or %NULL
* @param destroy Destroy notifier for @data, or %NULL
*/
set_destroy_count_func(func?: TreeDestroyCountFunc | null, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the row that is highlighted for feedback.
* @param path The path of the row to highlight, or %NULL.
* @param pos Specifies whether to drop before, after or into the row
*/
set_drag_dest_row(path: TreePath | null, pos: TreeViewDropPosition | null): void;
/**
* If `enable_search` is set, then the user can type in text to search through
* the tree interactively (this is sometimes called "typeahead find").
*
* Note that even if this is %FALSE, the user can still initiate a search
* using the "start-interactive-search" key binding.
* @param enable_search %TRUE, if the user can search interactively
*/
set_enable_search(enable_search: boolean): void;
/**
* Sets whether to draw lines interconnecting the expanders in `tree_view`.
* This does not have any visible effects for lists.
* @param enabled %TRUE to enable tree line drawing, %FALSE otherwise.
*/
set_enable_tree_lines(enabled: boolean): void;
/**
* Sets the column to draw the expander arrow at. It must be in `tree_view`.
* If `column` is %NULL, then the expander arrow is always at the first
* visible column.
*
* If you do not want expander arrow to appear in your tree, set the
* expander column to a hidden column.
* @param column %NULL, or the column to draw the expander arrow at.
*/
set_expander_column(column: TreeViewColumn): void;
/**
* Enables or disables the fixed height mode of `tree_view`.
* Fixed height mode speeds up #GtkTreeView by assuming that all
* rows have the same height.
* Only enable this option if all rows are the same height and all
* columns are of type %GTK_TREE_VIEW_COLUMN_FIXED.
* @param enable %TRUE to enable fixed height mode
*/
set_fixed_height_mode(enable: boolean): void;
/**
* Sets which grid lines to draw in `tree_view`.
* @param grid_lines a #GtkTreeViewGridLines value indicating which grid lines to enable.
*/
set_grid_lines(grid_lines: TreeViewGridLines | null): void;
/**
* Sets the #GtkAdjustment for the current horizontal aspect.
* @param adjustment The #GtkAdjustment to set, or %NULL
*/
set_hadjustment(adjustment?: Adjustment | null): void;
/**
* Allow the column title buttons to be clicked.
* @param setting %TRUE if the columns are clickable.
*/
set_headers_clickable(setting: boolean): void;
/**
* Sets the visibility state of the headers.
* @param headers_visible %TRUE if the headers are visible
*/
set_headers_visible(headers_visible: boolean): void;
/**
* Enables of disables the hover expansion mode of `tree_view`.
* Hover expansion makes rows expand or collapse if the pointer
* moves over them.
* @param expand %TRUE to enable hover selection mode
*/
set_hover_expand(expand: boolean): void;
/**
* Enables of disables the hover selection mode of `tree_view`.
* Hover selection makes the selected row follow the pointer.
* Currently, this works only for the selection modes
* %GTK_SELECTION_SINGLE and %GTK_SELECTION_BROWSE.
* @param hover %TRUE to enable hover selection mode
*/
set_hover_selection(hover: boolean): void;
/**
* Sets the amount of extra indentation for child levels to use in `tree_view`
* in addition to the default indentation. The value should be specified in
* pixels, a value of 0 disables this feature and in this case only the default
* indentation will be used.
* This does not have any visible effects for lists.
* @param indentation the amount, in pixels, of extra indentation in @tree_view.
*/
set_level_indentation(indentation: number): void;
/**
* Sets the model for a #GtkTreeView. If the `tree_view` already has a model
* set, it will remove it before setting the new model. If `model` is %NULL,
* then it will unset the old model.
* @param model The model.
*/
set_model(model?: TreeModel | null): void;
/**
* This function is a convenience function to allow you to reorder
* models that support the #GtkDragSourceIface and the
* #GtkDragDestIface. Both #GtkTreeStore and #GtkListStore support
* these. If `reorderable` is %TRUE, then the user can reorder the
* model by dragging and dropping rows. The developer can listen to
* these changes by connecting to the model's row_inserted and
* row_deleted signals. The reordering is implemented by setting up
* the tree view as a drag source and destination. Therefore, drag and
* drop can not be used in a reorderable view for any other purpose.
*
* This function does not give you any degree of control over the order -- any
* reordering is allowed. If more control is needed, you should probably
* handle drag and drop manually.
* @param reorderable %TRUE, if the tree can be reordered.
*/
set_reorderable(reorderable: boolean): void;
/**
* Sets the row separator function, which is used to determine
* whether a row should be drawn as a separator. If the row separator
* function is %NULL, no separators are drawn. This is the default value.
* @param func a #GtkTreeViewRowSeparatorFunc
* @param destroy destroy notifier for @data, or %NULL
*/
set_row_separator_func(func: TreeViewRowSeparatorFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Enables or disables rubber banding in `tree_view`. If the selection mode
* is #GTK_SELECTION_MULTIPLE, rubber banding will allow the user to select
* multiple rows by dragging the mouse.
* @param enable %TRUE to enable rubber banding
*/
set_rubber_banding(enable: boolean): void;
/**
* This function tells GTK+ that the user interface for your
* application requires users to read across tree rows and associate
* cells with one another. By default, GTK+ will then render the tree
* with alternating row colors. Do <emphasis>not</emphasis> use it
* just because you prefer the appearance of the ruled tree; that's a
* question for the theme. Some themes will draw tree rows in
* alternating colors even when rules are turned off, and users who
* prefer that appearance all the time can choose those themes. You
* should call this function only as a <emphasis>semantic</emphasis>
* hint to the theme engine that your tree makes alternating colors
* useful from a functional standpoint (since it has lots of columns,
* generally).
* @param setting %TRUE if the tree requires reading across rows
*/
set_rules_hint(setting: boolean): void;
/**
* Sets `column` as the column where the interactive search code should
* search in for the current model.
*
* If the search column is set, users can use the "start-interactive-search"
* key binding to bring up search popup. The enable-search property controls
* whether simply typing text will also start an interactive search.
*
* Note that `column` refers to a column of the current model. The search
* column is reset to -1 when the model is changed.
* @param column the column of the model to search in, or -1 to disable searching
*/
set_search_column(column: number): void;
/**
* Sets the entry which the interactive search code will use for this
* `tree_view`. This is useful when you want to provide a search entry
* in our interface at all time at a fixed position. Passing %NULL for
* `entry` will make the interactive search code use the built-in popup
* entry again.
* @param entry the entry the interactive search code of @tree_view should use or %NULL
*/
set_search_entry(entry?: Entry | null): void;
/**
* Sets the compare function for the interactive search capabilities; note
* that somewhat like strcmp() returning 0 for equality
* #GtkTreeViewSearchEqualFunc returns %FALSE on matches.
* @param search_equal_func the compare function to use during the search
* @param search_destroy Destroy notifier for @search_user_data, or %NULL
*/
set_search_equal_func(
search_equal_func: TreeViewSearchEqualFunc,
search_destroy?: GLib.DestroyNotify | null,
): void;
/**
* Sets the function to use when positioning the search dialog.
* @param func the function to use to position the search dialog, or %NULL to use the default search position function
* @param destroy Destroy notifier for @data, or %NULL
*/
set_search_position_func(
func?: TreeViewSearchPositionFunc | null,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Sets whether to draw and enable expanders and indent child rows in
* `tree_view`. When disabled there will be no expanders visible in trees
* and there will be no way to expand and collapse rows by default. Also
* note that hiding the expanders will disable the default indentation. You
* can set a custom indentation in this case using
* gtk_tree_view_set_level_indentation().
* This does not have any visible effects for lists.
* @param enabled %TRUE to enable expander drawing, %FALSE otherwise.
*/
set_show_expanders(enabled: boolean): void;
/**
* Sets the tip area of `tooltip` to the area `path,` `column` and `cell` have
* in common. For example if `path` is %NULL and `column` is set, the tip
* area will be set to the full area covered by `column`. See also
* gtk_tooltip_set_tip_area().
*
* Note that if `path` is not specified and `cell` is set and part of a column
* containing the expander, the tooltip might not show and hide at the correct
* position. In such cases `path` must be set to the current node under the
* mouse cursor for this function to operate correctly.
*
* See also gtk_tree_view_set_tooltip_column() for a simpler alternative.
* @param tooltip a #GtkTooltip
* @param path a #GtkTreePath or %NULL
* @param column a #GtkTreeViewColumn or %NULL
* @param cell a #GtkCellRenderer or %NULL
*/
set_tooltip_cell(
tooltip: Tooltip,
path?: TreePath | null,
column?: TreeViewColumn | null,
cell?: CellRenderer | null,
): void;
/**
* If you only plan to have simple (text-only) tooltips on full rows, you
* can use this function to have #GtkTreeView handle these automatically
* for you. `column` should be set to the column in `tree_view'`s model
* containing the tooltip texts, or -1 to disable this feature.
*
* When enabled, #GtkWidget::has-tooltip will be set to %TRUE and
* `tree_view` will connect a #GtkWidget::query-tooltip signal handler.
*
* Note that the signal handler sets the text with gtk_tooltip_set_markup(),
* so &amp;, &lt;, etc have to be escaped in the text.
* @param column an integer, which is a valid column number for @tree_view's model
*/
set_tooltip_column(column: number): void;
/**
* Sets the tip area of `tooltip` to be the area covered by the row at `path`.
* See also gtk_tree_view_set_tooltip_column() for a simpler alternative.
* See also gtk_tooltip_set_tip_area().
* @param tooltip a #GtkTooltip
* @param path a #GtkTreePath
*/
set_tooltip_row(tooltip: Tooltip, path: TreePath): void;
/**
* Sets the #GtkAdjustment for the current vertical aspect.
* @param adjustment The #GtkAdjustment to set, or %NULL
*/
set_vadjustment(adjustment?: Adjustment | null): void;
/**
* Converts tree coordinates (coordinates in full scrollable area of the tree)
* to bin_window coordinates.
* @param tx tree X coordinate
* @param ty tree Y coordinate
* @param wx return location for X coordinate relative to bin_window
* @param wy return location for Y coordinate relative to bin_window
*/
tree_to_widget_coords(tx: number, ty: number, wx: number, wy: number): void;
/**
* Undoes the effect of
* gtk_tree_view_enable_model_drag_dest(). Calling this method sets
* #GtkTreeView:reorderable to %FALSE.
*/
unset_rows_drag_dest(): void;
/**
* Undoes the effect of
* gtk_tree_view_enable_model_drag_source(). Calling this method sets
* #GtkTreeView:reorderable to %FALSE.
*/
unset_rows_drag_source(): void;
/**
* Converts bin_window coordinates to coordinates for the
* tree (the full scrollable area of the tree).
* @param wx X coordinate relative to bin_window
* @param wy Y coordinate relative to bin_window
* @param tx return location for tree X coordinate
* @param ty return location for tree Y coordinate
*/
widget_to_tree_coords(wx: number, wy: number, tx: number, ty: 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 TreeViewColumn {
// Signal callback interfaces
interface Clicked {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Object.ConstructorProps,
Buildable.ConstructorProps,
CellLayout.ConstructorProps {
alignment: number;
clickable: boolean;
expand: boolean;
fixed_width: number;
fixedWidth: number;
max_width: number;
maxWidth: number;
min_width: number;
minWidth: number;
reorderable: boolean;
resizable: boolean;
sizing: TreeViewColumnSizing;
sort_column_id: number;
sortColumnId: number;
sort_indicator: boolean;
sortIndicator: boolean;
sort_order: SortType;
sortOrder: SortType;
spacing: number;
title: string;
visible: boolean;
widget: Widget;
width: number;
}
}
class TreeViewColumn extends Object implements Buildable, CellLayout {
static $gtype: GObject.GType<TreeViewColumn>;
// Properties
get alignment(): number;
set alignment(val: number);
get clickable(): boolean;
set clickable(val: boolean);
get expand(): boolean;
set expand(val: boolean);
get fixed_width(): number;
set fixed_width(val: number);
get fixedWidth(): number;
set fixedWidth(val: number);
get max_width(): number;
set max_width(val: number);
get maxWidth(): number;
set maxWidth(val: number);
get min_width(): number;
set min_width(val: number);
get minWidth(): number;
set minWidth(val: number);
get reorderable(): boolean;
set reorderable(val: boolean);
get resizable(): boolean;
set resizable(val: boolean);
get sizing(): TreeViewColumnSizing;
set sizing(val: TreeViewColumnSizing);
/**
* Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
* clickable. Set to %-1 to make the column unsortable.
*/
get sort_column_id(): number;
set sort_column_id(val: number);
/**
* Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
* clickable. Set to %-1 to make the column unsortable.
*/
get sortColumnId(): number;
set sortColumnId(val: number);
get sort_indicator(): boolean;
set sort_indicator(val: boolean);
get sortIndicator(): boolean;
set sortIndicator(val: boolean);
get sort_order(): SortType;
set sort_order(val: SortType);
get sortOrder(): SortType;
set sortOrder(val: SortType);
get spacing(): number;
set spacing(val: number);
get title(): string;
set title(val: string);
get visible(): boolean;
set visible(val: boolean);
get widget(): Widget;
set widget(val: Widget);
get width(): number;
// Fields
tree_view: Widget;
button: Widget;
child: Widget;
arrow: Widget;
window: Gdk.Window;
editable_widget: CellEditable;
xalign: number;
property_changed_signal: number;
column_type: TreeViewColumnSizing;
requested_width: number;
button_request: number;
resized_width: number;
drag_x: number;
drag_y: number;
cell_list: any[];
sort_clicked_signal: number;
sort_column_changed_signal: number;
dirty: number;
show_sort_indicator: number;
maybe_reordered: number;
use_resized_width: number;
// Constructors
constructor(properties?: Partial<TreeViewColumn.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): TreeViewColumn;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'clicked', callback: (_source: this) => void): number;
connect_after(signal: 'clicked', callback: (_source: this) => void): number;
emit(signal: 'clicked'): void;
// Virtual methods
/**
* Emits the "clicked" signal on the column. This function will only work if
* `tree_column` is clickable.
*/
vfunc_clicked(): void;
// Methods
/**
* Adds an attribute mapping to the list in `tree_column`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell_renderer` to be set from the value. So for example
* if column 2 of the model contains strings, you could have the
* "text" attribute of a #GtkCellRendererText get its values from
* column 2.
* @param cell_renderer the #GtkCellRenderer to set attributes on
* @param attribute An attribute on the renderer
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell_renderer: CellRenderer, attribute: string, column: number): void;
/**
* Obtains the horizontal position and size of a cell in a column. If the
* cell is not found in the column, `start_pos` and `width` are not changed and
* %FALSE is returned.
* @param cell_renderer a #GtkCellRenderer
* @param start_pos return location for the horizontal position of @cell within @tree_column, may be %NULL
* @param width return location for the width of @cell, may be %NULL
* @returns %TRUE if @cell belongs to @tree_column.
*/
cell_get_position(cell_renderer: CellRenderer, start_pos: number, width: number): boolean;
/**
* Obtains the width and height needed to render the column. This is used
* primarily by the #GtkTreeView.
* @param cell_area The area a cell in the column will be allocated, or %NULL
*/
cell_get_size(cell_area: Gdk.Rectangle | null): [number, number, number, number];
/**
* Returns %TRUE if any of the cells packed into the `tree_column` are visible.
* For this to be meaningful, you must first initialize the cells with
* gtk_tree_view_column_cell_set_cell_data()
* @returns %TRUE, if any of the cells packed into the @tree_column are currently visible
*/
cell_is_visible(): boolean;
/**
* Sets the cell renderer based on the `tree_model` and `iter`. That is, for
* every attribute mapping in `tree_column,` it will get a value from the set
* column on the `iter,` and use that value to set the attribute on the cell
* renderer. This is used primarily by the #GtkTreeView.
* @param tree_model The #GtkTreeModel to to get the cell renderers attributes from.
* @param iter The #GtkTreeIter to to get the cell renderer's attributes from.
* @param is_expander %TRUE, if the row has children
* @param is_expanded %TRUE, if the row has visible children
*/
cell_set_cell_data(tree_model: TreeModel, iter: TreeIter, is_expander: boolean, is_expanded: boolean): void;
/**
* Unsets all the mappings on all renderers on the `tree_column`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_tree_view_column_set_attributes().
* @param cell_renderer a #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell_renderer: CellRenderer): void;
/**
* Emits the "clicked" signal on the column. This function will only work if
* `tree_column` is clickable.
*/
clicked(): void;
/**
* Sets the current keyboard focus to be at `cell,` if the column contains
* 2 or more editable and activatable cells.
* @param cell A #GtkCellRenderer
*/
focus_cell(cell: CellRenderer): void;
/**
* Returns the current x alignment of `tree_column`. This value can range
* between 0.0 and 1.0.
* @returns The current alignent of @tree_column.
*/
get_alignment(): number;
/**
* Returns %TRUE if the user can click on the header for the column.
* @returns %TRUE if user can click the column header.
*/
get_clickable(): boolean;
/**
* Return %TRUE if the column expands to take any available space.
* @returns %TRUE, if the column expands
*/
get_expand(): boolean;
/**
* Gets the fixed width of the column. This value is only meaning may not be
* the actual width of the column on the screen, just what is requested.
* @returns the fixed width of the column
*/
get_fixed_width(): number;
/**
* Returns the maximum width in pixels of the `tree_column,` or -1 if no maximum
* width is set.
* @returns The maximum width of the @tree_column.
*/
get_max_width(): number;
/**
* Returns the minimum width in pixels of the `tree_column,` or -1 if no minimum
* width is set.
* @returns The minimum width of the @tree_column.
*/
get_min_width(): number;
/**
* Returns %TRUE if the `tree_column` can be reordered by the user.
* @returns %TRUE if the @tree_column can be reordered by the user.
*/
get_reorderable(): boolean;
/**
* Returns %TRUE if the `tree_column` can be resized by the end user.
* @returns %TRUE, if the @tree_column can be resized.
*/
get_resizable(): boolean;
/**
* Returns the current type of `tree_column`.
* @returns The type of @tree_column.
*/
get_sizing(): TreeViewColumnSizing;
/**
* Gets the logical `sort_column_id` that the model sorts on when this
* column is selected for sorting.
* See gtk_tree_view_column_set_sort_column_id().
* @returns the current @sort_column_id for this column, or -1 if this column can't be used for sorting.
*/
get_sort_column_id(): number;
/**
* Gets the value set by gtk_tree_view_column_set_sort_indicator().
* @returns whether the sort indicator arrow is displayed
*/
get_sort_indicator(): boolean;
/**
* Gets the value set by gtk_tree_view_column_set_sort_order().
* @returns the sort order the sort indicator is indicating
*/
get_sort_order(): SortType;
/**
* Returns the spacing of `tree_column`.
* @returns the spacing of @tree_column.
*/
get_spacing(): number;
/**
* Returns the title of the widget.
* @returns the title of the column. This string should not be modified or freed.
*/
get_title(): string;
/**
* Returns the #GtkTreeView wherein `tree_column` has been inserted.
* If `column` is currently not inserted in any tree view, %NULL is
* returned.
* @returns The tree view wherein @column has been inserted if any, %NULL otherwise.
*/
get_tree_view(): Widget;
/**
* Returns %TRUE if `tree_column` is visible.
* @returns whether the column is visible or not. If it is visible, then the tree will show the column.
*/
get_visible(): boolean;
/**
* Returns the #GtkWidget in the button on the column header.
* If a custom widget has not been set then %NULL is returned.
* @returns The #GtkWidget in the column header, or %NULL
*/
get_widget(): Widget;
/**
* Returns the current size of `tree_column` in pixels.
* @returns The current width of @tree_column.
*/
get_width(): number;
/**
* Adds the `cell` to end of the column. If `expand` is %FALSE, then the `cell`
* is allocated no more space than it needs. Any unused space is divided
* evenly between cells for which `expand` is %TRUE.
* @param cell The #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @tree_column.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of the column. If `expand` is %FALSE, then
* the `cell` is allocated no more space than it needs. Any unused space is divided
* evenly between cells for which `expand` is %TRUE.
* @param cell The #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @tree_column.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Flags the column, and the cell renderers added to this column, to have
* their sizes renegotiated.
*/
queue_resize(): void;
/**
* Sets the alignment of the title or custom widget inside the column header.
* The alignment determines its location inside the button -- 0.0 for left, 0.5
* for center, 1.0 for right.
* @param xalign The alignment, which is between [0.0 and 1.0] inclusive.
*/
set_alignment(xalign: number): void;
/**
* Sets the #GtkTreeViewColumnFunc to use for the column. This
* function is used instead of the standard attributes mapping for
* setting the column value, and should set the value of `tree_column'`s
* cell renderer as appropriate. `func` may be %NULL to remove an
* older one.
* @param cell_renderer A #GtkCellRenderer
* @param func The #GtkTreeViewColumnFunc to use.
*/
set_cell_data_func(cell_renderer: CellRenderer, func: TreeCellDataFunc): void;
// Conflicted with Gtk.CellLayout.set_cell_data_func
set_cell_data_func(...args: never[]): any;
/**
* Sets the header to be active if `active` is %TRUE. When the header is active,
* then it can take keyboard focus, and can be clicked.
* @param clickable %TRUE if the header is active.
*/
set_clickable(clickable: boolean): void;
/**
* Sets the column to take available extra space. This space is shared equally
* amongst all columns that have the expand set to %TRUE. If no column has this
* option set, then the last column gets all extra space. By default, every
* column is created with this %FALSE.
* @param expand %TRUE if the column should take available extra space, %FALSE if not
*/
set_expand(expand: boolean): void;
/**
* Sets the size of the column in pixels. This is meaningful only if the sizing
* type is #GTK_TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to
* the min/max width for the column. Please note that the min/max width of the
* column doesn't actually affect the "fixed_width" property of the widget, just
* the actual size when displayed.
* @param fixed_width The size to set @tree_column to. Must be greater than 0.
*/
set_fixed_width(fixed_width: number): void;
/**
* Sets the maximum width of the `tree_column`. If `max_width` is -1, then the
* maximum width is unset. Note, the column can actually be wider than max
* width if it's the last column in a view. In this case, the column expands to
* fill any extra space.
* @param max_width The maximum width of the column in pixels, or -1.
*/
set_max_width(max_width: number): void;
/**
* Sets the minimum width of the `tree_column`. If `min_width` is -1, then the
* minimum width is unset.
* @param min_width The minimum width of the column in pixels, or -1.
*/
set_min_width(min_width: number): void;
/**
* If `reorderable` is %TRUE, then the column can be reordered by the end user
* dragging the header.
* @param reorderable %TRUE, if the column can be reordered.
*/
set_reorderable(reorderable: boolean): void;
/**
* If `resizable` is %TRUE, then the user can explicitly resize the column by
* grabbing the outer edge of the column button. If resizable is %TRUE and
* sizing mode of the column is #GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
* mode is changed to #GTK_TREE_VIEW_COLUMN_GROW_ONLY.
* @param resizable %TRUE, if the column can be resized
*/
set_resizable(resizable: boolean): void;
/**
* Sets the growth behavior of `tree_column` to `type`.
* @param type The #GtkTreeViewColumnSizing.
*/
set_sizing(type: TreeViewColumnSizing | null): void;
/**
* Sets the logical `sort_column_id` that this column sorts on when this column
* is selected for sorting. Doing so makes the column header clickable.
* @param sort_column_id The @sort_column_id of the model to sort on.
*/
set_sort_column_id(sort_column_id: number): void;
/**
* Call this function with a `setting` of %TRUE to display an arrow in
* the header button indicating the column is sorted. Call
* gtk_tree_view_column_set_sort_order() to change the direction of
* the arrow.
* @param setting %TRUE to display an indicator that the column is sorted
*/
set_sort_indicator(setting: boolean): void;
/**
* Changes the appearance of the sort indicator.
*
* This <emphasis>does not</emphasis> actually sort the model. Use
* gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
* support. This function is primarily for custom sorting behavior, and should
* be used in conjunction with gtk_tree_sortable_set_sort_column() to do
* that. For custom models, the mechanism will vary.
*
* The sort indicator changes direction to indicate normal sort or reverse sort.
* Note that you must have the sort indicator enabled to see anything when
* calling this function; see gtk_tree_view_column_set_sort_indicator().
* @param order sort order that the sort indicator should indicate
*/
set_sort_order(order: SortType | null): void;
/**
* Sets the spacing field of `tree_column,` which is the number of pixels to
* place between cell renderers packed into it.
* @param spacing distance between cell renderers in pixels.
*/
set_spacing(spacing: number): void;
/**
* Sets the title of the `tree_column`. If a custom widget has been set, then
* this value is ignored.
* @param title The title of the @tree_column.
*/
set_title(title: string): void;
/**
* Sets the visibility of `tree_column`.
* @param visible %TRUE if the @tree_column is visible.
*/
set_visible(visible: boolean): void;
/**
* Sets the widget in the header to be `widget`. If widget is %NULL, then the
* header button is set with a #GtkLabel set to the title of `tree_column`.
* @param widget A child #GtkWidget, or %NULL.
*/
set_widget(widget?: Widget | null): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): 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 UIManager {
// Signal callback interfaces
interface ActionsChanged {
(): void;
}
interface AddWidget {
(widget: Widget): void;
}
interface ConnectProxy {
(action: Action, proxy: Widget): void;
}
interface DisconnectProxy {
(action: Action, proxy: Widget): void;
}
interface PostActivate {
(action: Action): void;
}
interface PreActivate {
(action: Action): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, Buildable.ConstructorProps {
add_tearoffs: boolean;
addTearoffs: boolean;
ui: string;
}
}
class UIManager extends GObject.Object implements Buildable {
static $gtype: GObject.GType<UIManager>;
// Properties
/**
* The "add-tearoffs" property controls whether generated menus
* have tearoff menu items.
*
* Note that this only affects regular menus. Generated popup
* menus never have tearoff menu items.
*/
get add_tearoffs(): boolean;
set add_tearoffs(val: boolean);
/**
* The "add-tearoffs" property controls whether generated menus
* have tearoff menu items.
*
* Note that this only affects regular menus. Generated popup
* menus never have tearoff menu items.
*/
get addTearoffs(): boolean;
set addTearoffs(val: boolean);
get ui(): string;
// Constructors
constructor(properties?: Partial<UIManager.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): UIManager;
// 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: 'actions-changed', callback: (_source: this) => void): number;
connect_after(signal: 'actions-changed', callback: (_source: this) => void): number;
emit(signal: 'actions-changed'): void;
connect(signal: 'add-widget', callback: (_source: this, widget: Widget) => void): number;
connect_after(signal: 'add-widget', callback: (_source: this, widget: Widget) => void): number;
emit(signal: 'add-widget', widget: Widget): void;
connect(signal: 'connect-proxy', callback: (_source: this, action: Action, proxy: Widget) => void): number;
connect_after(
signal: 'connect-proxy',
callback: (_source: this, action: Action, proxy: Widget) => void,
): number;
emit(signal: 'connect-proxy', action: Action, proxy: Widget): void;
connect(
signal: 'disconnect-proxy',
callback: (_source: this, action: Action, proxy: Widget) => void,
): number;
connect_after(
signal: 'disconnect-proxy',
callback: (_source: this, action: Action, proxy: Widget) => void,
): number;
emit(signal: 'disconnect-proxy', action: Action, proxy: Widget): void;
connect(signal: 'post-activate', callback: (_source: this, action: Action) => void): number;
connect_after(signal: 'post-activate', callback: (_source: this, action: Action) => void): number;
emit(signal: 'post-activate', action: Action): void;
connect(signal: 'pre-activate', callback: (_source: this, action: Action) => void): number;
connect_after(signal: 'pre-activate', callback: (_source: this, action: Action) => void): number;
emit(signal: 'pre-activate', action: Action): void;
// Virtual methods
vfunc_actions_changed(): void;
vfunc_add_widget(widget: Widget): void;
vfunc_connect_proxy(action: Action, proxy: Widget): void;
vfunc_disconnect_proxy(action: Action, proxy: Widget): void;
/**
* Looks up an action by following a path. See gtk_ui_manager_get_widget()
* for more information about paths.
* @param path a path
*/
vfunc_get_action(path: string): Action;
/**
* Looks up a widget by following a path.
* The path consists of the names specified in the XML description of the UI.
* separated by '/'. Elements which don't have a name or action attribute in
* the XML (e.g. &lt;popup&gt;) can be addressed by their XML element name
* (e.g. "popup"). The root element ("/ui") can be omitted in the path.
*
* Note that the widget found by following a path that ends in a &lt;menu&gt;
* element is the menuitem to which the menu is attached, not the menu itself.
*
* Also note that the widgets constructed by a ui manager are not tied to
* the lifecycle of the ui manager. If you add the widgets returned by this
* function to some container or explicitly ref them, they will survive the
* destruction of the ui manager.
* @param path a path
*/
vfunc_get_widget(path: string): Widget;
vfunc_post_activate(action: Action): void;
vfunc_pre_activate(action: Action): void;
// Methods
/**
* Adds a UI element to the current contents of `self`.
*
* If `type` is %GTK_UI_MANAGER_AUTO, GTK+ inserts a menuitem, toolitem or
* separator if such an element can be inserted at the place determined by
* `path`. Otherwise `type` must indicate an element that can be inserted at
* the place determined by `path`.
*
* If `path` points to a menuitem or toolitem, the new element will be inserted
* before or after this item, depending on `top`.
* @param merge_id the merge id for the merged UI, see gtk_ui_manager_new_merge_id()
* @param path a path
* @param name the name for the added UI element
* @param action the name of the action to be proxied, or %NULL to add a separator
* @param type the type of UI element to add.
* @param top if %TRUE, the UI element is added before its siblings, otherwise it is added after its siblings.
*/
add_ui(
merge_id: number,
path: string,
name: string,
action: string | null,
type: UIManagerItemType | null,
top: boolean,
): void;
/**
* Parses a file containing a <link linkend="XML-UI">UI definition</link> and
* merges it with the current contents of `self`.
* @param filename the name of the file to parse
* @returns The merge id for the merged UI. The merge id can be used to unmerge the UI with gtk_ui_manager_remove_ui(). If an error occurred, the return value is 0.
*/
add_ui_from_file(filename: string): number;
/**
* Parses a string containing a <link linkend="XML-UI">UI definition</link> and
* merges it with the current contents of `self`. An enclosing &lt;ui&gt;
* element is added if it is missing.
* @param buffer the string to parse
* @param length the length of @buffer (may be -1 if @buffer is nul-terminated)
* @returns The merge id for the merged UI. The merge id can be used to unmerge the UI with gtk_ui_manager_remove_ui(). If an error occurred, the return value is 0.
*/
add_ui_from_string(buffer: string, length: number): number;
/**
* Makes sure that all pending updates to the UI have been completed.
*
* This may occasionally be necessary, since #GtkUIManager updates the
* UI in an idle function. A typical example where this function is
* useful is to enforce that the menubar and toolbar have been added to
* the main window before showing it:
*
* ```
* gtk_container_add (GTK_CONTAINER (window), vbox);
* g_signal_connect (merge, "add-widget",
* G_CALLBACK (add_widget), vbox);
* gtk_ui_manager_add_ui_from_file (merge, "my-menus");
* gtk_ui_manager_add_ui_from_file (merge, "my-toolbars");
* gtk_ui_manager_ensure_update (merge);
* gtk_widget_show (window);
* ```
*
*/
ensure_update(): void;
/**
* Returns the #GtkAccelGroup associated with `self`.
* @returns the #GtkAccelGroup.
*/
get_accel_group(): AccelGroup;
/**
* Looks up an action by following a path. See gtk_ui_manager_get_widget()
* for more information about paths.
* @param path a path
* @returns the action whose proxy widget is found by following the path, or %NULL if no widget was found.
*/
get_action(path: string): Action;
/**
* Returns the list of action groups associated with `self`.
* @returns a #GList of action groups. The list is owned by GTK+ and should not be modified.
*/
get_action_groups(): ActionGroup[];
/**
* Returns whether menus generated by this #GtkUIManager
* will have tearoff menu items.
* @returns whether tearoff menu items are added
*/
get_add_tearoffs(): boolean;
/**
* Obtains a list of all toplevel widgets of the requested types.
* @param types specifies the types of toplevel widgets to include. Allowed types are #GTK_UI_MANAGER_MENUBAR, #GTK_UI_MANAGER_TOOLBAR and #GTK_UI_MANAGER_POPUP.
* @returns a newly-allocated #GSList of all toplevel widgets of the requested types. Free the returned list with g_slist_free().
*/
get_toplevels(types: UIManagerItemType | null): Widget[];
/**
* Creates a <link linkend="XML-UI">UI definition</link> of the merged UI.
* @returns A newly allocated string containing an XML representation of the merged UI.
*/
get_ui(): string;
/**
* Looks up a widget by following a path.
* The path consists of the names specified in the XML description of the UI.
* separated by '/'. Elements which don't have a name or action attribute in
* the XML (e.g. &lt;popup&gt;) can be addressed by their XML element name
* (e.g. "popup"). The root element ("/ui") can be omitted in the path.
*
* Note that the widget found by following a path that ends in a &lt;menu&gt;
* element is the menuitem to which the menu is attached, not the menu itself.
*
* Also note that the widgets constructed by a ui manager are not tied to
* the lifecycle of the ui manager. If you add the widgets returned by this
* function to some container or explicitly ref them, they will survive the
* destruction of the ui manager.
* @param path a path
* @returns the widget found by following the path, or %NULL if no widget was found.
*/
get_widget(path: string): Widget;
/**
* Inserts an action group into the list of action groups associated
* with `self`. Actions in earlier groups hide actions with the same
* name in later groups.
* @param action_group the action group to be inserted
* @param pos the position at which the group will be inserted.
*/
insert_action_group(action_group: ActionGroup, pos: number): void;
/**
* Returns an unused merge id, suitable for use with
* gtk_ui_manager_add_ui().
* @returns an unused merge id.
*/
new_merge_id(): number;
/**
* Removes an action group from the list of action groups associated
* with `self`.
* @param action_group the action group to be removed
*/
remove_action_group(action_group: ActionGroup): void;
/**
* Unmerges the part of `self<`!-- -->s content identified by `merge_id`.
* @param merge_id a merge id as returned by gtk_ui_manager_add_ui_from_string()
*/
remove_ui(merge_id: number): void;
/**
* Sets the "add_tearoffs" property, which controls whether menus
* generated by this #GtkUIManager will have tearoff menu items.
*
* Note that this only affects regular menus. Generated popup
* menus never have tearoff menu items.
* @param add_tearoffs whether tearoff menu items are added
*/
set_add_tearoffs(add_tearoffs: 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: 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<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace VBox {
// Constructor properties interface
interface ConstructorProps
extends Box.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* A #GtkVBox is a container that organizes child widgets into a single column.
*
* Use the #GtkBox packing interface to determine the arrangement,
* spacing, height, and alignment of #GtkVBox children.
*
* All children are allocated the same width.
*/
class VBox extends Box implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<VBox>;
// Fields
box: Box;
// Constructors
constructor(properties?: Partial<VBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](homogeneous: boolean, spacing: number): VBox;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace VButtonBox {
// Constructor properties interface
interface ConstructorProps
extends ButtonBox.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
class VButtonBox extends ButtonBox implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<VButtonBox>;
// Fields
button_box: ButtonBox;
// Constructors
constructor(properties?: Partial<VButtonBox.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): VButtonBox;
// Static methods
/**
* Retrieves the current layout used to arrange buttons in button box widgets.
*/
static get_layout_default(): ButtonBoxStyle;
/**
* Retrieves the current default spacing for vertical button boxes. This is the number of pixels
* to be placed between the buttons when they are arranged.
*/
static get_spacing_default(): number;
/**
* Sets a new layout mode that will be used by all button boxes.
* @param layout a new #GtkButtonBoxStyle.
*/
static set_layout_default(layout: ButtonBoxStyle): void;
/**
* Changes the default spacing that is placed between widgets in an
* vertical button box.
* @param spacing an integer value.
*/
static set_spacing_default(spacing: 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 VPaned {
// Constructor properties interface
interface ConstructorProps
extends Paned.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* The VPaned widget is a container widget with two
* children arranged vertically. The division between
* the two panes is adjustable by the user by dragging
* a handle. See #GtkPaned for details.
*/
class VPaned extends Paned implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<VPaned>;
// Fields
paned: Paned;
// Constructors
constructor(properties?: Partial<VPaned.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): VPaned;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace VRuler {
// Constructor properties interface
interface ConstructorProps
extends Ruler.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* <note>
* This widget is considered too specialized/little-used for
* GTK+, and will be removed in GTK 3. If your application needs this widget,
* feel free to use it, as the widget is useful in some applications; it's just
* not of general interest. However, we are not accepting new features for the
* widget, and it will move out of the GTK+ distribution.
* </note>
*
* The VRuler widget is a widget arranged vertically creating a ruler that is
* utilized around other widgets such as a text widget. The ruler is used to show
* the location of the mouse on the window and to show the size of the window in
* specified units. The available units of measurement are GTK_PIXELS, GTK_INCHES
* and GTK_CENTIMETERS. GTK_PIXELS is the default unit of measurement.
*/
class VRuler extends Ruler implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<VRuler>;
// Fields
ruler: Ruler;
// Constructors
constructor(properties?: Partial<VRuler.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): VRuler;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace VScale {
// Constructor properties interface
interface ConstructorProps
extends Scale.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* The #GtkVScale widget is used to allow the user to select a value using
* a vertical slider. To create one, use gtk_hscale_new_with_range().
*
* The position to show the current value, and the number of decimal places
* shown can be set using the parent #GtkScale class's functions.
*/
class VScale extends Scale implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<VScale>;
// Fields
scale: Scale;
// Constructors
constructor(properties?: Partial<VScale.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](adjustment: Adjustment): VScale;
static new_with_range(min: number, max: number, step: number): VScale;
// 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 VScrollbar {
// Constructor properties interface
interface ConstructorProps
extends Scrollbar.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* The #GtkVScrollbar widget is a widget arranged vertically creating a
* scrollbar. See #GtkScrollbar for details on
* scrollbars. #GtkAdjustment pointers may be added to handle the
* adjustment of the scrollbar or it may be left %NULL in which case one
* will be created for you. See #GtkScrollbar for a description of what the
* fields in an adjustment represent for a scrollbar.
*/
class VScrollbar extends Scrollbar implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<VScrollbar>;
// Fields
scrollbar: Scrollbar;
// Constructors
constructor(properties?: Partial<VScrollbar.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](adjustment?: Adjustment | null): VScrollbar;
// 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 VSeparator {
// Constructor properties interface
interface ConstructorProps
extends Separator.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* The #GtkVSeparator widget is a vertical separator, used to group the
* widgets within a window. It displays a vertical line with a shadow to
* make it appear sunken into the interface.
*/
class VSeparator extends Separator implements Atk.ImplementorIface, Buildable, Orientable {
static $gtype: GObject.GType<VSeparator>;
// Fields
separator: Separator;
// Constructors
constructor(properties?: Partial<VSeparator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): VSeparator;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Viewport {
// Signal callback interfaces
interface SetScrollAdjustments {
(object: Adjustment, p0: Adjustment): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
hadjustment: Adjustment;
shadow_type: ShadowType;
shadowType: ShadowType;
vadjustment: Adjustment;
}
}
/**
* The #GtkViewport widget acts as an adaptor class, implementing
* scrollability for child widgets that lack their own scrolling
* capabilities. Use #GtkViewport to scroll child widgets such as
* #GtkTable, #GtkBox, and so on.
*
* If a widget has native scrolling abilities, such as #GtkTextView,
* #GtkTreeView or #GtkIconview, it can be added to a #GtkScrolledWindow
* with gtk_container_add(). If a widget does not, you must first add the
* widget to a #GtkViewport, then add the viewport to the scrolled window.
* The convenience function gtk_scrolled_window_add_with_viewport() does
* exactly this, so you can ignore the presence of the viewport.
*/
class Viewport extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Viewport>;
// Properties
get hadjustment(): Adjustment;
set hadjustment(val: Adjustment);
get shadow_type(): ShadowType;
set shadow_type(val: ShadowType);
get shadowType(): ShadowType;
set shadowType(val: ShadowType);
get vadjustment(): Adjustment;
set vadjustment(val: Adjustment);
// Fields
bin: Bin;
view_window: Gdk.Window;
bin_window: Gdk.Window;
// Constructors
constructor(properties?: Partial<Viewport.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](hadjustment: Adjustment, vadjustment: Adjustment): Viewport;
// 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: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
connect_after(
signal: 'set-scroll-adjustments',
callback: (_source: this, object: Adjustment, p0: Adjustment) => void,
): number;
emit(signal: 'set-scroll-adjustments', object: Adjustment, p0: Adjustment): void;
// Virtual methods
vfunc_set_scroll_adjustments(hadjustment: Adjustment, vadjustment: Adjustment): void;
// Methods
/**
* Gets the bin window of the #GtkViewport.
* @returns a #GdkWindow
*/
get_bin_window(): Gdk.Window;
/**
* Returns the horizontal adjustment of the viewport.
* @returns the horizontal adjustment of @viewport.
*/
get_hadjustment(): Adjustment;
/**
* Gets the shadow type of the #GtkViewport. See
* gtk_viewport_set_shadow_type().
* @returns the shadow type
*/
get_shadow_type(): ShadowType;
/**
* Returns the vertical adjustment of the viewport.
* @returns the vertical adjustment of @viewport.
*/
get_vadjustment(): Adjustment;
/**
* Gets the view window of the #GtkViewport.
* @returns a #GdkWindow
*/
get_view_window(): Gdk.Window;
/**
* Sets the horizontal adjustment of the viewport.
* @param adjustment a #GtkAdjustment.
*/
set_hadjustment(adjustment?: Adjustment | null): void;
/**
* Sets the shadow type of the viewport.
* @param type the new shadow type.
*/
set_shadow_type(type: ShadowType | null): void;
/**
* Sets the vertical adjustment of the viewport.
* @param adjustment a #GtkAdjustment.
*/
set_vadjustment(adjustment?: Adjustment | 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 VolumeButton {
// Constructor properties interface
interface ConstructorProps
extends ScaleButton.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Activatable.ConstructorProps,
Buildable.ConstructorProps,
Orientable.ConstructorProps {}
}
/**
* #GtkVolumeButton is a subclass of #GtkScaleButton that has
* been tailored for use as a volume control widget with suitable
* icons, tooltips and accessible labels.
*/
class VolumeButton extends ScaleButton implements Atk.ImplementorIface, Activatable, Buildable, Orientable {
static $gtype: GObject.GType<VolumeButton>;
// Constructors
constructor(properties?: Partial<VolumeButton.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): VolumeButton;
// Inherited properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Inherited methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Widget {
// Signal callback interfaces
interface AccelClosuresChanged {
(): void;
}
interface ButtonPressEvent {
(event: Gdk.EventButton): boolean;
}
interface ButtonReleaseEvent {
(event: Gdk.EventButton): boolean;
}
interface CanActivateAccel {
(signal_id: number): boolean;
}
interface ChildNotify {
(pspec: GObject.ParamSpec): void;
}
interface ClientEvent {
(event: Gdk.EventClient): boolean;
}
interface CompositedChanged {
(): void;
}
interface ConfigureEvent {
(event: Gdk.EventConfigure): boolean;
}
interface DamageEvent {
(event: Gdk.Event): boolean;
}
interface DeleteEvent {
(event: Gdk.Event): boolean;
}
interface DestroyEvent {
(event: Gdk.Event): boolean;
}
interface DirectionChanged {
(previous_direction: TextDirection): void;
}
interface DragBegin {
(drag_context: Gdk.DragContext): void;
}
interface DragDataDelete {
(drag_context: Gdk.DragContext): void;
}
interface DragDataGet {
(drag_context: Gdk.DragContext, data: SelectionData, info: number, time: number): void;
}
interface DragDataReceived {
(
drag_context: Gdk.DragContext,
x: number,
y: number,
data: SelectionData,
info: number,
time: number,
): void;
}
interface DragDrop {
(drag_context: Gdk.DragContext, x: number, y: number, time: number): boolean;
}
interface DragEnd {
(drag_context: Gdk.DragContext): void;
}
interface DragFailed {
(drag_context: Gdk.DragContext, result: DragResult): boolean;
}
interface DragLeave {
(drag_context: Gdk.DragContext, time: number): void;
}
interface DragMotion {
(drag_context: Gdk.DragContext, x: number, y: number, time: number): boolean;
}
interface EnterNotifyEvent {
(event: Gdk.EventCrossing): boolean;
}
interface Event {
(event: Gdk.Event): boolean;
}
interface EventAfter {
(event: Gdk.Event): void;
}
interface ExposeEvent {
(event: Gdk.EventExpose): boolean;
}
interface Focus {
(direction: DirectionType): boolean;
}
interface FocusInEvent {
(event: Gdk.EventFocus): boolean;
}
interface FocusOutEvent {
(event: Gdk.EventFocus): boolean;
}
interface GrabBrokenEvent {
(event: Gdk.Event): boolean;
}
interface GrabFocus {
(): void;
}
interface GrabNotify {
(was_grabbed: boolean): void;
}
interface Hide {
(): void;
}
interface HierarchyChanged {
(previous_toplevel?: Widget | null): void;
}
interface KeyPressEvent {
(event: Gdk.EventKey): boolean;
}
interface KeyReleaseEvent {
(event: Gdk.EventKey): boolean;
}
interface KeynavFailed {
(direction: DirectionType): boolean;
}
interface LeaveNotifyEvent {
(event: Gdk.EventCrossing): boolean;
}
interface Map {
(): void;
}
interface MapEvent {
(event: Gdk.EventAny): boolean;
}
interface MnemonicActivate {
(arg1: boolean): boolean;
}
interface MotionNotifyEvent {
(event: Gdk.EventMotion): boolean;
}
interface MoveFocus {
(direction: DirectionType): void;
}
interface NoExposeEvent {
(event: Gdk.EventNoExpose): boolean;
}
interface ParentSet {
(old_parent?: Widget | null): void;
}
interface PopupMenu {
(): boolean;
}
interface PropertyNotifyEvent {
(event: Gdk.EventProperty): boolean;
}
interface ProximityInEvent {
(event: Gdk.EventProximity): boolean;
}
interface ProximityOutEvent {
(event: Gdk.EventProximity): boolean;
}
interface QueryTooltip {
(x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip): boolean;
}
interface Realize {
(): void;
}
interface ScreenChanged {
(previous_screen?: Gdk.Screen | null): void;
}
interface ScrollEvent {
(event: Gdk.EventScroll): boolean;
}
interface SelectionClearEvent {
(event: Gdk.EventSelection): boolean;
}
interface SelectionGet {
(data: SelectionData, info: number, time: number): void;
}
interface SelectionNotifyEvent {
(event: Gdk.Event): boolean;
}
interface SelectionReceived {
(data: SelectionData, time: number): void;
}
interface SelectionRequestEvent {
(event: Gdk.EventSelection): boolean;
}
interface Show {
(): void;
}
interface ShowHelp {
(help_type: WidgetHelpType): boolean;
}
interface SizeAllocate {
(allocation: Gdk.Rectangle): void;
}
interface SizeRequest {
(requisition: Requisition): void;
}
interface StateChanged {
(state: StateType): void;
}
interface StyleSet {
(previous_style?: Style | null): void;
}
interface Unmap {
(): void;
}
interface UnmapEvent {
(event: Gdk.EventAny): boolean;
}
interface Unrealize {
(): void;
}
interface VisibilityNotifyEvent {
(event: Gdk.EventVisibility): boolean;
}
interface WindowStateEvent {
(event: Gdk.EventWindowState): boolean;
}
// Constructor properties interface
interface ConstructorProps
extends Object.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
app_paintable: boolean;
appPaintable: boolean;
can_default: boolean;
canDefault: boolean;
can_focus: boolean;
canFocus: boolean;
composite_child: boolean;
compositeChild: boolean;
double_buffered: boolean;
doubleBuffered: boolean;
events: Gdk.EventMask;
extension_events: Gdk.ExtensionMode;
extensionEvents: Gdk.ExtensionMode;
has_default: boolean;
hasDefault: boolean;
has_focus: boolean;
hasFocus: boolean;
has_tooltip: boolean;
hasTooltip: boolean;
height_request: number;
heightRequest: number;
is_focus: boolean;
isFocus: boolean;
name: string;
no_show_all: boolean;
noShowAll: boolean;
parent: Container;
receives_default: boolean;
receivesDefault: boolean;
sensitive: boolean;
style: Style;
tooltip_markup: string;
tooltipMarkup: string;
tooltip_text: string;
tooltipText: string;
visible: boolean;
width_request: number;
widthRequest: number;
window: Gdk.Window;
}
}
/**
* GtkWidget is the base class all widgets in GTK+ derive from. It manages the
* widget lifecycle, states and style.
*
* <refsect2 id="style-properties">
* <para>
* <structname>GtkWidget</structname> introduces <firstterm>style
* properties</firstterm> - these are basically object properties that are stored
* not on the object, but in the style object associated to the widget. Style
* properties are set in <link linkend="gtk-Resource-Files">resource files</link>.
* This mechanism is used for configuring such things as the location of the
* scrollbar arrows through the theme, giving theme authors more control over the
* look of applications without the need to write a theme engine in C.
* </para>
* <para>
* Use gtk_widget_class_install_style_property() to install style properties for
* a widget class, gtk_widget_class_find_style_property() or
* gtk_widget_class_list_style_properties() to get information about existing
* style properties and gtk_widget_style_get_property(), gtk_widget_style_get() or
* gtk_widget_style_get_valist() to obtain the value of a style property.
* </para>
* </refsect2>
* <refsect2 id="GtkWidget-BUILDER-UI">
* <title>GtkWidget as GtkBuildable</title>
* <para>
* The GtkWidget implementation of the GtkBuildable interface supports a
* custom &lt;accelerator&gt; element, which has attributes named key,
* modifiers and signal and allows to specify accelerators.
* </para>
* <example>
* <title>A UI definition fragment specifying an accelerator</title>
* <programlisting><![CDATA[
* <object class="GtkButton">
* <accelerator key="q" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
* </object>
* ]]></programlisting>
* </example>
* <para>
* In addition to accelerators, <structname>GtkWidget</structname> also support a
* custom &lt;accessible&gt; element, which supports actions and relations.
* Properties on the accessible implementation of an object can be set by accessing the
* internal child "accessible" of a <structname>GtkWidget</structname>.
* </para>
* <example>
* <title>A UI definition fragment specifying an accessible</title>
* <programlisting><![CDATA[
* <object class="GtkButton" id="label1"/>
* <property name="label">I am a Label for a Button</property>
* </object>
* <object class="GtkButton" id="button1">
* <accessibility>
* <action action_name="click" translatable="yes">Click the button.</action>
* <relation target="label1" type="labelled-by"/>
* </accessibility>
* <child internal-child="accessible">
* <object class="AtkObject" id="a11y-button1">
* <property name="AtkObject::name">Clickable Button</property>
* </object>
* </child>
* </object>
* ]]></programlisting>
* </example>
* </refsect2>
*/
abstract class Widget extends Object implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Widget>;
// 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 or not the widget is double buffered.
*/
get double_buffered(): boolean;
set double_buffered(val: boolean);
/**
* Whether or not the widget is double buffered.
*/
get doubleBuffered(): boolean;
set doubleBuffered(val: boolean);
get events(): Gdk.EventMask;
set events(val: Gdk.EventMask);
get extension_events(): Gdk.ExtensionMode;
set extension_events(val: Gdk.ExtensionMode);
get extensionEvents(): Gdk.ExtensionMode;
set extensionEvents(val: Gdk.ExtensionMode);
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);
get is_focus(): boolean;
set is_focus(val: boolean);
get isFocus(): boolean;
set isFocus(val: boolean);
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);
get parent(): Container;
set parent(val: Container);
get receives_default(): boolean;
set receives_default(val: boolean);
get receivesDefault(): boolean;
set receivesDefault(val: boolean);
get sensitive(): boolean;
set sensitive(val: boolean);
get style(): Style;
set style(val: Style);
/**
* Sets the text of tooltip to be the given string, which is marked up
* with the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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 <link linkend="PangoMarkupFormat">Pango text markup language</link>.
* 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.
*/
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.
*/
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.
*/
get tooltipText(): string;
set tooltipText(val: string);
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;
// Fields
object: Object;
private_flags: number;
state: number;
saved_state: number;
requisition: Requisition;
allocation: Allocation;
// Constructors
constructor(properties?: Partial<Widget.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'accel-closures-changed', callback: (_source: this) => void): number;
connect_after(signal: 'accel-closures-changed', callback: (_source: this) => void): number;
emit(signal: 'accel-closures-changed'): void;
connect(signal: 'button-press-event', callback: (_source: this, event: Gdk.EventButton) => boolean): number;
connect_after(
signal: 'button-press-event',
callback: (_source: this, event: Gdk.EventButton) => boolean,
): number;
emit(signal: 'button-press-event', event: Gdk.EventButton): void;
connect(
signal: 'button-release-event',
callback: (_source: this, event: Gdk.EventButton) => boolean,
): number;
connect_after(
signal: 'button-release-event',
callback: (_source: this, event: Gdk.EventButton) => boolean,
): number;
emit(signal: 'button-release-event', event: Gdk.EventButton): void;
connect(signal: 'can-activate-accel', callback: (_source: this, signal_id: number) => boolean): number;
connect_after(
signal: 'can-activate-accel',
callback: (_source: this, signal_id: number) => boolean,
): number;
emit(signal: 'can-activate-accel', signal_id: number): void;
connect(signal: 'child-notify', callback: (_source: this, pspec: GObject.ParamSpec) => void): number;
connect_after(signal: 'child-notify', callback: (_source: this, pspec: GObject.ParamSpec) => void): number;
emit(signal: 'child-notify', pspec: GObject.ParamSpec): void;
connect(signal: 'client-event', callback: (_source: this, event: Gdk.EventClient) => boolean): number;
connect_after(signal: 'client-event', callback: (_source: this, event: Gdk.EventClient) => boolean): number;
emit(signal: 'client-event', event: Gdk.EventClient): void;
connect(signal: 'composited-changed', callback: (_source: this) => void): number;
connect_after(signal: 'composited-changed', callback: (_source: this) => void): number;
emit(signal: 'composited-changed'): void;
connect(signal: 'configure-event', callback: (_source: this, event: Gdk.EventConfigure) => boolean): number;
connect_after(
signal: 'configure-event',
callback: (_source: this, event: Gdk.EventConfigure) => boolean,
): number;
emit(signal: 'configure-event', event: Gdk.EventConfigure): void;
connect(signal: 'damage-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(signal: 'damage-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
emit(signal: 'damage-event', event: Gdk.Event): void;
connect(signal: 'delete-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(signal: 'delete-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
emit(signal: 'delete-event', event: Gdk.Event): void;
connect(signal: 'destroy-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(signal: 'destroy-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
emit(signal: 'destroy-event', event: Gdk.Event): void;
connect(
signal: 'direction-changed',
callback: (_source: this, previous_direction: TextDirection) => void,
): number;
connect_after(
signal: 'direction-changed',
callback: (_source: this, previous_direction: TextDirection) => void,
): number;
emit(signal: 'direction-changed', previous_direction: TextDirection): void;
connect(signal: 'drag-begin', callback: (_source: this, drag_context: Gdk.DragContext) => void): number;
connect_after(
signal: 'drag-begin',
callback: (_source: this, drag_context: Gdk.DragContext) => void,
): number;
emit(signal: 'drag-begin', drag_context: Gdk.DragContext): void;
connect(
signal: 'drag-data-delete',
callback: (_source: this, drag_context: Gdk.DragContext) => void,
): number;
connect_after(
signal: 'drag-data-delete',
callback: (_source: this, drag_context: Gdk.DragContext) => void,
): number;
emit(signal: 'drag-data-delete', drag_context: Gdk.DragContext): void;
connect(
signal: 'drag-data-get',
callback: (
_source: this,
drag_context: Gdk.DragContext,
data: SelectionData,
info: number,
time: number,
) => void,
): number;
connect_after(
signal: 'drag-data-get',
callback: (
_source: this,
drag_context: Gdk.DragContext,
data: SelectionData,
info: number,
time: number,
) => void,
): number;
emit(
signal: 'drag-data-get',
drag_context: Gdk.DragContext,
data: SelectionData,
info: number,
time: number,
): void;
connect(
signal: 'drag-data-received',
callback: (
_source: this,
drag_context: Gdk.DragContext,
x: number,
y: number,
data: SelectionData,
info: number,
time: number,
) => void,
): number;
connect_after(
signal: 'drag-data-received',
callback: (
_source: this,
drag_context: Gdk.DragContext,
x: number,
y: number,
data: SelectionData,
info: number,
time: number,
) => void,
): number;
emit(
signal: 'drag-data-received',
drag_context: Gdk.DragContext,
x: number,
y: number,
data: SelectionData,
info: number,
time: number,
): void;
connect(
signal: 'drag-drop',
callback: (_source: this, drag_context: Gdk.DragContext, x: number, y: number, time: number) => boolean,
): number;
connect_after(
signal: 'drag-drop',
callback: (_source: this, drag_context: Gdk.DragContext, x: number, y: number, time: number) => boolean,
): number;
emit(signal: 'drag-drop', drag_context: Gdk.DragContext, x: number, y: number, time: number): void;
connect(signal: 'drag-end', callback: (_source: this, drag_context: Gdk.DragContext) => void): number;
connect_after(signal: 'drag-end', callback: (_source: this, drag_context: Gdk.DragContext) => void): number;
emit(signal: 'drag-end', drag_context: Gdk.DragContext): void;
connect(
signal: 'drag-failed',
callback: (_source: this, drag_context: Gdk.DragContext, result: DragResult) => boolean,
): number;
connect_after(
signal: 'drag-failed',
callback: (_source: this, drag_context: Gdk.DragContext, result: DragResult) => boolean,
): number;
emit(signal: 'drag-failed', drag_context: Gdk.DragContext, result: DragResult): void;
connect(
signal: 'drag-leave',
callback: (_source: this, drag_context: Gdk.DragContext, time: number) => void,
): number;
connect_after(
signal: 'drag-leave',
callback: (_source: this, drag_context: Gdk.DragContext, time: number) => void,
): number;
emit(signal: 'drag-leave', drag_context: Gdk.DragContext, time: number): void;
connect(
signal: 'drag-motion',
callback: (_source: this, drag_context: Gdk.DragContext, x: number, y: number, time: number) => boolean,
): number;
connect_after(
signal: 'drag-motion',
callback: (_source: this, drag_context: Gdk.DragContext, x: number, y: number, time: number) => boolean,
): number;
emit(signal: 'drag-motion', drag_context: Gdk.DragContext, x: number, y: number, time: number): void;
connect(
signal: 'enter-notify-event',
callback: (_source: this, event: Gdk.EventCrossing) => boolean,
): number;
connect_after(
signal: 'enter-notify-event',
callback: (_source: this, event: Gdk.EventCrossing) => boolean,
): number;
emit(signal: 'enter-notify-event', event: Gdk.EventCrossing): void;
connect(signal: 'event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(signal: 'event', callback: (_source: this, event: Gdk.Event) => boolean): number;
emit(signal: 'event', event: Gdk.Event): void;
connect(signal: 'event-after', callback: (_source: this, event: Gdk.Event) => void): number;
connect_after(signal: 'event-after', callback: (_source: this, event: Gdk.Event) => void): number;
emit(signal: 'event-after', event: Gdk.Event): void;
connect(signal: 'expose-event', callback: (_source: this, event: Gdk.EventExpose) => boolean): number;
connect_after(signal: 'expose-event', callback: (_source: this, event: Gdk.EventExpose) => boolean): number;
emit(signal: 'expose-event', event: Gdk.EventExpose): void;
connect(signal: 'focus', callback: (_source: this, direction: DirectionType) => boolean): number;
connect_after(signal: 'focus', callback: (_source: this, direction: DirectionType) => boolean): number;
emit(signal: 'focus', direction: DirectionType): void;
connect(signal: 'focus-in-event', callback: (_source: this, event: Gdk.EventFocus) => boolean): number;
connect_after(
signal: 'focus-in-event',
callback: (_source: this, event: Gdk.EventFocus) => boolean,
): number;
emit(signal: 'focus-in-event', event: Gdk.EventFocus): void;
connect(signal: 'focus-out-event', callback: (_source: this, event: Gdk.EventFocus) => boolean): number;
connect_after(
signal: 'focus-out-event',
callback: (_source: this, event: Gdk.EventFocus) => boolean,
): number;
emit(signal: 'focus-out-event', event: Gdk.EventFocus): void;
connect(signal: 'grab-broken-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(signal: 'grab-broken-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
emit(signal: 'grab-broken-event', event: Gdk.Event): void;
connect(signal: 'grab-focus', callback: (_source: this) => void): number;
connect_after(signal: 'grab-focus', callback: (_source: this) => void): number;
emit(signal: 'grab-focus'): void;
connect(signal: 'grab-notify', callback: (_source: this, was_grabbed: boolean) => void): number;
connect_after(signal: 'grab-notify', callback: (_source: this, was_grabbed: boolean) => void): number;
emit(signal: 'grab-notify', was_grabbed: boolean): void;
connect(signal: 'hide', callback: (_source: this) => void): number;
connect_after(signal: 'hide', callback: (_source: this) => void): number;
emit(signal: 'hide'): void;
connect(
signal: 'hierarchy-changed',
callback: (_source: this, previous_toplevel: Widget | null) => void,
): number;
connect_after(
signal: 'hierarchy-changed',
callback: (_source: this, previous_toplevel: Widget | null) => void,
): number;
emit(signal: 'hierarchy-changed', previous_toplevel?: Widget | null): void;
connect(signal: 'key-press-event', callback: (_source: this, event: Gdk.EventKey) => boolean): number;
connect_after(signal: 'key-press-event', callback: (_source: this, event: Gdk.EventKey) => boolean): number;
emit(signal: 'key-press-event', event: Gdk.EventKey): void;
connect(signal: 'key-release-event', callback: (_source: this, event: Gdk.EventKey) => boolean): number;
connect_after(
signal: 'key-release-event',
callback: (_source: this, event: Gdk.EventKey) => boolean,
): number;
emit(signal: 'key-release-event', event: Gdk.EventKey): void;
connect(signal: 'keynav-failed', callback: (_source: this, direction: DirectionType) => boolean): number;
connect_after(
signal: 'keynav-failed',
callback: (_source: this, direction: DirectionType) => boolean,
): number;
emit(signal: 'keynav-failed', direction: DirectionType): void;
connect(
signal: 'leave-notify-event',
callback: (_source: this, event: Gdk.EventCrossing) => boolean,
): number;
connect_after(
signal: 'leave-notify-event',
callback: (_source: this, event: Gdk.EventCrossing) => boolean,
): number;
emit(signal: 'leave-notify-event', event: Gdk.EventCrossing): void;
connect(signal: 'map', callback: (_source: this) => void): number;
connect_after(signal: 'map', callback: (_source: this) => void): number;
emit(signal: 'map'): void;
connect(signal: 'map-event', callback: (_source: this, event: Gdk.EventAny) => boolean): number;
connect_after(signal: 'map-event', callback: (_source: this, event: Gdk.EventAny) => boolean): number;
emit(signal: 'map-event', event: Gdk.EventAny): void;
connect(signal: 'mnemonic-activate', callback: (_source: this, arg1: boolean) => boolean): number;
connect_after(signal: 'mnemonic-activate', callback: (_source: this, arg1: boolean) => boolean): number;
emit(signal: 'mnemonic-activate', arg1: boolean): void;
connect(
signal: 'motion-notify-event',
callback: (_source: this, event: Gdk.EventMotion) => boolean,
): number;
connect_after(
signal: 'motion-notify-event',
callback: (_source: this, event: Gdk.EventMotion) => boolean,
): number;
emit(signal: 'motion-notify-event', event: Gdk.EventMotion): void;
connect(signal: 'move-focus', callback: (_source: this, direction: DirectionType) => void): number;
connect_after(signal: 'move-focus', callback: (_source: this, direction: DirectionType) => void): number;
emit(signal: 'move-focus', direction: DirectionType): void;
connect(signal: 'no-expose-event', callback: (_source: this, event: Gdk.EventNoExpose) => boolean): number;
connect_after(
signal: 'no-expose-event',
callback: (_source: this, event: Gdk.EventNoExpose) => boolean,
): number;
emit(signal: 'no-expose-event', event: Gdk.EventNoExpose): void;
connect(signal: 'parent-set', callback: (_source: this, old_parent: Widget | null) => void): number;
connect_after(signal: 'parent-set', callback: (_source: this, old_parent: Widget | null) => void): number;
emit(signal: 'parent-set', old_parent?: Widget | null): void;
connect(signal: 'popup-menu', callback: (_source: this) => boolean): number;
connect_after(signal: 'popup-menu', callback: (_source: this) => boolean): number;
emit(signal: 'popup-menu'): void;
connect(
signal: 'property-notify-event',
callback: (_source: this, event: Gdk.EventProperty) => boolean,
): number;
connect_after(
signal: 'property-notify-event',
callback: (_source: this, event: Gdk.EventProperty) => boolean,
): number;
emit(signal: 'property-notify-event', event: Gdk.EventProperty): void;
connect(
signal: 'proximity-in-event',
callback: (_source: this, event: Gdk.EventProximity) => boolean,
): number;
connect_after(
signal: 'proximity-in-event',
callback: (_source: this, event: Gdk.EventProximity) => boolean,
): number;
emit(signal: 'proximity-in-event', event: Gdk.EventProximity): void;
connect(
signal: 'proximity-out-event',
callback: (_source: this, event: Gdk.EventProximity) => boolean,
): number;
connect_after(
signal: 'proximity-out-event',
callback: (_source: this, event: Gdk.EventProximity) => boolean,
): number;
emit(signal: 'proximity-out-event', event: Gdk.EventProximity): void;
connect(
signal: 'query-tooltip',
callback: (_source: this, x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip) => boolean,
): number;
connect_after(
signal: 'query-tooltip',
callback: (_source: this, x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip) => boolean,
): number;
emit(signal: 'query-tooltip', x: number, y: number, keyboard_mode: boolean, tooltip: Tooltip): void;
connect(signal: 'realize', callback: (_source: this) => void): number;
connect_after(signal: 'realize', callback: (_source: this) => void): number;
emit(signal: 'realize'): void;
connect(
signal: 'screen-changed',
callback: (_source: this, previous_screen: Gdk.Screen | null) => void,
): number;
connect_after(
signal: 'screen-changed',
callback: (_source: this, previous_screen: Gdk.Screen | null) => void,
): number;
emit(signal: 'screen-changed', previous_screen?: Gdk.Screen | null): void;
connect(signal: 'scroll-event', callback: (_source: this, event: Gdk.EventScroll) => boolean): number;
connect_after(signal: 'scroll-event', callback: (_source: this, event: Gdk.EventScroll) => boolean): number;
emit(signal: 'scroll-event', event: Gdk.EventScroll): void;
connect(
signal: 'selection-clear-event',
callback: (_source: this, event: Gdk.EventSelection) => boolean,
): number;
connect_after(
signal: 'selection-clear-event',
callback: (_source: this, event: Gdk.EventSelection) => boolean,
): number;
emit(signal: 'selection-clear-event', event: Gdk.EventSelection): void;
connect(
signal: 'selection-get',
callback: (_source: this, data: SelectionData, info: number, time: number) => void,
): number;
connect_after(
signal: 'selection-get',
callback: (_source: this, data: SelectionData, info: number, time: number) => void,
): number;
emit(signal: 'selection-get', data: SelectionData, info: number, time: number): void;
connect(signal: 'selection-notify-event', callback: (_source: this, event: Gdk.Event) => boolean): number;
connect_after(
signal: 'selection-notify-event',
callback: (_source: this, event: Gdk.Event) => boolean,
): number;
emit(signal: 'selection-notify-event', event: Gdk.Event): void;
connect(
signal: 'selection-received',
callback: (_source: this, data: SelectionData, time: number) => void,
): number;
connect_after(
signal: 'selection-received',
callback: (_source: this, data: SelectionData, time: number) => void,
): number;
emit(signal: 'selection-received', data: SelectionData, time: number): void;
connect(
signal: 'selection-request-event',
callback: (_source: this, event: Gdk.EventSelection) => boolean,
): number;
connect_after(
signal: 'selection-request-event',
callback: (_source: this, event: Gdk.EventSelection) => boolean,
): number;
emit(signal: 'selection-request-event', event: Gdk.EventSelection): void;
connect(signal: 'show', callback: (_source: this) => void): number;
connect_after(signal: 'show', callback: (_source: this) => void): number;
emit(signal: 'show'): void;
connect(signal: 'show-help', callback: (_source: this, help_type: WidgetHelpType) => boolean): number;
connect_after(signal: 'show-help', callback: (_source: this, help_type: WidgetHelpType) => boolean): number;
emit(signal: 'show-help', help_type: WidgetHelpType): void;
connect(signal: 'size-allocate', callback: (_source: this, allocation: Gdk.Rectangle) => void): number;
connect_after(
signal: 'size-allocate',
callback: (_source: this, allocation: Gdk.Rectangle) => void,
): number;
emit(signal: 'size-allocate', allocation: Gdk.Rectangle): void;
connect(signal: 'size-request', callback: (_source: this, requisition: Requisition) => void): number;
connect_after(signal: 'size-request', callback: (_source: this, requisition: Requisition) => void): number;
emit(signal: 'size-request', requisition: Requisition): void;
connect(signal: 'state-changed', callback: (_source: this, state: StateType) => void): number;
connect_after(signal: 'state-changed', callback: (_source: this, state: StateType) => void): number;
emit(signal: 'state-changed', state: StateType): void;
connect(signal: 'style-set', callback: (_source: this, previous_style: Style | null) => void): number;
connect_after(signal: 'style-set', callback: (_source: this, previous_style: Style | null) => void): number;
emit(signal: 'style-set', previous_style?: Style | null): void;
connect(signal: 'unmap', callback: (_source: this) => void): number;
connect_after(signal: 'unmap', callback: (_source: this) => void): number;
emit(signal: 'unmap'): void;
connect(signal: 'unmap-event', callback: (_source: this, event: Gdk.EventAny) => boolean): number;
connect_after(signal: 'unmap-event', callback: (_source: this, event: Gdk.EventAny) => boolean): number;
emit(signal: 'unmap-event', event: Gdk.EventAny): void;
connect(signal: 'unrealize', callback: (_source: this) => void): number;
connect_after(signal: 'unrealize', callback: (_source: this) => void): number;
emit(signal: 'unrealize'): void;
connect(
signal: 'visibility-notify-event',
callback: (_source: this, event: Gdk.EventVisibility) => boolean,
): number;
connect_after(
signal: 'visibility-notify-event',
callback: (_source: this, event: Gdk.EventVisibility) => boolean,
): number;
emit(signal: 'visibility-notify-event', event: Gdk.EventVisibility): void;
connect(
signal: 'window-state-event',
callback: (_source: this, event: Gdk.EventWindowState) => boolean,
): number;
connect_after(
signal: 'window-state-event',
callback: (_source: this, event: Gdk.EventWindowState) => boolean,
): number;
emit(signal: 'window-state-event', event: Gdk.EventWindowState): void;
// Static methods
/**
* Obtains the default colormap used to create widgets.
*/
static get_default_colormap(): Gdk.Colormap;
/**
* Obtains the current default reading direction. See
* gtk_widget_set_default_direction().
*/
static get_default_direction(): TextDirection;
/**
* Returns the default style used by all widgets initially.
*/
static get_default_style(): Style;
/**
* Obtains the visual of the default colormap. Not really useful;
* used to be useful before gdk_colormap_get_visual() existed.
*/
static get_default_visual(): Gdk.Visual;
/**
* Removes a colormap pushed with gtk_widget_push_colormap().
*/
static pop_colormap(): void;
/**
* Cancels the effect of a previous call to gtk_widget_push_composite_child().
*/
static pop_composite_child(): void;
/**
* Pushes `cmap` onto a global stack of colormaps; the topmost
* colormap on the stack will be used to create all widgets.
* Remove `cmap` with gtk_widget_pop_colormap(). There's little
* reason to use this function.
* @param cmap a #GdkColormap
*/
static push_colormap(cmap: Gdk.Colormap): void;
/**
* Makes all newly-created widgets as composite children until
* the corresponding gtk_widget_pop_composite_child() call.
*
* A composite child is a child that's an implementation detail of the
* container it's inside and should not be visible to people using the
* container. Composite children aren't treated differently by GTK (but
* see gtk_container_foreach() vs. gtk_container_forall()), but e.g. GUI
* builders might want to treat them in a different way.
*
* Here is a simple example:
*
* ```
* gtk_widget_push_composite_child ();
* scrolled_window->hscrollbar = gtk_hscrollbar_new (hadjustment);
* gtk_widget_set_composite_name (scrolled_window->hscrollbar, "hscrollbar");
* gtk_widget_pop_composite_child ();
* gtk_widget_set_parent (scrolled_window->hscrollbar,
* GTK_WIDGET (scrolled_window));
* g_object_ref (scrolled_window->hscrollbar);
* ```
*
*/
static push_composite_child(): void;
/**
* Sets the default colormap to use when creating widgets.
* gtk_widget_push_colormap() is a better function to use if
* you only want to affect a few widgets, rather than all widgets.
* @param colormap a #GdkColormap
*/
static set_default_colormap(colormap: Gdk.Colormap): void;
/**
* Sets the default reading direction for widgets where the
* direction has not been explicitly set by gtk_widget_set_direction().
* @param dir the new default direction. This cannot be %GTK_TEXT_DIR_NONE.
*/
static set_default_direction(dir: TextDirection): void;
static find_style_property(property_name: string): GObject.ParamSpec;
static install_style_property(pspec: GObject.ParamSpec): void;
static list_style_properties(): GObject.ParamSpec[];
// Virtual methods
vfunc_button_press_event(event: Gdk.EventButton): boolean;
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
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param pspec
*/
vfunc_child_notify(pspec: GObject.ParamSpec): void;
vfunc_client_event(event: Gdk.EventClient): boolean;
vfunc_composited_changed(): void;
vfunc_configure_event(event: Gdk.EventConfigure): boolean;
vfunc_delete_event(event: Gdk.EventAny): boolean;
vfunc_destroy_event(event: Gdk.EventAny): boolean;
vfunc_direction_changed(previous_direction: TextDirection): void;
vfunc_dispatch_child_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
vfunc_drag_begin(context: Gdk.DragContext): void;
vfunc_drag_data_delete(context: Gdk.DragContext): void;
vfunc_drag_data_get(
context: Gdk.DragContext,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_data_received(
context: Gdk.DragContext,
x: number,
y: number,
selection_data: SelectionData,
info: number,
time_: number,
): void;
vfunc_drag_drop(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
vfunc_drag_end(context: Gdk.DragContext): void;
vfunc_drag_leave(context: Gdk.DragContext, time_: number): void;
vfunc_drag_motion(context: Gdk.DragContext, x: number, y: number, time_: number): boolean;
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_expose_event(event: Gdk.EventExpose): boolean;
vfunc_focus(direction: DirectionType): boolean;
vfunc_focus_in_event(event: Gdk.EventFocus): boolean;
vfunc_focus_out_event(event: Gdk.EventFocus): boolean;
/**
* Returns the accessible object that describes the widget to an
* assistive technology.
*
* If no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
*/
vfunc_get_accessible(): Atk.Object;
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;
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;
/**
* Recursively hides a widget and any child widgets.
*/
vfunc_hide_all(): void;
vfunc_hierarchy_changed(previous_toplevel: Widget): void;
vfunc_key_press_event(event: Gdk.EventKey): boolean;
vfunc_key_release_event(event: Gdk.EventKey): boolean;
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;
vfunc_map_event(event: Gdk.EventAny): boolean;
/**
* Emits the #GtkWidget::mnemonic-activate signal.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @param group_cycling %TRUE if there are other widgets with the same mnemonic
*/
vfunc_mnemonic_activate(group_cycling: boolean): boolean;
vfunc_motion_notify_event(event: Gdk.EventMotion): boolean;
vfunc_no_expose_event(event: Gdk.EventAny): boolean;
vfunc_parent_set(previous_parent: Widget): void;
vfunc_popup_menu(): boolean;
vfunc_property_notify_event(event: Gdk.EventProperty): boolean;
vfunc_proximity_in_event(event: Gdk.EventProximity): boolean;
vfunc_proximity_out_event(event: Gdk.EventProximity): boolean;
vfunc_query_tooltip(x: number, y: number, keyboard_tooltip: boolean, tooltip: Tooltip): boolean;
/**
* 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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
vfunc_realize(): void;
vfunc_screen_changed(previous_screen: Gdk.Screen): void;
vfunc_scroll_event(event: Gdk.EventScroll): boolean;
vfunc_selection_clear_event(event: Gdk.EventSelection): boolean;
vfunc_selection_get(selection_data: SelectionData, info: number, time_: number): void;
vfunc_selection_notify_event(event: Gdk.EventSelection): boolean;
vfunc_selection_received(selection_data: SelectionData, time_: number): void;
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: WidgetHelpType): boolean;
/**
* This function is only used by #GtkContainer subclasses, to assign a size
* and position to their child widgets.
* @param allocation position and size to be allocated to @widget
*/
vfunc_size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
vfunc_size_request(requisition: Requisition): void;
vfunc_state_changed(previous_state: StateType): void;
vfunc_style_set(previous_style: Style): void;
/**
* This function is only for use in widget implementations. Causes
* a widget to be unmapped if it's currently mapped.
*/
vfunc_unmap(): void;
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;
vfunc_visibility_notify_event(event: Gdk.EventVisibility): boolean;
vfunc_window_state_event(event: Gdk.EventWindowState): boolean;
// Methods
/**
* 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_RUN_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: AccelGroup,
accel_key: number,
accel_mods: Gdk.ModifierType | null,
accel_flags: AccelFlags | null,
): void;
/**
* Adds the events in the bitfield `events` to the event mask for
* `widget`. See gtk_widget_set_events() 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: Widget): void;
/**
* 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.
*
* This function replaces gtk_container_focus() from GTK+ 1.2.
* It was necessary to check that the child was visible, sensitive,
* and focusable before calling gtk_container_focus().
* gtk_widget_child_focus() returns %FALSE if the widget is not
* currently in a focusable state, so there's no need for those checks.
* @param direction direction of focus movement
* @returns %TRUE if focus ended up inside @widget
*/
child_focus(direction: DirectionType | null): boolean;
/**
* Emits a #GtkWidget::child-notify signal for the
* <link linkend="child-properties">child property</link> `child_property`
* on `widget`.
*
* This is the analogue of g_object_notify() for child properties.
* @param child_property the name of a child property installed on the class of @widget<!-- -->'s parent
*/
child_notify(child_property: string): void;
/**
* Same as gtk_widget_path(), but always uses the name of a widget's type,
* never uses a custom name set with gtk_widget_set_name().
*/
class_path(): [number, string, string];
/**
* Creates a new #PangoContext with the appropriate font map,
* 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, in order to
* notify the layout of changes to the base direction or font of this
* widget, you must call pango_layout_context_changed() in response to
* the #GtkWidget::style-set and #GtkWidget::direction-changed signals
* for the widget.
* @param text text to set on the layout (can be %NULL)
* @returns the new #PangoLayout
*/
create_pango_layout(text: string): Pango.Layout;
/**
* Destroys a widget. Equivalent to gtk_object_destroy(), except that
* you don't have to cast the widget to #GtkObject. When a widget is
* destroyed, it will break any references it holds to other objects.
* If the widget is inside a container, the widget will be removed
* from the container. If the widget is a toplevel (derived from
* #GtkWindow), it will be removed from the list of toplevels, and the
* reference GTK+ holds to it will be removed. Removing a
* widget from its container or the list of toplevels results in the
* widget being finalized, unless you've added additional references
* to the widget with g_object_ref().
*
* In most cases, only toplevel widgets (windows) require explicit
* destruction, because when you destroy a toplevel its children will
* be destroyed as well.
*/
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: Widget): Widget;
/**
* In GTK+ 1.2, this function would immediately render the
* region `area` of a widget, by invoking the virtual draw method of a
* widget. In GTK+ 2.0, the draw method is gone, and instead
* gtk_widget_draw() simply invalidates the specified region of the
* widget, then updates the invalid region of the widget immediately.
* Usually you don't want to update the region immediately for
* performance reasons, so in general gtk_widget_queue_draw_area() is
* a better choice if you want to draw a region of a widget.
* @param area area to draw
*/
draw(area: Gdk.Rectangle): 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 no accessibility library is loaded (i.e. no ATK implementation library is
* loaded via <envar>GTK_MODULES</envar> or via another application library,
* such as libgnome), then 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 <ulink url="http://developer.gnome.org/doc/API/2.0/atk/index.html">ATK</ulink>
* library contains more information about accessible objects and their uses.
* @returns the #AtkObject associated with @widget
*/
get_accessible(): Atk.Object;
/**
* Retrieves the widget's allocation.
*/
get_allocation(): Allocation;
/**
* Gets the first ancestor of `widget` with type `widget_type`. For example,
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_BOX)</literal> 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): Widget;
/**
* Determines whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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().
* @param requisition a #GtkRequisition to be filled in
*/
get_child_requisition(requisition: Requisition): void;
/**
* 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;
/**
* 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): Clipboard;
/**
* Gets the colormap that will be used to render `widget`. No reference will
* be added to the returned colormap; it should not be unreferenced.
* @returns the colormap used by @widget
*/
get_colormap(): Gdk.Colormap;
/**
* 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;
/**
* Gets the reading direction for a particular widget. See
* gtk_widget_set_direction().
* @returns the reading direction for the widget.
*/
get_direction(): 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 for the widget (a bitfield containing flags
* from the #GdkEventMask enumeration). These are the events that the widget
* will receive.
* @returns event mask for @widget
*/
get_events(): number;
/**
* Retrieves the extension events the widget will receive; see
* gdk_input_set_extension_events().
* @returns extension events for @widget
*/
get_extension_events(): Gdk.ExtensionMode;
/**
* 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;
/**
* Whether the widget is mapped.
* @returns %TRUE if the widget is mapped, %FALSE otherwise.
*/
get_mapped(): boolean;
/**
* 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(): 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() and
* gtk_widget_hide_all() will affect this widget.
* @returns the current value of the "no-show-all" property.
*/
get_no_show_all(): boolean;
/**
* 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.
*
* If you create and keep a #PangoLayout using this context, you must
* deal with changes to the context by calling pango_layout_context_changed()
* on the layout in response to the #GtkWidget::style-set and
* #GtkWidget::direction-changed signals for 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(): Widget;
/**
* Gets `widget'`s parent window.
* @returns the parent window of @widget.
*/
get_parent_window(): Gdk.Window;
/**
* 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 are not
* #GTK_NO_WINDOW widgets, and are relative to `widget->`allocation.x,
* `widget->`allocation.y for widgets that are #GTK_NO_WINDOW widgets.
*/
get_pointer(): [number, number];
/**
* Determines whether `widget` is realized.
* @returns %TRUE if @widget is realized, %FALSE otherwise
*/
get_realized(): boolean;
/**
* Determines whether `widget` is alyways treated as default widget
* withing 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 default widget when focussed, %FALSE otherwise
*/
get_receives_default(): boolean;
/**
* 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(): 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;
/**
* 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 (global property
* settings, RC file information, etc) 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(): 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 intead. See
* gtk_widget_set_size_request(). To get the size a widget will
* actually use, call gtk_widget_size_request() 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(): StateType;
/**
* Simply an accessor function that returns `widget->`style.
* @returns the widget's #GtkStyle
*/
get_style(): Style;
/**
* 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;
/**
* 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;
/**
* 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(): 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();
* <literal>gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW)</literal>
* 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 check if the %TOPLEVEL flags
* is set on the result.
*
* ```
* GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
* if (gtk_widget_is_toplevel (toplevel))
* {
* /&ast; Perform action on toplevel. &ast;/
* }
* ```
*
* @returns the topmost ancestor of @widget, or @widget itself if there's no ancestor.
*/
get_toplevel(): Widget;
/**
* Determines whether the widget is visible. Note that this doesn't
* take into account whether the widget's parent is also visible
* or 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;
/**
* Causes `widget` to become the default widget. `widget` must have the
* %GTK_CAN_DEFAULT flag set; typically you have to set this flag
* yourself by calling <literal>gtk_widget_set_can_default (`widget,`
* %TRUE)</literal>. 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.
*/
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;
/**
* 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 associcated with the widget.
*/
has_screen(): boolean;
/**
* Reverses the effects of gtk_widget_show(), causing the widget to be
* hidden (invisible to the user).
*/
hide(): void;
/**
* Recursively hides a widget and any child widgets.
*/
hide_all(): 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;
/**
* 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_mask() for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
input_shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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
* @param intersection rectangle to store intersection of @widget and @area
* @returns %TRUE if there was an intersection
*/
intersect(area: Gdk.Rectangle, intersection: Gdk.Rectangle): boolean;
/**
* 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: 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 sensntive
* @returns %TRUE if the widget is effectively sensitive
*/
is_sensitive(): boolean;
/**
* Determines whether `widget` is a toplevel widget. Currently only
* #GtkWindow and #GtkInvisible are toplevel widgets. Toplevel
* widgets have no parent widget.
* @returns %TRUE if @widget is a toplevel, %FALSE otherwise
*/
is_toplevel(): 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 %TRUE for
* %GTK_DIR_TAB_FORWARD and %GTK_DIR_TAB_BACKWARD. For the other
* values of #GtkDirectionType, it looks at the
* #GtkSettings:gtk-keynav-cursor-only setting and returns %FALSE
* if the setting is %TRUE. This way the entire user interface
* becomes cursor-navigatable on input devices such as mobile phones
* which only have cursor keys but no tab key.
*
* 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: 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[];
/**
* Returns a newly allocated list of the widgets, normally labels, for
* which this widget is a 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
* <emphasis>must</emphasis> call <literal>g_list_foreach (result,
* (GFunc)g_object_ref, NULL)</literal> 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(): 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.
*
* The default handler for this signal activates the `widget` if
* `group_cycling` is %FALSE, and just grabs the focus if `group_cycling`
* is %TRUE.
* @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: 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: StateType | null, color?: Gdk.Color | null): void;
/**
* Sets the cursor color to use in a widget, overriding the
* #GtkWidget:cursor-color and #GtkWidget: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, secondary: Gdk.Color): 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: 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 overriden if a style is explicitely set on
* the widget using gtk_widget_set_style(). The #GtkRcStyle structure
* 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 holding the style modifications
*/
modify_style(style: 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: StateType | null, color?: Gdk.Color | 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 does the same as gtk_widget_queue_draw().
*/
queue_clear(): void;
/**
* This function is no longer different from
* gtk_widget_queue_draw_area(), though it once was. Now it just calls
* gtk_widget_queue_draw_area(). Originally
* gtk_widget_queue_clear_area() would force a redraw of the
* background for %GTK_NO_WINDOW widgets, and
* gtk_widget_queue_draw_area() would not. Now both functions ensure
* the background will be redrawn.
* @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_clear_area(x: number, y: number, width: number, height: number): void;
/**
* Equivalent to calling gtk_widget_queue_draw_area() for the
* entire area of a widget.
*/
queue_draw(): void;
/**
* Invalidates the rectangular area of `widget` defined by `x,` `y,`
* `width` and `height` by calling gdk_window_invalidate_rect() 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, or
* gdk_window_invalidate_rect() directly, to schedule a redraw of a
* #GtkDrawingArea or some portion thereof.
*
* Frequently you can just call gdk_window_invalidate_rect() or
* gdk_window_invalidate_region() instead of this function. Those
* functions will invalidate only a single window, instead of the
* widget and all its children.
*
* The advantage of adding to the invalidated region compared to
* simply drawing immediately is efficiency; using an invalid region
* ensures that you only have to redraw one time.
* @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;
/**
* 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.
*/
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::expose-event. Or simply g_signal_connect () to the
* GtkWidget::realize signal.
*/
realize(): 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: 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 mnemnic label for @widget with gtk_widget_add_mnemonic_label().
*/
remove_mnemonic_label(label: Widget): void;
/**
* A convenience function that uses the theme engine and RC file
* 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. 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;
/**
* 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: 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;
/**
* Recursively resets the shape on this widget and its descendants.
*/
reset_shapes(): void;
/**
* Very rarely-used function. This function is used to emit
* an expose event signals on a widget. This function is not
* normally used directly. The only time it is used is when
* propagating an expose event to a child %NO_WINDOW widget, and
* that is normally done using gtk_container_propagate_expose().
*
* 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:
*
*
* ```
* 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?: AccelGroup | null): void;
/**
* Sets the widget's allocation. This should not be used
* directly, but from within a widget's size_allocate method.
* @param allocation a pointer to a #GtkAllocation to copy from
*/
set_allocation(allocation: Allocation): void;
/**
* Sets whether the application intends to draw on the widget in
* an #GtkWidget::expose-event 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.
* If this is not suitable (e.g. because you want to make a transparent
* window using an RGBA visual), you can work around this by doing:
*
* ```
* gtk_widget_realize (window);
* gdk_window_set_back_pixmap (window->window, NULL, FALSE);
* gtk_widget_show (window);
* ```
*
* @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 colormap for the widget to the given value. Widget must not
* have been previously realized. This probably should only be used
* from an <function>init()</function> function (i.e. from the constructor
* for the widget).
* @param colormap a colormap
*/
set_colormap(colormap: Gdk.Colormap): 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;
/**
* 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 explicitely
* 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: 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_paint_region() and gdk_window_end_paint() are called
* automatically around expose events sent to the
* widget. gdk_window_begin_paint() diverts all drawing to a widget's
* window to an offscreen buffer, and gdk_window_end_paint() 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_paint()).
* @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 #GTK_NO_WINDOW widgets;
* 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 the extension events mask to `mode`. See #GdkExtensionMode
* and gdk_input_set_extension_events().
* @param mode bitfield of extension events to receive
*/
set_extension_events(mode: Gdk.ExtensionMode | 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;
/**
* Marks the widget as being realized.
*
* 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;
/**
* Widgets can be named, which allows you to refer to them from a
* gtkrc file. You can apply a style to widgets with a particular name
* in the gtkrc file. See the documentation for gtkrc files (on the
* same page as the docs for #GtkRcStyle).
*
* Note that widget names are separated by periods in paths (see
* gtk_widget_path()), so names with embedded periods may cause confusion.
* @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() and gtk_widget_hide_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;
/**
* 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: Widget): void;
/**
* Sets a non default parent window for `widget`.
* @param parent_window the new parent window.
*/
set_parent_window(parent_window: Gdk.Window): void;
/**
* Marks the widget as being realized.
*
* 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 %NO_WINDOW widgets 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
* %NO_WINDOW widget that <emphasis>does</emphasis> 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;
/**
* For widgets that support scrolling, sets the scroll adjustments and
* returns %TRUE. For widgets that don't support scrolling, does
* nothing and returns %FALSE. Widgets that don't support scrolling
* can be scrolled by placing them in a #GtkViewport, which does
* support scrolling.
* @param hadjustment an adjustment for horizontal scrolling, or %NULL
* @param vadjustment an adjustment for vertical scrolling, or %NULL
* @returns %TRUE if the widget supports scrolling
*/
set_scroll_adjustments(hadjustment?: Adjustment | null, vadjustment?: Adjustment | null): boolean;
/**
* 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 `width` by `height`. You can use this function to
* force a widget to be either larger or smaller 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.
*
* Widgets can't actually be allocated a size less than 1 by 1, but
* you can pass 0,0 to this function to mean "as small as possible."
* @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: StateType | null): void;
/**
* Sets the #GtkStyle for a widget (`widget->`style). You probably don't
* want to use this function; it interacts badly with themes, because
* themes work by replacing the #GtkStyle. Instead, use
* gtk_widget_modify_style().
* @param style a #GtkStyle, or %NULL to remove the effect of a previous gtk_widget_set_style() and go back to the default style
*/
set_style(style?: Style | null): void;
/**
* Sets `markup` as the contents of the tooltip, which is marked up with
* the <link linkend="PangoMarkupFormat">Pango text markup language</link>.
*
* 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): void;
/**
* Replaces the default, usually yellow, 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.
*
* If the custom window should have the default theming it needs to
* have the name "gtk-tooltip", see gtk_widget_set_name().
* @param custom_window a #GtkWindow, or %NULL
*/
set_tooltip_window(custom_window?: Window | null): void;
/**
* Sets the position of a widget. The funny "u" in the name comes from
* the "user position" hint specified by the X Window System, and
* exists for legacy reasons. This function doesn't work if a widget
* is inside a container; it's only really useful on #GtkWindow.
*
* Don't use this function to center dialogs over the main application
* window; most window managers will do the centering on your behalf
* if you call gtk_window_set_transient_for(), and it's really not
* possible to get the centering to work correctly in all cases from
* application code. But if you insist, use gtk_window_set_position()
* to set #GTK_WIN_POS_CENTER_ON_PARENT, don't do the centering
* manually.
*
* Note that although `x` and `y` can be individually unset, the position
* is not honoured unless both `x` and `y` are set.
* @param x x position; -1 to unset x; -2 to leave x unchanged
* @param y y position; -1 to unset y; -2 to leave y unchanged
*/
set_uposition(x: number, y: number): void;
/**
* Sets the minimum size of a widget; that is, the widget's size
* request will be `width` by `height`. You can use this function to
* force a widget to be either larger or smaller than it is. The
* strange "usize" name dates from the early days of GTK+, and derives
* from X Window System terminology. In many 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 usize will force them
* to leave the window at least as large as the usize. 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.
* @param width minimum width, or -1 to unset
* @param height minimum height, or -1 to unset
*/
set_usize(width: number, height: number): 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 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.
* @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_mask()
* for more information.
* @param shape_mask shape to be added, or %NULL to remove an existing shape
* @param offset_x X position of shape mask with respect to @window
* @param offset_y Y position of shape mask with respect to @window
*/
shape_combine_mask(shape_mask: Gdk.Bitmap | null, offset_x: number, offset_y: number): 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.
* @param allocation position and size to be allocated to @widget
*/
size_allocate(allocation: Allocation): 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.
*
* See also gtk_widget_get_child_requisition().
* @param requisition a #GtkRequisition to be filled in
*/
size_request(requisition: Requisition): void;
/**
* This function attaches the widget's #GtkStyle to the widget's
* #GdkWindow. It is a replacement for
*
* <programlisting>
* widget->style = gtk_style_attach (widget->style, widget->window);
* </programlisting>
*
* 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: 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;
/**
* Inverse of gtk_widget_ref(). Equivalent to g_object_unref().
*/
unref(): void;
// Inherited methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* 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 {
// Signal callback interfaces
interface ActivateDefault {
(): void;
}
interface ActivateFocus {
(): void;
}
interface FrameEvent {
(object: Gdk.Event): boolean;
}
interface KeysChanged {
(): void;
}
interface SetFocus {
(object: Widget): void;
}
// Constructor properties interface
interface ConstructorProps
extends Bin.ConstructorProps,
Atk.ImplementorIface.ConstructorProps,
Buildable.ConstructorProps {
accept_focus: boolean;
acceptFocus: boolean;
allow_grow: boolean;
allowGrow: boolean;
allow_shrink: boolean;
allowShrink: boolean;
decorated: boolean;
default_height: number;
defaultHeight: number;
default_width: number;
defaultWidth: number;
deletable: boolean;
destroy_with_parent: boolean;
destroyWithParent: boolean;
focus_on_map: boolean;
focusOnMap: boolean;
gravity: Gdk.Gravity;
has_toplevel_focus: boolean;
hasToplevelFocus: boolean;
icon: GdkPixbuf.Pixbuf;
icon_name: string;
iconName: string;
is_active: boolean;
isActive: boolean;
mnemonics_visible: boolean;
mnemonicsVisible: boolean;
modal: boolean;
opacity: number;
resizable: boolean;
role: string;
screen: Gdk.Screen;
skip_pager_hint: boolean;
skipPagerHint: boolean;
skip_taskbar_hint: boolean;
skipTaskbarHint: boolean;
startup_id: string;
startupId: string;
title: string;
transient_for: Window;
transientFor: Window;
type: WindowType;
type_hint: Gdk.WindowTypeHint;
typeHint: Gdk.WindowTypeHint;
urgency_hint: boolean;
urgencyHint: boolean;
window_position: WindowPosition;
windowPosition: WindowPosition;
}
}
class Window extends Bin implements Atk.ImplementorIface, Buildable {
static $gtype: GObject.GType<Window>;
// Properties
/**
* Whether the window should receive the input focus.
*/
get accept_focus(): boolean;
set accept_focus(val: boolean);
/**
* Whether the window should receive the input focus.
*/
get acceptFocus(): boolean;
set acceptFocus(val: boolean);
/**
* If %TRUE, users can expand the window beyond its minimum size.
*/
get allow_grow(): boolean;
set allow_grow(val: boolean);
/**
* If %TRUE, users can expand the window beyond its minimum size.
*/
get allowGrow(): boolean;
set allowGrow(val: boolean);
/**
* If %TRUE, the window has no mimimum size. Setting this to %TRUE is
* 99&percnt; of the time a bad idea.
*/
get allow_shrink(): boolean;
set allow_shrink(val: boolean);
/**
* If %TRUE, the window has no mimimum size. Setting this to %TRUE is
* 99&percnt; of the time a bad idea.
*/
get allowShrink(): boolean;
set allowShrink(val: boolean);
/**
* Whether the window should be decorated by the window manager.
*/
get decorated(): boolean;
set decorated(val: boolean);
get default_height(): number;
set default_height(val: number);
get defaultHeight(): number;
set defaultHeight(val: number);
get default_width(): number;
set default_width(val: number);
get defaultWidth(): number;
set defaultWidth(val: number);
/**
* Whether the window frame should have a close button.
*/
get deletable(): boolean;
set deletable(val: boolean);
get destroy_with_parent(): boolean;
set destroy_with_parent(val: boolean);
get destroyWithParent(): boolean;
set destroyWithParent(val: boolean);
/**
* Whether the window should receive the input focus when mapped.
*/
get focus_on_map(): boolean;
set focus_on_map(val: boolean);
/**
* Whether the window should receive the input focus when mapped.
*/
get focusOnMap(): boolean;
set focusOnMap(val: boolean);
/**
* The window gravity of the window. See gtk_window_move() and #GdkGravity for
* more details about window gravity.
*/
get gravity(): Gdk.Gravity;
set gravity(val: Gdk.Gravity);
get has_toplevel_focus(): boolean;
get hasToplevelFocus(): boolean;
get icon(): GdkPixbuf.Pixbuf;
set icon(val: GdkPixbuf.Pixbuf);
/**
* The :icon-name property specifies the name of the themed icon to
* use as the window icon. See #GtkIconTheme for more details.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The :icon-name property specifies the name of the themed icon to
* use as the window icon. See #GtkIconTheme for more details.
*/
get iconName(): string;
set iconName(val: string);
get is_active(): boolean;
get isActive(): boolean;
get mnemonics_visible(): boolean;
set mnemonics_visible(val: boolean);
get mnemonicsVisible(): boolean;
set mnemonicsVisible(val: boolean);
get modal(): boolean;
set modal(val: boolean);
/**
* The requested opacity of the window. See gtk_window_set_opacity() for
* more details about window opacity.
*/
get opacity(): number;
set opacity(val: number);
get resizable(): boolean;
set resizable(val: boolean);
get role(): string;
set role(val: string);
get screen(): Gdk.Screen;
set screen(val: Gdk.Screen);
get skip_pager_hint(): boolean;
set skip_pager_hint(val: boolean);
get skipPagerHint(): boolean;
set skipPagerHint(val: boolean);
get skip_taskbar_hint(): boolean;
set skip_taskbar_hint(val: boolean);
get skipTaskbarHint(): boolean;
set skipTaskbarHint(val: boolean);
/**
* The :startup-id is a write-only property for setting window's
* startup notification identifier. See gtk_window_set_startup_id()
* for more details.
*/
set startup_id(val: string);
/**
* The :startup-id is a write-only property for setting window's
* startup notification identifier. See gtk_window_set_startup_id()
* for more details.
*/
set startupId(val: string);
get title(): string;
set title(val: string);
/**
* The transient parent of the window. See gtk_window_set_transient_for() for
* more details about transient windows.
*/
get transient_for(): Window;
set transient_for(val: Window);
/**
* The transient parent of the window. See gtk_window_set_transient_for() for
* more details about transient windows.
*/
get transientFor(): Window;
set transientFor(val: Window);
get type(): WindowType;
get type_hint(): Gdk.WindowTypeHint;
set type_hint(val: Gdk.WindowTypeHint);
get typeHint(): Gdk.WindowTypeHint;
set typeHint(val: Gdk.WindowTypeHint);
get urgency_hint(): boolean;
set urgency_hint(val: boolean);
get urgencyHint(): boolean;
set urgencyHint(val: boolean);
get window_position(): WindowPosition;
set window_position(val: WindowPosition);
get windowPosition(): WindowPosition;
set windowPosition(val: WindowPosition);
// Fields
bin: Bin;
wmclass_name: string;
wmclass_class: string;
wm_role: string;
focus_widget: Widget;
default_widget: Widget;
transient_parent: Window;
frame: Gdk.Window;
group: WindowGroup;
configure_request_count: number;
configure_notify_received: number;
need_default_position: number;
need_default_size: number;
position: number;
has_user_ref_count: number;
// @ts-expect-error This property conflicts with an accessor in a parent class or interface.
has_focus: number;
has_frame: number;
iconify_initially: number;
stick_initially: number;
maximize_initially: number;
frame_left: number;
frame_top: number;
frame_right: number;
frame_bottom: number;
keys_changed_handler: number;
mnemonic_modifier: Gdk.ModifierType;
// Constructors
constructor(properties?: Partial<Window.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](type: WindowType): Window;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'activate-default', callback: (_source: this) => void): number;
connect_after(signal: 'activate-default', callback: (_source: this) => void): number;
emit(signal: 'activate-default'): void;
connect(signal: 'activate-focus', callback: (_source: this) => void): number;
connect_after(signal: 'activate-focus', callback: (_source: this) => void): number;
emit(signal: 'activate-focus'): void;
connect(signal: 'frame-event', callback: (_source: this, object: Gdk.Event) => boolean): number;
connect_after(signal: 'frame-event', callback: (_source: this, object: Gdk.Event) => boolean): number;
emit(signal: 'frame-event', object: Gdk.Event): void;
connect(signal: 'keys-changed', callback: (_source: this) => void): number;
connect_after(signal: 'keys-changed', callback: (_source: this) => void): number;
emit(signal: 'keys-changed'): void;
connect(signal: 'set-focus', callback: (_source: this, object: Widget) => void): number;
connect_after(signal: 'set-focus', callback: (_source: this, object: Widget) => void): number;
emit(signal: 'set-focus', object: Widget): void;
// Static methods
/**
* Gets the value set by gtk_window_set_default_icon_list().
* The list is a copy and should be freed with g_list_free(),
* but the pixbufs in the list have not had their reference count
* incremented.
*/
static get_default_icon_list(): GdkPixbuf.Pixbuf[];
/**
* Returns the fallback icon name for windows that has been set
* with gtk_window_set_default_icon_name(). The returned
* string is owned by GTK+ and should not be modified. It
* is only valid until the next call to
* gtk_window_set_default_icon_name().
*/
static get_default_icon_name(): string;
/**
* Returns a list of all existing toplevel windows. 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 <emphasis>must</emphasis> call
* <literal>g_list_foreach (result, (GFunc)g_object_ref, NULL)</literal> first, and
* then unref all the widgets afterwards.
*/
static list_toplevels(): Widget[];
/**
* By default, after showing the first #GtkWindow, GTK+ calls
* gdk_notify_startup_complete(). Call this function to disable
* the automatic startup notification. You might do this if your
* first window is a splash screen, and you want to delay notification
* until after your real main window has been shown, for example.
*
* In that example, you would disable startup notification
* temporarily, show your splash screen, then re-enable it so that
* showing the main window would automatically result in notification.
* @param setting %TRUE to automatically do startup notification
*/
static set_auto_startup_notification(setting: boolean): void;
/**
* Sets an icon to be used as fallback for windows that haven't
* had gtk_window_set_icon() called on them from a pixbuf.
* @param icon the icon
*/
static set_default_icon(icon: GdkPixbuf.Pixbuf): void;
/**
* Sets an icon to be used as fallback for windows that haven't
* had gtk_window_set_icon_list() called on them from a file
* on disk. Warns on failure if `err` is %NULL.
* @param filename location of icon file
*/
static set_default_icon_from_file(filename: string): boolean;
/**
* Sets an icon list to be used as fallback for windows that haven't
* had gtk_window_set_icon_list() called on them to set up a
* window-specific icon list. This function allows you to set up the
* icon for all windows in your app at once.
*
* See gtk_window_set_icon_list() for more details.
* @param list a list of #GdkPixbuf
*/
static set_default_icon_list(list: GdkPixbuf.Pixbuf[]): void;
/**
* Sets an icon to be used as fallback for windows that haven't
* had gtk_window_set_icon_list() called on them from a named
* themed icon, see gtk_window_set_icon_name().
* @param name the name of the themed icon
*/
static set_default_icon_name(name: string): void;
// Virtual methods
vfunc_activate_default(): void;
vfunc_activate_focus(): void;
vfunc_frame_event(event: Gdk.Event): boolean;
vfunc_keys_changed(): void;
vfunc_move_focus(direction: DirectionType): void;
/**
* If `focus` is not the current focus widget, and is focusable, sets
* it as the focus widget for the window. If `focus` is %NULL, unsets
* the focus widget for this window. To set the focus to a particular
* widget in the toplevel, it is usually more convenient to use
* gtk_widget_grab_focus() instead of this function.
* @param focus widget to be the new focus widget, or %NULL to unset any focus widget for the toplevel window.
*/
vfunc_set_focus(focus?: Widget | null): void;
// Methods
/**
* Activates the default widget for the window, unless the current
* focused widget has been configured to receive the default action
* (see gtk_widget_set_receives_default()), in which case the
* focused widget is activated.
* @returns %TRUE if a widget got activated.
*/
activate_default(): boolean;
/**
* Activates the current focused widget within the window.
* @returns %TRUE if a widget got activated.
*/
activate_focus(): boolean;
/**
* Activates mnemonics and accelerators for this #GtkWindow. This is normally
* called by the default ::key_press_event handler for toplevel windows,
* however in some cases it may be useful to call this directly when
* overriding the standard key handling for a toplevel window.
* @param event a #GdkEventKey
* @returns %TRUE if a mnemonic or accelerator was found and activated.
*/
activate_key(event: Gdk.EventKey): boolean;
/**
* Associate `accel_group` with `window,` such that calling
* gtk_accel_groups_activate() on `window` will activate accelerators
* in `accel_group`.
* @param accel_group a #GtkAccelGroup
*/
add_accel_group(accel_group: AccelGroup): void;
add_embedded_xid(xid: Gdk.NativeWindow): void;
/**
* Adds a mnemonic to this window.
* @param keyval the mnemonic
* @param target the widget that gets activated by the mnemonic
*/
add_mnemonic(keyval: number, target: Widget): void;
/**
* Starts moving a window. This function is used if an application has
* window movement grips. When GDK can support it, the window movement
* will be done using the standard mechanism for the <link
* linkend="gtk-X11-arch">window manager</link> or windowing
* system. Otherwise, GDK will try to emulate window movement,
* potentially not all that well, depending on the windowing system.
* @param button mouse button that initiated the drag
* @param root_x X position where the user clicked to initiate the drag, in root window coordinates
* @param root_y Y position where the user clicked to initiate the drag
* @param timestamp timestamp from the click event that initiated the drag
*/
begin_move_drag(button: number, root_x: number, root_y: number, timestamp: number): void;
/**
* Starts resizing a window. This function is used if an application
* has window resizing controls. When GDK can support it, the resize
* will be done using the standard mechanism for the <link
* linkend="gtk-X11-arch">window manager</link> or windowing
* system. Otherwise, GDK will try to emulate window resizing,
* potentially not all that well, depending on the windowing system.
* @param edge position of the resize control
* @param button mouse button that initiated the drag
* @param root_x X position where the user clicked to initiate the drag, in root window coordinates
* @param root_y Y position where the user clicked to initiate the drag
* @param timestamp timestamp from the click event that initiated the drag
*/
begin_resize_drag(
edge: Gdk.WindowEdge | null,
button: number,
root_x: number,
root_y: number,
timestamp: number,
): void;
/**
* Asks to deiconify (i.e. unminimize) the specified `window`. Note
* that you shouldn't assume the window is definitely deiconified
* afterward, because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could iconify it
* again before your code which assumes deiconification gets to run.
*
* You can track iconification via the "window-state-event" signal
* on #GtkWidget.
*/
deiconify(): void;
/**
* Asks to place `window` in the fullscreen state. Note that you
* shouldn't assume the window is definitely full screen afterward,
* because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could unfullscreen it
* again, and not all window managers honor requests to fullscreen
* windows. But normally the window will end up fullscreen. Just
* don't write code that crashes if not.
*
* You can track the fullscreen state via the "window-state-event" signal
* on #GtkWidget.
*/
fullscreen(): void;
/**
* Gets the value set by gtk_window_set_accept_focus().
* @returns %TRUE if window should receive the input focus
*/
get_accept_focus(): boolean;
/**
* Returns whether the window has been set to have decorations
* such as a title bar via gtk_window_set_decorated().
* @returns %TRUE if the window has been set to have decorations
*/
get_decorated(): boolean;
/**
* Gets the default size of the window. A value of -1 for the width or
* height indicates that a default size has not been explicitly set
* for that dimension, so the "natural" size of the window will be
* used.
* @param width location to store the default width, or %NULL
* @param height location to store the default height, or %NULL
*/
get_default_size(width?: number | null, height?: number | null): void;
/**
* Returns the default widget for `window`. See gtk_window_set_default()
* for more details.
* @returns the default widget, or %NULL if there is none.
*/
get_default_widget(): Widget;
/**
* Returns whether the window has been set to have a close button
* via gtk_window_set_deletable().
* @returns %TRUE if the window has been set to have a close button
*/
get_deletable(): boolean;
/**
* Returns whether the window will be destroyed with its transient parent. See
* gtk_window_set_destroy_with_parent ().
* @returns %TRUE if the window will be destroyed with its transient parent.
*/
get_destroy_with_parent(): boolean;
/**
* Retrieves the current focused widget within the window.
* Note that this is the widget that would have the focus
* if the toplevel window focused; if the toplevel window
* is not focused then <literal>gtk_widget_has_focus (widget)</literal> will
* not be %TRUE for the widget.
* @returns the currently focused widget, or %NULL if there is none.
*/
get_focus(): Widget;
/**
* Gets the value set by gtk_window_set_focus_on_map().
* @returns %TRUE if window should receive the input focus when mapped.
*/
get_focus_on_map(): boolean;
/**
* (Note: this is a special-purpose function intended for the
* framebuffer port; see gtk_window_set_has_frame(). It will not
* return the size of the window border drawn by the <link
* linkend="gtk-X11-arch">window manager</link>, which is the normal
* case when using a windowing system. See
* gdk_window_get_frame_extents() to get the standard window border
* extents.)
*
* Retrieves the dimensions of the frame window for this toplevel.
* See gtk_window_set_has_frame(), gtk_window_set_frame_dimensions().
*/
get_frame_dimensions(): [number, number, number, number];
/**
* Gets the value set by gtk_window_set_gravity().
* @returns window gravity
*/
get_gravity(): Gdk.Gravity;
/**
* Returns the group for `window` or the default group, if
* `window` is %NULL or if `window` does not have an explicit
* window group.
* @returns the #GtkWindowGroup for a window or the default group
*/
get_group(): WindowGroup;
/**
* Accessor for whether the window has a frame window exterior to
* `window->`window. Gets the value set by gtk_window_set_has_frame ().
* @returns %TRUE if a frame has been added to the window via gtk_window_set_has_frame().
*/
get_has_frame(): boolean;
/**
* Gets the value set by gtk_window_set_icon() (or if you've
* called gtk_window_set_icon_list(), gets the first icon in
* the icon list).
* @returns icon for window
*/
get_icon(): GdkPixbuf.Pixbuf;
/**
* Retrieves the list of icons set by gtk_window_set_icon_list().
* The list is copied, but the reference count on each
* member won't be incremented.
* @returns copy of window's icon list
*/
get_icon_list(): GdkPixbuf.Pixbuf[];
/**
* Returns the name of the themed icon for the window,
* see gtk_window_set_icon_name().
* @returns the icon name or %NULL if the window has no themed icon
*/
get_icon_name(): string;
/**
* Returns the mnemonic modifier for this window. See
* gtk_window_set_mnemonic_modifier().
* @returns the modifier mask used to activate mnemonics on this window.
*/
get_mnemonic_modifier(): Gdk.ModifierType;
get_mnemonics_visible(): boolean;
/**
* Returns whether the window is modal. See gtk_window_set_modal().
* @returns %TRUE if the window is set to be modal and establishes a grab when shown
*/
get_modal(): boolean;
/**
* Fetches the requested opacity for this window. See
* gtk_window_set_opacity().
* @returns the requested opacity for this window.
*/
get_opacity(): number;
/**
* This function returns the position you need to pass to
* gtk_window_move() to keep `window` in its current position. This
* means that the meaning of the returned value varies with window
* gravity. See gtk_window_move() for more details.
*
* If you haven't changed the window gravity, its gravity will be
* #GDK_GRAVITY_NORTH_WEST. This means that gtk_window_get_position()
* gets the position of the top-left corner of the window manager
* frame for the window. gtk_window_move() sets the position of this
* same top-left corner.
*
* gtk_window_get_position() is not 100% reliable because the X Window System
* does not specify a way to obtain the geometry of the
* decorations placed on a window by the window manager.
* Thus GTK+ is using a "best guess" that works with most
* window managers.
*
* Moreover, nearly all window managers are historically broken with
* respect to their handling of window gravity. So moving a window to
* its current position as returned by gtk_window_get_position() tends
* to result in moving the window slightly. Window managers are
* slowly getting better over time.
*
* If a window has gravity #GDK_GRAVITY_STATIC the window manager
* frame is not relevant, and thus gtk_window_get_position() will
* always produce accurate results. However you can't use static
* gravity to do things like place a window in a corner of the screen,
* because static gravity ignores the window manager decorations.
*
* If you are saving and restoring your application's window
* positions, you should know that it's impossible for applications to
* do this without getting it somewhat wrong because applications do
* not have sufficient knowledge of window manager state. The Correct
* Mechanism is to support the session management protocol (see the
* "GnomeClient" object in the GNOME libraries for example) and allow
* the window manager to save your window sizes and positions.
*/
get_position(): [number, number];
/**
* Gets the value set by gtk_window_set_resizable().
* @returns %TRUE if the user can resize the window
*/
get_resizable(): boolean;
/**
* Returns the role of the window. See gtk_window_set_role() for
* further explanation.
* @returns the role of the window if set, or %NULL. The returned is owned by the widget and must not be modified or freed.
*/
get_role(): string;
/**
* Returns the #GdkScreen associated with `window`.
* @returns a #GdkScreen.
*/
get_screen(): Gdk.Screen;
/**
* Obtains the current size of `window`. If `window` is not onscreen,
* it returns the size GTK+ will suggest to the <link
* linkend="gtk-X11-arch">window manager</link> for the initial window
* size (but this is not reliably the same as the size the window
* manager will actually select). The size obtained by
* gtk_window_get_size() is the last size received in a
* #GdkEventConfigure, that is, GTK+ uses its locally-stored size,
* rather than querying the X server for the size. As a result, if you
* call gtk_window_resize() then immediately call
* gtk_window_get_size(), the size won't have taken effect yet. After
* the window manager processes the resize request, GTK+ receives
* notification that the size has changed via a configure event, and
* the size of the window gets updated.
*
* Note 1: Nearly any use of this function creates a race condition,
* because the size of the window may change between the time that you
* get the size and the time that you perform some action assuming
* that size is the current size. To avoid race conditions, connect to
* "configure-event" on the window and adjust your size-dependent
* state to match the size delivered in the #GdkEventConfigure.
*
* Note 2: The returned size does <emphasis>not</emphasis> include the
* size of the window manager decorations (aka the window frame or
* border). Those are not drawn by GTK+ and GTK+ has no reliable
* method of determining their size.
*
* Note 3: If you are getting a window size in order to position
* the window onscreen, there may be a better way. The preferred
* way is to simply set the window's semantic type with
* gtk_window_set_type_hint(), which allows the window manager to
* e.g. center dialogs. Also, if you set the transient parent of
* dialogs with gtk_window_set_transient_for() window managers
* will often center the dialog over its parent window. It's
* much preferred to let the window manager handle these
* things rather than doing it yourself, because all apps will
* behave consistently and according to user prefs if the window
* manager handles it. Also, the window manager can take the size
* of the window decorations/border into account, while your
* application cannot.
*
* In any case, if you insist on application-specified window
* positioning, there's <emphasis>still</emphasis> a better way than
* doing it yourself - gtk_window_set_position() will frequently
* handle the details for you.
*/
get_size(): [number, number];
/**
* Gets the value set by gtk_window_set_skip_pager_hint().
* @returns %TRUE if window shouldn't be in pager
*/
get_skip_pager_hint(): boolean;
/**
* Gets the value set by gtk_window_set_skip_taskbar_hint()
* @returns %TRUE if window shouldn't be in taskbar
*/
get_skip_taskbar_hint(): boolean;
/**
* Retrieves the title of the window. See gtk_window_set_title().
* @returns the title of the window, or %NULL if none has been set explicitely. The returned string is owned by the widget and must not be modified or freed.
*/
get_title(): string;
/**
* Fetches the transient parent for this window. See
* gtk_window_set_transient_for().
* @returns the transient parent for this window, or %NULL if no transient parent has been set.
*/
get_transient_for(): Window;
/**
* Gets the type hint for this window. See gtk_window_set_type_hint().
* @returns the type hint for @window.
*/
get_type_hint(): Gdk.WindowTypeHint;
/**
* Gets the value set by gtk_window_set_urgency_hint()
* @returns %TRUE if window is urgent
*/
get_urgency_hint(): boolean;
/**
* Gets the type of the window. See #GtkWindowType.
* @returns the type of the window
*/
get_window_type(): WindowType;
/**
* Returns whether `window` has an explicit window group.
* @returns %TRUE if @window has an explicit window group. Since 2.22
*/
has_group(): boolean;
/**
* Asks to iconify (i.e. minimize) the specified `window`. Note that
* you shouldn't assume the window is definitely iconified afterward,
* because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could deiconify it
* again, or there may not be a window manager in which case
* iconification isn't possible, etc. But normally the window will end
* up iconified. Just don't write code that crashes if not.
*
* It's permitted to call this function before showing a window,
* in which case the window will be iconified before it ever appears
* onscreen.
*
* You can track iconification via the "window-state-event" signal
* on #GtkWidget.
*/
iconify(): void;
/**
* Asks to maximize `window,` so that it becomes full-screen. Note that
* you shouldn't assume the window is definitely maximized afterward,
* because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could unmaximize it
* again, and not all window managers support maximization. But
* normally the window will end up maximized. Just don't write code
* that crashes if not.
*
* It's permitted to call this function before showing a window,
* in which case the window will be maximized when it appears onscreen
* initially.
*
* You can track maximization via the "window-state-event" signal
* on #GtkWidget.
*/
maximize(): void;
/**
* Activates the targets associated with the mnemonic.
* @param keyval the mnemonic
* @param modifier the modifiers
* @returns %TRUE if the activation is done.
*/
mnemonic_activate(keyval: number, modifier: Gdk.ModifierType | null): boolean;
// Conflicted with Gtk.Widget.mnemonic_activate
mnemonic_activate(...args: never[]): any;
/**
* Asks the <link linkend="gtk-X11-arch">window manager</link> to move
* `window` to the given position. Window managers are free to ignore
* this; most window managers ignore requests for initial window
* positions (instead using a user-defined placement algorithm) and
* honor requests after the window has already been shown.
*
* Note: the position is the position of the gravity-determined
* reference point for the window. The gravity determines two things:
* first, the location of the reference point in root window
* coordinates; and second, which point on the window is positioned at
* the reference point.
*
* By default the gravity is #GDK_GRAVITY_NORTH_WEST, so the reference
* point is simply the `x,` `y` supplied to gtk_window_move(). The
* top-left corner of the window decorations (aka window frame or
* border) will be placed at `x,` `y`. Therefore, to position a window
* at the top left of the screen, you want to use the default gravity
* (which is #GDK_GRAVITY_NORTH_WEST) and move the window to 0,0.
*
* To position a window at the bottom right corner of the screen, you
* would set #GDK_GRAVITY_SOUTH_EAST, which means that the reference
* point is at `x` + the window width and `y` + the window height, and
* the bottom-right corner of the window border will be placed at that
* reference point. So, to place a window in the bottom right corner
* you would first set gravity to south east, then write:
* <literal>gtk_window_move (window, gdk_screen_width () - window_width,
* gdk_screen_height () - window_height)</literal> (note that this
* example does not take multi-head scenarios into account).
*
* The Extended Window Manager Hints specification at <ulink
* url="http://www.freedesktop.org/Standards/wm-spec">
* http://www.freedesktop.org/Standards/wm-spec</ulink> has a
* nice table of gravities in the "implementation notes" section.
*
* The gtk_window_get_position() documentation may also be relevant.
* @param x X coordinate to move window to
* @param y Y coordinate to move window to
*/
move(x: number, y: number): void;
/**
* Parses a standard X Window System geometry string - see the
* manual page for X (type 'man X') for details on this.
* gtk_window_parse_geometry() does work on all GTK+ ports
* including Win32 but is primarily intended for an X environment.
*
* If either a size or a position can be extracted from the
* geometry string, gtk_window_parse_geometry() returns %TRUE
* and calls gtk_window_set_default_size() and/or gtk_window_move()
* to resize/move the window.
*
* If gtk_window_parse_geometry() returns %TRUE, it will also
* set the #GDK_HINT_USER_POS and/or #GDK_HINT_USER_SIZE hints
* indicating to the window manager that the size/position of
* the window was user-specified. This causes most window
* managers to honor the geometry.
*
* Note that for gtk_window_parse_geometry() to work as expected, it has
* to be called when the window has its "final" size, i.e. after calling
* gtk_widget_show_all() on the contents and gtk_window_set_geometry_hints()
* on the window.
*
* ```
* #include <gtk/gtk.h>
*
* static void
* fill_with_content (GtkWidget *vbox)
* {
* /&ast; fill with content... &ast;/
* }
*
* int
* main (int argc, char *argv[])
* {
* GtkWidget *window, *vbox;
* GdkGeometry size_hints = {
* 100, 50, 0, 0, 100, 50, 10, 10, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST
* };
*
* gtk_init (&argc, &argv);
*
* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
* vbox = gtk_vbox_new (FALSE, 0);
*
* gtk_container_add (GTK_CONTAINER (window), vbox);
* fill_with_content (vbox);
* gtk_widget_show_all (vbox);
*
* gtk_window_set_geometry_hints (GTK_WINDOW (window),
* window,
* &size_hints,
* GDK_HINT_MIN_SIZE |
* GDK_HINT_BASE_SIZE |
* GDK_HINT_RESIZE_INC);
*
* if (argc &gt; 1)
* {
* if (!gtk_window_parse_geometry (GTK_WINDOW (window), argv[1]))
* fprintf (stderr, "Failed to parse '%s'\n", argv[1]);
* }
*
* gtk_widget_show_all (window);
* gtk_main ();
*
* return 0;
* }
* ```
*
* @param geometry geometry string
* @returns %TRUE if string was parsed successfully
*/
parse_geometry(geometry: string): boolean;
/**
* Presents a window to the user. This may mean raising the window
* in the stacking order, deiconifying it, moving it to the current
* desktop, and/or giving it the keyboard focus, possibly dependent
* on the user's platform, window manager, and preferences.
*
* If `window` is hidden, this function calls gtk_widget_show()
* as well.
*
* This function should be used when the user tries to open a window
* that's already open. Say for example the preferences dialog is
* currently open, and the user chooses Preferences from the menu
* a second time; use gtk_window_present() to move the already-open dialog
* where the user can see it.
*
* If you are calling this function in response to a user interaction,
* it is preferable to use gtk_window_present_with_time().
*/
present(): void;
/**
* Presents a window to the user in response to a user interaction.
* If you need to present a window without a timestamp, use
* gtk_window_present(). See gtk_window_present() for details.
* @param timestamp the timestamp of the user interaction (typically a button or key press event) which triggered this call
*/
present_with_time(timestamp: number): void;
/**
* Propagate a key press or release event to the focus widget and
* up the focus container chain until a widget handles `event`.
* This is normally called by the default ::key_press_event and
* ::key_release_event handlers for toplevel windows,
* however in some cases it may be useful to call this directly when
* overriding the standard key handling for a toplevel window.
* @param event a #GdkEventKey
* @returns %TRUE if a widget in the focus chain handled the event.
*/
propagate_key_event(event: Gdk.EventKey): boolean;
/**
* Reverses the effects of gtk_window_add_accel_group().
* @param accel_group a #GtkAccelGroup
*/
remove_accel_group(accel_group: AccelGroup): void;
remove_embedded_xid(xid: Gdk.NativeWindow): void;
/**
* Removes a mnemonic from this window.
* @param keyval the mnemonic
* @param target the widget that gets activated by the mnemonic
*/
remove_mnemonic(keyval: number, target: Widget): void;
/**
* Hides `window,` then reshows it, resetting the
* default size and position of the window. Used
* by GUI builders only.
*/
reshow_with_initial_size(): void;
/**
* Resizes the window as if the user had done so, obeying geometry
* constraints. The default geometry constraint is that windows may
* not be smaller than their size request; to override this
* constraint, call gtk_widget_set_size_request() to set the window's
* request to a smaller value.
*
* If gtk_window_resize() is called before showing a window for the
* first time, it overrides any default size set with
* gtk_window_set_default_size().
*
* Windows may not be resized smaller than 1 by 1 pixels.
* @param width width in pixels to resize the window to
* @param height height in pixels to resize the window to
*/
resize(width: number, height: number): void;
/**
* Windows may set a hint asking the desktop environment not to receive
* the input focus. This function sets this hint.
* @param setting %TRUE to let this window receive input focus
*/
set_accept_focus(setting: boolean): void;
/**
* By default, windows are decorated with a title bar, resize
* controls, etc. Some <link linkend="gtk-X11-arch">window
* managers</link> allow GTK+ to disable these decorations, creating a
* borderless window. If you set the decorated property to %FALSE
* using this function, GTK+ will do its best to convince the window
* manager not to decorate the window. Depending on the system, this
* function may not have any effect when called on a window that is
* already visible, so you should call it before calling gtk_window_show().
*
* On Windows, this function always works, since there's no window manager
* policy involved.
* @param setting %TRUE to decorate the window
*/
set_decorated(setting: boolean): void;
/**
* The default widget is the widget that's activated when the user
* presses Enter in a dialog (for example). This function sets or
* unsets the default widget for a #GtkWindow about. When setting
* (rather than unsetting) the default widget it's generally easier to
* call gtk_widget_grab_focus() on the widget. Before making a widget
* the default widget, you must set the #GTK_CAN_DEFAULT flag on the
* widget you'd like to make the default using GTK_WIDGET_SET_FLAGS().
* @param default_widget widget to be the default, or %NULL to unset the default widget for the toplevel.
*/
set_default(default_widget?: Widget | null): void;
/**
* Sets the default size of a window. If the window's "natural" size
* (its size request) is larger than the default, the default will be
* ignored. More generally, if the default size does not obey the
* geometry hints for the window (gtk_window_set_geometry_hints() can
* be used to set these explicitly), the default size will be clamped
* to the nearest permitted size.
*
* Unlike gtk_widget_set_size_request(), which sets a size request for
* a widget and thus would keep users from shrinking the window, this
* function only sets the initial size, just as if the user had
* resized the window themselves. Users can still shrink the window
* again as they normally would. Setting a default size of -1 means to
* use the "natural" default size (the size request of the window).
*
* For more control over a window's initial size and how resizing works,
* investigate gtk_window_set_geometry_hints().
*
* For some uses, gtk_window_resize() is a more appropriate function.
* gtk_window_resize() changes the current size of the window, rather
* than the size to be used on initial display. gtk_window_resize() always
* affects the window itself, not the geometry widget.
*
* The default size of a window only affects the first time a window is
* shown; if a window is hidden and re-shown, it will remember the size
* it had prior to hiding, rather than using the default size.
*
* Windows can't actually be 0x0 in size, they must be at least 1x1, but
* passing 0 for `width` and `height` is OK, resulting in a 1x1 default size.
* @param width width in pixels, or -1 to unset the default width
* @param height height in pixels, or -1 to unset the default height
*/
set_default_size(width: number, height: number): void;
/**
* By default, windows have a close button in the window frame. Some
* <link linkend="gtk-X11-arch">window managers</link> allow GTK+ to
* disable this button. If you set the deletable property to %FALSE
* using this function, GTK+ will do its best to convince the window
* manager not to show a close button. Depending on the system, this
* function may not have any effect when called on a window that is
* already visible, so you should call it before calling gtk_window_show().
*
* On Windows, this function always works, since there's no window manager
* policy involved.
* @param setting %TRUE to decorate the window as deletable
*/
set_deletable(setting: boolean): void;
/**
* If `setting` is %TRUE, then destroying the transient parent of `window`
* will also destroy `window` itself. This is useful for dialogs that
* shouldn't persist beyond the lifetime of the main window they're
* associated with, for example.
* @param setting whether to destroy @window with its transient parent
*/
set_destroy_with_parent(setting: boolean): void;
/**
* If `focus` is not the current focus widget, and is focusable, sets
* it as the focus widget for the window. If `focus` is %NULL, unsets
* the focus widget for this window. To set the focus to a particular
* widget in the toplevel, it is usually more convenient to use
* gtk_widget_grab_focus() instead of this function.
* @param focus widget to be the new focus widget, or %NULL to unset any focus widget for the toplevel window.
*/
set_focus(focus?: Widget | null): void;
/**
* Windows may set a hint asking the desktop environment not to receive
* the input focus when the window is mapped. This function sets this
* hint.
* @param setting %TRUE to let this window receive input focus on map
*/
set_focus_on_map(setting: boolean): void;
/**
* (Note: this is a special-purpose function intended for the framebuffer
* port; see gtk_window_set_has_frame(). It will have no effect on the
* window border drawn by the window manager, which is the normal
* case when using the X Window system.)
*
* For windows with frames (see gtk_window_set_has_frame()) this function
* can be used to change the size of the frame border.
* @param left The width of the left border
* @param top The height of the top border
* @param right The width of the right border
* @param bottom The height of the bottom border
*/
set_frame_dimensions(left: number, top: number, right: number, bottom: number): void;
/**
* This function sets up hints about how a window can be resized by
* the user. You can set a minimum and maximum size; allowed resize
* increments (e.g. for xterm, you can only resize by the size of a
* character); aspect ratios; and more. See the #GdkGeometry struct.
* @param geometry_widget widget the geometry hints will be applied to
* @param geometry struct containing geometry information
* @param geom_mask mask indicating which struct fields should be paid attention to
*/
set_geometry_hints(
geometry_widget: Widget,
geometry: Gdk.Geometry,
geom_mask: Gdk.WindowHints | null,
): void;
/**
* Window gravity defines the meaning of coordinates passed to
* gtk_window_move(). See gtk_window_move() and #GdkGravity for
* more details.
*
* The default window gravity is #GDK_GRAVITY_NORTH_WEST which will
* typically "do what you mean."
* @param gravity window gravity
*/
set_gravity(gravity: Gdk.Gravity | null): void;
/**
* (Note: this is a special-purpose function for the framebuffer port,
* that causes GTK+ to draw its own window border. For most applications,
* you want gtk_window_set_decorated() instead, which tells the window
* manager whether to draw the window border.)
*
* If this function is called on a window with setting of %TRUE, before
* it is realized or showed, it will have a "frame" window around
* `window->`window, accessible in `window->`frame. Using the signal
* frame_event you can receive all events targeted at the frame.
*
* This function is used by the linux-fb port to implement managed
* windows, but it could conceivably be used by X-programs that
* want to do their own window decorations.
* @param setting a boolean
*/
set_has_frame(setting: boolean): void;
/**
* Sets up the icon representing a #GtkWindow. This icon is used when
* the window is minimized (also known as iconified). Some window
* managers or desktop environments may also place it in the window
* frame, or display it in other contexts.
*
* The icon should be provided in whatever size it was naturally
* drawn; that is, don't scale the image before passing it to
* GTK+. Scaling is postponed until the last minute, when the desired
* final size is known, to allow best quality.
*
* If you have your icon hand-drawn in multiple sizes, use
* gtk_window_set_icon_list(). Then the best size will be used.
*
* This function is equivalent to calling gtk_window_set_icon_list()
* with a 1-element list.
*
* See also gtk_window_set_default_icon_list() to set the icon
* for all windows in your application in one go.
* @param icon icon image, or %NULL
*/
set_icon(icon?: GdkPixbuf.Pixbuf | null): void;
/**
* Sets the icon for `window`.
* Warns on failure if `err` is %NULL.
*
* This function is equivalent to calling gtk_window_set_icon()
* with a pixbuf created by loading the image from `filename`.
* @param filename location of icon file
* @returns %TRUE if setting the icon succeeded.
*/
set_icon_from_file(filename: string): boolean;
/**
* Sets the icon for the window from a named themed icon. See
* the docs for #GtkIconTheme for more details.
*
* Note that this has nothing to do with the WM_ICON_NAME
* property which is mentioned in the ICCCM.
* @param name the name of the themed icon
*/
set_icon_name(name?: string | null): void;
/**
* Asks to keep `window` above, so that it stays on top. Note that
* you shouldn't assume the window is definitely above afterward,
* because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could not keep it above,
* and not all window managers support keeping windows above. But
* normally the window will end kept above. Just don't write code
* that crashes if not.
*
* It's permitted to call this function before showing a window,
* in which case the window will be kept above when it appears onscreen
* initially.
*
* You can track the above state via the "window-state-event" signal
* on #GtkWidget.
*
* Note that, according to the <ulink
* url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
* Manager Hints</ulink> specification, the above state is mainly meant
* for user preferences and should not be used by applications e.g. for
* drawing attention to their dialogs.
* @param setting whether to keep @window above other windows
*/
set_keep_above(setting: boolean): void;
/**
* Asks to keep `window` below, so that it stays in bottom. Note that
* you shouldn't assume the window is definitely below afterward,
* because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could not keep it below,
* and not all window managers support putting windows below. But
* normally the window will be kept below. Just don't write code
* that crashes if not.
*
* It's permitted to call this function before showing a window,
* in which case the window will be kept below when it appears onscreen
* initially.
*
* You can track the below state via the "window-state-event" signal
* on #GtkWidget.
*
* Note that, according to the <ulink
* url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
* Manager Hints</ulink> specification, the above state is mainly meant
* for user preferences and should not be used by applications e.g. for
* drawing attention to their dialogs.
* @param setting whether to keep @window below other windows
*/
set_keep_below(setting: boolean): void;
/**
* Sets the mnemonic modifier for this window.
* @param modifier the modifier mask used to activate mnemonics on this window.
*/
set_mnemonic_modifier(modifier: Gdk.ModifierType | null): void;
/**
* Sets the #GtkWindow:mnemonics-visible property.
* @param setting the new value
*/
set_mnemonics_visible(setting: boolean): void;
/**
* Sets a window modal or non-modal. Modal windows prevent interaction
* with other windows in the same application. To keep modal dialogs
* on top of main application windows, use
* gtk_window_set_transient_for() to make the dialog transient for the
* parent; most <link linkend="gtk-X11-arch">window managers</link>
* will then disallow lowering the dialog below the parent.
* @param modal whether the window is modal
*/
set_modal(modal: boolean): void;
/**
* Request the windowing system to make `window` partially transparent,
* with opacity 0 being fully transparent and 1 fully opaque. (Values
* of the opacity parameter are clamped to the [0,1] range.) 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.
*
* Note that setting a window's opacity after the window has been
* shown causes it to flicker once on Windows.
* @param opacity desired opacity, between 0 and 1
*/
set_opacity(opacity: number): void;
set_policy(allow_shrink: number, allow_grow: number, auto_shrink: number): void;
/**
* Sets a position constraint for this window. If the old or new
* constraint is %GTK_WIN_POS_CENTER_ALWAYS, this will also cause
* the window to be repositioned to satisfy the new constraint.
* @param position a position constraint.
*/
set_position(position: WindowPosition | null): void;
/**
* Sets whether the user can resize a window. Windows are user resizable
* by default.
* @param resizable %TRUE if the user can resize this window
*/
set_resizable(resizable: boolean): void;
/**
* This function is only useful on X11, not with other GTK+ targets.
*
* In combination with the window title, the window role allows a
* <link linkend="gtk-X11-arch">window manager</link> to identify "the
* same" window when an application is restarted. So for example you
* might set the "toolbox" role on your app's toolbox window, so that
* when the user restarts their session, the window manager can put
* the toolbox back in the same place.
*
* If a window already has a unique title, you don't need to set the
* role, since the WM can use the title to identify the window when
* restoring the session.
* @param role unique identifier for the window to be used when restoring a session
*/
set_role(role: string): void;
/**
* Sets the #GdkScreen where the `window` is displayed; if
* the window is already mapped, it will be unmapped, and
* then remapped on the new screen.
* @param screen a #GdkScreen.
*/
set_screen(screen: Gdk.Screen): void;
/**
* Windows may set a hint asking the desktop environment not to display
* the window in the pager. This function sets this hint.
* (A "pager" is any desktop navigation tool such as a workspace
* switcher that displays a thumbnail representation of the windows
* on the screen.)
* @param setting %TRUE to keep this window from appearing in the pager
*/
set_skip_pager_hint(setting: boolean): void;
/**
* Windows may set a hint asking the desktop environment not to display
* the window in the task bar. This function sets this hint.
* @param setting %TRUE to keep this window from appearing in the task bar
*/
set_skip_taskbar_hint(setting: boolean): void;
/**
* Startup notification identifiers are used by desktop environment to
* track application startup, to provide user feedback and other
* features. This function changes the corresponding property on the
* underlying GdkWindow. Normally, startup identifier is managed
* automatically and you should only use this function in special cases
* like transferring focus from other processes. You should use this
* function before calling gtk_window_present() or any equivalent
* function generating a window map event.
*
* This function is only useful on X11, not with other GTK+ targets.
* @param startup_id a string with startup-notification identifier
*/
set_startup_id(startup_id: string): void;
/**
* Sets the title of the #GtkWindow. The title of a window will be
* displayed in its title bar; on the X Window System, the title bar
* is rendered by the <link linkend="gtk-X11-arch">window
* manager</link>, so exactly how the title appears to users may vary
* according to a user's exact configuration. The title should help a
* user distinguish this window from other windows they may have
* open. A good title might include the application name and current
* document filename, for example.
* @param title title of the window
*/
set_title(title: string): void;
/**
* Dialog windows should be set transient for the main application
* window they were spawned from. This allows <link
* linkend="gtk-X11-arch">window managers</link> to e.g. keep the
* dialog on top of the main window, or center the dialog over the
* main window. gtk_dialog_new_with_buttons() and other convenience
* functions in GTK+ will sometimes call
* gtk_window_set_transient_for() on your behalf.
*
* Passing %NULL for `parent` unsets the current transient window.
*
* On Windows, this function puts the child window on top of the parent,
* much as the window manager would have done on X.
* @param parent parent window, or %NULL
*/
set_transient_for(parent?: Window | null): void;
/**
* By setting the type hint for the window, you allow the window
* manager to decorate and handle the window in a way which is
* suitable to the function of the window in your application.
*
* This function should be called before the window becomes visible.
*
* gtk_dialog_new_with_buttons() and other convenience functions in GTK+
* will sometimes call gtk_window_set_type_hint() on your behalf.
* @param hint the window type
*/
set_type_hint(hint: Gdk.WindowTypeHint | null): void;
/**
* Windows may set a hint asking the desktop environment to draw
* the users attention to the window. This function sets this hint.
* @param setting %TRUE to mark this window as urgent
*/
set_urgency_hint(setting: boolean): void;
/**
* Don't use this function. It sets the X Window System "class" and
* "name" hints for a window. According to the ICCCM, you should
* always set these to the same value for all windows in an
* application, and GTK+ sets them to that value by default, so calling
* this function is sort of pointless. However, you may want to call
* gtk_window_set_role() on each window in your application, for the
* benefit of the session manager. Setting the role allows the window
* manager to restore window positions when loading a saved session.
* @param wmclass_name window name hint
* @param wmclass_class window class hint
*/
set_wmclass(wmclass_name: string, wmclass_class: string): void;
/**
* Asks to stick `window,` which means that it will appear on all user
* desktops. Note that you shouldn't assume the window is definitely
* stuck afterward, because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could unstick it
* again, and some window managers do not support sticking
* windows. But normally the window will end up stuck. Just don't
* write code that crashes if not.
*
* It's permitted to call this function before showing a window.
*
* You can track stickiness via the "window-state-event" signal
* on #GtkWidget.
*/
stick(): void;
/**
* Asks to toggle off the fullscreen state for `window`. Note that you
* shouldn't assume the window is definitely not full screen
* afterward, because other entities (e.g. the user or <link
* linkend="gtk-X11-arch">window manager</link>) could fullscreen it
* again, and not all window managers honor requests to unfullscreen
* windows. But normally the window will end up restored to its normal
* state. Just don't write code that crashes if not.
*
* You can track the fullscreen state via the "window-state-event" signal
* on #GtkWidget.
*/
unfullscreen(): void;
/**
* Asks to unmaximize `window`. Note that you shouldn't assume the
* window is definitely unmaximized afterward, because other entities
* (e.g. the user or <link linkend="gtk-X11-arch">window
* manager</link>) could maximize it again, and not all window
* managers honor requests to unmaximize. But normally the window will
* end up unmaximized. Just don't write code that crashes if not.
*
* You can track maximization via the "window-state-event" signal
* on #GtkWidget.
*/
unmaximize(): void;
/**
* Asks to unstick `window,` which means that it will appear on only
* one of the user's desktops. Note that you shouldn't assume the
* window is definitely unstuck afterward, because other entities
* (e.g. the user or <link linkend="gtk-X11-arch">window
* manager</link>) could stick it again. But normally the window will
* end up stuck. Just don't write code that crashes if not.
*
* You can track stickiness via the "window-state-event" signal
* on #GtkWidget.
*/
unstick(): 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 WindowGroup {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
class WindowGroup extends GObject.Object {
static $gtype: GObject.GType<WindowGroup>;
// Fields
grabs: any[];
// Constructors
constructor(properties?: Partial<WindowGroup.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): WindowGroup;
// Methods
/**
* Adds a window to a #GtkWindowGroup.
* @param window the #GtkWindow to add
*/
add_window(window: Window): void;
/**
* Returns a list of the #GtkWindows that belong to `window_group`.
* @returns A newly-allocated list of windows inside the group.
*/
list_windows(): Widget[];
/**
* Removes a window from a #GtkWindowGroup.
* @param window the #GtkWindow to remove
*/
remove_window(window: Window): void;
}
type AboutDialogClass = typeof AboutDialog;
type AccelGroupClass = typeof AccelGroup;
class AccelGroupEntry {
static $gtype: GObject.GType<AccelGroupEntry>;
// Fields
accel_path_quark: GLib.Quark;
// Constructors
_init(...args: any[]): void;
}
class AccelKey {
static $gtype: GObject.GType<AccelKey>;
// Fields
accel_key: number;
accel_mods: Gdk.ModifierType;
accel_flags: number;
// Constructors
_init(...args: any[]): void;
}
type AccelLabelClass = typeof AccelLabel;
type AccelMapClass = typeof AccelMap;
type AccessibleClass = typeof Accessible;
type ActionClass = typeof Action;
class ActionEntry {
static $gtype: GObject.GType<ActionEntry>;
// Fields
name: string;
stock_id: string;
label: string;
accelerator: string;
tooltip: string;
callback: GObject.Callback;
// Constructors
_init(...args: any[]): void;
}
type ActionGroupClass = typeof ActionGroup;
abstract class ActionGroupPrivate {
static $gtype: GObject.GType<ActionGroupPrivate>;
// Constructors
_init(...args: any[]): void;
}
abstract class ActionPrivate {
static $gtype: GObject.GType<ActionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ActivatableIface = typeof Activatable;
type AdjustmentClass = typeof Adjustment;
type AlignmentClass = typeof Alignment;
abstract class AlignmentPrivate {
static $gtype: GObject.GType<AlignmentPrivate>;
// Constructors
_init(...args: any[]): void;
}
class Arg {
static $gtype: GObject.GType<Arg>;
// Fields
type: GObject.GType;
name: string;
// Constructors
_init(...args: any[]): void;
}
type ArrowClass = typeof Arrow;
type AspectFrameClass = typeof AspectFrame;
type AssistantClass = typeof Assistant;
abstract class AssistantPrivate {
static $gtype: GObject.GType<AssistantPrivate>;
// Constructors
_init(...args: any[]): void;
}
type BinClass = typeof Bin;
class BindingArg {
static $gtype: GObject.GType<BindingArg>;
// Fields
arg_type: GObject.GType;
// Constructors
_init(...args: any[]): void;
}
class BindingEntry {
static $gtype: GObject.GType<BindingEntry>;
// Fields
keyval: number;
modifiers: Gdk.ModifierType;
destroyed: number;
in_emission: number;
marks_unbound: number;
// Constructors
_init(...args: any[]): void;
// Static methods
/**
* Override or install a new key binding for `keyval` with `modifiers` on
* `binding_set`.
* @param binding_set a #GtkBindingSet to add a signal to
* @param keyval key value
* @param modifiers key modifier
* @param signal_name signal name to be bound
* @param binding_args list of #GtkBindingArg signal arguments
*/
static add_signall(
binding_set: BindingSet,
keyval: number,
modifiers: Gdk.ModifierType,
signal_name: string,
binding_args: BindingArg[],
): void;
/**
* Clears a binding entry.
* @param binding_set binding set to clear an entry of
* @param keyval key value of binding to clear
* @param modifiers key modifier of binding to clear
*/
static clear(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType): void;
/**
* Remove a binding previously installed via
* gtk_binding_entry_add_signal() on `binding_set`.
* @param binding_set a #GtkBindingSet to remove an entry of
* @param keyval key value of binding to remove
* @param modifiers key modifier of binding to remove
*/
static remove(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType): void;
/**
* Install a binding on `binding_set` which causes key lookups
* to be aborted, to prevent bindings from lower priority sets
* to be activated.
* @param binding_set a #GtkBindingSet to skip an entry of
* @param keyval key value of binding to skip
* @param modifiers key modifier of binding to skip
*/
static skip(binding_set: BindingSet, keyval: number, modifiers: Gdk.ModifierType): void;
}
class BindingSet {
static $gtype: GObject.GType<BindingSet>;
// Fields
set_name: string;
priority: number;
widget_path_pspecs: any[];
widget_class_pspecs: any[];
class_branch_pspecs: any[];
parsed: number;
// Constructors
_init(...args: any[]): void;
// Static methods
/**
* Find a binding set by its globally unique name. The `set_name` can
* either be a name used for gtk_binding_set_new() or the type name of
* a class used in gtk_binding_set_by_class().
* @param set_name unique binding set name
*/
static find(set_name: string): BindingSet;
// Methods
/**
* Find a key binding matching `keyval` and `modifiers` within
* `binding_set` and activate the binding on `object`.
* @param keyval key value of the binding
* @param modifiers key modifier of the binding
* @param object object to activate when binding found
* @returns %TRUE if a binding was found and activated
*/
activate(keyval: number, modifiers: Gdk.ModifierType | null, object: Object): boolean;
/**
* This function is used internally by the GtkRC parsing mechanism to
* assign match patterns to #GtkBindingSet structures.
* @param path_type path type the pattern applies to
* @param path_pattern the actual match pattern
* @param priority binding priority
*/
add_path(path_type: PathType | null, path_pattern: string, priority: PathPriorityType | null): void;
}
class BindingSignal {
static $gtype: GObject.GType<BindingSignal>;
// Fields
signal_name: string;
n_args: number;
// Constructors
_init(...args: any[]): void;
}
class Border {
static $gtype: GObject.GType<Border>;
// Fields
left: number;
right: number;
top: number;
bottom: number;
// Constructors
constructor(
properties?: Partial<{
left: number;
right: number;
top: number;
bottom: number;
}>,
);
_init(...args: any[]): void;
static ['new'](): Border;
// Methods
/**
* Copies a #GtkBorder structure.
* @returns a copy of @border_.
*/
copy(): Border;
/**
* Frees a #GtkBorder structure.
*/
free(): void;
}
/**
* The #GtkBoxChild holds a child widget of #GtkBox and describes how the child
* is to be packed into the #GtkBox. All fields of this #GtkBoxChild should be
* considered read-only and they should never be set directly by an application.
* Use gtk_box_query_child_packing() and gtk_box_set_child_packing() to query
* and set the #GtkBoxChild.padding, #GtkBoxChild.expand, #GtkBoxChild.fill and
* #GtkBoxChild.pack fields.
*/
class BoxChild {
static $gtype: GObject.GType<BoxChild>;
// Fields
widget: Widget;
padding: number;
expand: number;
fill: number;
pack: number;
is_secondary: number;
// Constructors
_init(...args: any[]): void;
}
type BoxClass = typeof Box;
type BuildableIface = typeof Buildable;
type BuilderClass = typeof Builder;
abstract class BuilderPrivate {
static $gtype: GObject.GType<BuilderPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ButtonBoxClass = typeof ButtonBox;
type ButtonClass = typeof Button;
class CListCellInfo {
static $gtype: GObject.GType<CListCellInfo>;
// Fields
row: number;
column: number;
// Constructors
constructor(
properties?: Partial<{
row: number;
column: number;
}>,
);
_init(...args: any[]): void;
}
type CListClass = typeof CList;
class CListColumn {
static $gtype: GObject.GType<CListColumn>;
// Fields
title: string;
area: Gdk.Rectangle;
button: Widget;
window: Gdk.Window;
width: number;
min_width: number;
max_width: number;
justification: Justification;
visible: number;
width_set: number;
resizeable: number;
auto_resize: number;
button_passive: number;
// Constructors
_init(...args: any[]): void;
}
class CListDestInfo {
static $gtype: GObject.GType<CListDestInfo>;
// Fields
cell: CListCellInfo;
insert_pos: CListDragPos;
// Constructors
_init(...args: any[]): void;
}
class CListRow {
static $gtype: GObject.GType<CListRow>;
// Fields
state: StateType;
foreground: Gdk.Color;
background: Gdk.Color;
style: Style;
data: any;
destroy: GLib.DestroyNotify;
fg_set: number;
bg_set: number;
selectable: number;
// Constructors
_init(...args: any[]): void;
}
type CTreeClass = typeof CTree;
class CTreeNode {
static $gtype: GObject.GType<CTreeNode>;
// Fields
list: any[];
// Constructors
constructor(
properties?: Partial<{
list: any[];
}>,
);
_init(...args: any[]): void;
}
class CTreeRow {
static $gtype: GObject.GType<CTreeRow>;
// Fields
sibling: CTreeNode;
children: CTreeNode;
pixmap_closed: Gdk.Pixmap;
pixmap_opened: Gdk.Pixmap;
level: number;
is_leaf: number;
expanded: number;
// Constructors
_init(...args: any[]): void;
}
type CalendarClass = typeof Calendar;
abstract class CalendarPrivate {
static $gtype: GObject.GType<CalendarPrivate>;
// Constructors
_init(...args: any[]): void;
}
class Cell {
static $gtype: GObject.GType<Cell>;
// Fields
type: CellType;
vertical: number;
horizontal: number;
style: Style;
// Constructors
_init(...args: any[]): void;
}
type CellEditableIface = typeof CellEditable;
type CellLayoutIface = typeof CellLayout;
class CellPixText {
static $gtype: GObject.GType<CellPixText>;
// Fields
type: CellType;
vertical: number;
horizontal: number;
style: Style;
text: string;
spacing: number;
pixmap: Gdk.Pixmap;
// Constructors
_init(...args: any[]): void;
}
class CellPixmap {
static $gtype: GObject.GType<CellPixmap>;
// Fields
type: CellType;
vertical: number;
horizontal: number;
style: Style;
pixmap: Gdk.Pixmap;
// Constructors
_init(...args: any[]): void;
}
type CellRendererAccelClass = typeof CellRendererAccel;
type CellRendererClass = typeof CellRenderer;
type CellRendererComboClass = typeof CellRendererCombo;
type CellRendererPixbufClass = typeof CellRendererPixbuf;
type CellRendererProgressClass = typeof CellRendererProgress;
abstract class CellRendererProgressPrivate {
static $gtype: GObject.GType<CellRendererProgressPrivate>;
// Constructors
_init(...args: any[]): void;
}
type CellRendererSpinClass = typeof CellRendererSpin;
abstract class CellRendererSpinPrivate {
static $gtype: GObject.GType<CellRendererSpinPrivate>;
// Constructors
_init(...args: any[]): void;
}
type CellRendererSpinnerClass = typeof CellRendererSpinner;
abstract class CellRendererSpinnerPrivate {
static $gtype: GObject.GType<CellRendererSpinnerPrivate>;
// Constructors
_init(...args: any[]): void;
}
type CellRendererTextClass = typeof CellRendererText;
type CellRendererToggleClass = typeof CellRendererToggle;
class CellText {
static $gtype: GObject.GType<CellText>;
// Fields
type: CellType;
vertical: number;
horizontal: number;
style: Style;
text: string;
// Constructors
_init(...args: any[]): void;
}
type CellViewClass = typeof CellView;
abstract class CellViewPrivate {
static $gtype: GObject.GType<CellViewPrivate>;
// Constructors
_init(...args: any[]): void;
}
class CellWidget {
static $gtype: GObject.GType<CellWidget>;
// Fields
type: CellType;
vertical: number;
horizontal: number;
style: Style;
widget: Widget;
// Constructors
_init(...args: any[]): void;
}
type CheckButtonClass = typeof CheckButton;
type CheckMenuItemClass = typeof CheckMenuItem;
type ColorButtonClass = typeof ColorButton;
abstract class ColorButtonPrivate {
static $gtype: GObject.GType<ColorButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ColorSelectionClass = typeof ColorSelection;
type ColorSelectionDialogClass = typeof ColorSelectionDialog;
type ComboBoxClass = typeof ComboBox;
type ComboBoxEntryClass = typeof ComboBoxEntry;
abstract class ComboBoxEntryPrivate {
static $gtype: GObject.GType<ComboBoxEntryPrivate>;
// Constructors
_init(...args: any[]): void;
}
abstract class ComboBoxPrivate {
static $gtype: GObject.GType<ComboBoxPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ComboBoxTextClass = typeof ComboBoxText;
abstract class ComboBoxTextPrivate {
static $gtype: GObject.GType<ComboBoxTextPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ComboClass = typeof Combo;
type ContainerClass = typeof Container;
type CurveClass = typeof Curve;
type DialogClass = typeof Dialog;
type DrawingAreaClass = typeof DrawingArea;
class EditableClass {
static $gtype: GObject.GType<EditableClass>;
// Constructors
_init(...args: any[]): void;
}
type EntryBufferClass = typeof EntryBuffer;
abstract class EntryBufferPrivate {
static $gtype: GObject.GType<EntryBufferPrivate>;
// Constructors
_init(...args: any[]): void;
}
type EntryClass = typeof Entry;
type EntryCompletionClass = typeof EntryCompletion;
abstract class EntryCompletionPrivate {
static $gtype: GObject.GType<EntryCompletionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type EventBoxClass = typeof EventBox;
type ExpanderClass = typeof Expander;
abstract class ExpanderPrivate {
static $gtype: GObject.GType<ExpanderPrivate>;
// Constructors
_init(...args: any[]): void;
}
type FileChooserButtonClass = typeof FileChooserButton;
abstract class FileChooserButtonPrivate {
static $gtype: GObject.GType<FileChooserButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type FileChooserDialogClass = typeof FileChooserDialog;
abstract class FileChooserDialogPrivate {
static $gtype: GObject.GType<FileChooserDialogPrivate>;
// Constructors
_init(...args: any[]): void;
}
type FileChooserWidgetClass = typeof FileChooserWidget;
abstract class FileChooserWidgetPrivate {
static $gtype: GObject.GType<FileChooserWidgetPrivate>;
// Constructors
_init(...args: any[]): void;
}
class FileFilterInfo {
static $gtype: GObject.GType<FileFilterInfo>;
// Fields
contains: FileFilterFlags;
filename: string;
uri: string;
display_name: string;
mime_type: string;
// Constructors
_init(...args: any[]): void;
}
type FileSelectionClass = typeof FileSelection;
class FixedChild {
static $gtype: GObject.GType<FixedChild>;
// Fields
widget: Widget;
x: number;
y: number;
// Constructors
_init(...args: any[]): void;
}
type FixedClass = typeof Fixed;
type FontButtonClass = typeof FontButton;
abstract class FontButtonPrivate {
static $gtype: GObject.GType<FontButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type FontSelectionClass = typeof FontSelection;
type FontSelectionDialogClass = typeof FontSelectionDialog;
type FrameClass = typeof Frame;
type GammaCurveClass = typeof GammaCurve;
type HBoxClass = typeof HBox;
type HButtonBoxClass = typeof HButtonBox;
type HPanedClass = typeof HPaned;
type HRulerClass = typeof HRuler;
type HSVClass = typeof HSV;
type HScaleClass = typeof HScale;
type HScrollbarClass = typeof HScrollbar;
type HSeparatorClass = typeof HSeparator;
type HandleBoxClass = typeof HandleBox;
type IMContextClass = typeof IMContext;
/**
* Bookkeeping information about a loadable input method.
*/
class IMContextInfo {
static $gtype: GObject.GType<IMContextInfo>;
// Fields
context_id: string;
context_name: string;
domain: string;
domain_dirname: string;
default_locales: string;
// Constructors
constructor(
properties?: Partial<{
context_id: string;
context_name: string;
domain: string;
domain_dirname: string;
default_locales: string;
}>,
);
_init(...args: any[]): void;
}
type IMContextSimpleClass = typeof IMContextSimple;
type IMMulticontextClass = typeof IMMulticontext;
abstract class IMMulticontextPrivate {
static $gtype: GObject.GType<IMMulticontextPrivate>;
// Constructors
_init(...args: any[]): void;
}
type IconFactoryClass = typeof IconFactory;
class IconInfo {
static $gtype: GObject.GType<IconInfo>;
// Constructors
constructor(icon_theme: IconTheme, pixbuf: GdkPixbuf.Pixbuf);
_init(...args: any[]): void;
static new_for_pixbuf(icon_theme: IconTheme, pixbuf: GdkPixbuf.Pixbuf): IconInfo;
// Methods
/**
* Make a copy of a #GtkIconInfo.
* @returns the new GtkIconInfo
*/
copy(): IconInfo;
/**
* Free a #GtkIconInfo and associated information
*/
free(): void;
/**
* Fetches the set of attach points for an icon. An attach point
* is a location in the icon that can be used as anchor points for attaching
* emblems or overlays to the icon.
* @returns %TRUE if there are any attach points for the icon.
*/
get_attach_points(): [boolean, Gdk.Point[] | null];
/**
* Gets the base size for the icon. The base size
* is a size for the icon that was specified by
* the icon theme creator. This may be different
* than the actual size of image; an example of
* this is small emblem icons that can be attached
* to a larger icon. These icons will be given
* the same base size as the larger icons to which
* they are attached.
* @returns the base size, or 0, if no base size is known for the icon.
*/
get_base_size(): number;
/**
* Gets the built-in image for this icon, if any. To allow
* GTK+ to use built in icon images, you must pass the
* %GTK_ICON_LOOKUP_USE_BUILTIN to
* gtk_icon_theme_lookup_icon().
* @returns the built-in image pixbuf, or %NULL. No extra reference is added to the returned pixbuf, so if you want to keep it around, you must use g_object_ref(). The returned image must not be modified.
*/
get_builtin_pixbuf(): GdkPixbuf.Pixbuf;
/**
* Gets the display name for an icon. A display name is a
* string to be used in place of the icon name in a user
* visible context like a list of icons.
* @returns the display name for the icon or %NULL, if the icon doesn't have a specified display name. This value is owned @icon_info and must not be modified or free.
*/
get_display_name(): string;
/**
* Gets the coordinates of a rectangle within the icon
* that can be used for display of information such
* as a preview of the contents of a text file.
* See gtk_icon_info_set_raw_coordinates() for further
* information about the coordinate system.
* @returns %TRUE if the icon has an embedded rectangle
*/
get_embedded_rect(): [boolean, Gdk.Rectangle];
/**
* Gets the filename for the icon. If the
* %GTK_ICON_LOOKUP_USE_BUILTIN flag was passed
* to gtk_icon_theme_lookup_icon(), there may be
* no filename if a builtin icon is returned; in this
* case, you should use gtk_icon_info_get_builtin_pixbuf().
* @returns the filename for the icon, or %NULL if gtk_icon_info_get_builtin_pixbuf() should be used instead. The return value is owned by GTK+ and should not be modified or freed.
*/
get_filename(): string;
/**
* Renders an icon previously looked up in an icon theme using
* gtk_icon_theme_lookup_icon(); the size will be based on the size
* passed to gtk_icon_theme_lookup_icon(). Note that the resulting
* pixbuf may not be exactly this size; an icon theme may have icons
* that differ slightly from their nominal sizes, and in addition GTK+
* will avoid scaling icons that it considers sufficiently close to the
* requested size or for which the source image would have to be scaled
* up too far. (This maintains sharpness.). This behaviour can be changed
* by passing the %GTK_ICON_LOOKUP_FORCE_SIZE flag when obtaining
* the #GtkIconInfo. If this flag has been specified, the pixbuf
* returned by this function will be scaled to the exact size.
* @returns the rendered icon; this may be a newly created icon or a new reference to an internal icon, so you must not modify the icon. Use g_object_unref() to release your reference to the icon.
*/
load_icon(): GdkPixbuf.Pixbuf;
/**
* Sets whether the coordinates returned by gtk_icon_info_get_embedded_rect()
* and gtk_icon_info_get_attach_points() should be returned in their
* original form as specified in the icon theme, instead of scaled
* appropriately for the pixbuf returned by gtk_icon_info_load_icon().
*
* Raw coordinates are somewhat strange; they are specified to be with
* respect to the unscaled pixmap for PNG and XPM icons, but for SVG
* icons, they are in a 1000x1000 coordinate space that is scaled
* to the final size of the icon. You can determine if the icon is an SVG
* icon by using gtk_icon_info_get_filename(), and seeing if it is non-%NULL
* and ends in '.svg'.
*
* This function is provided primarily to allow compatibility wrappers
* for older API's, and is not expected to be useful for applications.
* @param raw_coordinates whether the coordinates of embedded rectangles and attached points should be returned in their original (unscaled) form.
*/
set_raw_coordinates(raw_coordinates: boolean): void;
}
class IconSet {
static $gtype: GObject.GType<IconSet>;
// Constructors
constructor(properties?: Partial<{}>);
_init(...args: any[]): void;
static ['new'](): IconSet;
static new_from_pixbuf(pixbuf: GdkPixbuf.Pixbuf): IconSet;
// Methods
/**
* Icon sets have a list of #GtkIconSource, which they use as base
* icons for rendering icons in different states and sizes. Icons are
* scaled, made to look insensitive, etc. in
* gtk_icon_set_render_icon(), but #GtkIconSet needs base images to
* work with. The base images and when to use them are described by
* a #GtkIconSource.
*
* This function copies `source,` so you can reuse the same source immediately
* without affecting the icon set.
*
* An example of when you'd use this function: a web browser's "Back
* to Previous Page" icon might point in a different direction in
* Hebrew and in English; it might look different when insensitive;
* and it might change size depending on toolbar mode (small/large
* icons). So a single icon set would contain all those variants of
* the icon, and you might add a separate source for each one.
*
* You should nearly always add a "default" icon source with all
* fields wildcarded, which will be used as a fallback if no more
* specific source matches. #GtkIconSet always prefers more specific
* icon sources to more generic icon sources. The order in which you
* add the sources to the icon set does not matter.
*
* gtk_icon_set_new_from_pixbuf() creates a new icon set with a
* default icon source based on the given pixbuf.
* @param source a #GtkIconSource
*/
add_source(source: IconSource): void;
/**
* Copies `icon_set` by value.
* @returns a new #GtkIconSet identical to the first.
*/
copy(): IconSet;
/**
* Obtains a list of icon sizes this icon set can render. The returned
* array must be freed with g_free().
*/
get_sizes(): number[];
/**
* Increments the reference count on `icon_set`.
* @returns @icon_set.
*/
ref(): IconSet;
/**
* Renders an icon using gtk_style_render_icon(). In most cases,
* gtk_widget_render_icon() is better, since it automatically provides
* most of the arguments from the current widget settings. This
* function never returns %NULL; if the icon can't be rendered
* (perhaps because an image file fails to load), a default "missing
* image" icon will be returned instead.
* @param style a #GtkStyle associated with @widget, or %NULL
* @param direction text direction
* @param state widget state
* @param size icon size. A size of (GtkIconSize)-1 means render at the size of the source and don't scale.
* @param widget widget that will display the icon, or %NULL. The only use that is typically made of this is to determine the appropriate #GdkScreen.
* @param detail detail to pass to the theme engine, or %NULL. Note that passing a detail of anything but %NULL will disable caching.
* @returns a #GdkPixbuf to be displayed
*/
render_icon(
style: Style | null,
direction: TextDirection | null,
state: StateType | null,
size: number,
widget?: Widget | null,
detail?: string | null,
): GdkPixbuf.Pixbuf;
/**
* Decrements the reference count on `icon_set,` and frees memory
* if the reference count reaches 0.
*/
unref(): void;
}
class IconSource {
static $gtype: GObject.GType<IconSource>;
// Constructors
constructor(properties?: Partial<{}>);
_init(...args: any[]): void;
static ['new'](): IconSource;
// Methods
/**
* Creates a copy of `source;` mostly useful for language bindings.
* @returns a new #GtkIconSource
*/
copy(): IconSource;
/**
* Frees a dynamically-allocated icon source, along with its
* filename, size, and pixbuf fields if those are not %NULL.
*/
free(): void;
/**
* Obtains the text direction this icon source applies to. The return
* value is only useful/meaningful if the text direction is <emphasis>not</emphasis>
* wildcarded.
* @returns text direction this source matches
*/
get_direction(): TextDirection;
/**
* Gets the value set by gtk_icon_source_set_direction_wildcarded().
* @returns %TRUE if this icon source is a base for any text direction variant
*/
get_direction_wildcarded(): boolean;
/**
* Retrieves the source filename, or %NULL if none is set. The
* filename is not a copy, and should not be modified or expected to
* persist beyond the lifetime of the icon source.
* @returns image filename. This string must not be modified or freed.
*/
get_filename(): string;
/**
* Retrieves the source icon name, or %NULL if none is set. The
* icon_name is not a copy, and should not be modified or expected to
* persist beyond the lifetime of the icon source.
* @returns icon name. This string must not be modified or freed.
*/
get_icon_name(): string;
/**
* Retrieves the source pixbuf, or %NULL if none is set.
* In addition, if a filename source is in use, this
* function in some cases will return the pixbuf from
* loaded from the filename. This is, for example, true
* for the GtkIconSource passed to the GtkStyle::render_icon()
* virtual function. The reference count on the pixbuf is
* not incremented.
* @returns source pixbuf
*/
get_pixbuf(): GdkPixbuf.Pixbuf;
/**
* Obtains the icon size this source applies to. The return value
* is only useful/meaningful if the icon size is <emphasis>not</emphasis> wildcarded.
* @returns icon size this source matches.
*/
get_size(): number;
/**
* Gets the value set by gtk_icon_source_set_size_wildcarded().
* @returns %TRUE if this icon source is a base for any icon size variant
*/
get_size_wildcarded(): boolean;
/**
* Obtains the widget state this icon source applies to. The return
* value is only useful/meaningful if the widget state is <emphasis>not</emphasis>
* wildcarded.
* @returns widget state this source matches
*/
get_state(): StateType;
/**
* Gets the value set by gtk_icon_source_set_state_wildcarded().
* @returns %TRUE if this icon source is a base for any widget state variant
*/
get_state_wildcarded(): boolean;
/**
* Sets the text direction this icon source is intended to be used
* with.
*
* Setting the text direction on an icon source makes no difference
* if the text direction is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
* in addition to calling this function.
* @param direction text direction this source applies to
*/
set_direction(direction: TextDirection | null): void;
/**
* If the text direction is wildcarded, this source can be used
* as the base image for an icon in any #GtkTextDirection.
* If the text direction is not wildcarded, then the
* text direction the icon source applies to should be set
* with gtk_icon_source_set_direction(), and the icon source
* will only be used with that text direction.
*
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
* wildcarded sources, and will use an exact match when possible.
* @param setting %TRUE to wildcard the text direction
*/
set_direction_wildcarded(setting: boolean): void;
/**
* Sets the name of an image file to use as a base image when creating
* icon variants for #GtkIconSet. The filename must be absolute.
* @param filename image file to use
*/
set_filename(filename: string): void;
/**
* Sets the name of an icon to look up in the current icon theme
* to use as a base image when creating icon variants for #GtkIconSet.
* @param icon_name name of icon to use
*/
set_icon_name(icon_name?: string | null): void;
/**
* Sets a pixbuf to use as a base image when creating icon variants
* for #GtkIconSet.
* @param pixbuf pixbuf to use as a source
*/
set_pixbuf(pixbuf: GdkPixbuf.Pixbuf): void;
/**
* Sets the icon size this icon source is intended to be used
* with.
*
* Setting the icon size on an icon source makes no difference
* if the size is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_size_wildcarded() to un-wildcard it
* in addition to calling this function.
* @param size icon size this source applies to
*/
set_size(size: number): void;
/**
* If the icon size is wildcarded, this source can be used as the base
* image for an icon of any size. If the size is not wildcarded, then
* the size the source applies to should be set with
* gtk_icon_source_set_size() and the icon source will only be used
* with that specific size.
*
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
* wildcarded sources, and will use an exact match when possible.
*
* #GtkIconSet will normally scale wildcarded source images to produce
* an appropriate icon at a given size, but will not change the size
* of source images that match exactly.
* @param setting %TRUE to wildcard the widget state
*/
set_size_wildcarded(setting: boolean): void;
/**
* Sets the widget state this icon source is intended to be used
* with.
*
* Setting the widget state on an icon source makes no difference
* if the state is wildcarded. Therefore, you should usually
* call gtk_icon_source_set_state_wildcarded() to un-wildcard it
* in addition to calling this function.
* @param state widget state this source applies to
*/
set_state(state: StateType | null): void;
/**
* If the widget state is wildcarded, this source can be used as the
* base image for an icon in any #GtkStateType. If the widget state
* is not wildcarded, then the state the source applies to should be
* set with gtk_icon_source_set_state() and the icon source will
* only be used with that specific state.
*
* #GtkIconSet prefers non-wildcarded sources (exact matches) over
* wildcarded sources, and will use an exact match when possible.
*
* #GtkIconSet will normally transform wildcarded source images to
* produce an appropriate icon for a given state, for example
* lightening an image on prelight, but will not modify source images
* that match exactly.
* @param setting %TRUE to wildcard the widget state
*/
set_state_wildcarded(setting: boolean): void;
}
type IconThemeClass = typeof IconTheme;
abstract class IconThemePrivate {
static $gtype: GObject.GType<IconThemePrivate>;
// Constructors
_init(...args: any[]): void;
}
type IconViewClass = typeof IconView;
abstract class IconViewPrivate {
static $gtype: GObject.GType<IconViewPrivate>;
// Constructors
_init(...args: any[]): void;
}
class ImageAnimationData {
static $gtype: GObject.GType<ImageAnimationData>;
// Fields
anim: GdkPixbuf.PixbufAnimation;
iter: GdkPixbuf.PixbufAnimationIter;
frame_timeout: number;
// Constructors
_init(...args: any[]): void;
}
type ImageClass = typeof Image;
class ImageGIconData {
static $gtype: GObject.GType<ImageGIconData>;
// Fields
icon: Gio.Icon;
pixbuf: GdkPixbuf.Pixbuf;
theme_change_id: number;
// Constructors
_init(...args: any[]): void;
}
class ImageIconNameData {
static $gtype: GObject.GType<ImageIconNameData>;
// Fields
icon_name: string;
pixbuf: GdkPixbuf.Pixbuf;
theme_change_id: number;
// Constructors
_init(...args: any[]): void;
}
class ImageIconSetData {
static $gtype: GObject.GType<ImageIconSetData>;
// Constructors
_init(...args: any[]): void;
}
class ImageImageData {
static $gtype: GObject.GType<ImageImageData>;
// Fields
image: Gdk.Image;
// Constructors
_init(...args: any[]): void;
}
type ImageMenuItemClass = typeof ImageMenuItem;
class ImagePixbufData {
static $gtype: GObject.GType<ImagePixbufData>;
// Fields
pixbuf: GdkPixbuf.Pixbuf;
// Constructors
_init(...args: any[]): void;
}
class ImagePixmapData {
static $gtype: GObject.GType<ImagePixmapData>;
// Fields
pixmap: Gdk.Pixmap;
// Constructors
_init(...args: any[]): void;
}
class ImageStockData {
static $gtype: GObject.GType<ImageStockData>;
// Fields
stock_id: string;
// Constructors
constructor(
properties?: Partial<{
stock_id: string;
}>,
);
_init(...args: any[]): void;
}
type InfoBarClass = typeof InfoBar;
abstract class InfoBarPrivate {
static $gtype: GObject.GType<InfoBarPrivate>;
// Constructors
_init(...args: any[]): void;
}
type InputDialogClass = typeof InputDialog;
type InvisibleClass = typeof Invisible;
type ItemClass = typeof Item;
type ItemFactoryClass = typeof ItemFactory;
class ItemFactoryEntry {
static $gtype: GObject.GType<ItemFactoryEntry>;
// Fields
path: string;
accelerator: string;
callback: ItemFactoryCallback;
callback_action: number;
item_type: string;
extra_data: any;
// Constructors
_init(...args: any[]): void;
}
class ItemFactoryItem {
static $gtype: GObject.GType<ItemFactoryItem>;
// Fields
path: string;
widgets: any[];
// Constructors
constructor(
properties?: Partial<{
path: string;
}>,
);
_init(...args: any[]): void;
}
type LabelClass = typeof Label;
abstract class LabelSelectionInfo {
static $gtype: GObject.GType<LabelSelectionInfo>;
// Constructors
_init(...args: any[]): void;
}
type LayoutClass = typeof Layout;
type LinkButtonClass = typeof LinkButton;
abstract class LinkButtonPrivate {
static $gtype: GObject.GType<LinkButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ListClass = typeof List;
type ListItemClass = typeof ListItem;
type ListStoreClass = typeof ListStore;
type MenuBarClass = typeof MenuBar;
type MenuClass = typeof Menu;
class MenuEntry {
static $gtype: GObject.GType<MenuEntry>;
// Fields
path: string;
accelerator: string;
callback: MenuCallback;
callback_data: any;
widget: Widget;
// Constructors
_init(...args: any[]): void;
}
type MenuItemClass = typeof MenuItem;
type MenuShellClass = typeof MenuShell;
type MenuToolButtonClass = typeof MenuToolButton;
abstract class MenuToolButtonPrivate {
static $gtype: GObject.GType<MenuToolButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type MessageDialogClass = typeof MessageDialog;
type MiscClass = typeof Misc;
type MountOperationClass = typeof MountOperation;
abstract class MountOperationPrivate {
static $gtype: GObject.GType<MountOperationPrivate>;
// Constructors
_init(...args: any[]): void;
}
type NotebookClass = typeof Notebook;
abstract class NotebookPage {
static $gtype: GObject.GType<NotebookPage>;
// Constructors
_init(...args: any[]): void;
}
type ObjectClass = typeof Object;
type OffscreenWindowClass = typeof OffscreenWindow;
type OldEditableClass = typeof OldEditable;
type OptionMenuClass = typeof OptionMenu;
type OrientableIface = typeof Orientable;
class PageRange {
static $gtype: GObject.GType<PageRange>;
// Fields
start: number;
end: number;
// Constructors
constructor(
properties?: Partial<{
start: number;
end: number;
}>,
);
_init(...args: any[]): void;
}
type PanedClass = typeof Paned;
abstract class PanedPrivate {
static $gtype: GObject.GType<PanedPrivate>;
// Constructors
_init(...args: any[]): void;
}
class PaperSize {
static $gtype: GObject.GType<PaperSize>;
// Constructors
constructor(name?: string | null);
_init(...args: any[]): void;
static ['new'](name?: string | null): PaperSize;
static new_custom(name: string, display_name: string, width: number, height: number, unit: Unit): PaperSize;
static new_from_key_file(key_file: GLib.KeyFile, group_name: string): PaperSize;
static new_from_ppd(ppd_name: string, ppd_display_name: string, width: number, height: number): PaperSize;
// Static methods
/**
* Returns the name of the default paper size, which
* depends on the current locale.
*/
static get_default(): string;
/**
* Creates a list of known paper sizes.
* @param include_custom whether to include custom paper sizes as defined in the page setup dialog
*/
static get_paper_sizes(include_custom: boolean): PaperSize[];
// Methods
/**
* Copies an existing #GtkPaperSize.
* @returns a copy of @other
*/
copy(): PaperSize;
/**
* Free the given #GtkPaperSize object.
*/
free(): void;
/**
* Gets the default bottom margin for the #GtkPaperSize.
* @param unit the unit for the return value
* @returns the default bottom margin
*/
get_default_bottom_margin(unit: Unit | null): number;
/**
* Gets the default left margin for the #GtkPaperSize.
* @param unit the unit for the return value
* @returns the default left margin
*/
get_default_left_margin(unit: Unit | null): number;
/**
* Gets the default right margin for the #GtkPaperSize.
* @param unit the unit for the return value
* @returns the default right margin
*/
get_default_right_margin(unit: Unit | null): number;
/**
* Gets the default top margin for the #GtkPaperSize.
* @param unit the unit for the return value
* @returns the default top margin
*/
get_default_top_margin(unit: Unit | null): number;
/**
* Gets the human-readable name of the #GtkPaperSize.
* @returns the human-readable name of @size
*/
get_display_name(): string;
/**
* Gets the paper height of the #GtkPaperSize, in
* units of `unit`.
* @param unit the unit for the return value
* @returns the paper height
*/
get_height(unit: Unit | null): number;
/**
* Gets the name of the #GtkPaperSize.
* @returns the name of @size
*/
get_name(): string;
/**
* Gets the PPD name of the #GtkPaperSize, which
* may be %NULL.
* @returns the PPD name of @size
*/
get_ppd_name(): string;
/**
* Gets the paper width of the #GtkPaperSize, in
* units of `unit`.
* @param unit the unit for the return value
* @returns the paper width
*/
get_width(unit: Unit | null): number;
/**
* Returns %TRUE if `size` is not a standard paper size.
* @returns whether @size is a custom paper size.
*/
is_custom(): boolean;
/**
* Compares two #GtkPaperSize objects.
* @param size2 another #GtkPaperSize object
* @returns %TRUE, if @size1 and @size2 represent the same paper size
*/
is_equal(size2: PaperSize): boolean;
/**
* Changes the dimensions of a `size` to `width` x `height`.
* @param width the new width in units of @unit
* @param height the new height in units of @unit
* @param unit the unit for @width and @height
*/
set_size(width: number, height: number, unit: Unit | null): void;
/**
* This function adds the paper size from `size` to `key_file`.
* @param key_file the #GKeyFile to save the paper size to
* @param group_name the group to add the settings to in @key_file
*/
to_key_file(key_file: GLib.KeyFile, group_name: string): void;
}
type PixmapClass = typeof Pixmap;
type PlugClass = typeof Plug;
type PreviewClass = typeof Preview;
class PreviewInfo {
static $gtype: GObject.GType<PreviewInfo>;
// Fields
lookup: number;
gamma: number;
// Constructors
constructor(
properties?: Partial<{
lookup: number;
gamma: number;
}>,
);
_init(...args: any[]): void;
}
type PrintOperationClass = typeof PrintOperation;
type PrintOperationPreviewIface = typeof PrintOperationPreview;
abstract class PrintOperationPrivate {
static $gtype: GObject.GType<PrintOperationPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ProgressBarClass = typeof ProgressBar;
type ProgressClass = typeof Progress;
type RadioActionClass = typeof RadioAction;
class RadioActionEntry {
static $gtype: GObject.GType<RadioActionEntry>;
// Fields
name: string;
stock_id: string;
label: string;
accelerator: string;
tooltip: string;
value: number;
// Constructors
constructor(
properties?: Partial<{
name: string;
stock_id: string;
label: string;
accelerator: string;
tooltip: string;
value: number;
}>,
);
_init(...args: any[]): void;
}
abstract class RadioActionPrivate {
static $gtype: GObject.GType<RadioActionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type RadioButtonClass = typeof RadioButton;
type RadioMenuItemClass = typeof RadioMenuItem;
type RadioToolButtonClass = typeof RadioToolButton;
type RangeClass = typeof Range;
abstract class RangeLayout {
static $gtype: GObject.GType<RangeLayout>;
// Constructors
_init(...args: any[]): void;
}
abstract class RangeStepTimer {
static $gtype: GObject.GType<RangeStepTimer>;
// Constructors
_init(...args: any[]): void;
}
abstract class RcContext {
static $gtype: GObject.GType<RcContext>;
// Constructors
_init(...args: any[]): void;
}
class RcProperty {
static $gtype: GObject.GType<RcProperty>;
// Fields
type_name: GLib.Quark;
property_name: GLib.Quark;
origin: string;
// Constructors
_init(...args: any[]): void;
// Static methods
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses
* borders in the form
* <literal>"{ left, right, top, bottom }"</literal> for integers
* %left, %right, %top and %bottom.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold boxed values.
*/
static parse_border(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses a
* color given either by its name or in the form
* <literal>{ red, green, blue }</literal> where %red, %green and
* %blue are integers between 0 and 65535 or floating-point numbers
* between 0 and 1.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold #GdkColor values.
*/
static parse_color(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses a single
* enumeration value.
*
* The enumeration value can be specified by its name, its nickname or
* its numeric value. For consistency with flags parsing, the value
* may be surrounded by parentheses.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold enum values.
*/
static parse_enum(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses flags.
*
* Flags can be specified by their name, their nickname or
* numerically. Multiple flags can be specified in the form
* <literal>"( flag1 | flag2 | ... )"</literal>.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold flags values.
*/
static parse_flags(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
/**
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
* or gtk_widget_class_install_style_property_parser() which parses a
* requisition in the form
* <literal>"{ width, height }"</literal> for integers %width and %height.
* @param pspec a #GParamSpec
* @param gstring the #GString to be parsed
* @param property_value a #GValue which must hold boxed values.
*/
static parse_requisition(
pspec: GObject.ParamSpec,
gstring: GLib.String,
property_value: GObject.Value | any,
): boolean;
}
type RcStyleClass = typeof RcStyle;
type RecentActionClass = typeof RecentAction;
abstract class RecentActionPrivate {
static $gtype: GObject.GType<RecentActionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type RecentChooserDialogClass = typeof RecentChooserDialog;
abstract class RecentChooserDialogPrivate {
static $gtype: GObject.GType<RecentChooserDialogPrivate>;
// Constructors
_init(...args: any[]): void;
}
type RecentChooserIface = typeof RecentChooser;
type RecentChooserMenuClass = typeof RecentChooserMenu;
abstract class RecentChooserMenuPrivate {
static $gtype: GObject.GType<RecentChooserMenuPrivate>;
// Constructors
_init(...args: any[]): void;
}
type RecentChooserWidgetClass = typeof RecentChooserWidget;
abstract class RecentChooserWidgetPrivate {
static $gtype: GObject.GType<RecentChooserWidgetPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Meta-data to be passed to gtk_recent_manager_add_full() when
* registering a recently used resource.
*/
class RecentData {
static $gtype: GObject.GType<RecentData>;
// Fields
display_name: string;
description: string;
mime_type: string;
app_name: string;
app_exec: string;
groups: string;
is_private: boolean;
// Constructors
constructor(
properties?: Partial<{
display_name: string;
description: string;
mime_type: string;
app_name: string;
app_exec: string;
groups: string;
is_private: boolean;
}>,
);
_init(...args: any[]): void;
}
class RecentFilterInfo {
static $gtype: GObject.GType<RecentFilterInfo>;
// Fields
contains: RecentFilterFlags;
uri: string;
display_name: string;
mime_type: string;
applications: string;
groups: string;
age: number;
// Constructors
_init(...args: any[]): void;
}
abstract class RecentInfo {
static $gtype: GObject.GType<RecentInfo>;
// Constructors
_init(...args: any[]): void;
// Methods
/**
* Checks whether the resource pointed by `info` still exists. At
* the moment this check is done only on resources pointing to local files.
* @returns %TRUE if the resource exists
*/
exists(): boolean;
/**
* Gets the timestamp (seconds from system's Epoch) when the resource
* was added to the recently used resources list.
* @returns the number of seconds elapsed from system's Epoch when the resource was added to the list, or -1 on failure.
*/
get_added(): never;
/**
* Gets the number of days elapsed since the last update of the resource
* pointed by `info`.
* @returns a positive integer containing the number of days elapsed since the time this resource was last modified.
*/
get_age(): number;
/**
* Gets the data regarding the application that has registered the resource
* pointed by `info`.
*
* If the command line contains any escape characters defined inside the
* storage specification, they will be expanded.
* @param app_name the name of the application that has registered this item
* @returns %TRUE if an application with @app_name has registered this resource inside the recently used list, or %FALSE otherwise. The @app_exec string is owned by the #GtkRecentInfo and should not be modified or freed
*/
get_application_info(app_name: string): [boolean, string, number, never];
/**
* Retrieves the list of applications that have registered this resource.
* @returns a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it.
*/
get_applications(): string[];
/**
* Gets the (short) description of the resource.
* @returns the description of the resource. The returned string is owned by the recent manager, and should not be freed.
*/
get_description(): string;
/**
* Gets the name of the resource. If none has been defined, the basename
* of the resource is obtained.
* @returns the display name of the resource. The returned string is owned by the recent manager, and should not be freed.
*/
get_display_name(): string;
/**
* Returns all groups registered for the recently used item `info`. The
* array of returned group names will be %NULL terminated, so length might
* optionally be %NULL.
* @returns a newly allocated %NULL terminated array of strings. Use g_strfreev() to free it.
*/
get_groups(): string[];
/**
* Retrieves the icon of size `size` associated to the resource MIME type.
* @param size the size of the icon in pixels
* @returns a #GdkPixbuf containing the icon, or %NULL. Use g_object_unref() when finished using the icon.
*/
get_icon(size: number): GdkPixbuf.Pixbuf;
/**
* Gets the MIME type of the resource.
* @returns the MIME type of the resource. The returned string is owned by the recent manager, and should not be freed.
*/
get_mime_type(): string;
/**
* Gets the timestamp (seconds from system's Epoch) when the resource
* was last modified.
* @returns the number of seconds elapsed from system's Epoch when the resource was last modified, or -1 on failure.
*/
get_modified(): never;
/**
* Gets the value of the "private" flag. Resources in the recently used
* list that have this flag set to %TRUE should only be displayed by the
* applications that have registered them.
* @returns %TRUE if the private flag was found, %FALSE otherwise.
*/
get_private_hint(): boolean;
/**
* Computes a valid UTF-8 string that can be used as the name of the item in a
* menu or list. For example, calling this function on an item that refers to
* "file:///foo/bar.txt" will yield "bar.txt".
* @returns A newly-allocated string in UTF-8 encoding; free it with g_free().
*/
get_short_name(): string;
/**
* Gets the URI of the resource.
* @returns the URI of the resource. The returned string is owned by the recent manager, and should not be freed.
*/
get_uri(): string;
/**
* Gets a displayable version of the resource's URI. If the resource
* is local, it returns a local path; if the resource is not local,
* it returns the UTF-8 encoded content of gtk_recent_info_get_uri().
* @returns a newly allocated UTF-8 string containing the resource's URI or %NULL. Use g_free() when done using it.
*/
get_uri_display(): string;
/**
* Gets the timestamp (seconds from system's Epoch) when the resource
* was last visited.
* @returns the number of seconds elapsed from system's Epoch when the resource was last visited, or -1 on failure.
*/
get_visited(): never;
/**
* Checks whether an application registered this resource using `app_name`.
* @param app_name a string containing an application name
* @returns %TRUE if an application with name @app_name was found, %FALSE otherwise.
*/
has_application(app_name: string): boolean;
/**
* Checks whether `group_name` appears inside the groups registered for the
* recently used item `info`.
* @param group_name name of a group
* @returns %TRUE if the group was found.
*/
has_group(group_name: string): boolean;
/**
* Checks whether the resource is local or not by looking at the
* scheme of its URI.
* @returns %TRUE if the resource is local.
*/
is_local(): boolean;
/**
* Gets the name of the last application that have registered the
* recently used resource represented by `info`.
* @returns an application name. Use g_free() to free it.
*/
last_application(): string;
/**
* Checks whether two #GtkRecentInfo structures point to the same
* resource.
* @param info_b a #GtkRecentInfo
* @returns %TRUE if both #GtkRecentInfo structures point to se same resource, %FALSE otherwise.
*/
match(info_b: RecentInfo): boolean;
/**
* Increases the reference count of `recent_info` by one.
* @returns the recent info object with its reference count increased by one.
*/
ref(): RecentInfo;
/**
* Decreases the reference count of `info` by one. If the reference
* count reaches zero, `info` is deallocated, and the memory freed.
*/
unref(): void;
}
type RecentManagerClass = typeof RecentManager;
abstract class RecentManagerPrivate {
static $gtype: GObject.GType<RecentManagerPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* A <structname>GtkRequisition</structname> represents the desired size of a widget. See
* <xref linkend="size-requisition"/> for more information.
*/
class Requisition {
static $gtype: GObject.GType<Requisition>;
// Fields
width: number;
height: number;
// Constructors
constructor(
properties?: Partial<{
width: number;
height: number;
}>,
);
_init(...args: any[]): void;
// Methods
/**
* Copies a #GtkRequisition.
* @returns a copy of @requisition
*/
copy(): Requisition;
/**
* Frees a #GtkRequisition.
*/
free(): void;
}
type RulerClass = typeof Ruler;
class RulerMetric {
static $gtype: GObject.GType<RulerMetric>;
// Fields
metric_name: string;
abbrev: string;
pixels_per_unit: number;
ruler_scale: number[];
subdivide: number[];
// Constructors
constructor(
properties?: Partial<{
metric_name: string;
abbrev: string;
pixels_per_unit: number;
ruler_scale: number[];
subdivide: number[];
}>,
);
_init(...args: any[]): void;
}
type ScaleButtonClass = typeof ScaleButton;
abstract class ScaleButtonPrivate {
static $gtype: GObject.GType<ScaleButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ScaleClass = typeof Scale;
type ScrollbarClass = typeof Scrollbar;
type ScrolledWindowClass = typeof ScrolledWindow;
class SelectionData {
static $gtype: GObject.GType<SelectionData>;
// Fields
format: number;
data: number;
length: number;
display: Gdk.Display;
// Constructors
_init(...args: any[]): void;
// Methods
/**
* Makes a copy of a #GtkSelectionData structure and its data.
* @returns a pointer to a copy of @data.
*/
copy(): SelectionData;
/**
* Frees a #GtkSelectionData structure returned from
* gtk_selection_data_copy().
*/
free(): void;
/**
* Retrieves the raw data of the selection.
* @returns the raw data of the selection.
*/
get_data(): number;
/**
* Retrieves the data type of the selection.
* @returns the data type of the selection.
*/
get_data_type(): Gdk.Atom;
/**
* Retrieves the display of the selection.
* @returns the display of the selection.
*/
get_display(): Gdk.Display;
/**
* Retrieves the format of the selection.
* @returns the format of the selection.
*/
get_format(): number;
/**
* Retrieves the length of the raw data of the selection.
* @returns the length of the data of the selection.
*/
get_length(): number;
/**
* Gets the contents of the selection data as a #GdkPixbuf.
* @returns if the selection data contained a recognized image type and it could be converted to a #GdkPixbuf, a newly allocated pixbuf is returned, otherwise %NULL. If the result is non-%NULL it must be freed with g_object_unref().
*/
get_pixbuf(): GdkPixbuf.Pixbuf;
/**
* Retrieves the selection #GdkAtom of the selection data.
* @returns the selection #GdkAtom of the selection data.
*/
get_selection(): Gdk.Atom;
/**
* Retrieves the target of the selection.
* @returns the target of the selection.
*/
get_target(): Gdk.Atom;
/**
* Gets the contents of `selection_data` as an array of targets.
* This can be used to interpret the results of getting
* the standard TARGETS target that is always supplied for
* any selection.
* @returns %TRUE if @selection_data contains a valid array of targets, otherwise %FALSE.
*/
get_targets(): [boolean, Gdk.Atom[]];
/**
* Gets the contents of the selection data as a UTF-8 string.
* @returns if the selection data contained a recognized text type and it could be converted to UTF-8, a newly allocated string containing the converted text, otherwise %NULL. If the result is non-%NULL it must be freed with g_free().
*/
get_text(): number;
/**
* Gets the contents of the selection data as array of URIs.
* @returns if the selection data contains a list of URIs, a newly allocated %NULL-terminated string array containing the URIs, otherwise %NULL. If the result is non-%NULL it must be freed with g_strfreev().
*/
get_uris(): string[];
/**
* Stores new data into a #GtkSelectionData object. Should
* <emphasis>only</emphasis> be called from a selection handler callback.
* Zero-terminates the stored data.
* @param type the type of selection data
* @param format format (number of bits in a unit)
* @param data pointer to the data (will be copied)
*/
set(type: Gdk.Atom, format: number, data: Uint8Array | string): void;
/**
* Sets the contents of the selection from a #GdkPixbuf
* The pixbuf is converted to the form determined by
* `selection_data->`target.
* @param pixbuf a #GdkPixbuf
* @returns %TRUE if the selection was successfully set, otherwise %FALSE.
*/
set_pixbuf(pixbuf: GdkPixbuf.Pixbuf): boolean;
/**
* Sets the contents of the selection from a UTF-8 encoded string.
* The string is converted to the form determined by
* `selection_data->`target.
* @param str a UTF-8 string
* @param len the length of @str, or -1 if @str is nul-terminated.
* @returns %TRUE if the selection was successfully set, otherwise %FALSE.
*/
set_text(str: string, len: number): boolean;
/**
* Sets the contents of the selection from a list of URIs.
* The string is converted to the form determined by
* `selection_data->`target.
* @param uris a %NULL-terminated array of strings holding URIs
* @returns %TRUE if the selection was successfully set, otherwise %FALSE.
*/
set_uris(uris: string[]): boolean;
/**
* Given a #GtkSelectionData object holding a list of targets,
* determines if any of the targets in `targets` can be used to
* provide a #GdkPixbuf.
* @param writable whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format
* @returns %TRUE if @selection_data holds a list of targets, and a suitable target for images is included, otherwise %FALSE.
*/
targets_include_image(writable: boolean): boolean;
/**
* Given a #GtkSelectionData object holding a list of targets,
* determines if any of the targets in `targets` can be used to
* provide rich text.
* @param buffer a #GtkTextBuffer
* @returns %TRUE if @selection_data holds a list of targets, and a suitable target for rich text is included, otherwise %FALSE.
*/
targets_include_rich_text(buffer: TextBuffer): boolean;
/**
* Given a #GtkSelectionData object holding a list of targets,
* determines if any of the targets in `targets` can be used to
* provide text.
* @returns %TRUE if @selection_data holds a list of targets, and a suitable target for text is included, otherwise %FALSE.
*/
targets_include_text(): boolean;
/**
* Given a #GtkSelectionData object holding a list of targets,
* determines if any of the targets in `targets` can be used to
* provide a list or URIs.
* @returns %TRUE if @selection_data holds a list of targets, and a suitable target for URI lists is included, otherwise %FALSE.
*/
targets_include_uri(): boolean;
}
type SeparatorClass = typeof Separator;
type SeparatorMenuItemClass = typeof SeparatorMenuItem;
type SeparatorToolItemClass = typeof SeparatorToolItem;
abstract class SeparatorToolItemPrivate {
static $gtype: GObject.GType<SeparatorToolItemPrivate>;
// Constructors
_init(...args: any[]): void;
}
type SettingsClass = typeof Settings;
abstract class SettingsPropertyValue {
static $gtype: GObject.GType<SettingsPropertyValue>;
// Constructors
_init(...args: any[]): void;
}
class SettingsValue {
static $gtype: GObject.GType<SettingsValue>;
// Fields
origin: string;
// Constructors
_init(...args: any[]): void;
}
type SizeGroupClass = typeof SizeGroup;
type SocketClass = typeof Socket;
type SpinButtonClass = typeof SpinButton;
type SpinnerClass = typeof Spinner;
abstract class SpinnerPrivate {
static $gtype: GObject.GType<SpinnerPrivate>;
// Constructors
_init(...args: any[]): void;
}
type StatusIconClass = typeof StatusIcon;
abstract class StatusIconPrivate {
static $gtype: GObject.GType<StatusIconPrivate>;
// Constructors
_init(...args: any[]): void;
}
type StatusbarClass = typeof Statusbar;
class StockItem {
static $gtype: GObject.GType<StockItem>;
// Fields
stock_id: string;
label: string;
modifier: Gdk.ModifierType;
keyval: number;
translation_domain: string;
// Constructors
_init(...args: any[]): void;
// Methods
/**
* Frees a stock item allocated on the heap, such as one returned by
* gtk_stock_item_copy(). Also frees the fields inside the stock item,
* if they are not %NULL.
*/
free(): void;
}
type StyleClass = typeof Style;
class TableChild {
static $gtype: GObject.GType<TableChild>;
// Fields
widget: Widget;
left_attach: number;
right_attach: number;
top_attach: number;
bottom_attach: number;
xpadding: number;
ypadding: number;
xexpand: number;
yexpand: number;
xshrink: number;
yshrink: number;
xfill: number;
yfill: number;
// Constructors
_init(...args: any[]): void;
}
type TableClass = typeof Table;
class TableRowCol {
static $gtype: GObject.GType<TableRowCol>;
// Fields
requisition: number;
allocation: number;
spacing: number;
need_expand: number;
need_shrink: number;
expand: number;
shrink: number;
empty: number;
// Constructors
constructor(
properties?: Partial<{
requisition: number;
allocation: number;
spacing: number;
need_expand: number;
need_shrink: number;
expand: number;
shrink: number;
empty: number;
}>,
);
_init(...args: any[]): void;
}
class TargetEntry {
static $gtype: GObject.GType<TargetEntry>;
// Fields
target: string;
flags: number;
info: number;
// Constructors
constructor(
properties?: Partial<{
target: string;
flags: number;
info: number;
}>,
);
_init(...args: any[]): void;
}
class TargetList {
static $gtype: GObject.GType<TargetList>;
// Fields
list: any[];
ref_count: number;
// Constructors
constructor(
properties?: Partial<{
ref_count: number;
}>,
);
_init(...args: any[]): void;
static ['new'](targets: TargetEntry[]): TargetList;
// Methods
/**
* Appends another target to a #GtkTargetList.
* @param target the interned atom representing the target
* @param flags the flags for this target
* @param info an ID that will be passed back to the application
*/
add(target: Gdk.Atom, flags: number, info: number): void;
/**
* Appends the image targets supported by #GtkSelection to
* the target list. All targets are added with the same `info`.
* @param info an ID that will be passed back to the application
* @param writable whether to add only targets for which GTK+ knows how to convert a pixbuf into the format
*/
add_image_targets(info: number, writable: boolean): void;
/**
* Appends the rich text targets registered with
* gtk_text_buffer_register_serialize_format() or
* gtk_text_buffer_register_deserialize_format() to the target list. All
* targets are added with the same `info`.
* @param info an ID that will be passed back to the application
* @param deserializable if %TRUE, then deserializable rich text formats will be added, serializable formats otherwise.
* @param buffer a #GtkTextBuffer.
*/
add_rich_text_targets(info: number, deserializable: boolean, buffer: TextBuffer): void;
/**
* Prepends a table of #GtkTargetEntry to a target list.
* @param targets the table of #GtkTargetEntry
*/
add_table(targets: TargetEntry[]): void;
/**
* Appends the text targets supported by #GtkSelection to
* the target list. All targets are added with the same `info`.
* @param info an ID that will be passed back to the application
*/
add_text_targets(info: number): void;
/**
* Appends the URI targets supported by #GtkSelection to
* the target list. All targets are added with the same `info`.
* @param info an ID that will be passed back to the application
*/
add_uri_targets(info: number): void;
/**
* Looks up a given target in a #GtkTargetList.
* @param target an interned atom representing the target to search for
* @param info a pointer to the location to store application info for target, or %NULL
* @returns %TRUE if the target was found, otherwise %FALSE
*/
find(target: Gdk.Atom, info: number): boolean;
/**
* Increases the reference count of a #GtkTargetList by one.
* @returns the passed in #GtkTargetList.
*/
ref(): TargetList;
/**
* Removes a target from a target list.
* @param target the interned atom representing the target
*/
remove(target: Gdk.Atom): void;
/**
* Decreases the reference count of a #GtkTargetList by one.
* If the resulting reference count is zero, frees the list.
*/
unref(): void;
}
class TargetPair {
static $gtype: GObject.GType<TargetPair>;
// Fields
flags: number;
info: number;
// Constructors
_init(...args: any[]): void;
}
type TearoffMenuItemClass = typeof TearoffMenuItem;
class TextAppearance {
static $gtype: GObject.GType<TextAppearance>;
// Fields
bg_color: Gdk.Color;
fg_color: Gdk.Color;
rise: number;
underline: number;
strikethrough: number;
draw_bg: number;
inside_selection: number;
is_text: number;
// Constructors
_init(...args: any[]): void;
}
class TextAttrAppearance {
static $gtype: GObject.GType<TextAttrAppearance>;
// Constructors
_init(...args: any[]): void;
}
class TextAttributes {
static $gtype: GObject.GType<TextAttributes>;
// Fields
justification: Justification;
direction: TextDirection;
font_scale: number;
left_margin: number;
indent: number;
right_margin: number;
pixels_above_lines: number;
pixels_below_lines: number;
pixels_inside_wrap: number;
wrap_mode: WrapMode;
invisible: number;
bg_full_height: number;
editable: number;
realized: number;
// Constructors
constructor(
properties?: Partial<{
appearance: TextAppearance;
justification: Justification;
direction: TextDirection;
font_scale: number;
left_margin: number;
indent: number;
right_margin: number;
pixels_above_lines: number;
pixels_below_lines: number;
pixels_inside_wrap: number;
wrap_mode: WrapMode;
invisible: number;
bg_full_height: number;
editable: number;
realized: number;
}>,
);
_init(...args: any[]): void;
static ['new'](): TextAttributes;
// Methods
/**
* Copies `src` and returns a new #GtkTextAttributes.
* @returns a copy of @src
*/
copy(): TextAttributes;
/**
* Copies the values from `src` to `dest` so that `dest` has the same values
* as `src`. Frees existing values in `dest`.
* @param dest another #GtkTextAttributes
*/
copy_values(dest: TextAttributes): void;
/**
* Increments the reference count on `values`.
* @returns the #GtkTextAttributes that were passed in
*/
ref(): TextAttributes;
/**
* Decrements the reference count on `values,` freeing the structure
* if the reference count reaches 0.
*/
unref(): void;
}
abstract class TextBTree {
static $gtype: GObject.GType<TextBTree>;
// Constructors
_init(...args: any[]): void;
}
type TextBufferClass = typeof TextBuffer;
type TextChildAnchorClass = typeof TextChildAnchor;
class TextCursorDisplay {
static $gtype: GObject.GType<TextCursorDisplay>;
// Fields
x: number;
y: number;
height: number;
is_strong: number;
is_weak: number;
// Constructors
constructor(
properties?: Partial<{
x: number;
y: number;
height: number;
is_strong: number;
is_weak: number;
}>,
);
_init(...args: any[]): void;
}
class TextIter {
static $gtype: GObject.GType<TextIter>;
// Constructors
constructor(properties?: Partial<{}>);
_init(...args: any[]): void;
// Methods
/**
* Moves backward by one character offset. Returns %TRUE if movement
* was possible; if `iter` was the first in the buffer (character
* offset 0), gtk_text_iter_backward_char () returns %FALSE for convenience when
* writing loops.
* @returns whether movement was possible
*/
backward_char(): boolean;
/**
* Moves `count` characters backward, if possible (if `count` would move
* past the start or end of the buffer, moves to the start or end of
* the buffer). The return value indicates whether the iterator moved
* onto a dereferenceable position; if the iterator didn't move, or
* moved onto the end iterator, then %FALSE is returned. If `count` is 0,
* the function does nothing and returns %FALSE.
* @param count number of characters to move
* @returns whether @iter moved and is dereferenceable
*/
backward_chars(count: number): boolean;
/**
* Like gtk_text_iter_forward_cursor_position(), but moves backward.
* @returns %TRUE if we moved
*/
backward_cursor_position(): boolean;
/**
* Moves up to `count` cursor positions. See
* gtk_text_iter_forward_cursor_position() for details.
* @param count number of positions to move
* @returns %TRUE if we moved and the new position is dereferenceable
*/
backward_cursor_positions(count: number): boolean;
/**
* Same as gtk_text_iter_forward_find_char(), but goes backward from `iter`.
* @param pred function to be called on each character
* @param limit search limit, or %NULL for none
* @returns whether a match was found
*/
backward_find_char(pred: TextCharPredicate, limit?: TextIter | null): boolean;
/**
* Moves `iter` to the start of the previous line. Returns %TRUE if
* `iter` could be moved; i.e. if `iter` was at character offset 0, this
* function returns %FALSE. Therefore if `iter` was already on line 0,
* but not at the start of the line, `iter` is snapped to the start of
* the line and the function returns %TRUE. (Note that this implies that
* in a loop calling this function, the line number may not change on
* every iteration, if your first iteration is on line 0.)
* @returns whether @iter moved
*/
backward_line(): boolean;
/**
* Moves `count` lines backward, if possible (if `count` would move
* past the start or end of the buffer, moves to the start or end of
* the buffer). The return value indicates whether the iterator moved
* onto a dereferenceable position; if the iterator didn't move, or
* moved onto the end iterator, then %FALSE is returned. If `count` is 0,
* the function does nothing and returns %FALSE. If `count` is negative,
* moves forward by 0 - `count` lines.
* @param count number of lines to move backward
* @returns whether @iter moved and is dereferenceable
*/
backward_lines(count: number): boolean;
/**
* Same as gtk_text_iter_forward_search(), but moves backward.
* @param str search string
* @param flags bitmask of flags affecting the search
* @param limit location of last possible @match_start, or %NULL for start of buffer
* @returns whether a match was found
*/
backward_search(
str: string,
flags: TextSearchFlags | null,
limit?: TextIter | null,
): [boolean, TextIter | null, TextIter | null];
/**
* Moves backward to the previous sentence start; if `iter` is already at
* the start of a sentence, moves backward to the next one. Sentence
* boundaries are determined by Pango and should be correct for nearly
* any language (if not, the correct fix would be to the Pango text
* boundary algorithms).
* @returns %TRUE if @iter moved and is not the end iterator
*/
backward_sentence_start(): boolean;
/**
* Calls gtk_text_iter_backward_sentence_start() up to `count` times,
* or until it returns %FALSE. If `count` is negative, moves forward
* instead of backward.
* @param count number of sentences to move
* @returns %TRUE if @iter moved and is not the end iterator
*/
backward_sentence_starts(count: number): boolean;
/**
* Moves backward to the next toggle (on or off) of the
* #GtkTextTag `tag,` or to the next toggle of any tag if
* `tag` is %NULL. If no matching tag toggles are found,
* returns %FALSE, otherwise %TRUE. Does not return toggles
* located at `iter,` only toggles before `iter`. Sets `iter`
* to the location of the toggle, or the start of the buffer
* if no toggle is found.
* @param tag a #GtkTextTag, or %NULL
* @returns whether we found a tag toggle before @iter
*/
backward_to_tag_toggle(tag?: TextTag | null): boolean;
/**
* Moves `iter` forward to the previous visible cursor position. See
* gtk_text_iter_backward_cursor_position() for details.
* @returns %TRUE if we moved and the new position is dereferenceable
*/
backward_visible_cursor_position(): boolean;
/**
* Moves up to `count` visible cursor positions. See
* gtk_text_iter_backward_cursor_position() for details.
* @param count number of positions to move
* @returns %TRUE if we moved and the new position is dereferenceable
*/
backward_visible_cursor_positions(count: number): boolean;
/**
* Moves `iter` to the start of the previous visible line. Returns %TRUE if
* `iter` could be moved; i.e. if `iter` was at character offset 0, this
* function returns %FALSE. Therefore if `iter` was already on line 0,
* but not at the start of the line, `iter` is snapped to the start of
* the line and the function returns %TRUE. (Note that this implies that
* in a loop calling this function, the line number may not change on
* every iteration, if your first iteration is on line 0.)
* @returns whether @iter moved
*/
backward_visible_line(): boolean;
/**
* Moves `count` visible lines backward, if possible (if `count` would move
* past the start or end of the buffer, moves to the start or end of
* the buffer). The return value indicates whether the iterator moved
* onto a dereferenceable position; if the iterator didn't move, or
* moved onto the end iterator, then %FALSE is returned. If `count` is 0,
* the function does nothing and returns %FALSE. If `count` is negative,
* moves forward by 0 - `count` lines.
* @param count number of lines to move backward
* @returns whether @iter moved and is dereferenceable
*/
backward_visible_lines(count: number): boolean;
/**
* Moves backward to the previous visible word start. (If `iter` is currently
* on a word start, moves backward to the next one after that.) Word breaks
* are determined by Pango and should be correct for nearly any
* language (if not, the correct fix would be to the Pango word break
* algorithms).
* @returns %TRUE if @iter moved and is not the end iterator
*/
backward_visible_word_start(): boolean;
/**
* Calls gtk_text_iter_backward_visible_word_start() up to `count` times.
* @param count number of times to move
* @returns %TRUE if @iter moved and is not the end iterator
*/
backward_visible_word_starts(count: number): boolean;
/**
* Moves backward to the previous word start. (If `iter` is currently on a
* word start, moves backward to the next one after that.) Word breaks
* are determined by Pango and should be correct for nearly any
* language (if not, the correct fix would be to the Pango word break
* algorithms).
* @returns %TRUE if @iter moved and is not the end iterator
*/
backward_word_start(): boolean;
/**
* Calls gtk_text_iter_backward_word_start() up to `count` times.
* @param count number of times to move
* @returns %TRUE if @iter moved and is not the end iterator
*/
backward_word_starts(count: number): boolean;
/**
* Returns %TRUE if `tag` is toggled on at exactly this point. If `tag`
* is %NULL, returns %TRUE if any tag is toggled on at this point. Note
* that the gtk_text_iter_begins_tag () returns %TRUE if `iter` is the
* <emphasis>start</emphasis> of the tagged range;
* gtk_text_iter_has_tag () tells you whether an iterator is
* <emphasis>within</emphasis> a tagged range.
* @param tag a #GtkTextTag, or %NULL
* @returns whether @iter is the start of a range tagged with @tag
*/
begins_tag(tag?: TextTag | null): boolean;
/**
* Considering the default editability of the buffer, and tags that
* affect editability, determines whether text inserted at `iter` would
* be editable. If text inserted at `iter` would be editable then the
* user should be allowed to insert text at `iter`.
* gtk_text_buffer_insert_interactive() uses this function to decide
* whether insertions are allowed at a given position.
* @param default_editability %TRUE if text is editable by default
* @returns whether text inserted at @iter would be editable
*/
can_insert(default_editability: boolean): boolean;
/**
* A qsort()-style function that returns negative if `lhs` is less than
* `rhs,` positive if `lhs` is greater than `rhs,` and 0 if they're equal.
* Ordering is in character offset order, i.e. the first character in the buffer
* is less than the second character in the buffer.
* @param rhs another #GtkTextIter
* @returns -1 if @lhs is less than @rhs, 1 if @lhs is greater, 0 if they are equal
*/
compare(rhs: TextIter): number;
/**
* Creates a dynamically-allocated copy of an iterator. This function
* is not useful in applications, because iterators can be copied with a
* simple assignment (<literal>GtkTextIter i = j;</literal>). The
* function is used by language bindings.
* @returns a copy of the @iter, free with gtk_text_iter_free ()
*/
copy(): TextIter;
/**
* Returns whether the character at `iter` is within an editable region
* of text. Non-editable text is "locked" and can't be changed by the
* user via #GtkTextView. This function is simply a convenience
* wrapper around gtk_text_iter_get_attributes (). If no tags applied
* to this text affect editability, `default_setting` will be returned.
*
* You don't want to use this function to decide whether text can be
* inserted at `iter,` because for insertion you don't want to know
* whether the char at `iter` is inside an editable range, you want to
* know whether a new character inserted at `iter` would be inside an
* editable range. Use gtk_text_iter_can_insert() to handle this
* case.
* @param default_setting %TRUE if text is editable by default
* @returns whether @iter is inside an editable range
*/
editable(default_setting: boolean): boolean;
/**
* Returns %TRUE if `iter` points to the start of the paragraph
* delimiter characters for a line (delimiters will be either a
* newline, a carriage return, a carriage return followed by a
* newline, or a Unicode paragraph separator character). Note that an
* iterator pointing to the \n of a \r\n pair will not be counted as
* the end of a line, the line ends before the \r. The end iterator is
* considered to be at the end of a line, even though there are no
* paragraph delimiter chars there.
* @returns whether @iter is at the end of a line
*/
ends_line(): boolean;
/**
* Determines whether `iter` ends a sentence. Sentence boundaries are
* determined by Pango and should be correct for nearly any language
* (if not, the correct fix would be to the Pango text boundary
* algorithms).
* @returns %TRUE if @iter is at the end of a sentence.
*/
ends_sentence(): boolean;
/**
* Returns %TRUE if `tag` is toggled off at exactly this point. If `tag`
* is %NULL, returns %TRUE if any tag is toggled off at this point. Note
* that the gtk_text_iter_ends_tag () returns %TRUE if `iter` is the
* <emphasis>end</emphasis> of the tagged range;
* gtk_text_iter_has_tag () tells you whether an iterator is
* <emphasis>within</emphasis> a tagged range.
* @param tag a #GtkTextTag, or %NULL
* @returns whether @iter is the end of a range tagged with @tag
*/
ends_tag(tag?: TextTag | null): boolean;
/**
* Determines whether `iter` ends a natural-language word. Word breaks
* are determined by Pango and should be correct for nearly any
* language (if not, the correct fix would be to the Pango word break
* algorithms).
* @returns %TRUE if @iter is at the end of a word
*/
ends_word(): boolean;
/**
* Tests whether two iterators are equal, using the fastest possible
* mechanism. This function is very fast; you can expect it to perform
* better than e.g. getting the character offset for each iterator and
* comparing the offsets yourself. Also, it's a bit faster than
* gtk_text_iter_compare().
* @param rhs another #GtkTextIter
* @returns %TRUE if the iterators point to the same place in the buffer
*/
equal(rhs: TextIter): boolean;
/**
* Moves `iter` forward by one character offset. Note that images
* embedded in the buffer occupy 1 character slot, so
* gtk_text_iter_forward_char () may actually move onto an image instead
* of a character, if you have images in your buffer. If `iter` is the
* end iterator or one character before it, `iter` will now point at
* the end iterator, and gtk_text_iter_forward_char () returns %FALSE for
* convenience when writing loops.
* @returns whether @iter moved and is dereferenceable
*/
forward_char(): boolean;
/**
* Moves `count` characters if possible (if `count` would move past the
* start or end of the buffer, moves to the start or end of the
* buffer). The return value indicates whether the new position of
* `iter` is different from its original position, and dereferenceable
* (the last iterator in the buffer is not dereferenceable). If `count`
* is 0, the function does nothing and returns %FALSE.
* @param count number of characters to move, may be negative
* @returns whether @iter moved and is dereferenceable
*/
forward_chars(count: number): boolean;
/**
* Moves `iter` forward by a single cursor position. Cursor positions
* are (unsurprisingly) positions where the cursor can appear. Perhaps
* surprisingly, there may not be a cursor position between all
* characters. The most common example for European languages would be
* a carriage return/newline sequence. For some Unicode characters,
* the equivalent of say the letter "a" with an accent mark will be
* represented as two characters, first the letter then a "combining
* mark" that causes the accent to be rendered; so the cursor can't go
* between those two characters. See also the #PangoLogAttr structure and
* pango_break() function.
* @returns %TRUE if we moved and the new position is dereferenceable
*/
forward_cursor_position(): boolean;
/**
* Moves up to `count` cursor positions. See
* gtk_text_iter_forward_cursor_position() for details.
* @param count number of positions to move
* @returns %TRUE if we moved and the new position is dereferenceable
*/
forward_cursor_positions(count: number): boolean;
/**
* Advances `iter,` calling `pred` on each character. If
* `pred` returns %TRUE, returns %TRUE and stops scanning.
* If `pred` never returns %TRUE, `iter` is set to `limit` if
* `limit` is non-%NULL, otherwise to the end iterator.
* @param pred a function to be called on each character
* @param limit search limit, or %NULL for none
* @returns whether a match was found
*/
forward_find_char(pred: TextCharPredicate, limit?: TextIter | null): boolean;
/**
* Moves `iter` to the start of the next line. If the iter is already on the
* last line of the buffer, moves the iter to the end of the current line.
* If after the operation, the iter is at the end of the buffer and not
* dereferencable, returns %FALSE. Otherwise, returns %TRUE.
* @returns whether @iter can be dereferenced
*/
forward_line(): boolean;
/**
* Moves `count` lines forward, if possible (if `count` would move
* past the start or end of the buffer, moves to the start or end of
* the buffer). The return value indicates whether the iterator moved
* onto a dereferenceable position; if the iterator didn't move, or
* moved onto the end iterator, then %FALSE is returned. If `count` is 0,
* the function does nothing and returns %FALSE. If `count` is negative,
* moves backward by 0 - `count` lines.
* @param count number of lines to move forward
* @returns whether @iter moved and is dereferenceable
*/
forward_lines(count: number): boolean;
/**
* Searches forward for `str`. Any match is returned by setting
* `match_start` to the first character of the match and `match_end` to the
* first character after the match. The search will not continue past
* `limit`. Note that a search is a linear or O(n) operation, so you
* may wish to use `limit` to avoid locking up your UI on large
* buffers.
*
* If the #GTK_TEXT_SEARCH_VISIBLE_ONLY flag is present, the match may
* have invisible text interspersed in `str`. i.e. `str` will be a
* possibly-noncontiguous subsequence of the matched range. similarly,
* if you specify #GTK_TEXT_SEARCH_TEXT_ONLY, the match may have
* pixbufs or child widgets mixed inside the matched range. If these
* flags are not given, the match must be exact; the special 0xFFFC
* character in `str` will match embedded pixbufs or child widgets.
* @param str a search string
* @param flags flags affecting how the search is done
* @param limit bound for the search, or %NULL for the end of the buffer
* @returns whether a match was found
*/
forward_search(
str: string,
flags: TextSearchFlags | null,
limit?: TextIter | null,
): [boolean, TextIter | null, TextIter | null];
/**
* Moves forward to the next sentence end. (If `iter` is at the end of
* a sentence, moves to the next end of sentence.) Sentence
* boundaries are determined by Pango and should be correct for nearly
* any language (if not, the correct fix would be to the Pango text
* boundary algorithms).
* @returns %TRUE if @iter moved and is not the end iterator
*/
forward_sentence_end(): boolean;
/**
* Calls gtk_text_iter_forward_sentence_end() `count` times (or until
* gtk_text_iter_forward_sentence_end() returns %FALSE). If `count` is
* negative, moves backward instead of forward.
* @param count number of sentences to move
* @returns %TRUE if @iter moved and is not the end iterator
*/
forward_sentence_ends(count: number): boolean;
/**
* Moves `iter` forward to the "end iterator," which points one past the last
* valid character in the buffer. gtk_text_iter_get_char() called on the
* end iterator returns 0, which is convenient for writing loops.
*/
forward_to_end(): void;
/**
* Moves the iterator to point to the paragraph delimiter characters,
* which will be either a newline, a carriage return, a carriage
* return/newline in sequence, or the Unicode paragraph separator
* character. If the iterator is already at the paragraph delimiter
* characters, moves to the paragraph delimiter characters for the
* next line. If `iter` is on the last line in the buffer, which does
* not end in paragraph delimiters, moves to the end iterator (end of
* the last line), and returns %FALSE.
* @returns %TRUE if we moved and the new location is not the end iterator
*/
forward_to_line_end(): boolean;
/**
* Moves forward to the next toggle (on or off) of the
* #GtkTextTag `tag,` or to the next toggle of any tag if
* `tag` is %NULL. If no matching tag toggles are found,
* returns %FALSE, otherwise %TRUE. Does not return toggles
* located at `iter,` only toggles after `iter`. Sets `iter` to
* the location of the toggle, or to the end of the buffer
* if no toggle is found.
* @param tag a #GtkTextTag, or %NULL
* @returns whether we found a tag toggle after @iter
*/
forward_to_tag_toggle(tag?: TextTag | null): boolean;
/**
* Moves `iter` forward to the next visible cursor position. See
* gtk_text_iter_forward_cursor_position() for details.
* @returns %TRUE if we moved and the new position is dereferenceable
*/
forward_visible_cursor_position(): boolean;
/**
* Moves up to `count` visible cursor positions. See
* gtk_text_iter_forward_cursor_position() for details.
* @param count number of positions to move
* @returns %TRUE if we moved and the new position is dereferenceable
*/
forward_visible_cursor_positions(count: number): boolean;
/**
* Moves `iter` to the start of the next visible line. Returns %TRUE if there
* was a next line to move to, and %FALSE if `iter` was simply moved to
* the end of the buffer and is now not dereferenceable, or if `iter` was
* already at the end of the buffer.
* @returns whether @iter can be dereferenced
*/
forward_visible_line(): boolean;
/**
* Moves `count` visible lines forward, if possible (if `count` would move
* past the start or end of the buffer, moves to the start or end of
* the buffer). The return value indicates whether the iterator moved
* onto a dereferenceable position; if the iterator didn't move, or
* moved onto the end iterator, then %FALSE is returned. If `count` is 0,
* the function does nothing and returns %FALSE. If `count` is negative,
* moves backward by 0 - `count` lines.
* @param count number of lines to move forward
* @returns whether @iter moved and is dereferenceable
*/
forward_visible_lines(count: number): boolean;
/**
* Moves forward to the next visible word end. (If `iter` is currently on a
* word end, moves forward to the next one after that.) Word breaks
* are determined by Pango and should be correct for nearly any
* language (if not, the correct fix would be to the Pango word break
* algorithms).
* @returns %TRUE if @iter moved and is not the end iterator
*/
forward_visible_word_end(): boolean;
/**
* Calls gtk_text_iter_forward_visible_word_end() up to `count` times.
* @param count number of times to move
* @returns %TRUE if @iter moved and is not the end iterator
*/
forward_visible_word_ends(count: number): boolean;
/**
* Moves forward to the next word end. (If `iter` is currently on a
* word end, moves forward to the next one after that.) Word breaks
* are determined by Pango and should be correct for nearly any
* language (if not, the correct fix would be to the Pango word break
* algorithms).
* @returns %TRUE if @iter moved and is not the end iterator
*/
forward_word_end(): boolean;
/**
* Calls gtk_text_iter_forward_word_end() up to `count` times.
* @param count number of times to move
* @returns %TRUE if @iter moved and is not the end iterator
*/
forward_word_ends(count: number): boolean;
/**
* Free an iterator allocated on the heap. This function
* is intended for use in language bindings, and is not
* especially useful for applications, because iterators can
* simply be allocated on the stack.
*/
free(): void;
/**
* Computes the effect of any tags applied to this spot in the
* text. The `values` parameter should be initialized to the default
* settings you wish to use if no tags are in effect. You'd typically
* obtain the defaults from gtk_text_view_get_default_attributes().
*
* gtk_text_iter_get_attributes () will modify `values,` applying the
* effects of any tags present at `iter`. If any tags affected `values,`
* the function returns %TRUE.
* @returns %TRUE if @values was modified
*/
get_attributes(): [boolean, TextAttributes];
/**
* Returns the #GtkTextBuffer this iterator is associated with.
* @returns the buffer
*/
get_buffer(): TextBuffer;
/**
* Returns the number of bytes in the line containing `iter,`
* including the paragraph delimiters.
* @returns number of bytes in the line
*/
get_bytes_in_line(): number;
/**
* Returns the Unicode character at this iterator. (Equivalent to
* operator* on a C++ iterator.) If the element at this iterator is a
* non-character element, such as an image embedded in the buffer, the
* Unicode "unknown" character 0xFFFC is returned. If invoked on
* the end iterator, zero is returned; zero is not a valid Unicode character.
* So you can write a loop which ends when gtk_text_iter_get_char ()
* returns 0.
* @returns a Unicode character, or 0 if @iter is not dereferenceable
*/
get_char(): number;
/**
* Returns the number of characters in the line containing `iter,`
* including the paragraph delimiters.
* @returns number of characters in the line
*/
get_chars_in_line(): number;
/**
* If the location at `iter` contains a child anchor, the
* anchor is returned (with no new reference count added). Otherwise,
* %NULL is returned.
* @returns the anchor at @iter
*/
get_child_anchor(): TextChildAnchor;
/**
* A convenience wrapper around gtk_text_iter_get_attributes (),
* which returns the language in effect at `iter`. If no tags affecting
* language apply to `iter,` the return value is identical to that of
* gtk_get_default_language ().
* @returns language in effect at @iter
*/
get_language(): Pango.Language;
/**
* Returns the line number containing the iterator. Lines in
* a #GtkTextBuffer are numbered beginning with 0 for the first
* line in the buffer.
* @returns a line number
*/
get_line(): number;
/**
* Returns the byte index of the iterator, counting
* from the start of a newline-terminated line.
* Remember that #GtkTextBuffer encodes text in
* UTF-8, and that characters can require a variable
* number of bytes to represent.
* @returns distance from start of line, in bytes
*/
get_line_index(): number;
/**
* Returns the character offset of the iterator,
* counting from the start of a newline-terminated line.
* The first character on the line has offset 0.
* @returns offset from start of line
*/
get_line_offset(): number;
/**
* Returns a list of all #GtkTextMark at this location. Because marks
* are not iterable (they don't take up any "space" in the buffer,
* they are just marks in between iterable locations), multiple marks
* can exist in the same place. The returned list is not in any
* meaningful order.
* @returns list of #GtkTextMark
*/
get_marks(): TextMark[];
/**
* Returns the character offset of an iterator.
* Each character in a #GtkTextBuffer has an offset,
* starting with 0 for the first character in the buffer.
* Use gtk_text_buffer_get_iter_at_offset () to convert an
* offset back into an iterator.
* @returns a character offset
*/
get_offset(): number;
/**
* If the element at `iter` is a pixbuf, the pixbuf is returned
* (with no new reference count added). Otherwise,
* %NULL is returned.
* @returns the pixbuf at @iter
*/
get_pixbuf(): GdkPixbuf.Pixbuf;
/**
* Returns the text in the given range. A "slice" is an array of
* characters encoded in UTF-8 format, including the Unicode "unknown"
* character 0xFFFC for iterable non-character elements in the buffer,
* such as images. Because images are encoded in the slice, byte and
* character offsets in the returned array will correspond to byte
* offsets in the text buffer. Note that 0xFFFC can occur in normal
* text as well, so it is not a reliable indicator that a pixbuf or
* widget is in the buffer.
* @param end iterator at end of a range
* @returns slice of text from the buffer
*/
get_slice(end: TextIter): string;
/**
* Returns a list of tags that apply to `iter,` in ascending order of
* priority (highest-priority tags are last). The #GtkTextTag in the
* list don't have a reference added, but you have to free the list
* itself.
* @returns list of #GtkTextTag
*/
get_tags(): TextTag[];
/**
* Returns <emphasis>text</emphasis> in the given range. If the range
* contains non-text elements such as images, the character and byte
* offsets in the returned string will not correspond to character and
* byte offsets in the buffer. If you want offsets to correspond, see
* gtk_text_iter_get_slice ().
* @param end iterator at end of a range
* @returns array of characters from the buffer
*/
get_text(end: TextIter): string;
/**
* Returns a list of #GtkTextTag that are toggled on or off at this
* point. (If `toggled_on` is %TRUE, the list contains tags that are
* toggled on.) If a tag is toggled on at `iter,` then some non-empty
* range of characters following `iter` has that tag applied to it. If
* a tag is toggled off, then some non-empty range following `iter`
* does <emphasis>not</emphasis> have the tag applied to it.
* @param toggled_on %TRUE to get toggled-on tags
* @returns tags toggled at this point
*/
get_toggled_tags(toggled_on: boolean): TextTag[];
/**
* Returns the number of bytes from the start of the
* line to the given `iter,` not counting bytes that
* are invisible due to tags with the "invisible" flag
* toggled on.
* @returns byte index of @iter with respect to the start of the line
*/
get_visible_line_index(): number;
/**
* Returns the offset in characters from the start of the
* line to the given `iter,` not counting characters that
* are invisible due to tags with the "invisible" flag
* toggled on.
* @returns offset in visible characters from the start of the line
*/
get_visible_line_offset(): number;
/**
* Like gtk_text_iter_get_slice (), but invisible text is not included.
* Invisible text is usually invisible because a #GtkTextTag with the
* "invisible" attribute turned on has been applied to it.
* @param end iterator at end of range
* @returns slice of text from the buffer
*/
get_visible_slice(end: TextIter): string;
/**
* Like gtk_text_iter_get_text (), but invisible text is not included.
* Invisible text is usually invisible because a #GtkTextTag with the
* "invisible" attribute turned on has been applied to it.
* @param end iterator at end of range
* @returns string containing visible text in the range
*/
get_visible_text(end: TextIter): string;
/**
* Returns %TRUE if `iter` is within a range tagged with `tag`.
* @param tag a #GtkTextTag
* @returns whether @iter is tagged with @tag
*/
has_tag(tag: TextTag): boolean;
/**
* Checks whether `iter` falls in the range [`start,` `end)`.
* `start` and `end` must be in ascending order.
* @param start start of range
* @param end end of range
* @returns %TRUE if @iter is in the range
*/
in_range(start: TextIter, end: TextIter): boolean;
/**
* Determines whether `iter` is inside a sentence (as opposed to in
* between two sentences, e.g. after a period and before the first
* letter of the next sentence). Sentence boundaries are determined
* by Pango and should be correct for nearly any language (if not, the
* correct fix would be to the Pango text boundary algorithms).
* @returns %TRUE if @iter is inside a sentence.
*/
inside_sentence(): boolean;
/**
* Determines whether `iter` is inside a natural-language word (as
* opposed to say inside some whitespace). Word breaks are determined
* by Pango and should be correct for nearly any language (if not, the
* correct fix would be to the Pango word break algorithms).
* @returns %TRUE if @iter is inside a word
*/
inside_word(): boolean;
/**
* See gtk_text_iter_forward_cursor_position() or #PangoLogAttr or
* pango_break() for details on what a cursor position is.
* @returns %TRUE if the cursor can be placed at @iter
*/
is_cursor_position(): boolean;
/**
* Returns %TRUE if `iter` is the end iterator, i.e. one past the last
* dereferenceable iterator in the buffer. gtk_text_iter_is_end () is
* the most efficient way to check whether an iterator is the end
* iterator.
* @returns whether @iter is the end iterator
*/
is_end(): boolean;
/**
* Returns %TRUE if `iter` is the first iterator in the buffer, that is
* if `iter` has a character offset of 0.
* @returns whether @iter is the first in the buffer
*/
is_start(): boolean;
/**
* Swaps the value of `first` and `second` if `second` comes before
* `first` in the buffer. That is, ensures that `first` and `second` are
* in sequence. Most text buffer functions that take a range call this
* automatically on your behalf, so there's no real reason to call it yourself
* in those cases. There are some exceptions, such as gtk_text_iter_in_range(),
* that expect a pre-sorted range.
* @param second another #GtkTextIter
*/
order(second: TextIter): void;
/**
* Moves iterator `iter` to the start of the line `line_number`. If
* `line_number` is negative or larger than the number of lines in the
* buffer, moves `iter` to the start of the last line in the buffer.
* @param line_number line number (counted from 0)
*/
set_line(line_number: number): void;
/**
* Same as gtk_text_iter_set_line_offset(), but works with a
* <emphasis>byte</emphasis> index. The given byte index must be at
* the start of a character, it can't be in the middle of a UTF-8
* encoded character.
* @param byte_on_line a byte index relative to the start of @iter's current line
*/
set_line_index(byte_on_line: number): void;
/**
* Moves `iter` within a line, to a new <emphasis>character</emphasis>
* (not byte) offset. The given character offset must be less than or
* equal to the number of characters in the line; if equal, `iter`
* moves to the start of the next line. See
* gtk_text_iter_set_line_index() if you have a byte index rather than
* a character offset.
* @param char_on_line a character offset relative to the start of @iter's current line
*/
set_line_offset(char_on_line: number): void;
/**
* Sets `iter` to point to `char_offset`. `char_offset` counts from the start
* of the entire text buffer, starting with 0.
* @param char_offset a character number
*/
set_offset(char_offset: number): void;
/**
* Like gtk_text_iter_set_line_index(), but the index is in visible
* bytes, i.e. text with a tag making it invisible is not counted
* in the index.
* @param byte_on_line a byte index
*/
set_visible_line_index(byte_on_line: number): void;
/**
* Like gtk_text_iter_set_line_offset(), but the offset is in visible
* characters, i.e. text with a tag making it invisible is not
* counted in the offset.
* @param char_on_line a character offset
*/
set_visible_line_offset(char_on_line: number): void;
/**
* Returns %TRUE if `iter` begins a paragraph,
* i.e. if gtk_text_iter_get_line_offset () would return 0.
* However this function is potentially more efficient than
* gtk_text_iter_get_line_offset () because it doesn't have to compute
* the offset, it just has to see whether it's 0.
* @returns whether @iter begins a line
*/
starts_line(): boolean;
/**
* Determines whether `iter` begins a sentence. Sentence boundaries are
* determined by Pango and should be correct for nearly any language
* (if not, the correct fix would be to the Pango text boundary
* algorithms).
* @returns %TRUE if @iter is at the start of a sentence.
*/
starts_sentence(): boolean;
/**
* Determines whether `iter` begins a natural-language word. Word
* breaks are determined by Pango and should be correct for nearly any
* language (if not, the correct fix would be to the Pango word break
* algorithms).
* @returns %TRUE if @iter is at the start of a word
*/
starts_word(): boolean;
/**
* This is equivalent to (gtk_text_iter_begins_tag () ||
* gtk_text_iter_ends_tag ()), i.e. it tells you whether a range with
* `tag` applied to it begins <emphasis>or</emphasis> ends at `iter`.
* @param tag a #GtkTextTag, or %NULL
* @returns whether @tag is toggled on or off at @iter
*/
toggles_tag(tag?: TextTag | null): boolean;
}
type TextLayoutClass = typeof TextLayout;
abstract class TextLine {
static $gtype: GObject.GType<TextLine>;
// Constructors
_init(...args: any[]): void;
}
abstract class TextLineData {
static $gtype: GObject.GType<TextLineData>;
// Constructors
_init(...args: any[]): void;
}
class TextLineDisplay {
static $gtype: GObject.GType<TextLineDisplay>;
// Fields
layout: Pango.Layout;
cursors: any[];
shaped_objects: any[];
direction: TextDirection;
width: number;
total_width: number;
height: number;
x_offset: number;
left_margin: number;
right_margin: number;
top_margin: number;
bottom_margin: number;
insert_index: number;
size_only: boolean;
pg_bg_color: Gdk.Color;
block_cursor: Gdk.Rectangle;
cursors_invalid: number;
has_block_cursor: number;
cursor_at_line_end: number;
// Constructors
_init(...args: any[]): void;
}
abstract class TextLogAttrCache {
static $gtype: GObject.GType<TextLogAttrCache>;
// Constructors
_init(...args: any[]): void;
}
type TextMarkClass = typeof TextMark;
abstract class TextPendingScroll {
static $gtype: GObject.GType<TextPendingScroll>;
// Constructors
_init(...args: any[]): void;
}
type TextTagClass = typeof TextTag;
type TextTagTableClass = typeof TextTagTable;
type TextViewClass = typeof TextView;
abstract class TextWindow {
static $gtype: GObject.GType<TextWindow>;
// Constructors
_init(...args: any[]): void;
}
abstract class ThemeEngine {
static $gtype: GObject.GType<ThemeEngine>;
// Constructors
_init(...args: any[]): void;
}
type TipsQueryClass = typeof TipsQuery;
type ToggleActionClass = typeof ToggleAction;
class ToggleActionEntry {
static $gtype: GObject.GType<ToggleActionEntry>;
// Fields
name: string;
stock_id: string;
label: string;
accelerator: string;
tooltip: string;
callback: GObject.Callback;
is_active: boolean;
// Constructors
_init(...args: any[]): void;
}
abstract class ToggleActionPrivate {
static $gtype: GObject.GType<ToggleActionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ToggleButtonClass = typeof ToggleButton;
type ToggleToolButtonClass = typeof ToggleToolButton;
abstract class ToggleToolButtonPrivate {
static $gtype: GObject.GType<ToggleToolButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ToolButtonClass = typeof ToolButton;
abstract class ToolButtonPrivate {
static $gtype: GObject.GType<ToolButtonPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ToolItemClass = typeof ToolItem;
type ToolItemGroupClass = typeof ToolItemGroup;
abstract class ToolItemGroupPrivate {
static $gtype: GObject.GType<ToolItemGroupPrivate>;
// Constructors
_init(...args: any[]): void;
}
abstract class ToolItemPrivate {
static $gtype: GObject.GType<ToolItemPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ToolPaletteClass = typeof ToolPalette;
abstract class ToolPalettePrivate {
static $gtype: GObject.GType<ToolPalettePrivate>;
// Constructors
_init(...args: any[]): void;
}
type ToolShellIface = typeof ToolShell;
class ToolbarChild {
static $gtype: GObject.GType<ToolbarChild>;
// Fields
type: ToolbarChildType;
widget: Widget;
icon: Widget;
label: Widget;
// Constructors
_init(...args: any[]): void;
}
type ToolbarClass = typeof Toolbar;
abstract class ToolbarPrivate {
static $gtype: GObject.GType<ToolbarPrivate>;
// Constructors
_init(...args: any[]): void;
}
type TooltipsClass = typeof Tooltips;
class TooltipsData {
static $gtype: GObject.GType<TooltipsData>;
// Fields
tooltips: Tooltips;
widget: Widget;
tip_text: string;
tip_private: string;
// Constructors
_init(...args: any[]): void;
}
type TreeDragDestIface = typeof TreeDragDest;
type TreeDragSourceIface = typeof TreeDragSource;
class TreeIter {
static $gtype: GObject.GType<TreeIter>;
// Fields
stamp: number;
user_data: any;
user_data2: any;
user_data3: any;
// Constructors
constructor(
properties?: Partial<{
stamp: number;
user_data: any;
user_data2: any;
user_data3: any;
}>,
);
_init(...args: any[]): void;
// Methods
/**
* Creates a dynamically allocated tree iterator as a copy of `iter`.
* This function is not intended for use in applications, because you
* can just copy the structs by value
* (<literal>GtkTreeIter new_iter = iter;</literal>).
* You must free this iter with gtk_tree_iter_free().
* @returns a newly-allocated copy of @iter.
*/
copy(): TreeIter;
/**
* Frees an iterator that has been allocated by gtk_tree_iter_copy().
* This function is mainly used for language bindings.
*/
free(): void;
}
type TreeModelFilterClass = typeof TreeModelFilter;
abstract class TreeModelFilterPrivate {
static $gtype: GObject.GType<TreeModelFilterPrivate>;
// Constructors
_init(...args: any[]): void;
}
type TreeModelIface = typeof TreeModel;
type TreeModelSortClass = typeof TreeModelSort;
class TreePath {
static $gtype: GObject.GType<TreePath>;
// Constructors
constructor(properties?: Partial<{}>);
_init(...args: any[]): void;
static ['new'](): TreePath;
static new_first(): TreePath;
static new_from_string(path: string): TreePath;
// Methods
/**
* Appends a new index to a path. As a result, the depth of the path is
* increased.
* @param index_ The index.
*/
append_index(index_: number): void;
/**
* Compares two paths. If `a` appears before `b` in a tree, then -1 is returned.
* If `b` appears before `a,` then 1 is returned. If the two nodes are equal,
* then 0 is returned.
* @param b A #GtkTreePath to compare with.
* @returns The relative positions of @a and @b
*/
compare(b: TreePath): number;
/**
* Creates a new #GtkTreePath as a copy of `path`.
* @returns A new #GtkTreePath.
*/
copy(): TreePath;
/**
* Moves `path` to point to the first child of the current path.
*/
down(): void;
/**
* Frees `path`.
*/
free(): void;
/**
* Returns the current depth of `path`.
* @returns The depth of @path
*/
get_depth(): number;
/**
* Returns the current indices of `path`. This is an array of integers, each
* representing a node in a tree. This value should not be freed.
* @returns The current indices, or %NULL.
*/
get_indices(): number;
/**
* Returns the current indices of `path`.
* This is an array of integers, each representing a node in a tree.
* It also returns the number of elements in the array.
* The array should not be freed.
* @returns The current indices, or %NULL.
*/
get_indices_with_depth(): number[];
/**
* Returns %TRUE if `descendant` is a descendant of `path`.
* @param descendant another #GtkTreePath
* @returns %TRUE if @descendant is contained inside @path
*/
is_ancestor(descendant: TreePath): boolean;
/**
* Returns %TRUE if `path` is a descendant of `ancestor`.
* @param ancestor another #GtkTreePath
* @returns %TRUE if @ancestor contains @path somewhere below it
*/
is_descendant(ancestor: TreePath): boolean;
/**
* Moves the `path` to point to the next node at the current depth.
*/
next(): void;
/**
* Prepends a new index to a path. As a result, the depth of the path is
* increased.
* @param index_ The index.
*/
prepend_index(index_: number): void;
/**
* Moves the `path` to point to the previous node at the current depth,
* if it exists.
* @returns %TRUE if @path has a previous node, and the move was made.
*/
prev(): boolean;
/**
* Generates a string representation of the path. This string is a ':'
* separated list of numbers. For example, "4:10:0:3" would be an acceptable return value for this string.
* @returns A newly-allocated string. Must be freed with g_free().
*/
to_string(): string;
/**
* Moves the `path` to point to its parent node, if it has a parent.
* @returns %TRUE if @path has a parent, and the move was made.
*/
up(): boolean;
}
class TreeRowReference {
static $gtype: GObject.GType<TreeRowReference>;
// Constructors
constructor(model: TreeModel, path: TreePath);
_init(...args: any[]): void;
static ['new'](model: TreeModel, path: TreePath): TreeRowReference;
static new_proxy(proxy: GObject.Object, model: TreeModel, path: TreePath): TreeRowReference;
// Static methods
/**
* Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
* know that the model emitted the "row_deleted" signal.
* @param proxy A #GObject
* @param path The path position that was deleted
*/
static deleted(proxy: GObject.Object, path: TreePath): void;
/**
* Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
* know that the model emitted the "row_inserted" signal.
* @param proxy A #GObject
* @param path The row position that was inserted
*/
static inserted(proxy: GObject.Object, path: TreePath): void;
/**
* Lets a set of row reference created by gtk_tree_row_reference_new_proxy()
* know that the model emitted the "rows_reordered" signal.
* @param proxy A #GObject
* @param path The parent path of the reordered signal
* @param iter The iter pointing to the parent of the reordered
* @param new_order The new order of rows
*/
static reordered(proxy: GObject.Object, path: TreePath, iter: TreeIter, new_order: number): void;
// Methods
/**
* Copies a #GtkTreeRowReference.
* @returns a copy of @reference.
*/
copy(): TreeRowReference;
/**
* Free's `reference`. `reference` may be %NULL.
*/
free(): void;
/**
* Returns the model that the row reference is monitoring.
* @returns the model
*/
get_model(): TreeModel;
/**
* Returns a path that the row reference currently points to, or %NULL if the
* path pointed to is no longer valid.
* @returns A current path, or %NULL.
*/
get_path(): TreePath;
/**
* Returns %TRUE if the `reference` is non-%NULL and refers to a current valid
* path.
* @returns %TRUE if @reference points to a valid path.
*/
valid(): boolean;
}
type TreeSelectionClass = typeof TreeSelection;
type TreeSortableIface = typeof TreeSortable;
type TreeStoreClass = typeof TreeStore;
type TreeViewClass = typeof TreeView;
type TreeViewColumnClass = typeof TreeViewColumn;
abstract class TreeViewPrivate {
static $gtype: GObject.GType<TreeViewPrivate>;
// Constructors
_init(...args: any[]): void;
}
class TypeInfo {
static $gtype: GObject.GType<TypeInfo>;
// Fields
type_name: string;
object_size: number;
class_size: number;
class_init_func: ClassInitFunc;
object_init_func: ObjectInitFunc;
reserved_1: any;
reserved_2: any;
base_class_init_func: ClassInitFunc;
// Constructors
_init(...args: any[]): void;
}
type UIManagerClass = typeof UIManager;
abstract class UIManagerPrivate {
static $gtype: GObject.GType<UIManagerPrivate>;
// Constructors
_init(...args: any[]): void;
}
type VBoxClass = typeof VBox;
type VButtonBoxClass = typeof VButtonBox;
type VPanedClass = typeof VPaned;
type VRulerClass = typeof VRuler;
type VScaleClass = typeof VScale;
type VScrollbarClass = typeof VScrollbar;
type VSeparatorClass = typeof VSeparator;
type ViewportClass = typeof Viewport;
type VolumeButtonClass = typeof VolumeButton;
class WidgetAuxInfo {
static $gtype: GObject.GType<WidgetAuxInfo>;
// Fields
x: number;
y: number;
width: number;
height: number;
x_set: number;
y_set: number;
// Constructors
constructor(
properties?: Partial<{
x: number;
y: number;
width: number;
height: number;
x_set: number;
y_set: number;
}>,
);
_init(...args: any[]): void;
}
type WidgetClass = typeof Widget;
class WidgetShapeInfo {
static $gtype: GObject.GType<WidgetShapeInfo>;
// Fields
offset_x: number;
offset_y: number;
// Constructors
_init(...args: any[]): void;
}
type WindowClass = typeof Window;
abstract class WindowGeometryInfo {
static $gtype: GObject.GType<WindowGeometryInfo>;
// Constructors
_init(...args: any[]): void;
}
type WindowGroupClass = typeof WindowGroup;
class DitherInfo {
static $gtype: GObject.GType<DitherInfo>;
// Fields
s: number[];
c: Uint8Array;
// Constructors
constructor(
properties?: Partial<{
s: number[];
c: Uint8Array;
}>,
);
_init(...args: any[]): void;
}
namespace Activatable {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
related_action: Action;
relatedAction: Action;
use_action_appearance: boolean;
useActionAppearance: boolean;
}
}
export interface ActivatableNamespace {
$gtype: GObject.GType<Activatable>;
prototype: Activatable;
}
interface Activatable extends GObject.Object {
// Properties
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get related_action(): Action;
set related_action(val: Action);
/**
* The action that this activatable will activate and receive
* updates from for various states and possibly appearance.
*
* <note><para>#GtkActivatable implementors need to handle the this property and
* call gtk_activatable_do_set_related_action() when it changes.</para></note>
*/
get relatedAction(): Action;
set relatedAction(val: Action);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get use_action_appearance(): boolean;
set use_action_appearance(val: boolean);
/**
* Whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
*
* See the #GtkAction documentation directly to find which properties
* should be ignored by the #GtkActivatable when this property is %FALSE.
*
* <note><para>#GtkActivatable implementors need to handle this property
* and call gtk_activatable_sync_action_properties() on the activatable
* widget when it changes.</para></note>
*/
get useActionAppearance(): boolean;
set useActionAppearance(val: boolean);
// Methods
/**
* This is a utility function for #GtkActivatable implementors.
*
* When implementing #GtkActivatable you must call this when
* handling changes of the #GtkActivatable:related-action, and
* you must also use this to break references in #GObject->dispose().
*
* This function adds a reference to the currently set related
* action for you, it also makes sure the #GtkActivatable->update()
* method is called when the related #GtkAction properties change
* and registers to the action's proxy list.
*
* <note><para>Be careful to call this before setting the local
* copy of the #GtkAction property, since this function uses
* gtk_activatable_get_action() to retrieve the previous action</para></note>
* @param action the #GtkAction to set
*/
do_set_related_action(action: Action): void;
/**
* Gets the related #GtkAction for `activatable`.
* @returns the related #GtkAction if one is set.
*/
get_related_action(): Action;
/**
* Gets whether this activatable should reset its layout
* and appearance when setting the related action or when
* the action changes appearance.
* @returns whether @activatable uses its actions appearance.
*/
get_use_action_appearance(): boolean;
/**
* Sets the related action on the `activatable` object.
*
* <note><para>#GtkActivatable implementors need to handle the #GtkActivatable:related-action
* property and call gtk_activatable_do_set_related_action() when it changes.</para></note>
* @param action the #GtkAction to set
*/
set_related_action(action: Action): void;
/**
* Sets whether this activatable should reset its layout and appearance
* when setting the related action or when the action changes appearance
*
* <note><para>#GtkActivatable implementors need to handle the
* #GtkActivatable:use-action-appearance property and call
* gtk_activatable_sync_action_properties() to update `activatable`
* if needed.</para></note>
* @param use_appearance whether to use the actions appearance
*/
set_use_action_appearance(use_appearance: boolean): void;
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
sync_action_properties(action?: Action | null): void;
// Virtual methods
/**
* This is called to update the activatable completely, this is called
* internally when the #GtkActivatable::related-action property is set
* or unset and by the implementing class when
* #GtkActivatable::use-action-appearance changes.
* @param action the related #GtkAction or %NULL
*/
vfunc_sync_action_properties(action?: Action | null): void;
/**
* Called to update the activatable when its related action's properties change.
* You must check the #GtkActivatable:use-action-appearance property only apply action
* properties that are meant to effect the appearance accordingly.
* @param action
* @param property_name
*/
vfunc_update(action: Action, property_name: string): void;
}
export const Activatable: ActivatableNamespace & {
new (): Activatable; // This allows `obj instanceof Activatable`
};
namespace Buildable {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
export interface BuildableNamespace {
$gtype: GObject.GType<Buildable>;
prototype: Buildable;
}
interface Buildable extends GObject.Object {
// Methods
/**
* Adds a child to `buildable`. `type` is an optional string
* describing how the child should be added.
* @param builder a #GtkBuilder
* @param child child to add
* @param type kind of child or %NULL
*/
add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
* @returns the constructed child
*/
construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
custom_finished(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
custom_tag_end(builder: Builder, child: GObject.Object | null, tagname: string, data?: any | null): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @returns %TRUE if a object has a custom implementation, %FALSE if it doesn't.
*/
custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
* @returns the internal child of the buildable object
*/
get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* 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
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
set_name(name: string): void;
// Virtual 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
*/
vfunc_add_child(builder: Builder, child: GObject.Object, type?: string | null): void;
/**
* Constructs a child of `buildable` with the name `name`.
*
* #GtkBuilder calls this function if a "constructor" has been
* specified in the UI definition.
* @param builder #GtkBuilder used to construct this object
* @param name name of child to construct
*/
vfunc_construct_child<T = GObject.Object>(builder: Builder, name: string): T;
/**
* This is similar to gtk_buildable_parser_finished() but is
* called once for each custom tag handled by the `buildable`.
* @param builder a #GtkBuilder
* @param child child object or %NULL for non-child tags
* @param tagname the name of the tag
* @param data user data created in custom_tag_start
*/
vfunc_custom_finished(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called at the end of each custom element handled by
* the buildable.
* @param builder #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
* @param data user data that will be passed in to parser functions
*/
vfunc_custom_tag_end(
builder: Builder,
child: GObject.Object | null,
tagname: string,
data?: any | null,
): void;
/**
* This is called for each unknown element under &lt;child&gt;.
* @param builder a #GtkBuilder used to construct this object
* @param child child object or %NULL for non-child tags
* @param tagname name of tag
*/
vfunc_custom_tag_start(
builder: Builder,
child: GObject.Object | null,
tagname: string,
): [boolean, GLib.MarkupParser, any];
/**
* Get the internal child called `childname` of the `buildable` object.
* @param builder a #GtkBuilder
* @param childname name of child
*/
vfunc_get_internal_child<T = GObject.Object>(builder: Builder, childname: string): T;
/**
* Gets the name of the `buildable` object.
*
* #GtkBuilder sets the name based on the the
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>
* used to construct the `buildable`.
*/
vfunc_get_name(): string;
/**
* Called when the builder finishes the parsing of a
* <link linkend="BUILDER-UI">GtkBuilder UI definition</link>.
* Note that this will be called once for each time
* gtk_builder_add_from_file() or gtk_builder_add_from_string()
* is called on a builder.
* @param builder a #GtkBuilder
*/
vfunc_parser_finished(builder: Builder): void;
/**
* Sets the property name `name` to `value` on the `buildable` object.
* @param builder a #GtkBuilder
* @param name name of property
* @param value value of property
*/
vfunc_set_buildable_property(builder: Builder, name: string, value: GObject.Value | any): void;
/**
* Sets the name of the `buildable` object.
* @param name name to set
*/
vfunc_set_name(name: string): void;
}
export const Buildable: BuildableNamespace & {
new (): Buildable; // This allows `obj instanceof Buildable`
};
namespace CellEditable {
// Constructor properties interface
interface ConstructorProps extends Widget.ConstructorProps {
editing_canceled: boolean;
editingCanceled: boolean;
}
}
export interface CellEditableNamespace {
$gtype: GObject.GType<CellEditable>;
prototype: CellEditable;
}
interface CellEditable extends Widget {
// Properties
/**
* Indicates whether editing on the cell has been canceled.
*/
get editing_canceled(): boolean;
set editing_canceled(val: boolean);
/**
* Indicates whether editing on the cell has been canceled.
*/
get editingCanceled(): boolean;
set editingCanceled(val: boolean);
// Methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
start_editing(event?: Gdk.Event | null): void;
// Virtual methods
/**
* Emits the #GtkCellEditable::editing-done signal.
*/
vfunc_editing_done(): void;
/**
* Emits the #GtkCellEditable::remove-widget signal.
*/
vfunc_remove_widget(): void;
/**
* Begins editing on a `cell_editable`. `event` is the #GdkEvent that began
* the editing process. It may be %NULL, in the instance that editing was
* initiated through programatic means.
* @param event A #GdkEvent, or %NULL
*/
vfunc_start_editing(event?: Gdk.Event | null): void;
}
export const CellEditable: CellEditableNamespace & {
new (): CellEditable; // This allows `obj instanceof CellEditable`
};
namespace CellLayout {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
export interface CellLayoutNamespace {
$gtype: GObject.GType<CellLayout>;
prototype: CellLayout;
}
interface CellLayout extends GObject.Object {
// Methods
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
* @returns a list of cell renderers. The list, but not the renderers has been newly allocated and should be freed with g_list_free() when no longer needed.
*/
get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
// Virtual methods
/**
* Adds an attribute mapping to the list in `cell_layout`. The `column` is the
* column of the model to get a value from, and the `attribute` is the
* parameter on `cell` to be set from the value. So for example if column 2
* of the model contains strings, you could have the "text" attribute of a
* #GtkCellRendererText get its values from column 2.
* @param cell A #GtkCellRenderer.
* @param attribute An attribute on the renderer.
* @param column The column position on the model to get the attribute from.
*/
vfunc_add_attribute(cell: CellRenderer, attribute: string, column: number): void;
/**
* Unsets all the mappings on all renderers on `cell_layout` and
* removes all renderers from `cell_layout`.
*/
vfunc_clear(): void;
/**
* Clears all existing attributes previously set with
* gtk_cell_layout_set_attributes().
* @param cell A #GtkCellRenderer to clear the attribute mapping on.
*/
vfunc_clear_attributes(cell: CellRenderer): void;
/**
* Returns the cell renderers which have been added to `cell_layout`.
*/
vfunc_get_cells(): CellRenderer[];
/**
* Adds the `cell` to the end of `cell_layout`. If `expand` is %FALSE, then the
* `cell` is allocated no more space than it needs. Any unused space is
* divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_end(cell: CellRenderer, expand: boolean): void;
/**
* Packs the `cell` into the beginning of `cell_layout`. If `expand` is %FALSE,
* then the `cell` is allocated no more space than it needs. Any unused space
* is divided evenly between cells for which `expand` is %TRUE.
*
* Note that reusing the same cell renderer is not supported.
* @param cell A #GtkCellRenderer.
* @param expand %TRUE if @cell is to be given extra space allocated to @cell_layout.
*/
vfunc_pack_start(cell: CellRenderer, expand: boolean): void;
/**
* Re-inserts `cell` at `position`. Note that `cell` has already to be packed
* into `cell_layout` for this to function properly.
* @param cell A #GtkCellRenderer to reorder.
* @param position New position to insert @cell at.
*/
vfunc_reorder(cell: CellRenderer, position: number): void;
/**
* Sets the #GtkCellLayoutDataFunc to use for `cell_layout`. This function
* is used instead of the standard attributes mapping for setting the
* column value, and should set the value of `cell_layout'`s cell renderer(s)
* as appropriate. `func` may be %NULL to remove and older one.
* @param cell A #GtkCellRenderer.
* @param func The #GtkCellLayoutDataFunc to use.
*/
vfunc_set_cell_data_func(cell: CellRenderer, func: CellLayoutDataFunc): void;
}
export const CellLayout: CellLayoutNamespace & {
new (): CellLayout; // This allows `obj instanceof CellLayout`
};
namespace Editable {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
export interface EditableNamespace {
$gtype: GObject.GType<Editable>;
prototype: Editable;
}
interface Editable extends GObject.Object {
// Methods
/**
* Copies the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
copy_clipboard(): void;
/**
* Removes the contents of the currently selected content in the editable and
* puts it on the clipboard.
*/
cut_clipboard(): void;
/**
* Deletes the currently selected text of the editable.
* This call doesn't do anything if there is no selected text.
*/
delete_selection(): void;
/**
* Deletes a sequence of characters. The characters that are deleted are
* those characters at positions from `start_pos` up to, but not including
* `end_pos`. If `end_pos` is negative, then the the characters deleted
* are those from `start_pos` to the end of the text.
*
* Note that the positions are specified in characters, not bytes.
* @param start_pos start position
* @param end_pos end position
*/
delete_text(start_pos: number, end_pos: number): void;
/**
* Retrieves a sequence of characters. The characters that are retrieved
* are those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the characters
* retrieved are those characters from `start_pos` to the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of text
* @param end_pos end of text
* @returns a pointer to the contents of the widget as a string. This string is allocated by the #GtkEditable implementation and should be freed by the caller.
*/
get_chars(start_pos: number, end_pos: number): string;
/**
* Retrieves whether `editable` is editable. See
* gtk_editable_set_editable().
* @returns %TRUE if @editable is editable.
*/
get_editable(): boolean;
/**
* Retrieves the current position of the cursor relative to the start
* of the content of the editable.
*
* Note that this position is in characters, not in bytes.
* @returns the cursor position
*/
get_position(): number;
/**
* Retrieves the selection bound of the editable. start_pos will be filled
* with the start of the selection and `end_pos` with end. If no text was
* selected both will be identical and %FALSE will be returned.
*
* Note that positions are specified in characters, not bytes.
* @returns %TRUE if an area is selected, %FALSE otherwise
*/
get_selection_bounds(): [boolean, number, number];
/**
* Inserts `new_text_length` bytes of `new_text` into the contents of the
* widget, at position `position`.
*
* Note that the position is in characters, not in bytes.
* The function updates `position` to point after the newly inserted text.
* @param new_text the text to append
* @param new_text_length the length of the text in bytes, or -1
* @param position location of the position text will be inserted at
*/
insert_text(new_text: string, new_text_length: number, position: number): number;
/**
* Pastes the content of the clipboard to the current position of the
* cursor in the editable.
*/
paste_clipboard(): void;
/**
* Selects a region of text. The characters that are selected are
* those characters at positions from `start_pos` up to, but not
* including `end_pos`. If `end_pos` is negative, then the the
* characters selected are those characters from `start_pos` to
* the end of the text.
*
* Note that positions are specified in characters, not bytes.
* @param start_pos start of region
* @param end_pos end of region
*/
select_region(start_pos: number, end_pos: number): void;
/**
* Determines if the user can edit the text in the editable
* widget or not.
* @param is_editable %TRUE if the user is allowed to edit the text in the widget
*/
set_editable(is_editable: boolean): void;
/**
* Sets the cursor position in the editable to the given value.
*
* The cursor is displayed before the character with the given (base 0)
* index in the contents of the editable. The value must be less than or
* equal to the number of characters in the editable. A value of -1
* indicates that the position should be set after the last character
* of the editable. Note that `position` is in characters, not in bytes.
* @param position the position of the cursor
*/
set_position(position: number): void;
}
export const Editable: EditableNamespace & {
new (): Editable; // This allows `obj instanceof Editable`
};
namespace FileChooser {
// Constructor properties interface
interface ConstructorProps extends Widget.ConstructorProps {
action: FileChooserAction;
create_folders: boolean;
createFolders: boolean;
do_overwrite_confirmation: boolean;
doOverwriteConfirmation: boolean;
extra_widget: Widget;
extraWidget: Widget;
file_system_backend: string;
fileSystemBackend: string;
filter: FileFilter;
local_only: boolean;
localOnly: boolean;
preview_widget: Widget;
previewWidget: Widget;
preview_widget_active: boolean;
previewWidgetActive: boolean;
select_multiple: boolean;
selectMultiple: boolean;
show_hidden: boolean;
showHidden: boolean;
use_preview_label: boolean;
usePreviewLabel: boolean;
}
}
export interface FileChooserNamespace {
$gtype: GObject.GType<FileChooser>;
prototype: FileChooser;
}
interface FileChooser extends Widget {
// Properties
get action(): FileChooserAction;
set action(val: FileChooserAction);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get create_folders(): boolean;
set create_folders(val: boolean);
/**
* Whether a file chooser not in %GTK_FILE_CHOOSER_ACTION_OPEN mode
* will offer the user to create new folders.
*/
get createFolders(): boolean;
set createFolders(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get do_overwrite_confirmation(): boolean;
set do_overwrite_confirmation(val: boolean);
/**
* Whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode
* will present an overwrite confirmation dialog if the user
* selects a file name that already exists.
*/
get doOverwriteConfirmation(): boolean;
set doOverwriteConfirmation(val: boolean);
get extra_widget(): Widget;
set extra_widget(val: Widget);
get extraWidget(): Widget;
set extraWidget(val: Widget);
set file_system_backend(val: string);
set fileSystemBackend(val: string);
get filter(): FileFilter;
set filter(val: FileFilter);
get local_only(): boolean;
set local_only(val: boolean);
get localOnly(): boolean;
set localOnly(val: boolean);
get preview_widget(): Widget;
set preview_widget(val: Widget);
get previewWidget(): Widget;
set previewWidget(val: Widget);
get preview_widget_active(): boolean;
set preview_widget_active(val: boolean);
get previewWidgetActive(): boolean;
set previewWidgetActive(val: boolean);
get select_multiple(): boolean;
set select_multiple(val: boolean);
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
get show_hidden(): boolean;
set show_hidden(val: boolean);
get showHidden(): boolean;
set showHidden(val: boolean);
get use_preview_label(): boolean;
set use_preview_label(val: boolean);
get usePreviewLabel(): boolean;
set usePreviewLabel(val: boolean);
// Methods
/**
* Adds `filter` to the list of filters that the user can select between.
* When a filter is selected, only files that are passed by that
* filter are displayed.
*
* Note that the `chooser` takes ownership of the filter, so you have to
* ref and sink it if you want to keep a reference.
* @param filter a #GtkFileFilter
*/
add_filter(filter: FileFilter): void;
/**
* Adds a folder to be displayed with the shortcut folders in a file chooser.
* Note that shortcut folders do not get saved, as they are provided by the
* application. For example, you can use this to add a
* "/usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param folder filename of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder(folder: string): boolean;
/**
* Adds a folder URI to be displayed with the shortcut folders in a file
* chooser. Note that shortcut folders do not get saved, as they are provided
* by the application. For example, you can use this to add a
* "file:///usr/share/mydrawprogram/Clipart" folder to the volume list.
* @param uri URI of the folder to add
* @returns %TRUE if the folder could be added successfully, %FALSE otherwise. In the latter case, the @error will be set as appropriate.
*/
add_shortcut_folder_uri(uri: string): boolean;
/**
* Gets the type of operation that the file chooser is performing; see
* gtk_file_chooser_set_action().
* @returns the action that the file selector is performing
*/
get_action(): FileChooserAction;
/**
* Gets whether file choser will offer to create new folders.
* See gtk_file_chooser_set_create_folders().
* @returns %TRUE if the New Folder button should be displayed.
*/
get_create_folders(): boolean;
/**
* Gets the current folder of `chooser` as a local filename.
* See gtk_file_chooser_set_current_folder().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "/home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "/home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the full path of the current folder, or %NULL if the current path cannot be represented as a local filename. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder() on a nonexistent folder.
*/
get_current_folder(): string;
/**
* Gets the current folder of `chooser` as #GFile.
* See gtk_file_chooser_get_current_folder_uri().
* @returns the #GFile for the current folder.
*/
get_current_folder_file(): Gio.File;
/**
* Gets the current folder of `chooser` as an URI.
* See gtk_file_chooser_set_current_folder_uri().
*
* Note that this is the folder that the file chooser is currently displaying
* (e.g. "file:///home/username/Documents"), which is <emphasis>not the same</emphasis>
* as the currently-selected folder if the chooser is in
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER mode
* (e.g. "file:///home/username/Documents/selected-folder/". To get the
* currently-selected folder in that mode, use gtk_file_chooser_get_uri() as the
* usual way to get the selection.
* @returns the URI for the current folder. Free with g_free(). This function will also return %NULL if the file chooser was unable to load the last folder that was requested from it; for example, as would be for calling gtk_file_chooser_set_current_folder_uri() on a nonexistent folder.
*/
get_current_folder_uri(): string;
/**
* Queries whether a file chooser is set to confirm for overwriting when the user
* types a file name that already exists.
* @returns %TRUE if the file chooser will present a confirmation dialog; %FALSE otherwise.
*/
get_do_overwrite_confirmation(): boolean;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_extra_widget().
* @returns the current extra widget, or %NULL
*/
get_extra_widget(): Widget;
/**
* Gets the #GFile for the currently selected file in
* the file selector. If multiple files are selected,
* one of the files will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns a selected #GFile. You own the returned file; use g_object_unref() to release it.
*/
get_file(): Gio.File;
/**
* Gets the filename for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected filename, or %NULL if no file is selected, or the selected file can't be represented with a local filename. Free with g_free().
*/
get_filename(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute paths. If files in the current
* folder cannot be represented as local filenames they will be ignored. (See
* gtk_file_chooser_get_uris())
* @returns a #GSList containing the filenames of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_filenames(): string[];
/**
* Lists all the selected files and subfolders in the current folder of `chooser`
* as #GFile. An internal function, see gtk_file_chooser_get_uris().
* @returns a #GSList containing a #GFile for each selected file and subfolder in the current folder. Free the returned list with g_slist_free(), and the files with g_object_unref().
*/
get_files(): Gio.File[];
/**
* Gets the current filter; see gtk_file_chooser_set_filter().
* @returns the current filter, or %NULL
*/
get_filter(): FileFilter;
/**
* Gets whether only local files can be selected in the
* file selector. See gtk_file_chooser_set_local_only()
* @returns %TRUE if only local files can be selected.
*/
get_local_only(): boolean;
/**
* Gets the #GFile that should be previewed in a custom preview
* Internal function, see gtk_file_chooser_get_preview_uri().
* @returns the #GFile for the file to preview, or %NULL if no file is selected. Free with g_object_unref().
*/
get_preview_file(): Gio.File;
/**
* Gets the filename that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the filename to preview, or %NULL if no file is selected, or if the selected file cannot be represented as a local filename. Free with g_free()
*/
get_preview_filename(): string;
/**
* Gets the URI that should be previewed in a custom preview
* widget. See gtk_file_chooser_set_preview_widget().
* @returns the URI for the file to preview, or %NULL if no file is selected. Free with g_free().
*/
get_preview_uri(): string;
/**
* Gets the current preview widget; see
* gtk_file_chooser_set_preview_widget().
* @returns the current preview widget, or %NULL
*/
get_preview_widget(): Widget;
/**
* Gets whether the preview widget set by gtk_file_chooser_set_preview_widget()
* should be shown for the current filename. See
* gtk_file_chooser_set_preview_widget_active().
* @returns %TRUE if the preview widget is active for the current filename.
*/
get_preview_widget_active(): boolean;
/**
* Gets whether multiple files can be selected in the file
* selector. See gtk_file_chooser_set_select_multiple().
* @returns %TRUE if multiple files can be selected.
*/
get_select_multiple(): boolean;
/**
* Gets whether hidden files and folders are displayed in the file selector.
* See gtk_file_chooser_set_show_hidden().
* @returns %TRUE if hidden files and folders are displayed.
*/
get_show_hidden(): boolean;
/**
* Gets the URI for the currently selected file in
* the file selector. If multiple files are selected,
* one of the filenames will be returned at random.
*
* If the file chooser is in folder mode, this function returns the selected
* folder.
* @returns The currently selected URI, or %NULL if no file is selected. If gtk_file_chooser_set_local_only() is set to %TRUE (the default) a local URI will be returned for any FUSE locations. Free with g_free()
*/
get_uri(): string;
/**
* Lists all the selected files and subfolders in the current folder of
* `chooser`. The returned names are full absolute URIs.
* @returns a #GSList containing the URIs of all selected files and subfolders in the current folder. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
get_uris(): string[];
/**
* Gets whether a stock label should be drawn with the name of the previewed
* file. See gtk_file_chooser_set_use_preview_label().
* @returns %TRUE if the file chooser is set to display a label with the name of the previewed file, %FALSE otherwise.
*/
get_use_preview_label(): boolean;
/**
* Lists the current set of user-selectable filters; see
* gtk_file_chooser_add_filter(), gtk_file_chooser_remove_filter().
* @returns a #GSList containing the current set of user selectable filters. The contents of the list are owned by GTK+, but you must free the list itself with g_slist_free() when you are done with it.
*/
list_filters(): FileFilter[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder_uri().
* @returns A list of folder URIs, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the URIs with g_free().
*/
list_shortcut_folder_uris(): string[];
/**
* Queries the list of shortcut folders in the file chooser, as set by
* gtk_file_chooser_add_shortcut_folder().
* @returns A list of folder filenames, or %NULL if there are no shortcut folders. Free the returned list with g_slist_free(), and the filenames with g_free().
*/
list_shortcut_folders(): string[];
/**
* Removes `filter` from the list of filters that the user can select between.
* @param filter a #GtkFileFilter
*/
remove_filter(filter: FileFilter): void;
/**
* Removes a folder from a file chooser's list of shortcut folders.
* @param folder filename of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder()
*/
remove_shortcut_folder(folder: string): boolean;
/**
* Removes a folder URI from a file chooser's list of shortcut folders.
* @param uri URI of the folder to remove
* @returns %TRUE if the operation succeeds, %FALSE otherwise. In the latter case, the @error will be set as appropriate. See also: gtk_file_chooser_add_shortcut_folder_uri()
*/
remove_shortcut_folder_uri(uri: string): boolean;
/**
* Selects all the files in the current folder of a file chooser.
*/
select_all(): void;
/**
* Selects the file referred to by `file`. An internal function. See
* _gtk_file_chooser_select_uri().
* @param file the file to select
* @returns %TRUE if both the folder could be changed and the path was selected successfully, %FALSE otherwise.
*/
select_file(file: Gio.File): boolean;
/**
* Selects a filename. If the file name isn't in the current
* folder of `chooser,` then the current folder of `chooser` will
* be changed to the folder containing `filename`.
* @param filename the filename to select
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
select_filename(filename: string): boolean;
/**
* Selects the file to by `uri`. If the URI doesn't refer to a
* file in the current folder of `chooser,` then the current folder of
* `chooser` will be changed to the folder containing `filename`.
* @param uri the URI to select
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
select_uri(uri: string): boolean;
/**
* Sets the type of operation that the chooser is performing; the
* user interface is adapted to suit the selected action. For example,
* an option to create a new folder might be shown if the action is
* %GTK_FILE_CHOOSER_ACTION_SAVE but not if the action is
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param action the action that the file selector is performing
*/
set_action(action: FileChooserAction | null): void;
/**
* Sets whether file choser will offer to create new folders.
* This is only relevant if the action is not set to be
* %GTK_FILE_CHOOSER_ACTION_OPEN.
* @param create_folders %TRUE if the New Folder button should be displayed
*/
set_create_folders(create_folders: boolean): void;
/**
* Sets the current folder for `chooser` from a local filename.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param filename the full path of the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder(filename: string): boolean;
/**
* Sets the current folder for `chooser` from a #GFile.
* Internal function, see gtk_file_chooser_set_current_folder_uri().
* @param file the #GFile for the new folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_file(file: Gio.File): boolean;
/**
* Sets the current folder for `chooser` from an URI.
* The user will be shown the full contents of the current folder,
* plus user interface elements for navigating to other folders.
* @param uri the URI for the new current folder
* @returns %TRUE if the folder could be changed successfully, %FALSE otherwise.
*/
set_current_folder_uri(uri: string): boolean;
/**
* Sets the current name in the file selector, as if entered
* by the user. Note that the name passed in here is a UTF-8
* string rather than a filename. This function is meant for
* such uses as a suggested name in a "Save As..." dialog.
*
* If you want to preselect a particular existing file, you should use
* gtk_file_chooser_set_filename() or gtk_file_chooser_set_uri() instead.
* Please see the documentation for those functions for an example of using
* gtk_file_chooser_set_current_name() as well.
* @param name the filename to use, as a UTF-8 string
*/
set_current_name(name: string): void;
/**
* Sets whether a file chooser in %GTK_FILE_CHOOSER_ACTION_SAVE mode will present
* a confirmation dialog if the user types a file name that already exists. This
* is %FALSE by default.
*
* Regardless of this setting, the `chooser` will emit the
* #GtkFileChooser::confirm-overwrite signal when appropriate.
*
* If all you need is the stock confirmation dialog, set this property to %TRUE.
* You can override the way confirmation is done by actually handling the
* #GtkFileChooser::confirm-overwrite signal; please refer to its documentation
* for the details.
* @param do_overwrite_confirmation whether to confirm overwriting in save mode
*/
set_do_overwrite_confirmation(do_overwrite_confirmation: boolean): void;
/**
* Sets an application-supplied widget to provide extra options to the user.
* @param extra_widget widget for extra options
*/
set_extra_widget(extra_widget: Widget): void;
/**
* Sets `file` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_file (chooser, default_file_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_file (chooser, existing_file);
* }
* ```
*
* @param file the #GFile to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_file(file: Gio.File): boolean;
/**
* Sets `filename` as the current filename for the file chooser, by changing
* to the file's parent folder and actually selecting the file in list. If
* the `chooser` is in %GTK_FILE_CHOOSER_ACTION_SAVE mode, the file's base name
* will also appear in the dialog's file name entry.
*
* If the file name isn't in the current folder of `chooser,` then the current
* folder of `chooser` will be changed to the folder containing `filename`. This
* is equivalent to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_filename().
*
* Note that the file must exist, or nothing will be done except
* for the directory change.
*
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_filename (chooser, existing_filename);
* }
* ```
*
* @param filename the filename to set as current
* @returns %TRUE if both the folder could be changed and the file was selected successfully, %FALSE otherwise.
*/
set_filename(filename: string): boolean;
/**
* Sets the current filter; only the files that pass the
* filter will be displayed. If the user-selectable list of filters
* is non-empty, then the filter should be one of the filters
* in that list. Setting the current filter when the list of
* filters is empty is useful if you want to restrict the displayed
* set of files without letting the user change it.
* @param filter a #GtkFileFilter
*/
set_filter(filter: FileFilter): void;
/**
* Sets whether only local files can be selected in the
* file selector. If `local_only` is %TRUE (the default),
* then the selected file are files are guaranteed to be
* accessible through the operating systems native file
* file system and therefore the application only
* needs to worry about the filename functions in
* #GtkFileChooser, like gtk_file_chooser_get_filename(),
* rather than the URI functions like
* gtk_file_chooser_get_uri(),
*
* On some systems non-native files may still be
* available using the native filesystem via a userspace
* filesystem (FUSE).
* @param local_only %TRUE if only local files can be selected
*/
set_local_only(local_only: boolean): void;
/**
* Sets an application-supplied widget to use to display a custom preview
* of the currently selected file. To implement a preview, after setting the
* preview widget, you connect to the #GtkFileChooser::update-preview
* signal, and call gtk_file_chooser_get_preview_filename() or
* gtk_file_chooser_get_preview_uri() on each change. If you can
* display a preview of the new file, update your widget and
* set the preview active using gtk_file_chooser_set_preview_widget_active().
* Otherwise, set the preview inactive.
*
* When there is no application-supplied preview widget, or the
* application-supplied preview widget is not active, the file chooser
* may display an internally generated preview of the current file or
* it may display no preview at all.
* @param preview_widget widget for displaying preview.
*/
set_preview_widget(preview_widget: Widget): void;
/**
* Sets whether the preview widget set by
* gtk_file_chooser_set_preview_widget() should be shown for the
* current filename. When `active` is set to false, the file chooser
* may display an internally generated preview of the current file
* or it may display no preview at all. See
* gtk_file_chooser_set_preview_widget() for more details.
* @param active whether to display the user-specified preview widget
*/
set_preview_widget_active(active: boolean): void;
/**
* Sets whether multiple files can be selected in the file selector. This is
* only relevant if the action is set to be %GTK_FILE_CHOOSER_ACTION_OPEN or
* %GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER.
* @param select_multiple %TRUE if multiple files can be selected.
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether hidden files and folders are displayed in the file selector.
* @param show_hidden %TRUE if hidden files and folders should be displayed.
*/
set_show_hidden(show_hidden: boolean): void;
/**
* Sets the file referred to by `uri` as the current file for the file chooser,
* by changing to the URI's parent folder and actually selecting the URI in the
* list. If the `chooser` is %GTK_FILE_CHOOSER_ACTION_SAVE mode, the URI's base
* name will also appear in the dialog's file name entry.
*
* If the URI isn't in the current folder of `chooser,` then the current folder
* of `chooser` will be changed to the folder containing `uri`. This is equivalent
* to a sequence of gtk_file_chooser_unselect_all() followed by
* gtk_file_chooser_select_uri().
*
* Note that the URI must exist, or nothing will be done except for the
* directory change.
* If you are implementing a <guimenuitem>File/Save As...</guimenuitem> dialog,
* you should use this function if you already have a file name to which the
* user may save; for example, when the user opens an existing file and then
* does <guimenuitem>File/Save As...</guimenuitem> on it. If you don't have
* a file name already &mdash; for example, if the user just created a new
* file and is saving it for the first time, do not call this function.
* Instead, use something similar to this:
*
* ```
* if (document_is_new)
* {
* /&ast; the user just created a new document &ast;/
* gtk_file_chooser_set_current_folder_uri (chooser, default_folder_for_saving);
* gtk_file_chooser_set_current_name (chooser, "Untitled document");
* }
* else
* {
* /&ast; the user edited an existing document &ast;/
* gtk_file_chooser_set_uri (chooser, existing_uri);
* }
* ```
*
* @param uri the URI to set as current
* @returns %TRUE if both the folder could be changed and the URI was selected successfully, %FALSE otherwise.
*/
set_uri(uri: string): boolean;
/**
* Sets whether the file chooser should display a stock label with the name of
* the file that is being previewed; the default is %TRUE. Applications that
* want to draw the whole preview area themselves should set this to %FALSE and
* display the name themselves in their preview widget.
*
* See also: gtk_file_chooser_set_preview_widget()
* @param use_label whether to display a stock label with the name of the previewed file
*/
set_use_preview_label(use_label: boolean): void;
/**
* Unselects all the files in the current folder of a file chooser.
*/
unselect_all(): void;
/**
* Unselects the file referred to by `file`. If the file is not in the current
* directory, does not exist, or is otherwise not currently selected, does nothing.
* @param file a #GFile
*/
unselect_file(file: Gio.File): void;
/**
* Unselects a currently selected filename. If the filename
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param filename the filename to unselect
*/
unselect_filename(filename: string): void;
/**
* Unselects the file referred to by `uri`. If the file
* is not in the current directory, does not exist, or
* is otherwise not currently selected, does nothing.
* @param uri the URI to unselect
*/
unselect_uri(uri: string): void;
}
export const FileChooser: FileChooserNamespace & {
new (): FileChooser; // This allows `obj instanceof FileChooser`
};
namespace Orientable {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
orientation: Orientation;
}
}
export interface OrientableNamespace {
$gtype: GObject.GType<Orientable>;
prototype: Orientable;
}
interface Orientable extends GObject.Object {
// Properties
/**
* The orientation of the orientable.
*/
get orientation(): Orientation;
set orientation(val: Orientation);
// Methods
/**
* Retrieves the orientation of the `orientable`.
* @returns the orientation of the @orientable.
*/
get_orientation(): Orientation;
/**
* Sets the orientation of the `orientable`.
* @param orientation the orientable's new orientation.
*/
set_orientation(orientation: Orientation | null): void;
}
export const Orientable: OrientableNamespace & {
new (): Orientable; // This allows `obj instanceof Orientable`
};
namespace PrintOperationPreview {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
export interface PrintOperationPreviewNamespace {
$gtype: GObject.GType<PrintOperationPreview>;
prototype: PrintOperationPreview;
}
interface PrintOperationPreview extends GObject.Object {
// Methods
/**
* Ends a preview.
*
* This function must be called to finish a custom print preview.
*/
end_preview(): void;
/**
* Returns whether the given page is included in the set of pages that
* have been selected for printing.
* @param page_nr a page number
* @returns %TRUE if the page has been selected for printing
*/
is_selected(page_nr: number): boolean;
/**
* Renders a page to the preview, using the print context that
* was passed to the #GtkPrintOperation::preview handler together
* with `preview`.
*
* A custom iprint preview should use this function in its ::expose
* handler to render the currently selected page.
*
* Note that this function requires a suitable cairo context to
* be associated with the print context.
* @param page_nr the page to render
*/
render_page(page_nr: number): void;
// Virtual methods
/**
* Ends a preview.
*
* This function must be called to finish a custom print preview.
*/
vfunc_end_preview(): void;
vfunc_got_page_size(context: PrintContext, page_setup: PageSetup): void;
/**
* Returns whether the given page is included in the set of pages that
* have been selected for printing.
* @param page_nr a page number
*/
vfunc_is_selected(page_nr: number): boolean;
vfunc_ready(context: PrintContext): void;
/**
* Renders a page to the preview, using the print context that
* was passed to the #GtkPrintOperation::preview handler together
* with `preview`.
*
* A custom iprint preview should use this function in its ::expose
* handler to render the currently selected page.
*
* Note that this function requires a suitable cairo context to
* be associated with the print context.
* @param page_nr the page to render
*/
vfunc_render_page(page_nr: number): void;
}
export const PrintOperationPreview: PrintOperationPreviewNamespace & {
new (): PrintOperationPreview; // This allows `obj instanceof PrintOperationPreview`
};
namespace RecentChooser {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
filter: RecentFilter;
limit: number;
local_only: boolean;
localOnly: boolean;
recent_manager: RecentManager;
recentManager: RecentManager;
select_multiple: boolean;
selectMultiple: boolean;
show_icons: boolean;
showIcons: boolean;
show_not_found: boolean;
showNotFound: boolean;
show_private: boolean;
showPrivate: boolean;
show_tips: boolean;
showTips: boolean;
sort_type: RecentSortType;
sortType: RecentSortType;
}
}
export interface RecentChooserNamespace {
$gtype: GObject.GType<RecentChooser>;
prototype: RecentChooser;
}
interface RecentChooser extends GObject.Object {
// Properties
/**
* The #GtkRecentFilter object to be used when displaying
* the recently used resources.
*/
get filter(): RecentFilter;
set filter(val: RecentFilter);
/**
* The maximum number of recently used resources to be displayed,
* or -1 to display all items. By default, the
* GtkSetting:gtk-recent-files-limit setting is respected: you can
* override that limit on a particular instance of #GtkRecentChooser
* by setting this property.
*/
get limit(): number;
set limit(val: number);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get local_only(): boolean;
set local_only(val: boolean);
/**
* Whether this #GtkRecentChooser should display only local (file:)
* resources.
*/
get localOnly(): boolean;
set localOnly(val: boolean);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recent_manager(val: RecentManager);
/**
* The #GtkRecentManager instance used by the #GtkRecentChooser to
* display the list of recently used resources.
*/
set recentManager(val: RecentManager);
/**
* Allow the user to select multiple resources.
*/
get select_multiple(): boolean;
set select_multiple(val: boolean);
/**
* Allow the user to select multiple resources.
*/
get selectMultiple(): boolean;
set selectMultiple(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get show_icons(): boolean;
set show_icons(val: boolean);
/**
* Whether this #GtkRecentChooser should display an icon near the item.
*/
get showIcons(): boolean;
set showIcons(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get show_not_found(): boolean;
set show_not_found(val: boolean);
/**
* Whether this #GtkRecentChooser should display the recently used resources
* even if not present anymore. Setting this to %FALSE will perform a
* potentially expensive check on every local resource (every remote
* resource will always be displayed).
*/
get showNotFound(): boolean;
set showNotFound(val: boolean);
get show_private(): boolean;
set show_private(val: boolean);
get showPrivate(): boolean;
set showPrivate(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get show_tips(): boolean;
set show_tips(val: boolean);
/**
* Whether this #GtkRecentChooser should display a tooltip containing the
* full path of the recently used resources.
*/
get showTips(): boolean;
set showTips(val: boolean);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sort_type(): RecentSortType;
set sort_type(val: RecentSortType);
/**
* Sorting order to be used when displaying the recently used resources.
*/
get sortType(): RecentSortType;
set sortType(val: RecentSortType);
// Methods
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
add_filter(filter: RecentFilter): void;
/**
* Gets the #GtkRecentInfo currently selected by `chooser`.
* @returns a #GtkRecentInfo. Use gtk_recent_info_unref() when when you have finished using it.
*/
get_current_item(): RecentInfo;
/**
* Gets the URI currently selected by `chooser`.
* @returns a newly allocated string holding a URI.
*/
get_current_uri(): string;
/**
* Gets the #GtkRecentFilter object currently used by `chooser` to affect
* the display of the recently used resources.
* @returns a #GtkRecentFilter object.
*/
get_filter(): RecentFilter;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
* @returns A newly allocated list of #GtkRecentInfo objects. You should use gtk_recent_info_unref() on every item of the list, and then free the list itself using g_list_free().
*/
get_items(): RecentInfo[];
/**
* Gets the number of items returned by gtk_recent_chooser_get_items()
* and gtk_recent_chooser_get_uris().
* @returns A positive integer, or -1 meaning that all items are returned.
*/
get_limit(): number;
/**
* Gets whether only local resources should be shown in the recently used
* resources selector. See gtk_recent_chooser_set_local_only()
* @returns %TRUE if only local resources should be shown.
*/
get_local_only(): boolean;
/**
* Gets whether `chooser` can select multiple items.
* @returns %TRUE if @chooser can select more than one item.
*/
get_select_multiple(): boolean;
/**
* Retrieves whether `chooser` should show an icon near the resource.
* @returns %TRUE if the icons should be displayed, %FALSE otherwise.
*/
get_show_icons(): boolean;
/**
* Retrieves whether `chooser` should show the recently used resources that
* were not found.
* @returns %TRUE if the resources not found should be displayed, and %FALSE otheriwse.
*/
get_show_not_found(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* prepended by a unique number.
* @returns %TRUE if the recent chooser should show display numbers, %FALSE otherwise.
*/
get_show_numbers(): boolean;
/**
* Returns whether `chooser` should display recently used resources
* registered as private.
* @returns %TRUE if the recent chooser should show private items, %FALSE otherwise.
*/
get_show_private(): boolean;
/**
* Gets whether `chooser` should display tooltips containing the full path
* of a recently user resource.
* @returns %TRUE if the recent chooser should show tooltips, %FALSE otherwise.
*/
get_show_tips(): boolean;
/**
* Gets the value set by gtk_recent_chooser_set_sort_type().
* @returns the sorting order of the @chooser.
*/
get_sort_type(): RecentSortType;
/**
* Gets the URI of the recently used resources.
*
* The return value of this function is affected by the "sort-type" and "limit"
* properties of `chooser`.
*
* Since the returned array is %NULL terminated, `length` may be %NULL.
* @returns A newly allocated, %NULL-terminated array of strings. Use g_strfreev() to free it.
*/
get_uris(): string[];
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
* @returns A singly linked list of #GtkRecentFilter objects. You should just free the returned list using g_slist_free().
*/
list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
* @returns %TRUE if @uri was found.
*/
select_uri(uri: string): boolean;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
* @returns %TRUE if the URI was found.
*/
set_current_uri(uri: string): boolean;
/**
* Sets `filter` as the current #GtkRecentFilter object used by `chooser`
* to affect the displayed recently used resources.
* @param filter a #GtkRecentFilter
*/
set_filter(filter: RecentFilter): void;
/**
* Sets the number of items that should be returned by
* gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris().
* @param limit a positive integer, or -1 for all items
*/
set_limit(limit: number): void;
/**
* Sets whether only local resources, that is resources using the file:// URI
* scheme, should be shown in the recently used resources selector. If
* `local_only` is %TRUE (the default) then the shown resources are guaranteed
* to be accessible through the operating system native file system.
* @param local_only %TRUE if only local files can be shown
*/
set_local_only(local_only: boolean): void;
/**
* Sets whether `chooser` can select multiple items.
* @param select_multiple %TRUE if @chooser can select more than one item
*/
set_select_multiple(select_multiple: boolean): void;
/**
* Sets whether `chooser` should show an icon near the resource when
* displaying it.
* @param show_icons whether to show an icon near the resource
*/
set_show_icons(show_icons: boolean): void;
/**
* Sets whether `chooser` should display the recently used resources that
* it didn't find. This only applies to local resources.
* @param show_not_found whether to show the local items we didn't find
*/
set_show_not_found(show_not_found: boolean): void;
/**
* Whether to show recently used resources prepended by a unique number.
* @param show_numbers %TRUE to show numbers, %FALSE otherwise
*/
set_show_numbers(show_numbers: boolean): void;
/**
* Whether to show recently used resources marked registered as private.
* @param show_private %TRUE to show private items, %FALSE otherwise
*/
set_show_private(show_private: boolean): void;
/**
* Sets whether to show a tooltips containing the full path of each
* recently used resource in a #GtkRecentChooser widget.
* @param show_tips %TRUE if tooltips should be shown
*/
set_show_tips(show_tips: boolean): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
* @param data_destroy destroy notifier for @sort_data, or %NULL
*/
set_sort_func(sort_func: RecentSortFunc, data_destroy?: GLib.DestroyNotify | null): void;
/**
* Changes the sorting order of the recently used resources list displayed by
* `chooser`.
* @param sort_type sort order that the chooser should use
*/
set_sort_type(sort_type: RecentSortType | null): void;
/**
* Unselects all the items inside `chooser`.
*/
unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
unselect_uri(uri: string): void;
// Virtual methods
/**
* Adds `filter` to the list of #GtkRecentFilter objects held by `chooser`.
*
* If no previous filter objects were defined, this function will call
* gtk_recent_chooser_set_filter().
* @param filter a #GtkRecentFilter
*/
vfunc_add_filter(filter: RecentFilter): void;
/**
* Gets the URI currently selected by `chooser`.
*/
vfunc_get_current_uri(): string;
/**
* Gets the list of recently used resources in form of #GtkRecentInfo objects.
*
* The return value of this function is affected by the "sort-type" and
* "limit" properties of `chooser`.
*/
vfunc_get_items(): RecentInfo[];
vfunc_item_activated(): void;
/**
* Gets the #GtkRecentFilter objects held by `chooser`.
*/
vfunc_list_filters(): RecentFilter[];
/**
* Removes `filter` from the list of #GtkRecentFilter objects held by `chooser`.
* @param filter a #GtkRecentFilter
*/
vfunc_remove_filter(filter: RecentFilter): void;
/**
* Selects all the items inside `chooser,` if the `chooser` supports
* multiple selection.
*/
vfunc_select_all(): void;
/**
* Selects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_select_uri(uri: string): boolean;
vfunc_selection_changed(): void;
/**
* Sets `uri` as the current URI for `chooser`.
* @param uri a URI
*/
vfunc_set_current_uri(uri: string): boolean;
/**
* Sets the comparison function used when sorting to be `sort_func`. If
* the `chooser` has the sort type set to #GTK_RECENT_SORT_CUSTOM then
* the chooser will sort using this function.
*
* To the comparison function will be passed two #GtkRecentInfo structs and
* `sort_data;` `sort_func` should return a positive integer if the first
* item comes before the second, zero if the two items are equal and
* a negative integer if the first item comes after the second.
* @param sort_func the comparison function
*/
vfunc_set_sort_func(sort_func: RecentSortFunc): void;
/**
* Unselects all the items inside `chooser`.
*/
vfunc_unselect_all(): void;
/**
* Unselects `uri` inside `chooser`.
* @param uri a URI
*/
vfunc_unselect_uri(uri: string): void;
}
export const RecentChooser: RecentChooserNamespace & {
new (): RecentChooser; // This allows `obj instanceof RecentChooser`
};
namespace ToolShell {
// Constructor properties interface
interface ConstructorProps extends Widget.ConstructorProps {}
}
export interface ToolShellNamespace {
$gtype: GObject.GType<ToolShell>;
prototype: ToolShell;
}
interface ToolShell extends Widget {
// Methods
/**
* Retrieves the current ellipsize mode for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
* instead.
* @returns the current ellipsize mode of @shell
*/
get_ellipsize_mode(): Pango.EllipsizeMode;
/**
* Retrieves the icon size for the tool shell. Tool items must not call this
* function directly, but rely on gtk_tool_item_get_icon_size() instead.
* @returns the current size for icons of @shell
*/
get_icon_size(): number;
/**
* Retrieves the current orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_orientation()
* instead.
* @returns the current orientation of @shell
*/
get_orientation(): Orientation;
/**
* Returns the relief style of buttons on `shell`. Tool items must not call this
* function directly, but rely on gtk_tool_item_get_relief_style() instead.
* @returns The relief style of buttons on @shell.
*/
get_relief_style(): ReliefStyle;
/**
* Retrieves whether the tool shell has text, icons, or both. Tool items must
* not call this function directly, but rely on gtk_tool_item_get_style()
* instead.
* @returns the current style of @shell
*/
get_style(): ToolbarStyle;
// Conflicted with Gtk.Widget.get_style
get_style(...args: never[]): any;
/**
* Retrieves the current text alignment for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_alignment()
* instead.
* @returns the current text alignment of @shell
*/
get_text_alignment(): number;
/**
* Retrieves the current text orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_orientation()
* instead.
* @returns the current text orientation of @shell
*/
get_text_orientation(): Orientation;
/**
* Retrieves the current text size group for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_size_group()
* instead.
* @returns the current text size group of @shell
*/
get_text_size_group(): SizeGroup;
/**
* Calling this function signals the tool shell that the overflow menu item for
* tool items have changed. If there is an overflow menu and if it is visible
* when this function it called, the menu will be rebuilt.
*
* Tool items must not call this function directly, but rely on
* gtk_tool_item_rebuild_menu() instead.
*/
rebuild_menu(): void;
// Virtual methods
/**
* Retrieves the current ellipsize mode for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_ellipsize_mode()
* instead.
*/
vfunc_get_ellipsize_mode(): Pango.EllipsizeMode;
/**
* mandatory implementation of gtk_tool_shell_get_icon_size().
*/
vfunc_get_icon_size(): IconSize;
/**
* Retrieves the current orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_orientation()
* instead.
*/
vfunc_get_orientation(): Orientation;
/**
* Returns the relief style of buttons on `shell`. Tool items must not call this
* function directly, but rely on gtk_tool_item_get_relief_style() instead.
*/
vfunc_get_relief_style(): ReliefStyle;
/**
* Retrieves whether the tool shell has text, icons, or both. Tool items must
* not call this function directly, but rely on gtk_tool_item_get_style()
* instead.
*/
vfunc_get_style(): ToolbarStyle;
/**
* Retrieves the current text alignment for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_alignment()
* instead.
*/
vfunc_get_text_alignment(): number;
/**
* Retrieves the current text orientation for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_orientation()
* instead.
*/
vfunc_get_text_orientation(): Orientation;
/**
* Retrieves the current text size group for the tool shell. Tool items must not
* call this function directly, but rely on gtk_tool_item_get_text_size_group()
* instead.
*/
vfunc_get_text_size_group(): SizeGroup;
/**
* Calling this function signals the tool shell that the overflow menu item for
* tool items have changed. If there is an overflow menu and if it is visible
* when this function it called, the menu will be rebuilt.
*
* Tool items must not call this function directly, but rely on
* gtk_tool_item_rebuild_menu() instead.
*/
vfunc_rebuild_menu(): void;
}
export const ToolShell: ToolShellNamespace & {
new (): ToolShell; // This allows `obj instanceof ToolShell`
};
namespace TreeDragDest {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
export interface TreeDragDestNamespace {
$gtype: GObject.GType<TreeDragDest>;
prototype: TreeDragDest;
}
interface TreeDragDest extends GObject.Object {
// Methods
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
* @returns whether a new row was created before position @dest
*/
drag_data_received(dest: TreePath, selection_data: SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn't exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
* @returns %TRUE if a drop is possible before @dest_path
*/
row_drop_possible(dest_path: TreePath, selection_data: SelectionData): boolean;
// Virtual methods
/**
* Asks the #GtkTreeDragDest to insert a row before the path `dest,`
* deriving the contents of the row from `selection_data`. If `dest` is
* outside the tree so that inserting before it is impossible, %FALSE
* will be returned. Also, %FALSE may be returned if the new row is
* not created for some model-specific reason. Should robustly handle
* a `dest` no longer found in the model!
* @param dest row to drop in front of
* @param selection_data data to drop
*/
vfunc_drag_data_received(dest: TreePath, selection_data: SelectionData): boolean;
/**
* Determines whether a drop is possible before the given `dest_path,`
* at the same depth as `dest_path`. i.e., can we drop the data in
* `selection_data` at that location. `dest_path` does not have to
* exist; the return value will almost certainly be %FALSE if the
* parent of `dest_path` doesn't exist, though.
* @param dest_path destination row
* @param selection_data the data being dragged
*/
vfunc_row_drop_possible(dest_path: TreePath, selection_data: SelectionData): boolean;
}
export const TreeDragDest: TreeDragDestNamespace & {
new (): TreeDragDest; // This allows `obj instanceof TreeDragDest`
};
namespace TreeDragSource {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
export interface TreeDragSourceNamespace {
$gtype: GObject.GType<TreeDragSource>;
prototype: TreeDragSource;
}
interface TreeDragSource extends GObject.Object {
// Methods
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
* @returns %TRUE if the row was successfully deleted
*/
drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
* @returns %TRUE if data of the required type was provided
*/
drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
* @returns %TRUE if the row can be dragged
*/
row_draggable(path: TreePath): boolean;
// Virtual methods
/**
* Asks the #GtkTreeDragSource to delete the row at `path,` because
* it was moved somewhere else via drag-and-drop. Returns %FALSE
* if the deletion fails because `path` no longer exists, or for
* some model-specific reason. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was being dragged
*/
vfunc_drag_data_delete(path: TreePath): boolean;
/**
* Asks the #GtkTreeDragSource to fill in `selection_data` with a
* representation of the row at `path`. `selection_data->`target gives
* the required type of the data. Should robustly handle a `path` no
* longer found in the model!
* @param path row that was dragged
*/
vfunc_drag_data_get(path: TreePath): [boolean, SelectionData];
/**
* Asks the #GtkTreeDragSource whether a particular row can be used as
* the source of a DND operation. If the source doesn't implement
* this interface, the row is assumed draggable.
* @param path row on which user is initiating a drag
*/
vfunc_row_draggable(path: TreePath): boolean;
}
export const TreeDragSource: TreeDragSourceNamespace & {
new (): TreeDragSource; // This allows `obj instanceof TreeDragSource`
};
namespace TreeModel {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
export interface TreeModelNamespace {
$gtype: GObject.GType<TreeModel>;
prototype: TreeModel;
}
interface TreeModel extends GObject.Object {
// Methods
/**
* Creates a new #GtkTreeModel, with `child_model` as the child_model
* and `root` as the virtual root.
* @param root A #GtkTreePath or %NULL.
* @returns A new #GtkTreeModel.
*/
filter_new(root?: TreePath | null): TreeModel;
/**
* Calls func on each node in model in a depth-first fashion.
* If `func` returns %TRUE, then the tree ceases to be walked, and
* gtk_tree_model_foreach() returns.
* @param func A function to be called on each row
*/
foreach(func: TreeModelForeachFunc): void;
/**
* Returns the type of the column.
* @param index_ The column index.
* @returns The type of the column.
*/
get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
* @returns The flags supported by this interface.
*/
get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter(path: TreePath): [boolean, TreeIter];
/**
* Initializes `iter` with the first iterator in the tree (the one at the path
* "0") and returns %TRUE. Returns %FALSE if the tree is empty.
* @returns %TRUE, if @iter was set.
*/
get_iter_first(): [boolean, TreeIter];
/**
* Sets `iter` to a valid iterator pointing to `path_string,` if it
* exists. Otherwise, `iter` is left invalid and %FALSE is returned.
* @param path_string A string representation of a #GtkTreePath.
* @returns %TRUE, if @iter was set.
*/
get_iter_from_string(path_string: string): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
* @returns The number of columns.
*/
get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
* @returns a newly-created #GtkTreePath.
*/
get_path(iter: TreeIter): TreePath;
/**
* Generates a string representation of the iter. This string is a ':'
* separated list of numbers. For example, "4:10:0:3" would be an
* acceptable return value for this string.
* @param iter An #GtkTreeIter.
* @returns A newly-allocated string. Must be freed with g_free().
*/
get_string_from_iter(iter: TreeIter): string;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
* @returns %TRUE, if @child has been set to the first child.
*/
iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
* @returns %TRUE if @iter has children.
*/
iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
* @returns The number of children of @iter.
*/
iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
* @returns %TRUE if @iter has been changed to the next node.
*/
iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
* @returns %TRUE, if @parent has an @n<!-- -->th child.
*/
iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
* @returns %TRUE, if @iter is set to the parent of @child.
*/
iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Creates a new #GtkTreeModel, with `child_model` as the child model.
* @returns A new #GtkTreeModel.
*/
sort_new_with_model(): TreeModel;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
unref_node(iter: TreeIter): void;
// Virtual methods
/**
* Returns the type of the column.
* @param index_ The column index.
*/
vfunc_get_column_type(index_: number): GObject.GType;
/**
* Returns a set of flags supported by this interface. The flags are a bitwise
* combination of #GtkTreeModelFlags. The flags supported should not change
* during the lifecycle of the `tree_model`.
*/
vfunc_get_flags(): TreeModelFlags;
/**
* Sets `iter` to a valid iterator pointing to `path`.
* @param path The #GtkTreePath.
*/
vfunc_get_iter(path: TreePath): [boolean, TreeIter];
/**
* Returns the number of columns supported by `tree_model`.
*/
vfunc_get_n_columns(): number;
/**
* Returns a newly-created #GtkTreePath referenced by `iter`. This path should
* be freed with gtk_tree_path_free().
* @param iter The #GtkTreeIter.
*/
vfunc_get_path(iter: TreeIter): TreePath;
/**
* Initializes and sets `value` to that at `column`.
* When done with `value,` g_value_unset() needs to be called
* to free any allocated memory.
* @param iter The #GtkTreeIter.
* @param column The column to lookup the value at.
*/
vfunc_get_value(iter: TreeIter, column: number): unknown;
/**
* Sets `iter` to point to the first child of `parent`. If `parent` has no
* children, %FALSE is returned and `iter` is set to be invalid. `parent`
* will remain a valid node after this function has been called.
*
* If `parent` is %NULL returns the first node, equivalent to
* <literal>gtk_tree_model_get_iter_first (tree_model, iter);</literal>
* @param parent The #GtkTreeIter, or %NULL
*/
vfunc_iter_children(parent?: TreeIter | null): [boolean, TreeIter];
/**
* Returns %TRUE if `iter` has children, %FALSE otherwise.
* @param iter The #GtkTreeIter to test for children.
*/
vfunc_iter_has_child(iter: TreeIter): boolean;
/**
* Returns the number of children that `iter` has. As a special case, if `iter`
* is %NULL, then the number of toplevel nodes is returned.
* @param iter The #GtkTreeIter, or %NULL.
*/
vfunc_iter_n_children(iter?: TreeIter | null): number;
/**
* Sets `iter` to point to the node following it at the current level. If there
* is no next `iter,` %FALSE is returned and `iter` is set to be invalid.
* @param iter The #GtkTreeIter.
*/
vfunc_iter_next(iter: TreeIter): boolean;
/**
* Sets `iter` to be the child of `parent,` using the given index. The first
* index is 0. If `n` is too big, or `parent` has no children, `iter` is set
* to an invalid iterator and %FALSE is returned. `parent` will remain a valid
* node after this function has been called. As a special case, if `parent` is
* %NULL, then the `n<`!-- -->th root node is set.
* @param parent The #GtkTreeIter to get the child from, or %NULL.
* @param n Then index of the desired child.
*/
vfunc_iter_nth_child(parent: TreeIter | null, n: number): [boolean, TreeIter];
/**
* Sets `iter` to be the parent of `child`. If `child` is at the toplevel, and
* doesn't have a parent, then `iter` is set to an invalid iterator and %FALSE
* is returned. `child` will remain a valid node after this function has been
* called.
* @param child The #GtkTreeIter.
*/
vfunc_iter_parent(child: TreeIter): [boolean, TreeIter];
/**
* Lets the tree ref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* This function is primarily meant as a way for views to let caching model
* know when nodes are being displayed (and hence, whether or not to cache that
* node.) For example, a file-system based model would not want to keep the
* entire file-hierarchy in memory, just the sections that are currently being
* displayed by every current view.
*
* A model should be expected to be able to get an iter independent of its
* reffed state.
* @param iter The #GtkTreeIter.
*/
vfunc_ref_node(iter: TreeIter): void;
/**
* Emits the "row-changed" signal on `tree_model`.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_changed(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-deleted" signal on `tree_model`. This should be called by
* models after a row has been removed. The location pointed to by `path`
* should be the location that the row previously was at. It may not be a
* valid location anymore.
* @param path A #GtkTreePath pointing to the previous location of the deleted row.
*/
vfunc_row_deleted(path: TreePath): void;
/**
* Emits the "row-has-child-toggled" signal on `tree_model`. This should be
* called by models after the child state of a node changes.
* @param path A #GtkTreePath pointing to the changed row
* @param iter A valid #GtkTreeIter pointing to the changed row
*/
vfunc_row_has_child_toggled(path: TreePath, iter: TreeIter): void;
/**
* Emits the "row-inserted" signal on `tree_model`
* @param path A #GtkTreePath pointing to the inserted row
* @param iter A valid #GtkTreeIter pointing to the inserted row
*/
vfunc_row_inserted(path: TreePath, iter: TreeIter): void;
/**
* Emits the "rows-reordered" signal on `tree_model`. This should be called by
* models when their rows have been reordered.
* @param path A #GtkTreePath pointing to the tree node whose children have been reordered
* @param iter A valid #GtkTreeIter pointing to the node whose children have been reordered, or %NULL if the depth of @path is 0.
* @param new_order an array of integers mapping the current position of each child to its old position before the re-ordering, i.e. @new_order<literal>[newpos] = oldpos</literal>.
*/
vfunc_rows_reordered(path: TreePath, iter: TreeIter, new_order: number): void;
/**
* Lets the tree unref the node. This is an optional method for models to
* implement. To be more specific, models may ignore this call as it exists
* primarily for performance reasons.
*
* For more information on what this means, see gtk_tree_model_ref_node().
* Please note that nodes that are deleted are not unreffed.
* @param iter The #GtkTreeIter.
*/
vfunc_unref_node(iter: TreeIter): void;
}
export const TreeModel: TreeModelNamespace & {
new (): TreeModel; // This allows `obj instanceof TreeModel`
};
namespace TreeSortable {
// Constructor properties interface
interface ConstructorProps extends TreeModel.ConstructorProps {}
}
export interface TreeSortableNamespace {
$gtype: GObject.GType<TreeSortable>;
prototype: TreeSortable;
}
interface TreeSortable extends TreeModel {
// Methods
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
* @returns %TRUE if the sort column is not one of the special sort column ids.
*/
get_sort_column_id(sort_column_id: number, order: SortType | null): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
* @returns %TRUE, if the model has a default sort function
*/
has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_default_sort_func(sort_func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
set_sort_column_id(sort_column_id: number, order: SortType | null): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param sort_func The comparison function
* @param destroy Destroy notifier of @user_data, or %NULL
*/
set_sort_func(
sort_column_id: number,
sort_func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
sort_column_changed(): void;
// Virtual methods
/**
* Fills in `sort_column_id` and `order` with the current sort column and the
* order. It returns %TRUE unless the `sort_column_id` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID or
* %GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID.
* @param sort_column_id The sort column id to be filled in
* @param order The #GtkSortType to be filled in
*/
vfunc_get_sort_column_id(sort_column_id: number, order: SortType): boolean;
/**
* Returns %TRUE if the model has a default sort function. This is used
* primarily by GtkTreeViewColumns in order to determine if a model can
* go back to the default state, or not.
*/
vfunc_has_default_sort_func(): boolean;
/**
* Sets the default comparison function used when sorting to be `sort_func`.
* If the current sort column id of `sortable` is
* %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using
* this function.
*
* If `sort_func` is %NULL, then there will be no default comparison function.
* This means that once the model has been sorted, it can't go back to the
* default state. In this case, when the current sort column id of `sortable`
* is %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_default_sort_func(func: TreeIterCompareFunc, destroy?: GLib.DestroyNotify | null): void;
/**
* Sets the current sort column to be `sort_column_id`. The `sortable` will
* resort itself to reflect this change, after emitting a
* #GtkTreeSortable::sort-column-changed signal. `sort_column_id` may either be
* a regular column id, or one of the following special values:
* <variablelist>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID</term>
* <listitem>the default sort function will be used, if it is set</listitem>
* </varlistentry>
* <varlistentry>
* <term>%GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID</term>
* <listitem>no sorting will occur</listitem>
* </varlistentry>
* </variablelist>
* @param sort_column_id the sort column id to set
* @param order The sort order of the column
*/
vfunc_set_sort_column_id(sort_column_id: number, order: SortType): void;
/**
* Sets the comparison function used when sorting to be `sort_func`. If the
* current sort column id of `sortable` is the same as `sort_column_id,` then
* the model will sort using this function.
* @param sort_column_id the sort column id to set the function for
* @param func
* @param destroy Destroy notifier of @user_data, or %NULL
*/
vfunc_set_sort_func(
sort_column_id: number,
func: TreeIterCompareFunc,
destroy?: GLib.DestroyNotify | null,
): void;
/**
* Emits a #GtkTreeSortable::sort-column-changed signal on `sortable`.
*/
vfunc_sort_column_changed(): void;
}
export const TreeSortable: TreeSortableNamespace & {
new (): TreeSortable; // This allows `obj instanceof TreeSortable`
};
type Allocation = Gdk.Rectangle;
type ClassInitFunc = GObject.BaseInitFunc;
type EnumValue = GObject.EnumValue;
type FlagValue = GObject.FlagsValue;
type FundamentalType = GObject.GType;
type ObjectInitFunc = GObject.InstanceInitFunc;
type SignalMarshaller = GObject.SignalCMarshaller;
type Type = GObject.GType;
type TypeClass = GObject.TypeClass;
type TypeObject = GObject.TypeInstance;
/**
* 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 Gtk;
}
declare module 'gi://Gtk' {
import Gtk20 from 'gi://Gtk?version=2.0';
export default Gtk20;
}
// END