///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
/**
* 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://Hex?version=4' {
// Module dependencies
import type Gtk from 'gi://Gtk?version=4.0';
import type Gsk from 'gi://Gsk?version=4.0';
import type Graphene from 'gi://Graphene?version=1.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Gdk from 'gi://Gdk?version=4.0';
import type cairo from 'cairo';
import type PangoCairo from 'gi://PangoCairo?version=1.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';
export namespace Hex {
/**
* Hex-4
*/
/**
* Type of change operation.
*/
/**
* Type of change operation.
*/
export namespace ChangeType {
export const $gtype: GObject.GType;
}
enum ChangeType {
/**
* the change is a string
*/
STRING,
/**
* the change is a single byte/character
*/
BYTE,
}
/**
* Specifies how data is to be grouped by the #HexWidget.
*/
/**
* Specifies how data is to be grouped by the #HexWidget.
*/
export namespace WidgetGroupType {
export const $gtype: GObject.GType;
}
enum WidgetGroupType {
/**
* group data by byte (8-bit)
*/
BYTE,
/**
* group data by word (16-bit)
*/
WORD,
/**
* group data by long (32-bit)
*/
LONG,
/**
* group data by quadword (64-bit)
*/
QUAD,
}
/**
* Utility function to obtain the size of a #GFile.
*
* Since 4.6, this function will return an unspecified negative value if the
* file size was unable to be obtained, as opposed to 0 as it previously did.
* This is to distinguish between valid zero-length files and files for which
* the size was not able to be obtained (eg, if it was unreadable). In the
* future, these negative values may be defined as specific enums which have a
* more specific meaning. But presently and going forward, testing for a
* negative value is sufficient to determine that the file size was
* unobtainable.
* @param file file to obtain size of
* @returns the size of the file, in bytes
*/
function buffer_util_get_file_size(file: Gio.File): number;
/**
* Utility function to create an on object which implements the HexBuffer
* interface.
*
* The `plugin` parameter will be the unique part of the plugin file name (eg,
* if the file name is libhex-buffer-mmap.so, you would specify "mmap"). If
* `NULL` is passed, the fallback (presently the "malloc" backend, but this is
* an implementation detail and may be subject to change) will be used.
*
* The `file` parameter is a valid #GFile if you would like the buffer
* pre-loaded, or %NULL for an empty buffer.
* @param plugin the name of the plugin, or %NULL
* @param file file to initialize the buffer with, or %NULL
* @returns a pointer to a valid implementation of a [iface@Hex.Buffer] interface, pre-cast as type #HexBuffer, or %NULL if the operation failed. Starting with 4.2, if a specific backend is requested, and the system supports plugins as a whole but cannot load that specified plugin, %NULL will be returned as though the operation failed, so as to customize the fallback scheme programmatically.
*/
function buffer_util_new(plugin?: string | null, file?: Gio.File | null): Buffer;
/**
* Bitwise flags for search options that can be combined as desired.
*/
/**
* Bitwise flags for search options that can be combined as desired.
*/
export namespace SearchFlags {
export const $gtype: GObject.GType;
}
enum SearchFlags {
/**
* no search flags (byte-for-byte match)
*/
NONE,
/**
* regular expression search
*/
REGEX,
/**
* case-insensitive search
*/
IGNORE_CASE,
}
namespace Document {
// Signal callback interfaces
interface DocumentChanged {
(object: any | null, p0: boolean): void;
}
interface FileLoaded {
(): void;
}
interface FileNameChanged {
(): void;
}
interface FileReadStarted {
(): void;
}
interface FileSaveStarted {
(): void;
}
interface FileSaved {
(): void;
}
interface Redo {
(): void;
}
interface Undo {
(): void;
}
interface UndoStackForget {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
buffer: Buffer;
file: Gio.File;
}
}
/**
* `HexDocument` is an object which allows raw data to be loaded,
* saved and manipulated, intended primarily to be used with the `HexWidget`
* widget.
*/
class Document extends GObject.Object {
static $gtype: GObject.GType;
// Properties
get buffer(): Buffer;
set buffer(val: Buffer);
get file(): Gio.File;
set file(val: Gio.File);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Document;
static new_from_file(file: Gio.File): Document;
// 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: 'document-changed',
callback: (_source: this, object: any | null, p0: boolean) => void,
): number;
connect_after(
signal: 'document-changed',
callback: (_source: this, object: any | null, p0: boolean) => void,
): number;
emit(signal: 'document-changed', object: any | null, p0: boolean): void;
connect(signal: 'file-loaded', callback: (_source: this) => void): number;
connect_after(signal: 'file-loaded', callback: (_source: this) => void): number;
emit(signal: 'file-loaded'): void;
connect(signal: 'file-name-changed', callback: (_source: this) => void): number;
connect_after(signal: 'file-name-changed', callback: (_source: this) => void): number;
emit(signal: 'file-name-changed'): void;
connect(signal: 'file-read-started', callback: (_source: this) => void): number;
connect_after(signal: 'file-read-started', callback: (_source: this) => void): number;
emit(signal: 'file-read-started'): void;
connect(signal: 'file-save-started', callback: (_source: this) => void): number;
connect_after(signal: 'file-save-started', callback: (_source: this) => void): number;
emit(signal: 'file-save-started'): void;
connect(signal: 'file-saved', callback: (_source: this) => void): number;
connect_after(signal: 'file-saved', callback: (_source: this) => void): number;
emit(signal: 'file-saved'): void;
connect(signal: 'redo', callback: (_source: this) => void): number;
connect_after(signal: 'redo', callback: (_source: this) => void): number;
emit(signal: 'redo'): void;
connect(signal: 'undo', callback: (_source: this) => void): number;
connect_after(signal: 'undo', callback: (_source: this) => void): number;
emit(signal: 'undo'): void;
connect(signal: 'undo-stack-forget', callback: (_source: this) => void): number;
connect_after(signal: 'undo-stack-forget', callback: (_source: this) => void): number;
emit(signal: 'undo-stack-forget'): void;
// Methods
/**
* Determine whether a redo operation is possible.
* @returns %TRUE if a redo operation is possible; %FALSE otherwise
*/
can_redo(): boolean;
/**
* Determine whether an undo operation is possible.
* @returns %TRUE if an undo operation is possible; %FALSE otherwise
*/
can_undo(): boolean;
/**
* Convenience method to emit the [signal`Hex`.Document::document-changed]
* signal. This method is mostly only useful for widgets utilizing
* #HexDocument.
* @param change_data pointer to a [struct@Hex.ChangeData] structure
* @param push_undo whether the undo stack should be pushed to
*/
changed(change_data: any | null, push_undo: boolean): void;
compare_data(what: Uint8Array | string, pos: number): number;
/**
* Full version of [method`Hex`.Document.compare_data] to allow data
* comparisons broader than byte-for-byte matches only. However, it is
* less convenient than the above since it requires the caller to allocate
* and free a #HexDocumentFindData structure.
* @param find_data a #HexDocumentFindData structure
* @param pos offset position of the #HexDocument data to compare with the string contained in the `find_data` structure
* @returns 0 if the comparison is an exact match; otherwise, a non-zero value is returned.
*/
compare_data_full(find_data: DocumentFindData, pos: number): number;
/**
* Delete data at `offset` of `length` within the buffer.
* @param offset offset in bytes within the payload
* @param len length in bytes of the data to be set
* @param undoable whether the operation should be undoable
*/
delete_data(offset: number, len: number, undoable: boolean): void;
/**
* Export the #HexDocument to HTML.
* @param html_path path to the directory in which the HTML file will be saved
* @param base_name the base name of the filename to be saved, without the .html extension.
* @param start starting offset byte of the payload in the range to save
* @param end ending offset byte of the payload in the range to save
* @param cpl columns per line
* @param lpp lines per page
* @param cpw characters per word (for grouping of nibbles)
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
export_html(
html_path: string,
base_name: string,
start: number,
end: number,
cpl: number,
lpp: number,
cpw: number,
): boolean;
/**
* Find a string backwards in a #HexDocument.
*
* This method will block. For a non-blocking version, use
* [method`Hex`.Document.find_backward_async], which is also recommended
* for GUI operations, as it, unlike this method, allows for easy passing-in
* of found/not-found strings to be passed back to the interface.
* @param start starting offset byte of the payload to commence the search
* @param what a pointer to the data to search within the #HexDocument
* @returns %TRUE if @what was found by the requested operation; %FALSE otherwise.
*/
find_backward(start: number, what: Uint8Array | string): [boolean, number];
/**
* Non-blocking version of [method`Hex`.Document.find_backward]. This is the
* function that should generally be used by a GUI client to find a string
* backwards in a #HexDocument.
* @param start starting offset byte of the payload to commence the search
* @param what a pointer to the data to search within the #HexDocument
* @param found_msg message intended to be displayed by the client if the string is found
* @param not_found_msg message intended to be displayed by the client if the string is not found
* @param cancellable
* @param callback function to be called when the operation is complete
*/
find_backward_async(
start: number,
what: Uint8Array | string,
found_msg: string,
not_found_msg: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): number;
/**
* Full version of [method`Hex`.Document.find_backward] which allows for
* more flexibility than the above, which is only for a byte-by-byte exact
* match. However, it is less convenient to call since the caller must
* create and and free a #HexDocumentFindData structure manually.
*
* This method will block. For a non-blocking version, use
* [method`Hex`.Document.find_backward_full_async].
* @param find_data a #HexDocumentFindData structure
* @returns %TRUE if the search string contained in `find_data` was found by the requested operation; %FALSE otherwise.
*/
find_backward_full(find_data: DocumentFindData): boolean;
/**
* Non-blocking version of [method`Hex`.Document.find_backward_full].
* @param find_data a #HexDocumentFindData structure
* @param cancellable a #GCancellable
* @param callback function to be called when the operation is complete
*/
find_backward_full_async(
find_data: DocumentFindData,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Obtain the result of a completed asynchronous find operation (forwards or
* backwards).
* @param result result of the task
* @returns a pointer to a [struct@Hex.DocumentFindData] structure, or %NULL
*/
find_finish(result: Gio.AsyncResult): DocumentFindData;
/**
* Find a string forwards in a #HexDocument.
*
* This method will block. For a non-blocking version, use
* [method`Hex`.Document.find_forward_async], which is also recommended
* for GUI operations, as it, unlike this method, allows for easy passing-in
* of found/not-found strings to be passed back to the interface.
* @param start starting offset byte of the payload to commence the search
* @param what a pointer to the data to search within the #HexDocument
* @returns %TRUE if @what was found by the requested operation; %FALSE otherwise.
*/
find_forward(start: number, what: Uint8Array | string): [boolean, number];
/**
* Non-blocking version of [method`Hex`.Document.find_forward]. This is the
* function that should generally be used by a GUI client to find a string
* forwards in a #HexDocument.
* @param start starting offset byte of the payload to commence the search
* @param what a pointer to the data to search within the #HexDocument
* @param found_msg message intended to be displayed by the client if the string is found
* @param not_found_msg message intended to be displayed by the client if the string is not found
* @param cancellable
* @param callback function to be called when the operation is complete
*/
find_forward_async(
start: number,
what: Uint8Array | string,
found_msg: string,
not_found_msg: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): number;
/**
* Full version of [method`Hex`.Document.find_forward] which allows for
* more flexibility than the above, which is only for a byte-by-byte exact
* match. However, it is less convenient to call since the caller must
* create and and free a #HexDocumentFindData structure manually.
*
* This method will block. For a non-blocking version, use
* [method`Hex`.Document.find_forward_async].
* @param find_data a #HexDocumentFindData structure
* @returns %TRUE if the search string contained in `find_data` was found by the requested operation; %FALSE otherwise.
*/
find_forward_full(find_data: DocumentFindData): boolean;
/**
* Non-blocking version of [method`Hex`.Document.find_forward_full].
* @param find_data a #HexDocumentFindData structure
* @param cancellable a #GCancellable
* @param callback function to be called when the operation is complete
*/
find_forward_full_async(
find_data: DocumentFindData,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
/**
* Get the [iface`Hex`.Buffer] connected with the #HexDocument.
* @returns a pointer to the [iface@Hex.Buffer] connected with the #HexDocument, or %NULL if no such interface is so connected.
*/
get_buffer(): Buffer;
/**
* Get the #GFile connected with the #HexDocument.
* @returns the #GFile connected with the #HexDocument, or %NULL if no such object is so connected.
*/
get_file(): Gio.File;
get_file_size(): number;
/**
* Get the undo data at the top of the undo stack of a #HexDocument, if any.
* @returns a pointer to the [struct@Hex.ChangeData] structure at the top of the undo stack, or %NULL
*/
get_undo_data(): ChangeData;
/**
* Method to check whether the #HexDocument has changed.
* @returns %TRUE if the document has changed, %FALSE otherwise
*/
has_changed(): boolean;
/**
* Read the #GFile into the buffer connected to the #HexDocument object.
*
* This method is mostly a wrapper around [method`Hex`.Buffer.read_async]
* but will allow additional steps and appropriate signals to be emitted
* applicable to the document object above and beyond the buffer, when
* the operation completes.
* @param cancellable a #GCancellable
*/
read_async(cancellable?: Gio.Cancellable | null): Promise;
/**
* Read the #GFile into the buffer connected to the #HexDocument object.
*
* This method is mostly a wrapper around [method`Hex`.Buffer.read_async]
* but will allow additional steps and appropriate signals to be emitted
* applicable to the document object above and beyond the buffer, when
* the operation completes.
* @param cancellable a #GCancellable
* @param callback function to be called when the operation is complete
*/
read_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Read the #GFile into the buffer connected to the #HexDocument object.
*
* This method is mostly a wrapper around [method`Hex`.Buffer.read_async]
* but will allow additional steps and appropriate signals to be emitted
* applicable to the document object above and beyond the buffer, when
* the operation completes.
* @param cancellable a #GCancellable
* @param callback function to be called when the operation is complete
*/
read_async(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Obtain the result of a completed file read operation.
*
* This method is mostly a wrapper around [method`Hex`.Buffer.read_finish]
* but takes some additional steps and emits the appropriate signals
* applicable to the document object above and beyond the buffer.
*
* This method is typically called from the #GAsyncReadyCallback function
* passed to [method`Hex`.Document.read_async] to obtain the result of the
* operation.
* @param result result of the task
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
read_finish(result: Gio.AsyncResult): boolean;
/**
* Perform a redo operation.
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
redo(): boolean;
/**
* Set the [iface`Hex`.Buffer] connected with the #HexDocument.
* @param buf [iface@Hex.Buffer]
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
set_buffer(buf: Buffer): boolean;
/**
* Set a particular byte of a #HexDocument at position `offset` within
* the payload.
* @param val a character to set the byte as
* @param offset offset in bytes within the payload
* @param insert %TRUE if the operation should be insert mode, %FALSE if in overwrite mode
* @param undoable whether the operation should be undoable
*/
set_byte(val: number, offset: number, insert: boolean, undoable: boolean): void;
/**
* A convenience wrapper for [method`Hex`.Buffer.set_data]. See the
* description of that method for details.
* @param offset offset in bytes within the payload
* @param rep_len amount of bytes to replace/overwrite (if any)
* @param data a pointer to the data being provided
* @param undoable whether the operation should be undoable
*/
set_data(offset: number, rep_len: number, data: Uint8Array | string, undoable: boolean): void;
// Conflicted with GObject.Object.set_data
set_data(...args: never[]): any;
/**
* Set the file of a [class`Hex`.Document] object by #GFile.
* @param file a #GFile pointing to a valid file on the system
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
set_file(file: Gio.File): boolean;
/**
* Set the maximum size of the #HexDocument undo stack.
* @param max_undo the new maximum size of the undo stack
*/
set_max_undo(max_undo: number): void;
/**
* Set a particular nibble of a #HexDocument.
* @param val a character to set the nibble as
* @param offset offset in bytes within the payload
* @param lower_nibble %TRUE if targetting the lower nibble (2nd hex digit) %FALSE if targetting the upper nibble (1st hex digit)
* @param insert %TRUE if the operation should be insert mode, %FALSE if in overwrite mode
* @param undoable whether the operation should be undoable
*/
set_nibble(val: number, offset: number, lower_nibble: boolean, insert: boolean, undoable: boolean): void;
/**
* Perform an undo operation.
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
undo(): boolean;
/**
* Write the buffer to the pre-existing #GFile connected to the #HexDocument
* object. This can be used for a 'Save (in place)' operation.
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
write(): boolean;
/**
* Write the buffer to the pre-existing #GFile connected to the #HexDocument
* object. This can be used for a 'Save (in place)' operation. This is the
* non-blocking version of [method`Hex`.Document.write].
*
* Note that for both this method and
* [method`Hex`.Document.write_to_file_async],
* [method`Hex`.Document.write_finish] is the method to retrieve the return
* value in your #GAsyncReadyCallback function.
* @param cancellable a #GCancellable
*/
write_async(cancellable?: Gio.Cancellable | null): Promise;
/**
* Write the buffer to the pre-existing #GFile connected to the #HexDocument
* object. This can be used for a 'Save (in place)' operation. This is the
* non-blocking version of [method`Hex`.Document.write].
*
* Note that for both this method and
* [method`Hex`.Document.write_to_file_async],
* [method`Hex`.Document.write_finish] is the method to retrieve the return
* value in your #GAsyncReadyCallback function.
* @param cancellable a #GCancellable
* @param callback function to be called when the operation is complete
*/
write_async(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Write the buffer to the pre-existing #GFile connected to the #HexDocument
* object. This can be used for a 'Save (in place)' operation. This is the
* non-blocking version of [method`Hex`.Document.write].
*
* Note that for both this method and
* [method`Hex`.Document.write_to_file_async],
* [method`Hex`.Document.write_finish] is the method to retrieve the return
* value in your #GAsyncReadyCallback function.
* @param cancellable a #GCancellable
* @param callback function to be called when the operation is complete
*/
write_async(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): Promise | void;
/**
* Obtain the result of a completed write-to-file operation.
*
* Currently, this method is mostly a wrapper around
* [method`Hex`.Buffer.write_to_file_finish].
*
* This method is typically called from the #GAsyncReadyCallback function
* passed to [method`Hex`.Document.write_async] or
* [method`Hex`.Document.write_to_file_async] to obtain the result of the
* operation.
* @param result result of the task
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
write_finish(result: Gio.AsyncResult): boolean;
/**
* Write the buffer to `file`. This can be used for a 'Save As' operation.
*
* This operation will block.
* @param file #GFile to be written to
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
write_to_file(file: Gio.File): boolean;
/**
* Write the buffer to `file` asynchronously. This can be used for a 'Save As'
* operation. This is the non-blocking version of
* [method`Hex`.Document.write_to_file].
*
* Note that for both this method and [method`Hex`.Document.write_async],
* [method`Hex`.Document.write_finish] is the method to retrieve the return
* value in your #GAsyncReadyCallback function.
* @param file #GFile to be written to
* @param cancellable a #GCancellable
* @param callback function to be called when the operation is complete
*/
write_to_file_async(
file: Gio.File,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): void;
}
namespace Widget {
// Signal callback interfaces
interface CopyClipboard {
(): void;
}
interface CursorMoved {
(): void;
}
interface CutClipboard {
(): void;
}
interface DataChanged {
(): void;
}
interface DrawComplete {
(): void;
}
interface PasteClipboard {
(): void;
}
// Constructor properties interface
interface ConstructorProps
extends Gtk.Widget.ConstructorProps,
Gtk.Accessible.ConstructorProps,
Gtk.Buildable.ConstructorProps,
Gtk.ConstraintTarget.ConstructorProps {
document: Document;
fade_zeroes: boolean;
fadeZeroes: boolean;
}
}
/**
* #HexWidget is a widget which can display #HexDocument data as a
* side-by-side representation of offets, hexadecimal nibbles, and ASCII
* characters.
*/
class Widget extends Gtk.Widget implements Gtk.Accessible, Gtk.Buildable, Gtk.ConstraintTarget {
static $gtype: GObject.GType;
// Properties
/**
* `HexDocument` affiliated with and owned by the `HexWidget`.
*/
get document(): Document;
/**
* Whether zeroes (`00`) will be faded on the hex side of the `HexWidget`.
*/
get fade_zeroes(): boolean;
set fade_zeroes(val: boolean);
/**
* Whether zeroes (`00`) will be faded on the hex side of the `HexWidget`.
*/
get fadeZeroes(): boolean;
set fadeZeroes(val: boolean);
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](owner: Document): Widget;
// 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: 'copy-clipboard', callback: (_source: this) => void): number;
connect_after(signal: 'copy-clipboard', callback: (_source: this) => void): number;
emit(signal: 'copy-clipboard'): void;
connect(signal: 'cursor-moved', callback: (_source: this) => void): number;
connect_after(signal: 'cursor-moved', callback: (_source: this) => void): number;
emit(signal: 'cursor-moved'): 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: 'data-changed', callback: (_source: this) => void): number;
connect_after(signal: 'data-changed', callback: (_source: this) => void): number;
emit(signal: 'data-changed'): void;
connect(signal: 'draw-complete', callback: (_source: this) => void): number;
connect_after(signal: 'draw-complete', callback: (_source: this) => void): number;
emit(signal: 'draw-complete'): 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;
// Methods
/**
* Add a mark for a `HexWidget` object at the specified absolute `start` and
* `end` offsets.
*
* Although the mark obtains an index within the widget internally, this index
* numeral is private and is not retrievable. As a result, it is recommended
* that applications wishing to manipulate marks retain the pointer returned by
* this function, and implement their own tracking mechanism for the marks.
* @param start The start offset of the mark
* @param end The start offset of the mark
* @param color A custom color to set for the mark, or `NULL` to use the default
* @returns A pointer to a `HexWidgetMark` object, owned by the `HexWidget`.
*/
add_mark(start: number, end: number, color?: Gdk.RGBA | null): WidgetMark;
/**
* Clear the selection (if any). Any autohighlights will remain intact.
*/
clear_selection(): void;
/**
* Copy selection to clipboard.
*/
copy_to_clipboard(): void;
/**
* Cut selection to clipboard.
*/
cut_to_clipboard(): void;
/**
* Delete the requested autohighlight.
* @param ahl the autohighlight to be deleted
*/
delete_autohighlight(ahl: WidgetAutoHighlight): void;
/**
* Delete a `HexWidgetMark` from a `HexWidget`.
* @param mark The `HexWidgetMark` to delete
*/
delete_mark(mark: WidgetMark): void;
/**
* Delete the current selection. The resulting action will be undoable.
*/
delete_selection(): void;
/**
* Get the [class`Gtk`.Adjustment] of the #HexWidget.
* @returns #GtkAdjustment of the widget.
*/
get_adjustment(): Gtk.Adjustment;
/**
* Get the value of the byte at requested offset position.
* @param offset index of the requested byte within the whole of the buffer
*/
get_byte(offset: number): number;
/**
* Get the cursor position.
* @returns the cursor position, as index within the whole of the buffer
*/
get_cursor(): number;
// Conflicted with Gtk.Widget.get_cursor
get_cursor(...args: never[]): any;
/**
* Get the [class`Hex`.Document] owned by the #HexWidget.
* @returns the #HexDocument owned by the #HexWidget, or %NULL.
*/
get_document(): Document;
/**
* Retrieve whether zeroes (`00`) are faded in the hex display.
* @returns `TRUE` if zeroes are faded; `FALSE` otherwise
*/
get_fade_zeroes(): boolean;
/**
* Get the group type of the data of the #HexWidget.
* @returns the group type of the data of the #HexWidget, by [enum@Hex.WidgetGroupType]
*/
get_group_type(): WidgetGroupType;
/**
* Get whether the widget is insert mode.
* @returns %TRUE if the #HexWidget is in insert mode; %FALSE if it is in overwrite mode.
*/
get_insert_mode(): boolean;
/**
* Get the current widget selection (highlights).
* @returns %TRUE if the operation was successful; %FALSE otherwise.
*/
get_selection(): [boolean, number, number];
/**
* Jump the cursor in the `HexWidget` specified to the mark in question.
* @param mark The mark to jump to
*/
goto_mark(mark: WidgetMark): void;
/**
* Insert an auto-highlight of a given search string.
* @param search search string to auto-highlight
* @returns a newly created [struct@Hex.WidgetAutoHighlight] structure, owned by the `HexWidget`
*/
insert_autohighlight(search: Uint8Array | string): WidgetAutoHighlight;
/**
* Full version of [method`Hex`.Widget.insert_autohighlight] which allows
* for specifying string match types for auto-highlights over and above
* exact byte-for-byte string matches.
* @param search search string to auto-highlight
* @param flags #HexSearchFlags to specify match type
* @returns a newly created [struct@Hex.WidgetAutoHighlight] structure, owned by the `HexWidget`
*/
insert_autohighlight_full(search: Uint8Array | string, flags: SearchFlags | null): WidgetAutoHighlight;
/**
* Paste clipboard data to widget at position of cursor.
*
* Since 4.6, the behaviour of this method has changed. With 4.4 and earlier,
* paste operations always inserted data into the payload, even if insert mode
* was disabled.
*
* Commencing in 4.6, if insert mode is not enabled, data will be overwritten
* by default with a paste operation, and possibly truncated in the event the
* payload is not large enough to absorb the paste data. This is to avoid
* increasing the payload size of a hex document when insert mode is disabled.
*/
paste_from_clipboard(): void;
/**
* Move cursor to `index`.
* @param index where the cursor should be moved to, as offset by byte within the buffer
*/
set_cursor(index: number): void;
// Conflicted with Gtk.Widget.set_cursor
set_cursor(...args: never[]): any;
/**
* Move the cursor by row and column, as absolute values.
* @param col_x column to which the cursor should be moved
* @param line_y line to which the cursor should be moved, by absolute value, within the whole buffer (not just the currently visible part)
*/
set_cursor_by_row_and_col(col_x: number, line_y: number): void;
/**
* Set whether zeroes (`00`) are faded in the hex display.
* @param fade Whether zeroes (`00` in the hex display) should be faded
*/
set_fade_zeroes(fade: boolean): void;
/**
* Set the geometry of the widget to specified dimensions.
* @param cpl columns per line which should be displayed, or 0 for default
* @param vis_lines number of lines which should be displayed, or 0 for default
*/
set_geometry(cpl: number, vis_lines: number): void;
/**
* Set the group type of the #HexWidget.
* @param gt group type
*/
set_group_type(gt: WidgetGroupType | null): void;
/**
* Set whether the #HexWidget should be in insert or overwrite mode.
* @param insert %TRUE if insert mode should be enabled, %FALSE if overwrite mode should be enabled
*/
set_insert_mode(insert: boolean): void;
/**
* Set a custom color for a `HexWidgetMark` object.
* @param mark The `HexWidgetMark` for which the custom color will be set
* @param color The custom color to be set for the mark
*/
set_mark_custom_color(mark: WidgetMark, color: Gdk.RGBA): void;
/**
* Move the cursor to upper nibble or lower nibble of the current byte.
* @param lower_nibble %TRUE if the lower nibble of the current byte should be selected; %FALSE for the upper nibble
*/
set_nibble(lower_nibble: boolean): void;
/**
* Set the widget selection (highlights).
* @param start starting offset by byte within the buffer
* @param end ending offset by byte within the buffer
*/
set_selection(start: number, end: number): void;
/**
* Set whether the ASCII column of the widget should be shown.
* @param show %TRUE if the ASCII column should be shown, %FALSE if it should be hidden
*/
show_ascii_column(show: boolean): void;
/**
* Set whether the hex column of the widget should be shown.
* @param show %TRUE if the hex column should be shown, %FALSE if it should be hidden
*/
show_hex_column(show: boolean): void;
/**
* Set whether the offsets column of the widget should be shown.
* @param show %TRUE if the offsets column should be shown, %FALSE if it should be hidden
*/
show_offsets(show: boolean): void;
/**
* Set the current selection to zero. The resulting action will be undoable.
*/
zero_selection(): void;
// Inherited properties
/**
* The accessible role of the given `GtkAccessible` implementation.
*
* The accessible role cannot be changed once set.
*/
get accessible_role(): Gtk.AccessibleRole;
set accessible_role(val: Gtk.AccessibleRole);
/**
* The accessible role of the given `GtkAccessible` implementation.
*
* The accessible role cannot be changed once set.
*/
get accessibleRole(): Gtk.AccessibleRole;
set accessibleRole(val: Gtk.AccessibleRole);
// Inherited methods
/**
* Requests the user's screen reader to announce the given message.
*
* This kind of notification is useful for messages that
* either have only a visual representation or that are not
* exposed visually at all, e.g. a notification about a
* successful operation.
*
* Also, by using this API, you can ensure that the message
* does not interrupts the user's current screen reader output.
* @param message the string to announce
* @param priority the priority of the announcement
*/
announce(message: string, priority: Gtk.AccessibleAnnouncementPriority | null): void;
/**
* Retrieves the accessible parent for an accessible object.
*
* This function returns `NULL` for top level widgets.
* @returns the accessible parent
*/
get_accessible_parent(): Gtk.Accessible | null;
/**
* Retrieves the accessible role of an accessible object.
* @returns the accessible role
*/
get_accessible_role(): Gtk.AccessibleRole;
/**
* Retrieves the implementation for the given accessible object.
* @returns the accessible implementation object
*/
get_at_context(): Gtk.ATContext;
/**
* Queries the coordinates and dimensions of this accessible
*
* This functionality can be overridden by `GtkAccessible`
* implementations, e.g. to get the bounds from an ignored
* child widget.
* @returns true if the bounds are valid, and false otherwise
*/
get_bounds(): [boolean, number, number, number, number];
/**
* Retrieves the first accessible child of an accessible object.
* @returns the first accessible child
*/
get_first_accessible_child(): Gtk.Accessible | null;
/**
* Retrieves the next accessible sibling of an accessible object
* @returns the next accessible sibling
*/
get_next_accessible_sibling(): Gtk.Accessible | null;
/**
* Queries a platform state, such as focus.
*
* This functionality can be overridden by `GtkAccessible`
* implementations, e.g. to get platform state from an ignored
* child widget, as is the case for `GtkText` wrappers.
* @param state platform state to query
* @returns the value of state for the accessible
*/
get_platform_state(state: Gtk.AccessiblePlatformState | null): boolean;
/**
* Resets the accessible property to its default value.
* @param property the accessible property
*/
reset_property(property: Gtk.AccessibleProperty | null): void;
/**
* Resets the accessible relation to its default value.
* @param relation the accessible relation
*/
reset_relation(relation: Gtk.AccessibleRelation | null): void;
/**
* Resets the accessible state to its default value.
* @param state the accessible state
*/
reset_state(state: Gtk.AccessibleState | null): void;
/**
* Sets the parent and sibling of an accessible object.
*
* This function is meant to be used by accessible implementations that are
* not part of the widget hierarchy, and but act as a logical bridge between
* widgets. For instance, if a widget creates an object that holds metadata
* for each child, and you want that object to implement the `GtkAccessible`
* interface, you will use this function to ensure that the parent of each
* child widget is the metadata object, and the parent of each metadata
* object is the container widget.
* @param parent the parent accessible object
* @param next_sibling the sibling accessible object
*/
set_accessible_parent(parent?: Gtk.Accessible | null, next_sibling?: Gtk.Accessible | null): void;
/**
* Updates the next accessible sibling.
*
* That might be useful when a new child of a custom accessible
* is created, and it needs to be linked to a previous child.
* @param new_sibling the new next accessible sibling to set
*/
update_next_accessible_sibling(new_sibling?: Gtk.Accessible | null): void;
/**
* Informs ATs that the platform state has changed.
*
* This function should be used by `GtkAccessible` implementations that
* have a platform state but are not widgets. Widgets handle platform
* states automatically.
* @param state the platform state to update
*/
update_platform_state(state: Gtk.AccessiblePlatformState | null): void;
/**
* Updates an array of accessible properties.
*
* This function should be called by `GtkWidget` types whenever an accessible
* property change must be communicated to assistive technologies.
*
* This function is meant to be used by language bindings.
* @param properties an array of accessible properties
* @param values an array of `GValues`, one for each property
*/
update_property(properties: Gtk.AccessibleProperty[] | null, values: (GObject.Value | any)[]): void;
/**
* Updates an array of accessible relations.
*
* This function should be called by `GtkWidget` types whenever an accessible
* relation change must be communicated to assistive technologies.
*
* This function is meant to be used by language bindings.
* @param relations an array of accessible relations
* @param values an array of `GValues`, one for each relation
*/
update_relation(relations: Gtk.AccessibleRelation[] | null, values: (GObject.Value | any)[]): void;
/**
* Updates an array of accessible states.
*
* This function should be called by `GtkWidget` types whenever an accessible
* state change must be communicated to assistive technologies.
*
* This function is meant to be used by language bindings.
* @param states an array of accessible states
* @param values an array of `GValues`, one for each state
*/
update_state(states: Gtk.AccessibleState[] | null, values: (GObject.Value | any)[]): void;
/**
* Retrieves the accessible parent for an accessible object.
*
* This function returns `NULL` for top level widgets.
*/
vfunc_get_accessible_parent(): Gtk.Accessible | null;
/**
* Retrieves the implementation for the given accessible object.
*/
vfunc_get_at_context(): Gtk.ATContext | null;
/**
* Queries the coordinates and dimensions of this accessible
*
* This functionality can be overridden by `GtkAccessible`
* implementations, e.g. to get the bounds from an ignored
* child widget.
*/
vfunc_get_bounds(): [boolean, number, number, number, number];
/**
* Retrieves the first accessible child of an accessible object.
*/
vfunc_get_first_accessible_child(): Gtk.Accessible | null;
/**
* Retrieves the next accessible sibling of an accessible object
*/
vfunc_get_next_accessible_sibling(): Gtk.Accessible | null;
/**
* Queries a platform state, such as focus.
*
* This functionality can be overridden by `GtkAccessible`
* implementations, e.g. to get platform state from an ignored
* child widget, as is the case for `GtkText` wrappers.
* @param state platform state to query
*/
vfunc_get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
/**
* Gets the ID of the `buildable` object.
*
* `GtkBuilder` sets the name based on the ID attribute
* of the `