/// /// /// /// /// /// /// /// /// /// /// /// /** * 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://Gimp?version=3.0' { // Module dependencies import type cairo from 'cairo'; import type GObject from 'gi://GObject?version=2.0'; import type GLib from 'gi://GLib?version=2.0'; import type Pango from 'gi://Pango?version=1.0'; import type HarfBuzz from 'gi://HarfBuzz?version=0.0'; import type freetype2 from 'gi://freetype2?version=2.0'; import type Gio from 'gi://Gio?version=2.0'; import type GModule from 'gi://GModule?version=2.0'; import type Gegl from 'gi://Gegl?version=0.4'; import type Babl from 'gi://Babl?version=0.1'; import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0'; export namespace Gimp { // WORKAROUND: As long as ParamObject is not generated export class ParamObject extends GObject.ParamSpec {} // WORKAROUND: As long as ParamObject is not generated export class ParamItem extends GObject.ParamSpec {} // WORKAROUND: As long as ParamObject is not generated export class ParamArray extends GObject.ParamSpec {} /** * Gimp-3.0 */ /** * Modes of initialising a layer mask. */ /** * Modes of initialising a layer mask. */ export namespace AddMaskType { export const $gtype: GObject.GType; } enum AddMaskType { /** * White (full opacity) */ WHITE, /** * Black (full transparency) */ BLACK, /** * Layer's alpha channel */ ALPHA, /** * Transfer layer's alpha channel */ ALPHA_TRANSFER, /** * Selection */ SELECTION, /** * Grayscale copy of layer */ COPY, /** * Channel */ CHANNEL, } /** * Methods of syncing procedure arguments. */ /** * Methods of syncing procedure arguments. */ export namespace ArgumentSync { export const $gtype: GObject.GType; } enum ArgumentSync { /** * Don't sync this argument */ NONE, /** * Sync this argument with an image parasite */ PARASITE, } /** * Extracted from app/paint/paint-enums.h */ /** * Extracted from app/paint/paint-enums.h */ export namespace BrushApplicationMode { export const $gtype: GObject.GType; } enum BrushApplicationMode { /** * GIMP_BRUSH_HARD */ HARD, /** * GIMP_BRUSH_SOFT */ SOFT, } /** * Shapes of generated brushes. */ /** * Shapes of generated brushes. */ export namespace BrushGeneratedShape { export const $gtype: GObject.GType; } enum BrushGeneratedShape { /** * Circle */ CIRCLE, /** * Square */ SQUARE, /** * Diamond */ DIAMOND, } /** * Style of line endings. */ /** * Style of line endings. */ export namespace CapStyle { export const $gtype: GObject.GType; } enum CapStyle { /** * Butt */ BUTT, /** * Round */ ROUND, /** * Square */ SQUARE, } /** * Operations to combine channels and selections. */ /** * Operations to combine channels and selections. */ export namespace ChannelOps { export const $gtype: GObject.GType; } enum ChannelOps { /** * Add to the current selection */ ADD, /** * Subtract from the current selection */ SUBTRACT, /** * Replace the current selection */ REPLACE, /** * Intersect with the current selection */ INTERSECT, } /** * Channels (as in color components). */ /** * Channels (as in color components). */ export namespace ChannelType { export const $gtype: GObject.GType; } enum ChannelType { /** * Red */ RED, /** * Green */ GREEN, /** * Blue */ BLUE, /** * Gray */ GRAY, /** * Indexed */ INDEXED, /** * Alpha */ ALPHA, } /** * Size of the checkerboard indicating transparency. */ /** * Size of the checkerboard indicating transparency. */ export namespace CheckSize { export const $gtype: GObject.GType; } enum CheckSize { /** * Small */ SMALL_CHECKS, /** * Medium */ MEDIUM_CHECKS, /** * Large */ LARGE_CHECKS, } /** * Color/Brightness of the checkerboard indicating transparency. */ /** * Color/Brightness of the checkerboard indicating transparency. */ export namespace CheckType { export const $gtype: GObject.GType; } enum CheckType { /** * Light checks */ LIGHT_CHECKS, /** * Mid-tone checks */ GRAY_CHECKS, /** * Dark checks */ DARK_CHECKS, /** * White only */ WHITE_ONLY, /** * Gray only */ GRAY_ONLY, /** * Black only */ BLACK_ONLY, /** * Custom checks */ CUSTOM_CHECKS, } /** * Clone sources. */ /** * Clone sources. */ export namespace CloneType { export const $gtype: GObject.GType; } enum CloneType { /** * Clone from an image/drawable source */ IMAGE, /** * Clone from a pattern source */ PATTERN, } /** * Modes of color management. */ /** * Modes of color management. */ export namespace ColorManagementMode { export const $gtype: GObject.GType; } enum ColorManagementMode { /** * Color management is off */ OFF, /** * Color managed display */ DISPLAY, /** * Soft-proofing */ SOFTPROOF, } /** * Intents for color management. */ /** * Intents for color management. */ export namespace ColorRenderingIntent { export const $gtype: GObject.GType; } enum ColorRenderingIntent { /** * Perceptual */ PERCEPTUAL, /** * Relative colorimetric */ RELATIVE_COLORIMETRIC, /** * Saturation */ SATURATION, /** * Absolute colorimetric */ ABSOLUTE_COLORIMETRIC, } /** * Possible tag colors. */ /** * Possible tag colors. */ export namespace ColorTag { export const $gtype: GObject.GType; } enum ColorTag { /** * None */ NONE, /** * Blue */ BLUE, /** * Green */ GREEN, /** * Yellow */ YELLOW, /** * Orange */ ORANGE, /** * Brown */ BROWN, /** * Red */ RED, /** * Violet */ VIOLET, /** * Gray */ GRAY, } /** * Flags for modifying #GimpColorTransform's behavior. */ /** * Flags for modifying #GimpColorTransform's behavior. */ export namespace ColorTransformFlags { export const $gtype: GObject.GType; } enum ColorTransformFlags { /** * optimize for accuracy rather * than for speed */ NOOPTIMIZE, /** * mark out of gamut colors in the * transform result */ GAMUT_CHECK, /** * do black point * compensation */ BLACK_POINT_COMPENSATION, } /** * Encoding types of image components. */ /** * Encoding types of image components. */ export namespace ComponentType { export const $gtype: GObject.GType; } enum ComponentType { /** * 8-bit integer */ U8, /** * 16-bit integer */ U16, /** * 32-bit integer */ U32, /** * 16-bit floating point */ HALF, /** * 32-bit floating point */ FLOAT, /** * 64-bit floating point */ DOUBLE, } /** * The possible values of a #GError thrown by libgimpconfig. */ class ConfigError extends GLib.Error { static $gtype: GObject.GType; // Static fields /** * open failed */ static OPEN: number; /** * file does not exist */ static OPEN_ENOENT: number; /** * write failed */ static WRITE: number; /** * parser error */ static PARSE: number; /** * parser failed due to version mismatch */ static VERSION: number; // Constructors constructor(options: { message: string; code: number }); _init(...args: any[]): void; } /** * Types of config paths. */ /** * Types of config paths. */ export namespace ConfigPathType { export const $gtype: GObject.GType; } enum ConfigPathType { /** * A single file */ FILE, /** * A list of files */ FILE_LIST, /** * A single folder */ DIR, /** * A list of folders */ DIR_LIST, } /** * Extracted from app/core/core-enums.h */ /** * Extracted from app/core/core-enums.h */ export namespace ConvertDitherType { export const $gtype: GObject.GType; } enum ConvertDitherType { /** * GIMP_CONVERT_DITHER_NONE */ NONE, /** * GIMP_CONVERT_DITHER_FS */ FS, /** * GIMP_CONVERT_DITHER_FS_LOWBLEED */ FS_LOWBLEED, /** * GIMP_CONVERT_DITHER_FIXED */ FIXED, } /** * Types of palettes for indexed conversion. */ /** * Types of palettes for indexed conversion. */ export namespace ConvertPaletteType { export const $gtype: GObject.GType; } enum ConvertPaletteType { /** * Generate optimum palette */ GENERATE, /** * Use web-optimized palette */ WEB, /** * Use black and white (1-bit) palette */ MONO, /** * Use custom palette */ CUSTOM, } /** * Types of convolutions. */ /** * Types of convolutions. */ export namespace ConvolveType { export const $gtype: GObject.GType; } enum ConvolveType { /** * Blur */ BLUR, /** * Sharpen */ SHARPEN, } /** * Types of detectable CPU accelerations */ /** * Types of detectable CPU accelerations */ export namespace CpuAccelFlags { export const $gtype: GObject.GType; } enum CpuAccelFlags { /** * None */ NONE, /** * MMX */ X86_MMX, /** * 3dNow */ X86_3DNOW, /** * MMXEXT */ X86_MMXEXT, /** * SSE */ X86_SSE, /** * SSE2 */ X86_SSE2, /** * SSE3 */ X86_SSE3, /** * SSSE3 */ X86_SSSE3, /** * SSE4_1 */ X86_SSE4_1, /** * SSE4_2 */ X86_SSE4_2, /** * AVX */ X86_AVX, /** * Altivec */ PPC_ALTIVEC, } /** * Grayscale conversion methods. */ /** * Grayscale conversion methods. */ export namespace DesaturateMode { export const $gtype: GObject.GType; } enum DesaturateMode { /** * Lightness (HSL) */ LIGHTNESS, /** * Luma */ LUMA, /** * Average (HSI Intensity) */ AVERAGE, /** * Luminance */ LUMINANCE, /** * Value (HSV) */ VALUE, } /** * Methods for the dodge/burn operation. */ /** * Methods for the dodge/burn operation. */ export namespace DodgeBurnType { export const $gtype: GObject.GType; } enum DodgeBurnType { /** * Dodge */ DODGE, /** * Burn */ BURN, } /** * Possible return values of [method`ExportOptions`.get_image]. */ /** * Possible return values of [method`ExportOptions`.get_image]. */ export namespace ExportReturn { export const $gtype: GObject.GType; } enum ExportReturn { /** * The image is unmodified but export shall continue anyway */ IGNORE, /** * The chosen transforms were applied to a new image */ EXPORT, } /** * A type of file to choose from when actions are expected to choose a * file. This is basically a mapping to %GtkFileChooserAction except for * [enum`Gimp`.FileChooserAction.ANY] which should not be used for any * GUI functions since we can't know what you are looking for. */ /** * A type of file to choose from when actions are expected to choose a * file. This is basically a mapping to %GtkFileChooserAction except for * [enum`Gimp`.FileChooserAction.ANY] which should not be used for any * GUI functions since we can't know what you are looking for. */ export namespace FileChooserAction { export const $gtype: GObject.GType; } enum FileChooserAction { /** * No restriction. */ ANY, /** * Opens an existing file. */ OPEN, /** * Saves a file (over a new file or an existing one. */ SAVE, /** * Picks an existing folder. */ SELECT_FOLDER, /** * Picks an existing or new folder. */ CREATE_FOLDER, } /** * Types of filling. */ /** * Types of filling. */ export namespace FillType { export const $gtype: GObject.GType; } enum FillType { /** * Foreground color */ FOREGROUND, /** * Background color */ BACKGROUND, /** * Middle Gray (CIELAB) */ CIELAB_MIDDLE_GRAY, /** * White */ WHITE, /** * Transparency */ TRANSPARENT, /** * Pattern */ PATTERN, } /** * Foreground extract engines. */ /** * Foreground extract engines. */ export namespace ForegroundExtractMode { export const $gtype: GObject.GType; } enum ForegroundExtractMode { /** * Matting (Since 2.10) */ MATTING, } /** * Color space for blending gradients. */ /** * Color space for blending gradients. */ export namespace GradientBlendColorSpace { export const $gtype: GObject.GType; } enum GradientBlendColorSpace { /** * Perceptual RGB */ RGB_PERCEPTUAL, /** * Linear RGB */ RGB_LINEAR, /** * CIE Lab */ CIE_LAB, } /** * Coloring types for gradient segments. */ /** * Coloring types for gradient segments. */ export namespace GradientSegmentColor { export const $gtype: GObject.GType; } enum GradientSegmentColor { /** * RGB */ RGB, /** * HSV (counter-clockwise hue) */ HSV_CCW, /** * HSV (clockwise hue) */ HSV_CW, } /** * Transition functions for gradient segments. */ /** * Transition functions for gradient segments. */ export namespace GradientSegmentType { export const $gtype: GObject.GType; } enum GradientSegmentType { /** * Linear */ LINEAR, /** * Curved */ CURVED, /** * Sinusoidal */ SINE, /** * Spherical (increasing) */ SPHERE_INCREASING, /** * Spherical (decreasing) */ SPHERE_DECREASING, /** * Step */ STEP, } /** * Gradient shapes. */ /** * Gradient shapes. */ export namespace GradientType { export const $gtype: GObject.GType; } enum GradientType { /** * Linear */ LINEAR, /** * Bi-linear */ BILINEAR, /** * Radial */ RADIAL, /** * Square */ SQUARE, /** * Conical (symmetric) */ CONICAL_SYMMETRIC, /** * Conical (asymmetric) */ CONICAL_ASYMMETRIC, /** * Shaped (angular) */ SHAPEBURST_ANGULAR, /** * Shaped (spherical) */ SHAPEBURST_SPHERICAL, /** * Shaped (dimpled) */ SHAPEBURST_DIMPLED, /** * Spiral (clockwise) */ SPIRAL_CLOCKWISE, /** * Spiral (counter-clockwise) */ SPIRAL_ANTICLOCKWISE, } /** * Rendering types for the display grid. */ /** * Rendering types for the display grid. */ export namespace GridStyle { export const $gtype: GObject.GType; } enum GridStyle { /** * Intersections (dots) */ DOTS, /** * Intersections (crosshairs) */ INTERSECTIONS, /** * Dashed */ ON_OFF_DASH, /** * Double dashed */ DOUBLE_DASH, /** * Solid */ SOLID, } /** * Extracted from app/core/core-enums.h */ /** * Extracted from app/core/core-enums.h */ export namespace HistogramChannel { export const $gtype: GObject.GType; } enum HistogramChannel { /** * GIMP_HISTOGRAM_VALUE */ VALUE, /** * GIMP_HISTOGRAM_RED */ RED, /** * GIMP_HISTOGRAM_GREEN */ GREEN, /** * GIMP_HISTOGRAM_BLUE */ BLUE, /** * GIMP_HISTOGRAM_ALPHA */ ALPHA, /** * GIMP_HISTOGRAM_LUMINANCE */ LUMINANCE, } /** * Hue ranges. */ /** * Hue ranges. */ export namespace HueRange { export const $gtype: GObject.GType; } enum HueRange { /** * All hues */ ALL, /** * Red hues */ RED, /** * Yellow hues */ YELLOW, /** * Green hues */ GREEN, /** * Cyan hues */ CYAN, /** * Blue hues */ BLUE, /** * Magenta hues */ MAGENTA, } /** * Icon types for plug-ins to register. */ /** * Icon types for plug-ins to register. */ export namespace IconType { export const $gtype: GObject.GType; } enum IconType { /** * Icon name */ ICON_NAME, /** * Inline pixbuf */ PIXBUF, /** * Image file */ IMAGE_FILE, } /** * Image color models. */ /** * Image color models. */ export namespace ImageBaseType { export const $gtype: GObject.GType; } enum ImageBaseType { /** * RGB color */ RGB, /** * Grayscale */ GRAY, /** * Indexed color */ INDEXED, } /** * Possible drawable types. */ /** * Possible drawable types. */ export namespace ImageType { export const $gtype: GObject.GType; } enum ImageType { /** * RGB */ RGB_IMAGE, /** * RGB-alpha */ RGBA_IMAGE, /** * Grayscale */ GRAY_IMAGE, /** * Grayscale-alpha */ GRAYA_IMAGE, /** * Indexed */ INDEXED_IMAGE, /** * Indexed-alpha */ INDEXEDA_IMAGE, } /** * Ink tool tips. */ /** * Ink tool tips. */ export namespace InkBlobType { export const $gtype: GObject.GType; } enum InkBlobType { /** * Circle */ CIRCLE, /** * Square */ SQUARE, /** * Diamond */ DIAMOND, } /** * Interpolation types. */ /** * Interpolation types. */ export namespace InterpolationType { export const $gtype: GObject.GType; } enum InterpolationType { /** * None */ NONE, /** * Linear */ LINEAR, /** * Cubic */ CUBIC, /** * NoHalo */ NOHALO, /** * LoHalo */ LOHALO, } /** * Line join styles. */ /** * Line join styles. */ export namespace JoinStyle { export const $gtype: GObject.GType; } enum JoinStyle { /** * Miter */ MITER, /** * Round */ ROUND, /** * Bevel */ BEVEL, } /** * Extracted from app/operations/operations-enums.h */ /** * Extracted from app/operations/operations-enums.h */ export namespace LayerColorSpace { export const $gtype: GObject.GType; } enum LayerColorSpace { /** * GIMP_LAYER_COLOR_SPACE_AUTO */ AUTO, /** * GIMP_LAYER_COLOR_SPACE_RGB_LINEAR */ RGB_LINEAR, /** * GIMP_LAYER_COLOR_SPACE_RGB_NON_LINEAR */ RGB_NON_LINEAR, /** * GIMP_LAYER_COLOR_SPACE_LAB */ LAB, /** * GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL */ RGB_PERCEPTUAL, } /** * Extracted from app/operations/operations-enums.h */ /** * Extracted from app/operations/operations-enums.h */ export namespace LayerCompositeMode { export const $gtype: GObject.GType; } enum LayerCompositeMode { /** * GIMP_LAYER_COMPOSITE_AUTO */ AUTO, /** * GIMP_LAYER_COMPOSITE_UNION */ UNION, /** * GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP */ CLIP_TO_BACKDROP, /** * GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER */ CLIP_TO_LAYER, /** * GIMP_LAYER_COMPOSITE_INTERSECTION */ INTERSECTION, } /** * Extracted from app/operations/operations-enums.h */ /** * Extracted from app/operations/operations-enums.h */ export namespace LayerMode { export const $gtype: GObject.GType; } enum LayerMode { /** * GIMP_LAYER_MODE_NORMAL_LEGACY */ NORMAL_LEGACY, /** * GIMP_LAYER_MODE_DISSOLVE */ DISSOLVE, /** * GIMP_LAYER_MODE_BEHIND_LEGACY */ BEHIND_LEGACY, /** * GIMP_LAYER_MODE_MULTIPLY_LEGACY */ MULTIPLY_LEGACY, /** * GIMP_LAYER_MODE_SCREEN_LEGACY */ SCREEN_LEGACY, /** * GIMP_LAYER_MODE_OVERLAY_LEGACY */ OVERLAY_LEGACY, /** * GIMP_LAYER_MODE_DIFFERENCE_LEGACY */ DIFFERENCE_LEGACY, /** * GIMP_LAYER_MODE_ADDITION_LEGACY */ ADDITION_LEGACY, /** * GIMP_LAYER_MODE_SUBTRACT_LEGACY */ SUBTRACT_LEGACY, /** * GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY */ DARKEN_ONLY_LEGACY, /** * GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY */ LIGHTEN_ONLY_LEGACY, /** * GIMP_LAYER_MODE_HSV_HUE_LEGACY */ HSV_HUE_LEGACY, /** * GIMP_LAYER_MODE_HSV_SATURATION_LEGACY */ HSV_SATURATION_LEGACY, /** * GIMP_LAYER_MODE_HSL_COLOR_LEGACY */ HSL_COLOR_LEGACY, /** * GIMP_LAYER_MODE_HSV_VALUE_LEGACY */ HSV_VALUE_LEGACY, /** * GIMP_LAYER_MODE_DIVIDE_LEGACY */ DIVIDE_LEGACY, /** * GIMP_LAYER_MODE_DODGE_LEGACY */ DODGE_LEGACY, /** * GIMP_LAYER_MODE_BURN_LEGACY */ BURN_LEGACY, /** * GIMP_LAYER_MODE_HARDLIGHT_LEGACY */ HARDLIGHT_LEGACY, /** * GIMP_LAYER_MODE_SOFTLIGHT_LEGACY */ SOFTLIGHT_LEGACY, /** * GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY */ GRAIN_EXTRACT_LEGACY, /** * GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY */ GRAIN_MERGE_LEGACY, /** * GIMP_LAYER_MODE_COLOR_ERASE_LEGACY */ COLOR_ERASE_LEGACY, /** * GIMP_LAYER_MODE_OVERLAY */ OVERLAY, /** * GIMP_LAYER_MODE_LCH_HUE */ LCH_HUE, /** * GIMP_LAYER_MODE_LCH_CHROMA */ LCH_CHROMA, /** * GIMP_LAYER_MODE_LCH_COLOR */ LCH_COLOR, /** * GIMP_LAYER_MODE_LCH_LIGHTNESS */ LCH_LIGHTNESS, /** * GIMP_LAYER_MODE_NORMAL */ NORMAL, /** * GIMP_LAYER_MODE_BEHIND */ BEHIND, /** * GIMP_LAYER_MODE_MULTIPLY */ MULTIPLY, /** * GIMP_LAYER_MODE_SCREEN */ SCREEN, /** * GIMP_LAYER_MODE_DIFFERENCE */ DIFFERENCE, /** * GIMP_LAYER_MODE_ADDITION */ ADDITION, /** * GIMP_LAYER_MODE_SUBTRACT */ SUBTRACT, /** * GIMP_LAYER_MODE_DARKEN_ONLY */ DARKEN_ONLY, /** * GIMP_LAYER_MODE_LIGHTEN_ONLY */ LIGHTEN_ONLY, /** * GIMP_LAYER_MODE_HSV_HUE */ HSV_HUE, /** * GIMP_LAYER_MODE_HSV_SATURATION */ HSV_SATURATION, /** * GIMP_LAYER_MODE_HSL_COLOR */ HSL_COLOR, /** * GIMP_LAYER_MODE_HSV_VALUE */ HSV_VALUE, /** * GIMP_LAYER_MODE_DIVIDE */ DIVIDE, /** * GIMP_LAYER_MODE_DODGE */ DODGE, /** * GIMP_LAYER_MODE_BURN */ BURN, /** * GIMP_LAYER_MODE_HARDLIGHT */ HARDLIGHT, /** * GIMP_LAYER_MODE_SOFTLIGHT */ SOFTLIGHT, /** * GIMP_LAYER_MODE_GRAIN_EXTRACT */ GRAIN_EXTRACT, /** * GIMP_LAYER_MODE_GRAIN_MERGE */ GRAIN_MERGE, /** * GIMP_LAYER_MODE_VIVID_LIGHT */ VIVID_LIGHT, /** * GIMP_LAYER_MODE_PIN_LIGHT */ PIN_LIGHT, /** * GIMP_LAYER_MODE_LINEAR_LIGHT */ LINEAR_LIGHT, /** * GIMP_LAYER_MODE_HARD_MIX */ HARD_MIX, /** * GIMP_LAYER_MODE_EXCLUSION */ EXCLUSION, /** * GIMP_LAYER_MODE_LINEAR_BURN */ LINEAR_BURN, /** * GIMP_LAYER_MODE_LUMA_DARKEN_ONLY */ LUMA_DARKEN_ONLY, /** * GIMP_LAYER_MODE_LUMA_LIGHTEN_ONLY */ LUMA_LIGHTEN_ONLY, /** * GIMP_LAYER_MODE_LUMINANCE */ LUMINANCE, /** * GIMP_LAYER_MODE_COLOR_ERASE */ COLOR_ERASE, /** * GIMP_LAYER_MODE_ERASE */ ERASE, /** * GIMP_LAYER_MODE_MERGE */ MERGE, /** * GIMP_LAYER_MODE_SPLIT */ SPLIT, /** * GIMP_LAYER_MODE_PASS_THROUGH */ PASS_THROUGH, /** * GIMP_LAYER_MODE_REPLACE */ REPLACE, } /** * Layer mask apply modes. */ /** * Layer mask apply modes. */ export namespace MaskApplyMode { export const $gtype: GObject.GType; } enum MaskApplyMode { /** * Apply the mask */ APPLY, /** * Discard the mask */ DISCARD, } /** * Types of merging layers. */ /** * Types of merging layers. */ export namespace MergeType { export const $gtype: GObject.GType; } enum MergeType { /** * Expanded as necessary */ EXPAND_AS_NECESSARY, /** * Clipped to image */ CLIP_TO_IMAGE, /** * Clipped to bottom layer */ CLIP_TO_BOTTOM_LAYER, /** * Flatten */ FLATTEN_IMAGE, } /** * How to present messages. */ /** * How to present messages. */ export namespace MessageHandlerType { export const $gtype: GObject.GType; } enum MessageHandlerType { /** * A popup dialog */ MESSAGE_BOX, /** * The terminal */ CONSOLE, /** * The error console dockable */ ERROR_CONSOLE, } /** * Well-defined colorspace information available from metadata */ /** * Well-defined colorspace information available from metadata */ export namespace MetadataColorspace { export const $gtype: GObject.GType; } enum MetadataColorspace { /** * Unspecified */ UNSPECIFIED, /** * Uncalibrated */ UNCALIBRATED, /** * sRGB */ SRGB, /** * Adobe RGB */ ADOBERGB, } /** * Types of errors returned by modules */ /** * Types of errors returned by modules */ export namespace ModuleError { export const $gtype: GObject.GType; } enum ModuleError { /** * Generic error condition */ MODULE_FAILED, } /** * The possible states a #GimpModule can be in. */ /** * The possible states a #GimpModule can be in. */ export namespace ModuleState { export const $gtype: GObject.GType; } enum ModuleState { /** * Missing gimp_module_register() function * or other error. */ ERROR, /** * An instance of a type implemented by * this module is allocated. */ LOADED, /** * gimp_module_register() returned %FALSE. */ LOAD_FAILED, /** * There are no instances allocated of * types implemented by this module. */ NOT_LOADED, } /** * Background fill types for the offset operation. */ /** * Background fill types for the offset operation. */ export namespace OffsetType { export const $gtype: GObject.GType; } enum OffsetType { /** * Color */ COLOR, /** * Transparent */ TRANSPARENT, /** * Wrap image around */ WRAP_AROUND, } /** * Orientations for various purposes. */ /** * Orientations for various purposes. */ export namespace OrientationType { export const $gtype: GObject.GType; } enum OrientationType { /** * Horizontal */ HORIZONTAL, /** * Vertical */ VERTICAL, /** * Unknown */ UNKNOWN, } /** * PDB error handlers. */ /** * PDB error handlers. */ export namespace PDBErrorHandler { export const $gtype: GObject.GType; } enum PDBErrorHandler { /** * Internal */ INTERNAL, /** * Plug-In */ PLUGIN, } /** * Types of PDB procedures. */ /** * Types of PDB procedures. */ export namespace PDBProcType { export const $gtype: GObject.GType; } enum PDBProcType { /** * Internal GIMP procedure */ INTERNAL, /** * GIMP Plug-In */ PLUGIN, /** * GIMP Persistent Plug-in */ PERSISTENT, /** * Temporary Procedure */ TEMPORARY, } /** * Return status of PDB calls. */ /** * Return status of PDB calls. */ export namespace PDBStatusType { export const $gtype: GObject.GType; } enum PDBStatusType { /** * Execution error */ EXECUTION_ERROR, /** * Calling error */ CALLING_ERROR, /** * Pass through */ PASS_THROUGH, /** * Success */ SUCCESS, /** * User cancel */ CANCEL, } /** * Paint application modes. */ /** * Paint application modes. */ export namespace PaintApplicationMode { export const $gtype: GObject.GType; } enum PaintApplicationMode { /** * Constant */ CONSTANT, /** * Incremental */ INCREMENTAL, } /** * Possible type of strokes in path objects. */ /** * Possible type of strokes in path objects. */ export namespace PathStrokeType { export const $gtype: GObject.GType; } enum PathStrokeType { /** * A bezier stroke */ BEZIER, } /** * How to deal with transparency when creating thubnail pixbufs from * images and drawables. */ /** * How to deal with transparency when creating thubnail pixbufs from * images and drawables. */ export namespace PixbufTransparency { export const $gtype: GObject.GType; } enum PixbufTransparency { /** * Create a pixbuf with alpha */ KEEP_ALPHA, /** * Show transparency as small checks */ SMALL_CHECKS, /** * Show transparency as large checks */ LARGE_CHECKS, } /** * Precisions for pixel encoding. */ /** * Precisions for pixel encoding. */ export namespace Precision { export const $gtype: GObject.GType; } enum Precision { /** * 8-bit linear integer */ U8_LINEAR, /** * 8-bit non-linear integer */ U8_NON_LINEAR, /** * 8-bit perceptual integer */ U8_PERCEPTUAL, /** * 16-bit linear integer */ U16_LINEAR, /** * 16-bit non-linear integer */ U16_NON_LINEAR, /** * 16-bit perceptual integer */ U16_PERCEPTUAL, /** * 32-bit linear integer */ U32_LINEAR, /** * 32-bit non-linear integer */ U32_NON_LINEAR, /** * 32-bit perceptual integer */ U32_PERCEPTUAL, /** * 16-bit linear floating point */ HALF_LINEAR, /** * 16-bit non-linear floating point */ HALF_NON_LINEAR, /** * 16-bit perceptual floating point */ HALF_PERCEPTUAL, /** * 32-bit linear floating point */ FLOAT_LINEAR, /** * 32-bit non-linear floating point */ FLOAT_NON_LINEAR, /** * 32-bit perceptual floating point */ FLOAT_PERCEPTUAL, /** * 64-bit linear floating point */ DOUBLE_LINEAR, /** * 64-bit non-linear floating point */ DOUBLE_NON_LINEAR, /** * 64-bit perceptual floating point */ DOUBLE_PERCEPTUAL, } /** * Commands for the progress API. */ /** * Commands for the progress API. */ export namespace ProgressCommand { export const $gtype: GObject.GType; } enum ProgressCommand { /** * Start a progress */ START, /** * End the progress */ END, /** * Set the text */ SET_TEXT, /** * Set the percentage */ SET_VALUE, /** * Pulse the progress */ PULSE, /** * Get the window where the progress is shown */ GET_WINDOW, } /** * Repeat modes for example for gradients. */ /** * Repeat modes for example for gradients. */ export namespace RepeatMode { export const $gtype: GObject.GType; } enum RepeatMode { /** * None (extend) */ NONE, /** * None (truncate) */ TRUNCATE, /** * Sawtooth wave */ SAWTOOTH, /** * Triangular wave */ TRIANGULAR, } /** * Types of simple rotations. */ /** * Types of simple rotations. */ export namespace RotationType { export const $gtype: GObject.GType; } enum RotationType { /** * 90 degrees */ DEGREES90, /** * 180 degrees */ DEGREES180, /** * 270 degrees */ DEGREES270, } /** * Run modes for plug-ins. */ /** * Run modes for plug-ins. */ export namespace RunMode { export const $gtype: GObject.GType; } enum RunMode { /** * Run interactively */ INTERACTIVE, /** * Run non-interactively */ NONINTERACTIVE, /** * Run with last used values */ WITH_LAST_VALS, } /** * Criterions for color similarity. */ /** * Criterions for color similarity. */ export namespace SelectCriterion { export const $gtype: GObject.GType; } enum SelectCriterion { /** * Composite */ COMPOSITE, /** * Red */ RGB_RED, /** * Green */ RGB_GREEN, /** * Blue */ RGB_BLUE, /** * HSV Hue */ HSV_HUE, /** * HSV Saturation */ HSV_SATURATION, /** * HSV Value */ HSV_VALUE, /** * LCh Lightness */ LCH_LIGHTNESS, /** * LCh Chroma */ LCH_CHROMA, /** * LCh Hue */ LCH_HUE, /** * Alpha */ ALPHA, } /** * Size types for the old-style text API. */ /** * Size types for the old-style text API. */ export namespace SizeType { export const $gtype: GObject.GType; } enum SizeType { /** * Pixels */ PIXELS, /** * Points */ POINTS, } /** * When to generate stack traces in case of an error. */ /** * When to generate stack traces in case of an error. */ export namespace StackTraceMode { export const $gtype: GObject.GType; } enum StackTraceMode { /** * Never */ NEVER, /** * Ask each time */ QUERY, /** * Always */ ALWAYS, } /** * Methods of stroking selections and paths. */ /** * Methods of stroking selections and paths. */ export namespace StrokeMethod { export const $gtype: GObject.GType; } enum StrokeMethod { /** * Stroke line */ LINE, /** * Stroke with a paint tool */ PAINT_METHOD, } /** * Text directions. */ /** * Text directions. */ export namespace TextDirection { export const $gtype: GObject.GType; } enum TextDirection { /** * From left to right */ LTR, /** * From right to left */ RTL, /** * Characters are from top to bottom, Lines are from right to left */ TTB_RTL, /** * Upright characters are from top to bottom, Lines are from right to left */ TTB_RTL_UPRIGHT, /** * Characters are from top to bottom, Lines are from left to right */ TTB_LTR, /** * Upright characters are from top to bottom, Lines are from left to right */ TTB_LTR_UPRIGHT, } /** * Text hint strengths. */ /** * Text hint strengths. */ export namespace TextHintStyle { export const $gtype: GObject.GType; } enum TextHintStyle { /** * None */ NONE, /** * Slight */ SLIGHT, /** * Medium */ MEDIUM, /** * Full */ FULL, } /** * Text justifications. */ /** * Text justifications. */ export namespace TextJustification { export const $gtype: GObject.GType; } enum TextJustification { /** * Left justified */ LEFT, /** * Right justified */ RIGHT, /** * Centered */ CENTER, /** * Filled */ FILL, } /** * For choosing which brightness ranges to transform. */ /** * For choosing which brightness ranges to transform. */ export namespace TransferMode { export const $gtype: GObject.GType; } enum TransferMode { /** * Shadows */ SHADOWS, /** * Midtones */ MIDTONES, /** * Highlights */ HIGHLIGHTS, } /** * Transform directions. */ /** * Transform directions. */ export namespace TransformDirection { export const $gtype: GObject.GType; } enum TransformDirection { /** * Normal (Forward) */ FORWARD, /** * Corrective (Backward) */ BACKWARD, } /** * Ways of clipping the result when transforming drawables. */ /** * Ways of clipping the result when transforming drawables. */ export namespace TransformResize { export const $gtype: GObject.GType; } enum TransformResize { /** * Adjust */ ADJUST, /** * Clip */ CLIP, /** * Crop to result */ CROP, /** * Crop with aspect */ CROP_WITH_ASPECT, } /** * Integer IDs of built-in units used for dimensions in images. These * IDs are meant to stay stable but user-created units IDs may change * from one session to another. */ /** * Integer IDs of built-in units used for dimensions in images. These * IDs are meant to stay stable but user-created units IDs may change * from one session to another. */ export namespace UnitID { export const $gtype: GObject.GType; } enum UnitID { /** * Pixels */ PIXEL, /** * Inches */ INCH, /** * Millimeters */ MM, /** * Points */ POINT, /** * Picas */ PICA, /** * Marker for end-of-builtin-units */ END, /** * Pseudo-unit percent */ PERCENT, } const API_VERSION: string; /** * The dark gray value for the default checkerboard pattern. */ const CHECK_DARK: number; /** * The dark light value for the default checkerboard pattern. */ const CHECK_LIGHT: number; /** * The default checkerboard size in pixels. This is configurable in * the core but GIMP plug-ins can't access the user preference and * should use this constant instead. */ const CHECK_SIZE: number; /** * The default small checkerboard size in pixels. */ const CHECK_SIZE_SM: number; /** * The object property is to be treated as part of the parent object. */ const CONFIG_PARAM_AGGREGATE: number; /** * Changes to this property should be confirmed by the user before * being applied. */ const CONFIG_PARAM_CONFIRM: number; /** * Don't serialize this property if it has the default value. */ const CONFIG_PARAM_DEFAULTS: number; /** * Ignore this property when comparing objects. */ const CONFIG_PARAM_DONT_COMPARE: number; /** * The default flags that should be used for serializable #GimpConfig * properties. */ const CONFIG_PARAM_FLAGS: number; /** * Minimum shift count to be used for core application defined * [flags`GObject`.ParamFlags]. */ const CONFIG_PARAM_FLAG_SHIFT: number; /** * This property exists for obscure reasons or is needed for backward * compatibility. Ignore the value read and don't serialize it. */ const CONFIG_PARAM_IGNORE: number; /** * Changes to this property take effect only after a restart. */ const CONFIG_PARAM_RESTART: number; /** * A property that can and should be serialized and deserialized. */ const CONFIG_PARAM_SERIALIZE: number; /** * The major GIMP version number. */ const MAJOR_VERSION: number; /** * The maximum width and height of a GIMP image in pixels. This is a * somewhat arbitrary value that can be used when an upper value for * pixel sizes is needed; for example to give a spin button an upper * limit. */ const MAX_IMAGE_SIZE: number; /** * A large but arbitrary value that can be used when an upper limit * for a memory size (in bytes) is needed. It is smaller than * %G_MAXDOUBLE since the #GimpMemsizeEntry doesn't handle larger * values. */ const MAX_MEMSIZE: number; /** * The maximum resolution of a GIMP image in pixels per inch. This is * a somewhat arbitrary value that can be used to when an upper value * for a resolution is needed. GIMP will not accept resolutions larger * than this value. */ const MAX_RESOLUTION: number; /** * The micro GIMP version number. */ const MICRO_VERSION: number; /** * The minor GIMP version number. */ const MINOR_VERSION: number; /** * The minimum width and height of a GIMP image in pixels. */ const MIN_IMAGE_SIZE: number; /** * The minimum resolution of a GIMP image in pixels per inch. This is * a somewhat arbitrary value that can be used when a lower value for a * resolution is needed. GIMP will not accept resolutions smaller than * this value. */ const MIN_RESOLUTION: number; /** * The version of the module system's ABI. Modules put this value into * #GimpModuleInfo's `abi_version` field so the code loading the modules * can check if it was compiled against the same module ABI the modules * are compiled against. * * GIMP_MODULE_ABI_VERSION is incremented each time one of the * following changes: * * - the libgimpmodule implementation (if the change affects modules). * * - one of the classes implemented by modules (currently #GimpColorDisplay, * #GimpColorSelector and #GimpController). */ const MODULE_ABI_VERSION: number; /** * This property will be ignored when serializing and deserializing. * This is useful for GimpProcedure arguments for which you never want * the last run values to be restored. * * Since 3.0 */ const PARAM_DONT_SERIALIZE: number; /** * Minimum shift count to be used for libgimpconfig defined * [flags`GObject`.ParamFlags] (see libgimpconfig/gimpconfig-params.h). */ const PARAM_FLAG_SHIFT: number; /** * Since 3.0 */ const PARAM_NO_VALIDATE: number; const PARAM_READABLE: number; const PARAM_READWRITE: number; const PARAM_STATIC_STRINGS: number; const PARAM_WRITABLE: number; const PARASITE_ATTACH_GRANDPARENT: number; const PARASITE_ATTACH_PARENT: number; const PARASITE_GRANDPARENT_PERSISTENT: number; const PARASITE_GRANDPARENT_UNDOABLE: number; const PARASITE_PARENT_PERSISTENT: number; const PARASITE_PARENT_UNDOABLE: number; const PARASITE_PERSISTENT: number; const PARASITE_UNDOABLE: number; const PIXPIPE_MAXDIM: number; /** * The GIMP version as a string. */ const VERSION: string; function adaptive_supersample_area( x1: number, y1: number, x2: number, y2: number, max_depth: number, threshold: number, render_func: RenderFunc, put_pixel_func: PutPixelFunc, progress_func: ProgressFunc, ): number; /** * Paint in the current brush with varying pressure. Paint application * is time-dependent. * * This tool simulates the use of an airbrush. Paint pressure * represents the relative intensity of the paint application. High * pressure results in a thicker layer of paint while low pressure * results in a thinner layer. * @param drawable The affected drawable. * @param pressure The pressure of the airbrush strokes. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function airbrush(drawable: Drawable, pressure: number, strokes: number[]): boolean; /** * Paint in the current brush with varying pressure. Paint application * is time-dependent. * * This tool simulates the use of an airbrush. It is similar to * gimp_airbrush() except that the pressure is derived from the * airbrush tools options box. It the option has not been set the * default for the option will be used. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function airbrush_default(drawable: Drawable, strokes: number[]): boolean; /** * Add a global parasite. * * This procedure attaches a global parasite. It has no return values. * @param parasite The parasite to attach. * @returns TRUE on success. */ function attach_parasite(parasite: Parasite): boolean; function babl_format_get_type(): GObject.GType; function bilinear(x: number, y: number, values: number[]): number; function bilinear_16(x: number, y: number, values: number[]): number; function bilinear_32(x: number, y: number, values: number[]): number; function bilinear_8(x: number, y: number, values: Uint8Array | string): number; function bilinear_rgb(x: number, y: number, values: number[], has_alpha: boolean, retvalues: number[]): void; /** * This function wraps bindtextdomain on UNIX and wbintextdomain on Windows. * `dir_name` is expected to be in the encoding used by the C library on UNIX * and UTF-8 on Windows. * @param domain_name a gettext domain name * @param dir_name path of the catalog directory */ function bind_text_domain(domain_name: string, dir_name: string): void; /** * Close the brush selection dialog. * * Closes an open brush selection dialog. * @param brush_callback The name of the callback registered for this pop-up. * @returns TRUE on success. */ function brushes_close_popup(brush_callback: string): boolean; /** * Retrieve a complete listing of the available brushes. * * This procedure returns a complete listing of available GIMP brushes. * Each brush returned can be used as input to * [func`Gimp`.context_set_brush]. * @param filter An optional regular expression used to filter the list. * @returns The list of brushes. The returned value must be freed with g_free(). */ function brushes_get_list(filter: string): Brush[]; /** * Invokes the GIMP brush selection dialog. * * Opens a dialog letting a user choose a brush. * @param brush_callback The callback PDB proc to call when user chooses a brush. * @param popup_title Title of the brush selection dialog. * @param initial_brush The brush to set as the initial choice. * @param parent_window An optional parent window handle for the popup to be set transient to. * @returns TRUE on success. */ function brushes_popup( brush_callback: string, popup_title: string, initial_brush?: Brush | null, parent_window?: GLib.Bytes | null, ): boolean; /** * Refresh current brushes. This function always succeeds. * * This procedure retrieves all brushes currently in the user's brush * path and updates the brush dialogs accordingly. * @returns TRUE on success. */ function brushes_refresh(): boolean; /** * Sets the selected brush in a brush selection dialog. * * Sets the selected brush in a brush selection dialog. * @param brush_callback The name of the callback registered for this pop-up. * @param brush The brush to set as selected. * @returns TRUE on success. */ function brushes_set_popup(brush_callback: string, brush: Brush): boolean; /** * Deletes a named buffer. * * This procedure deletes a named buffer. * @param buffer_name The buffer name. * @returns TRUE on success. */ function buffer_delete(buffer_name: string): boolean; /** * Retrieves the specified buffer's bytes. * * This procedure retrieves the specified named buffer's bytes. * @param buffer_name The buffer name. * @returns The buffer bpp. */ function buffer_get_bytes(buffer_name: string): number; /** * Retrieves the specified buffer's height. * * This procedure retrieves the specified named buffer's height. * @param buffer_name The buffer name. * @returns The buffer height. */ function buffer_get_height(buffer_name: string): number; /** * Retrieves the specified buffer's image type. * * This procedure retrieves the specified named buffer's image type. * @param buffer_name The buffer name. * @returns The buffer image type. */ function buffer_get_image_type(buffer_name: string): ImageType; /** * Retrieves the specified buffer's width. * * This procedure retrieves the specified named buffer's width. * @param buffer_name The buffer name. * @returns The buffer width. */ function buffer_get_width(buffer_name: string): number; /** * Renames a named buffer. * * This procedure renames a named buffer. * @param buffer_name The buffer name. * @param new_name The buffer's new name. * @returns The real name given to the buffer. The returned value must be freed with g_free(). */ function buffer_rename(buffer_name: string, new_name: string): string; /** * Retrieve a complete listing of the available buffers. * * This procedure returns a complete listing of available named * buffers. * @param filter An optional regular expression used to filter the list. * @returns The list of buffer names. The returned value must be freed with g_strfreev(). */ function buffers_get_name_list(filter?: string | null): string[]; /** * Returns the default top directory for GIMP cached files. If the * environment variable GIMP3_CACHEDIR exists, that is used. It * should be an absolute pathname. Otherwise, a subdirectory of the * directory returned by g_get_user_cache_dir() is used. * * Note that the actual directories used for GIMP caches files can * be overridden by the user in the preferences dialog. * * In config files such as gimprc, the string ${gimp_cache_dir} * expands to this directory. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string is in the encoding used for filenames by * GLib, which isn't necessarily UTF-8. (On Windows it always is * UTF-8.). * @returns The default top directory for GIMP cached files. */ function cache_directory(): string; /** * Create a repeating checkerboard pattern. * @param cr Cairo context * @param size check size * @param light light check color or %NULL to use the default light gray * @param dark dark check color or %NULL to use the default dark gray * @returns a new Cairo pattern that can be used as a source on @cr. */ function cairo_checkerboard_create( cr: cairo.Context, size: number, light: Gegl.Color, dark: Gegl.Color, ): cairo.Pattern; /** * This function returns a #GeglBuffer which wraps `surface'`s pixels. * It must only be called on image surfaces, calling it on other surface * types is an error. * * If `format` is set, the returned [class`Gegl`.Buffer] will use it. It has to * map with `surface` Cairo format. If unset, the buffer format will be * determined from `surface`. The main difference is that automatically * determined format has sRGB space and TRC by default. * @param surface a Cairo surface * @param format a Babl format. * @returns a #GeglBuffer */ function cairo_surface_create_buffer(surface: cairo.Surface, format: Babl.Object): Gegl.Buffer; /** * This function returns a #Babl format that corresponds to `surface'`s * pixel format. * @param surface a Cairo surface * @returns the #Babl format of @surface. */ function cairo_surface_get_format(surface: cairo.Surface): Babl.Object; /** * Turns any input string into a canonicalized string. * * Canonical identifiers are e.g. expected by the PDB for procedure * and parameter names. Every character of the input string that is * not either '-', 'a-z', 'A-Z' or '0-9' will be replaced by a '-'. * @param identifier The identifier string to canonicalize. * @returns The canonicalized identifier. This is a newly allocated string that should be freed with g_free() when no longer needed. */ function canonicalize_identifier(identifier: string): string; /** * Returns the first checkerboard custom color that can * be used in previews. * * This is a constant value given at plug-in configuration time. * @returns the _check_custom_color1 value */ function check_custom_color1(): Gegl.Color; /** * Returns the second checkerboard custom color that can * be used in previews. * * This is a constant value given at plug-in configuration time. * @returns the _check_custom_color2 value */ function check_custom_color2(): Gegl.Color; /** * Returns the size of the checkerboard to be used in previews. * * This is a constant value given at plug-in configuration time. * @returns the check_size value */ function check_size(): CheckSize; /** * Returns the type of the checkerboard to be used in previews. * * This is a constant value given at plug-in configuration time. * @returns the check_type value */ function check_type(): CheckType; /** * Retrieves the colors to use when drawing a checkerboard for a certain * #GimpCheckType and custom colors. * If `type` is %GIMP_CHECK_TYPE_CUSTOM_CHECKS, then `color1` and `color2` * will remain untouched, which means you must initialize them to the * values expected for custom checks. * * To obtain the user-set colors in Preferences, just call: * * ```c * GeglColor *color1 = gimp_check_custom_color1 (); * GeglColor *color2 = gimp_check_custom_color2 (); * gimp_checks_get_colors (gimp_check_type (), &color1, &color2); * ``` * * @param type the checkerboard type * @param color1 current custom color and return location for the first color. * @param color2 current custom color and return location for the second color. */ function checks_get_colors( type: CheckType | null, color1: Gegl.Color, color2: Gegl.Color, ): [Gegl.Color, Gegl.Color]; /** * Clone from the source to the dest drawable using the current brush * * This tool clones (copies) from the source drawable starting at the * specified source coordinates to the dest drawable. If the * \"clone_type\" argument is set to PATTERN-CLONE, then the current * pattern is used as the source and the \"src_drawable\" argument is * ignored. Pattern cloning assumes a tileable pattern and mods the sum * of the src coordinates and subsequent stroke offsets with the width * and height of the pattern. For image cloning, if the sum of the src * coordinates and subsequent stroke offsets exceeds the extents of the * src drawable, then no paint is transferred. The clone tool is * capable of transforming between any image types including * RGB->Indexed--although converting from any type to indexed is * significantly slower. * @param drawable The affected drawable. * @param src_drawable The source drawable. * @param clone_type The type of clone. * @param src_x The x coordinate in the source image. * @param src_y The y coordinate in the source image. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function clone( drawable: Drawable, src_drawable: Drawable, clone_type: CloneType | null, src_x: number, src_y: number, strokes: number[], ): boolean; /** * Clone from the source to the dest drawable using the current brush * * This tool clones (copies) from the source drawable starting at the * specified source coordinates to the dest drawable. This function * performs exactly the same as the gimp_clone() function except that * the tools arguments are obtained from the clones option dialog. It * this dialog has not been activated then the dialogs default values * will be used. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function clone_default(drawable: Drawable, strokes: number[]): boolean; /** * Creates a new #GimpColorArray containing a deep copy of a %NULL-terminated * array of [class`Gegl`.Color]. * @param array an array of colors. * @returns a new #GimpColorArray. */ function color_array_copy(array: ColorArray): ColorArray; /** * Frees a %NULL-terminated array of [class`Gegl`.Color]. * @param array an array of colors. */ function color_array_free(array: ColorArray): void; function color_array_get_length(array: ColorArray): number; function color_array_get_type(): GObject.GType; /** * Determine whether `color` is out of its `space` gamut. * A small error of margin is accepted, so that for instance a component * at -0.0000001 is not making the whole color to be considered as * out-of-gamut while it may just be computation imprecision. * @param color a [class@Gegl.Color] * @param space a color space to convert @color to. * @returns whether the color is out of @space gamut. */ function color_is_out_of_gamut(color: Gegl.Color, space: Babl.Object): boolean; /** * Determine whether `color` is out of its own space gamut. This can only * happen if the color space is unbounded and any of the color component * is out of the `[0; 1]` range. * A small error of margin is accepted, so that for instance a component * at -0.0000001 is not making the whole color to be considered as * out-of-gamut while it may just be computation imprecision. * @param color a [class@Gegl.Color] * @returns whether the color is out of its own color space gamut. */ function color_is_out_of_self_gamut(color: Gegl.Color): boolean; /** * Determine whether `color1` and `color2` can be considered identical to the * human eyes, by computing the distance in a color space as perceptually * uniform as possible. * * This function will also consider any transparency channel, so that if you * only want to compare the pure color, you could for instance set both color's * alpha channel to 1.0 first (possibly on duplicates of the colors if originals * should not be modified), such as: * * ```C * gimp_color_set_alpha (color1, 1.0); * gimp_color_set_alpha (color2, 1.0); * if (gimp_color_is_perceptually_identical (color1, color2)) * { * printf ("Both colors are identical, ignoring their alpha component"); * } * ``` * @param color1 a [class@Gegl.Color] * @param color2 a [class@Gegl.Color] * @returns whether the 2 colors can be considered the same for the human eyes. */ function color_is_perceptually_identical(color1: Gegl.Color, color2: Gegl.Color): boolean; /** * Returns the list of [SVG 1.0 color * keywords](https://www.w3.org/TR/SVG/types.html) that is recognized by * [func`color_parse_name]`. * * The returned strings are const and must not be freed. Only the array * must be freed with `g_free()`. * * The optional `colors` arrays must be freed with [func`color_array_free]` when * they are no longer needed. * @returns an array of color names. */ function color_list_names(): [string[], Gegl.Color[] | null]; /** * Attempts to parse a string describing an sRGB color in CSS notation. This can * be either a numerical representation (`rgb(255,0,0)` or `rgb(100%,0%,0%)`) * or a hexadecimal notation as parsed by [func`color_parse_hex]` (`##ff0000`) or * a color name as parsed by [func`color_parse_css]` (`red`). * * Additionally the `rgba()`, `hsl()` and `hsla()` functions are supported too. * @param css a string describing a color in CSS notation * @returns a newly allocated [class@Gegl.Color] if @css was parsed successfully, %NULL otherwise */ function color_parse_css(css: string): Gegl.Color; /** * Attempts to parse a string describing a sRGB color in hexadecimal * notation (optionally prefixed with a '#'). * @param hex a string describing a color in hexadecimal notation * @returns a newly allocated color representing @hex. */ function color_parse_hex(hex: string): Gegl.Color; /** * Attempts to parse a color name. This function accepts [SVG 1.1 color * keywords](https://www.w3.org/TR/SVG11/types.html#ColorKeywords). * @param name a color name (in UTF-8 encoding) * @returns a sRGB color as defined in "4.4. Recognized color keyword names" list of SVG 1.1 specification, if @name was parsed successfully, %NULL otherwise */ function color_parse_name(name: string): Gegl.Color; /** * Update the `alpha` channel, and any other component if necessary (e.g. in case * of premultiplied channels), without changing the format of `color`. * * If `color` has no alpha component, this function is a no-op. * @param color a [class@Gegl.Color] * @param alpha new value for the alpha channel. */ function color_set_alpha(color: Gegl.Color, alpha: number): void; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_data_path() includes a directory * below the user's gimp directory and one in the system-wide data * directory. * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) * @returns a newly allocated string */ function config_build_data_path(name: string): string; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_plug_in_path() includes a directory * below the user's gimp directory and one in the system-wide plug-in * directory. * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) * @returns a newly allocated string */ function config_build_plug_in_path(name: string): string; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_system_path() is just the read-only * parts of the search path constructed by gimp_config_build_plug_in_path(). * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) * @returns a newly allocated string */ function config_build_system_path(name: string): string; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_writable_path() is just the writable * parts of the search path constructed by gimp_config_build_data_path(). * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) * @returns a newly allocated string */ function config_build_writable_path(name: string): string; function config_deserialize_return( scanner: GLib.Scanner, expected_token: GLib.TokenType | null, nest_level: number, ): boolean; /** * Compares all properties of `a` and `b` that have all `flags` set. If * `flags` is 0, all properties are compared. * * If the two objects are not of the same type, only properties that * exist in both object classes and are of the same value_type are * compared. * @param a a #GObject * @param b another #GObject object * @param flags a mask of GParamFlags * @returns a GList of differing GParamSpecs. */ function config_diff( a: GObject.Object, b: GObject.Object, flags: GObject.ParamFlags | null, ): GObject.ParamSpec[]; /** * This function is never called directly. Use GIMP_CONFIG_ERROR() instead. * @returns the #GQuark that defines the GimpConfig error domain. */ function config_error_quark(): GLib.Quark; /** * Creates an exact copy of `pspec,` with all its properties, returns * %NULL if `pspec` is of an unknown type that can't be duplicated. * @param pspec the #GParamSpec to duplicate * @returns The new #GParamSpec, or %NULL. */ function config_param_spec_duplicate(pspec: GObject.ParamSpec): GObject.ParamSpec; /** * Resets all writable properties of `object` to the default values as * defined in their #GParamSpec. Properties marked as "construct-only" * are not touched. * * If you want to reset a #GimpConfig object, please use gimp_config_reset(). * @param object a #GObject */ function config_reset_properties(object: GObject.Object): void; /** * Resets the property named `property_name` to its default value. The * property must be writable and must not be marked as "construct-only". * @param object a #GObject * @param property_name name of the property to reset */ function config_reset_property(object: GObject.Object, property_name: string): void; /** * This utility function appends a string representation of #GValue to `str`. * @param value a #GValue. * @param str a #GString. * @param escaped whether to escape string values. * @returns %TRUE if serialization succeeded, %FALSE otherwise. */ function config_serialize_value(value: GObject.Value | any, str: GLib.String, escaped: boolean): boolean; /** * Escapes and quotes `val` and appends it to `string`. The escape * algorithm is different from the one used by g_strescape() since it * leaves non-ASCII characters intact and thus preserves UTF-8 * strings. Only control characters and quotes are being escaped. * @param string pointer to a #GString * @param val a string to append or %NULL */ function config_string_append_escaped(string: GLib.String, val: string): void; /** * Compares all read- and write-able properties from `src` and `dest` * that have all `flags` set. Differing values are then copied from * `src` to `dest`. If `flags` is 0, all differing read/write properties. * * Properties marked as "construct-only" are not touched. * * If the two objects are not of the same type, only properties that * exist in both object classes and are of the same value_type are * synchronized * @param src a #GObject * @param dest another #GObject * @param flags a mask of GParamFlags * @returns %TRUE if @dest was modified, %FALSE otherwise */ function config_sync(src: GObject.Object, dest: GObject.Object, flags: GObject.ParamFlags | null): boolean; /** * This function is a fancy wrapper around g_type_register_static(). * It creates a new object type as subclass of `parent_type,` installs * `pspecs` on it and makes the new type implement the #GimpConfig * interface. * @param parent_type type from which this type will be derived * @param type_name string used as the name of the new type * @param pspecs array of #GParamSpec to install as properties on the new type * @returns the newly registered #GType */ function config_type_register( parent_type: GObject.GType, type_name: string, pspecs: GObject.ParamSpec[], ): GObject.GType; /** * Whether the currently active paint dynamics will be applied to * painting. * * Returns whether the currently active paint dynamics (as returned by * gimp_context_get_dynamics()) is enabled. * @returns Whether dynamics enabled or disabled. */ function context_are_dynamics_enabled(): boolean; /** * Enables paint dynamics using the active paint dynamics. * * Enables the active paint dynamics to be used in all subsequent paint * operations. * @param enable Whether to enable or disable dynamics. * @returns TRUE on success. */ function context_enable_dynamics(enable: boolean): boolean; /** * Get the antialias setting. * * Returns the antialias setting. * @returns The antialias setting. */ function context_get_antialias(): boolean; /** * Get the current GIMP background color. * * Returns the current GIMP background color. The background color is * used in a variety of tools such as blending, erasing (with non-alpha * images), and image filling. * @returns The background color. */ function context_get_background(): Gegl.Color; /** * Get the currently active brush. * * Returns the currently active brush. All paint and stroke operations * use this brush. * @returns The active brush. */ function context_get_brush(): Brush; /** * Get brush angle in degrees. * * Set the angle in degrees for brush based paint tools. * @returns Angle in degrees. */ function context_get_brush_angle(): number; /** * Get brush aspect ratio. * * Set the aspect ratio for brush based paint tools. * @returns Aspect ratio. */ function context_get_brush_aspect_ratio(): number; /** * Get brush force in paint options. * * Get the brush application force for brush based paint tools. * @returns Brush application force. */ function context_get_brush_force(): number; /** * Get brush hardness in paint options. * * Get the brush hardness for brush based paint tools. * @returns Brush hardness. */ function context_get_brush_hardness(): number; /** * Get brush size in pixels. * * Get the brush size in pixels for brush based paint tools. * @returns Brush size in pixels. */ function context_get_brush_size(): number; /** * Get brush spacing as percent of size. * * Get the brush spacing as percent of size for brush based paint * tools. * @returns Brush spacing as fraction of size. */ function context_get_brush_spacing(): number; /** * Get the diagonal neighbors setting. * * Returns the diagonal neighbors setting. * @returns The diagonal neighbors setting. */ function context_get_diagonal_neighbors(): boolean; /** * Get the distance metric used in some computations. * * Returns the distance metric in the current context. See * gimp_context_set_distance_metric() to know more about its usage. * @returns The distance metric. */ function context_get_distance_metric(): Gegl.DistanceMetric; /** * Get the currently active paint dynamics. * * Returns the name of the currently active paint dynamics. If enabled, * all paint operations and stroke operations use this paint dynamics * to control the application of paint to the image. If disabled, the * dynamics will be ignored during paint actions. * See gimp_context_are_dynamics_enabled() to enquire whether dynamics * are used or ignored. * @returns The name of the active paint dynamics. The returned value must be freed with g_free(). */ function context_get_dynamics_name(): string; /** * Retrieve the currently active stroke option's emulate brush dynamics * setting. * * This procedure returns the emulate brush dynamics property of the * currently active stroke options. * @returns The emulate brush dynamics setting. */ function context_get_emulate_brush_dynamics(): boolean; /** * Get the feather setting. * * Returns the feather setting. * @returns The feather setting. */ function context_get_feather(): boolean; /** * Get the feather radius setting. * * Returns the feather radius setting. * @returns TRUE on success. */ function context_get_feather_radius(): [boolean, number, number]; /** * Get the currently active font. * * Returns the currently active font. * @returns The active font. */ function context_get_font(): Font; /** * Get the current GIMP foreground color. * * Returns the current GIMP foreground color. The foreground color is * used in a variety of tools such as paint tools, blending, and bucket * fill. * @returns The foreground color. */ function context_get_foreground(): Gegl.Color; /** * Get the currently active gradient. * * Returns the currently active gradient. * @returns The active gradient. */ function context_get_gradient(): Gradient; /** * Get the gradient blend color space. * * Get the gradient blend color space for paint tools and the gradient * tool. * @returns Color blend space. */ function context_get_gradient_blend_color_space(): GradientBlendColorSpace; /** * Get the gradient repeat mode. * * Get the gradient repeat mode for paint tools and the gradient tool. * @returns Repeat mode. */ function context_get_gradient_repeat_mode(): RepeatMode; /** * Get the gradient reverse setting. * * Get the gradient reverse setting for paint tools and the gradient * tool. * @returns Reverse. */ function context_get_gradient_reverse(): boolean; /** * Get ink angle in degrees. * * Get the ink angle in degrees for ink tool. * @returns ink angle in degrees. */ function context_get_ink_angle(): number; /** * Get ink blob angle in degrees. * * Get the ink blob angle in degrees for ink tool. * @returns ink blob angle in degrees. */ function context_get_ink_blob_angle(): number; /** * Get ink blob aspect ratio. * * Get the ink blob aspect ratio for ink tool. * @returns ink blob aspect ratio. */ function context_get_ink_blob_aspect_ratio(): number; /** * Get ink blob type. * * Get the ink blob type for ink tool. * @returns Ink blob type. */ function context_get_ink_blob_type(): InkBlobType; /** * Get ink blob size in pixels. * * Get the ink blob size in pixels for ink tool. * @returns ink blob size in pixels. */ function context_get_ink_size(): number; /** * Get ink size sensitivity. * * Get the ink size sensitivity for ink tool. * @returns ink size sensitivity. */ function context_get_ink_size_sensitivity(): number; /** * Get ink speed sensitivity. * * Get the ink speed sensitivity for ink tool. * @returns ink speed sensitivity. */ function context_get_ink_speed_sensitivity(): number; /** * Get ink tilt sensitivity. * * Get the ink tilt sensitivity for ink tool. * @returns ink tilt sensitivity. */ function context_get_ink_tilt_sensitivity(): number; /** * Get the interpolation type. * * Returns the interpolation setting. The return value is an integer * which corresponds to the values listed in the argument description. * If the interpolation has not been set explicitly by * gimp_context_set_interpolation(), the default interpolation set in * gimprc will be used. * @returns The interpolation type. */ function context_get_interpolation(): InterpolationType; /** * Get the line cap style setting. * * Returns the line cap style setting. * @returns The line cap style setting. */ function context_get_line_cap_style(): CapStyle; /** * Get the line dash offset setting. * * Returns the line dash offset setting. * @returns The line dash offset setting. */ function context_get_line_dash_offset(): number; /** * Get the line dash pattern setting. * * Returns the line dash pattern setting. * @returns TRUE on success. */ function context_get_line_dash_pattern(): [boolean, number[]]; /** * Get the line join style setting. * * Returns the line join style setting. * @returns The line join style setting. */ function context_get_line_join_style(): JoinStyle; /** * Get the line miter limit setting. * * Returns the line miter limit setting. * @returns The line miter limit setting. */ function context_get_line_miter_limit(): number; /** * Get the line width setting. * * Returns the line width setting. * @returns The line width setting. */ function context_get_line_width(): number; /** * Get the line width unit setting. * * Returns the line width unit setting. * @returns The line width unit setting. */ function context_get_line_width_unit(): Unit; /** * Get the currently active MyPaint brush. * * Returns the name of the currently active MyPaint brush. * @returns The name of the active MyPaint brush. The returned value must be freed with g_free(). */ function context_get_mypaint_brush(): string; /** * Get the opacity. * * Returns the opacity setting. The return value is a floating point * number between 0 and 100. * @returns The opacity. */ function context_get_opacity(): number; /** * Get the currently active paint method. * * Returns the name of the currently active paint method. * @returns The name of the active paint method. The returned value must be freed with g_free(). */ function context_get_paint_method(): string; /** * Get the paint mode. * * Returns the paint-mode setting. The return value is an integer which * corresponds to the values listed in the argument description. * @returns The paint mode. */ function context_get_paint_mode(): LayerMode; /** * Get the currently active palette. * * Returns the currently active palette. * @returns The active palette. */ function context_get_palette(): Palette; /** * Get the currently active pattern. * * Returns the active pattern in the current context. All clone and * bucket-fill operations with patterns will use this pattern to * control the application of paint to the image. * @returns The active pattern. */ function context_get_pattern(): Pattern; /** * Get the sample criterion setting. * * Returns the sample criterion setting. * @returns The sample criterion setting. */ function context_get_sample_criterion(): SelectCriterion; /** * Get the sample merged setting. * * Returns the sample merged setting. * @returns The sample merged setting. */ function context_get_sample_merged(): boolean; /** * Get the sample threshold setting. * * Returns the sample threshold setting. * @returns The sample threshold setting. */ function context_get_sample_threshold(): number; /** * Get the sample threshold setting as an integer value. * * Returns the sample threshold setting as an integer value. See * gimp_context_get_sample_threshold(). * @returns The sample threshold setting. */ function context_get_sample_threshold_int(): number; /** * Get the sample transparent setting. * * Returns the sample transparent setting. * @returns The sample transparent setting. */ function context_get_sample_transparent(): boolean; /** * Get the currently active stroke method. * * Returns the currently active stroke method. * @returns The active stroke method. */ function context_get_stroke_method(): StrokeMethod; /** * Get the transform direction. * * Returns the transform direction. The return value is an integer * which corresponds to the values listed in the argument description. * @returns The transform direction. */ function context_get_transform_direction(): TransformDirection; /** * Get the transform resize type. * * Returns the transform resize setting. The return value is an integer * which corresponds to the values listed in the argument description. * @returns The transform resize type. */ function context_get_transform_resize(): TransformResize; /** * Lists the available paint methods. * * Lists the names of the available paint methods. Any of the names can * be used for gimp_context_set_paint_method(). * @returns TRUE on success. */ function context_list_paint_methods(): [boolean, string[]]; /** * Pops the topmost context from the plug-in's context stack. * * Removes the topmost context from the plug-in's context stack. The * next context on the stack becomes the new current context of the * plug-in, that is, the context that was active before the * corresponding call to gimp_context_push() * @returns TRUE on success. */ function context_pop(): boolean; /** * Pushes a context onto the top of the plug-in's context stack. * * Creates a new context by copying the current context. The copy * becomes the new current context for the calling plug-in until it is * popped again using gimp_context_pop(). * @returns TRUE on success. */ function context_push(): boolean; /** * Set the antialias setting. * * Modifies the antialias setting. If antialiasing is turned on, the * edges of selected region will contain intermediate values which give * the appearance of a sharper, less pixelized edge. This should be set * as TRUE most of the time unless a binary-only selection is wanted. * * This setting affects the following procedures: * gimp_image_select_color(), gimp_image_select_contiguous_color(), * gimp_image_select_round_rectangle(), gimp_image_select_ellipse(), * gimp_image_select_polygon(), gimp_image_select_item(), * gimp_drawable_edit_bucket_fill(), gimp_drawable_edit_stroke_item(), * gimp_drawable_edit_stroke_selection(). * @param antialias The antialias setting. * @returns TRUE on success. */ function context_set_antialias(antialias: boolean): boolean; /** * Set the current GIMP background color. * * Sets the current GIMP background color. After this is set, * operations which use background such as blending, filling images, * clearing, and erasing (in non-alpha images) will use the new value. * @param background The background color. * @returns TRUE on success. */ function context_set_background(background: Gegl.Color): boolean; /** * Set the active brush. * * Sets the active brush in the current context. The brush will be used * in subsequent paint and stroke operations. Returns an error when the * brush data was uninstalled since the brush object was created. * @param brush The brush. * @returns TRUE on success. */ function context_set_brush(brush: Brush): boolean; /** * Set brush angle in degrees. * * Set the angle in degrees for brush based paint tools. * @param angle Angle in degrees. * @returns TRUE on success. */ function context_set_brush_angle(angle: number): boolean; /** * Set brush aspect ratio. * * Set the aspect ratio for brush based paint tools. * @param aspect Aspect ratio. * @returns TRUE on success. */ function context_set_brush_aspect_ratio(aspect: number): boolean; /** * Set brush spacing to its default. * * Set the brush spacing to the default for paintbrush, airbrush, or * pencil tools. * @returns TRUE on success. */ function context_set_brush_default_hardness(): boolean; /** * Set brush size to its default. * * Set the brush size to the default (max of width and height) for * paintbrush, airbrush, or pencil tools. * @returns TRUE on success. */ function context_set_brush_default_size(): boolean; /** * Set brush spacing to its default. * * Set the brush spacing to the default for paintbrush, airbrush, or * pencil tools. * @returns TRUE on success. */ function context_set_brush_default_spacing(): boolean; /** * Set brush application force. * * Set the brush application force for brush based paint tools. * @param force Brush application force. * @returns TRUE on success. */ function context_set_brush_force(force: number): boolean; /** * Set brush hardness. * * Set the brush hardness for brush based paint tools. * @param hardness Brush hardness. * @returns TRUE on success. */ function context_set_brush_hardness(hardness: number): boolean; /** * Set brush size in pixels. * * Set the brush size in pixels for brush based paint tools. * @param size Brush size in pixels. * @returns TRUE on success. */ function context_set_brush_size(size: number): boolean; /** * Set brush spacing as percent of size. * * Set the brush spacing as percent of size for brush based paint * tools. * @param spacing Brush spacing as fraction of size. * @returns TRUE on success. */ function context_set_brush_spacing(spacing: number): boolean; /** * Set the current GIMP foreground and background colors to black and * white. * * Sets the current GIMP foreground and background colors to their * initial default values, black and white. * @returns TRUE on success. */ function context_set_default_colors(): boolean; /** * Reset context settings to their default values. * * Resets context settings used by various procedures to their default * value. You should usually call this after a context push so that a * script which calls procedures affected by context settings will not * be affected by changes in the global context. * @returns TRUE on success. */ function context_set_defaults(): boolean; /** * Set the diagonal neighbors setting. * * Modifies the diagonal neighbors setting. If the affected region of * an operation is based on a seed point, like when doing a seed fill, * then, when this setting is TRUE, all eight neighbors of each pixel * are considered when calculating the affected region; in contrast, * when this setting is FALSE, only the four orthogonal neighbors of * each pixel are considered. * * This setting affects the following procedures: * gimp_image_select_contiguous_color(), * gimp_drawable_edit_bucket_fill(). * @param diagonal_neighbors The diagonal neighbors setting. * @returns TRUE on success. */ function context_set_diagonal_neighbors(diagonal_neighbors: boolean): boolean; /** * Set the distance metric used in some computations. * * Modifies the distance metric used in some computations, such as * gimp_drawable_edit_gradient_fill(). In particular, it does not * change the metric used in generic distance computation on canvas, as * in the Measure tool. * * This setting affects the following procedures: * gimp_drawable_edit_gradient_fill(). * @param metric The distance metric. * @returns TRUE on success. */ function context_set_distance_metric(metric: Gegl.DistanceMetric | null): boolean; /** * Set the active paint dynamics. * * Sets the active paint dynamics. The paint dynamics will be used in * all subsequent paint operations when dynamics are enabled. The name * should be a name of an installed paint dynamics. Returns an error if * no matching paint dynamics is found. * @param name A name of a paint dynamics. * @returns TRUE on success. */ function context_set_dynamics_name(name: string): boolean; /** * Set the stroke option's emulate brush dynamics setting. * * This procedure sets the specified emulate brush dynamics setting. * The new method will be used in all subsequent stroke operations. * @param emulate_dynamics The new emulate brush dynamics setting. * @returns TRUE on success. */ function context_set_emulate_brush_dynamics(emulate_dynamics: boolean): boolean; /** * Set the feather setting. * * Modifies the feather setting. If the feather option is enabled, * selections will be blurred before combining. The blur is a gaussian * blur; its radii can be controlled using * gimp_context_set_feather_radius(). * * This setting affects the following procedures: * gimp_image_select_color(), gimp_image_select_contiguous_color(), * gimp_image_select_rectangle(), gimp_image_select_round_rectangle(), * gimp_image_select_ellipse(), gimp_image_select_polygon(), * gimp_image_select_item(). * @param feather The feather setting. * @returns TRUE on success. */ function context_set_feather(feather: boolean): boolean; /** * Set the feather radius setting. * * Modifies the feather radius setting. * * This setting affects all procedures that are affected by * gimp_context_set_feather(). * @param feather_radius_x The horizontal feather radius. * @param feather_radius_y The vertical feather radius. * @returns TRUE on success. */ function context_set_feather_radius(feather_radius_x: number, feather_radius_y: number): boolean; /** * Set the active font. * * Sets the active font in the current context. The font will be used * in subsequent text operations. Returns an error when the font data * was uninstalled since the font object was created. * @param font The font. * @returns TRUE on success. */ function context_set_font(font: Font): boolean; /** * Set the current GIMP foreground color. * * Sets the current GIMP foreground color. After this is set, * operations which use foreground such as paint tools, blending, and * bucket fill will use the new value. * @param foreground The foreground color. * @returns TRUE on success. */ function context_set_foreground(foreground: Gegl.Color): boolean; /** * Sets the active gradient. * * Sets the active gradient in the current context. The gradient will * be used in subsequent gradient operations. Returns an error when the * gradient data was uninstalled since the gradient object was created. * @param gradient The gradient. * @returns TRUE on success. */ function context_set_gradient(gradient: Gradient): boolean; /** * Set the gradient blend color space. * * Set the gradient blend color space for paint tools and the gradient * tool. * @param blend_color_space Blend color space. * @returns TRUE on success. */ function context_set_gradient_blend_color_space(blend_color_space: GradientBlendColorSpace | null): boolean; /** * Sets the built-in FG-BG HSV (ccw) gradient as the active gradient. * * Sets the built-in FG-BG HSV (ccw) gradient as the active gradient. * The gradient will be used for subsequent gradient operations. * @returns TRUE on success. */ function context_set_gradient_fg_bg_hsv_ccw(): boolean; /** * Sets the built-in FG-BG HSV (cw) gradient as the active gradient. * * Sets the built-in FG-BG HSV (cw) gradient as the active gradient. * The gradient will be used for subsequent gradient operations. * @returns TRUE on success. */ function context_set_gradient_fg_bg_hsv_cw(): boolean; /** * Sets the built-in FG-BG RGB gradient as the active gradient. * * Sets the built-in FG-BG RGB gradient as the active gradient. The * gradient will be used for subsequent gradient operations. * @returns TRUE on success. */ function context_set_gradient_fg_bg_rgb(): boolean; /** * Sets the built-in FG-Transparent gradient as the active gradient. * * Sets the built-in FG-Transparent gradient as the active gradient. * The gradient will be used for subsequent gradient operations. * @returns TRUE on success. */ function context_set_gradient_fg_transparent(): boolean; /** * Set the gradient repeat mode. * * Set the gradient repeat mode for paint tools and the gradient tool. * @param repeat_mode Repeat mode. * @returns TRUE on success. */ function context_set_gradient_repeat_mode(repeat_mode: RepeatMode | null): boolean; /** * Set the gradient reverse setting. * * Set the gradient reverse setting for paint tools and the gradient * tool. * @param reverse Reverse. * @returns TRUE on success. */ function context_set_gradient_reverse(reverse: boolean): boolean; /** * Set ink angle in degrees. * * Set the ink angle in degrees for ink tool. * @param angle ink angle in degrees. * @returns TRUE on success. */ function context_set_ink_angle(angle: number): boolean; /** * Set ink blob angle in degrees. * * Set the ink blob angle in degrees for ink tool. * @param angle ink blob angle in degrees. * @returns TRUE on success. */ function context_set_ink_blob_angle(angle: number): boolean; /** * Set ink blob aspect ratio. * * Set the ink blob aspect ratio for ink tool. * @param aspect ink blob aspect ratio. * @returns TRUE on success. */ function context_set_ink_blob_aspect_ratio(aspect: number): boolean; /** * Set ink blob type. * * Set the ink blob type for ink tool. * @param type Ink blob type. * @returns TRUE on success. */ function context_set_ink_blob_type(type: InkBlobType | null): boolean; /** * Set ink blob size in pixels. * * Set the ink blob size in pixels for ink tool. * @param size ink blob size in pixels. * @returns TRUE on success. */ function context_set_ink_size(size: number): boolean; /** * Set ink size sensitivity. * * Set the ink size sensitivity for ink tool. * @param size ink size sensitivity. * @returns TRUE on success. */ function context_set_ink_size_sensitivity(size: number): boolean; /** * Set ink speed sensitivity. * * Set the ink speed sensitivity for ink tool. * @param speed ink speed sensitivity. * @returns TRUE on success. */ function context_set_ink_speed_sensitivity(speed: number): boolean; /** * Set ink tilt sensitivity. * * Set the ink tilt sensitivity for ink tool. * @param tilt ink tilt sensitivity. * @returns TRUE on success. */ function context_set_ink_tilt_sensitivity(tilt: number): boolean; /** * Set the interpolation type. * * Modifies the interpolation setting. * * This setting affects affects the following procedures: * gimp_item_transform_flip(), gimp_item_transform_perspective(), * gimp_item_transform_rotate(), gimp_item_transform_scale(), * gimp_item_transform_shear(), gimp_item_transform_2d(), * gimp_item_transform_matrix(), gimp_image_scale(), * gimp_layer_scale(). * @param interpolation The interpolation type. * @returns TRUE on success. */ function context_set_interpolation(interpolation: InterpolationType | null): boolean; /** * Set the line cap style setting. * * Modifies the line cap style setting for stroking lines. * * This setting affects the following procedures: * gimp_drawable_edit_stroke_selection(), * gimp_drawable_edit_stroke_item(). * @param cap_style The line cap style setting. * @returns TRUE on success. */ function context_set_line_cap_style(cap_style: CapStyle | null): boolean; /** * Set the line dash offset setting. * * Modifies the line dash offset setting for stroking lines. * * This setting affects the following procedures: * gimp_drawable_edit_stroke_selection(), * gimp_drawable_edit_stroke_item(). * @param dash_offset The line dash offset setting. * @returns TRUE on success. */ function context_set_line_dash_offset(dash_offset: number): boolean; /** * Set the line dash pattern setting. * * Modifies the line dash pattern setting for stroking lines. * * The unit of the dash pattern segments is the actual line width used * for the stroke operation, in other words a segment length of 1.0 * results in a square segment shape (or gap shape). * * This setting affects the following procedures: * gimp_drawable_edit_stroke_selection(), * gimp_drawable_edit_stroke_item(). * @param dashes The line dash pattern setting. * @returns TRUE on success. */ function context_set_line_dash_pattern(dashes: number[]): boolean; /** * Set the line join style setting. * * Modifies the line join style setting for stroking lines. * This setting affects the following procedures: * gimp_drawable_edit_stroke_selection(), * gimp_drawable_edit_stroke_item(). * @param join_style The line join style setting. * @returns TRUE on success. */ function context_set_line_join_style(join_style: JoinStyle | null): boolean; /** * Set the line miter limit setting. * * Modifies the line miter limit setting for stroking lines. * A mitered join is converted to a bevelled join if the miter would * extend to a distance of more than (miter-limit * line-width) from * the actual join point. * * This setting affects the following procedures: * gimp_drawable_edit_stroke_selection(), * gimp_drawable_edit_stroke_item(). * @param miter_limit The line miter limit setting. * @returns TRUE on success. */ function context_set_line_miter_limit(miter_limit: number): boolean; /** * Set the line width setting. * * Modifies the line width setting for stroking lines. * * This setting affects the following procedures: * gimp_drawable_edit_stroke_selection(), * gimp_drawable_edit_stroke_item(). * @param line_width The line width setting. * @returns TRUE on success. */ function context_set_line_width(line_width: number): boolean; /** * Set the line width unit setting. * * Modifies the line width unit setting for stroking lines. * * This setting affects the following procedures: * gimp_drawable_edit_stroke_selection(), * gimp_drawable_edit_stroke_item(). * @param line_width_unit The line width setting unit. * @returns TRUE on success. */ function context_set_line_width_unit(line_width_unit: Unit): boolean; /** * Set a MyPaint brush as the active MyPaint brush. * * Sets the active MyPaint brush to the named MyPaint brush. The brush * will be used in all subsequent MyPaint paint operations. The name * should be a name of an installed MyPaint brush. Returns an error if * no matching MyPaint brush is found. * @param name A name of a MyPaint brush. * @returns TRUE on success. */ function context_set_mypaint_brush(name: string): boolean; /** * Set the opacity. * * Modifies the opacity setting. The value should be a floating point * number between 0 and 100. * @param opacity The opacity. * @returns TRUE on success. */ function context_set_opacity(opacity: number): boolean; /** * Set the active paint method. * * Sets the active paint method to the named paint method. The paint * method will be used in all subsequent paint operations. The name * should be a name of an available paint method. Returns an error if * no matching paint method is found. * @param name The name of the paint method. * @returns TRUE on success. */ function context_set_paint_method(name: string): boolean; /** * Set the paint mode. * * Modifies the paint_mode setting. * @param paint_mode The paint mode. * @returns TRUE on success. */ function context_set_paint_mode(paint_mode: LayerMode | null): boolean; /** * Set the active palette. * * Sets the active palette in the current context. The palette will be * used in subsequent paint operations. Returns an error when the * palette data was uninstalled since the palette object was created. * @param palette The palette. * @returns TRUE on success. */ function context_set_palette(palette: Palette): boolean; /** * Set the active pattern. * * Sets the active pattern in the current context. The pattern will be * used in subsequent fill operations using a pattern. Returns an error * when the pattern data was uninstalled since the pattern object was * created. * @param pattern The pattern. * @returns TRUE on success. */ function context_set_pattern(pattern: Pattern): boolean; /** * Set the sample criterion setting. * * Modifies the sample criterion setting. If an operation depends on * the colors of the pixels present in a drawable, like when doing a * seed fill, this setting controls how color similarity is determined. * SELECT_CRITERION_COMPOSITE is the default value. * * This setting affects the following procedures: * gimp_image_select_color(), gimp_image_select_contiguous_color(), * gimp_drawable_edit_bucket_fill(). * @param sample_criterion The sample criterion setting. * @returns TRUE on success. */ function context_set_sample_criterion(sample_criterion: SelectCriterion | null): boolean; /** * Set the sample merged setting. * * Modifies the sample merged setting. If an operation depends on the * colors of the pixels present in a drawable, like when doing a seed * fill, this setting controls whether the pixel data from the given * drawable is used ('sample-merged' is FALSE), or the pixel data from * the composite image ('sample-merged' is TRUE. This is equivalent to * sampling for colors after merging all visible layers). * * This setting affects the following procedures: * gimp_image_select_color(), gimp_image_select_contiguous_color(), * gimp_drawable_edit_bucket_fill(). * @param sample_merged The sample merged setting. * @returns TRUE on success. */ function context_set_sample_merged(sample_merged: boolean): boolean; /** * Set the sample threshold setting. * * Modifies the sample threshold setting. If an operation depends on * the colors of the pixels present in a drawable, like when doing a * seed fill, this setting controls what is \"sufficiently close\" to * be considered a similar color. If the sample threshold has not been * set explicitly, the default threshold set in gimprc will be used. * * This setting affects the following procedures: * gimp_image_select_color(), gimp_image_select_contiguous_color(), * gimp_drawable_edit_bucket_fill(). * @param sample_threshold The sample threshold setting. * @returns TRUE on success. */ function context_set_sample_threshold(sample_threshold: number): boolean; /** * Set the sample threshold setting as an integer value. * * Modifies the sample threshold setting as an integer value. See * gimp_context_set_sample_threshold(). * @param sample_threshold The sample threshold setting. * @returns TRUE on success. */ function context_set_sample_threshold_int(sample_threshold: number): boolean; /** * Set the sample transparent setting. * * Modifies the sample transparent setting. If an operation depends on * the colors of the pixels present in a drawable, like when doing a * seed fill, this setting controls whether transparency is considered * to be a unique selectable color. When this setting is TRUE, * transparent areas can be selected or filled. * * This setting affects the following procedures: * gimp_image_select_color(), gimp_image_select_contiguous_color(), * gimp_drawable_edit_bucket_fill(). * @param sample_transparent The sample transparent setting. * @returns TRUE on success. */ function context_set_sample_transparent(sample_transparent: boolean): boolean; /** * Set the active stroke method. * * Sets the active stroke method. The method will be used in all * subsequent stroke operations. * @param stroke_method The new stroke method. * @returns TRUE on success. */ function context_set_stroke_method(stroke_method: StrokeMethod | null): boolean; /** * Set the transform direction. * * Modifies the transform direction setting. * * This setting affects affects the following procedures: * gimp_item_transform_flip(), gimp_item_transform_perspective(), * gimp_item_transform_rotate(), gimp_item_transform_scale(), * gimp_item_transform_shear(), gimp_item_transform_2d(), * gimp_item_transform_matrix(). * @param transform_direction The transform direction. * @returns TRUE on success. */ function context_set_transform_direction(transform_direction: TransformDirection | null): boolean; /** * Set the transform resize type. * * Modifies the transform resize setting. When transforming pixels, if * the result of a transform operation has a different size than the * original area, this setting determines how the resulting area is * sized. * * This setting affects affects the following procedures: * gimp_item_transform_flip(), gimp_item_transform_flip_simple(), * gimp_item_transform_perspective(), gimp_item_transform_rotate(), * gimp_item_transform_rotate_simple(), gimp_item_transform_scale(), * gimp_item_transform_shear(), gimp_item_transform_2d(), * gimp_item_transform_matrix(). * @param transform_resize The transform resize type. * @returns TRUE on success. */ function context_set_transform_resize(transform_resize: TransformResize | null): boolean; /** * Swap the current GIMP foreground and background colors. * * Swaps the current GIMP foreground and background colors, so that the * new foreground color becomes the old background color and vice * versa. * @returns TRUE on success. */ function context_swap_colors(): boolean; /** * Convolve (Blur, Sharpen) using the current brush. * * This tool convolves the specified drawable with either a sharpening * or blurring kernel. The pressure parameter controls the magnitude of * the operation. Like the paintbrush, this tool linearly interpolates * between the specified stroke coordinates. * @param drawable The affected drawable. * @param pressure The pressure. * @param convolve_type Convolve type. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function convolve( drawable: Drawable, pressure: number, convolve_type: ConvolveType | null, strokes: number[], ): boolean; /** * Convolve (Blur, Sharpen) using the current brush. * * This tool convolves the specified drawable with either a sharpening * or blurring kernel. This function performs exactly the same as the * gimp_convolve() function except that the tools arguments are * obtained from the convolve option dialog. It this dialog has not * been activated then the dialogs default values will be used. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function convolve_default(drawable: Drawable, strokes: number[]): boolean; function core_object_array_get_length(array: GObject.Object): number; function core_object_array_get_type(): GObject.GType; /** * Query for CPU acceleration support. * @returns #GimpCpuAccelFlags as supported by the CPU. */ function cpu_accel_get_support(): CpuAccelFlags; /** * Returns the default top directory for GIMP data. If the environment * variable GIMP3_DATADIR exists, that is used. It should be an * absolute pathname. Otherwise, on Unix the compile-time defined * directory is used. On Windows, the installation directory as * deduced from the executable's full filename is used. * * Note that the actual directories used for GIMP data files can be * overridden by the user in the preferences dialog. * * In config files such as gimprc, the string ${gimp_data_dir} expands * to this directory. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string is in the encoding used for filenames by * GLib, which isn't necessarily UTF-8. (On Windows it always is * UTF-8.) * @returns The top directory for GIMP data. */ function data_directory(): string; /** * Finishes measuring elapsed time. * * This procedure stops the timer started by a previous * gimp_debug_timer_start() call, and prints and returns the elapsed * time. * If there was already an active timer at the time of corresponding * call to gimp_debug_timer_start(), a dummy value is returned. * * This is a debug utility procedure. It is subject to change at any * point, and should not be used in production. * @returns The elapsed time, in seconds. */ function debug_timer_end(): number; /** * Starts measuring elapsed time. * * This procedure starts a timer, measuring the elapsed time since the * call. Each call to this procedure should be matched by a call to * gimp_debug_timer_end(), which returns the elapsed time. * If there is already an active timer, it is not affected by the call, * however, a matching gimp_debug_timer_end() call is still required. * * This is a debug utility procedure. It is subject to change at any * point, and should not be used in production. * @returns TRUE on success. */ function debug_timer_start(): boolean; /** * Returns the default display ID. This corresponds to the display the * running procedure's menu entry was invoked from. * * This is a constant value given at plug-in configuration time. * @returns the default display ID The object belongs to libgimp and you should not free it. */ function default_display(): Display; /** * Removes a global parasite. * * This procedure detaches a global parasite from. It has no return * values. * @param name The name of the parasite to detach. * @returns TRUE on success. */ function detach_parasite(name: string): boolean; /** * Returns the user-specific GIMP settings directory. If the * environment variable GIMP3_DIRECTORY exists, it is used. If it is * an absolute path, it is used as is. If it is a relative path, it * is taken to be a subdirectory of the home directory. If it is a * relative path, and no home directory can be determined, it is taken * to be a subdirectory of gimp_data_directory(). * * The usual case is that no GIMP3_DIRECTORY environment variable * exists, and then we use the GIMPDIR subdirectory of the local * configuration directory: * * - UNIX: $XDG_CONFIG_HOME (defaults to $HOME/.config/) * * - Windows: CSIDL_APPDATA * * - OSX (UNIX exception): the Application Support Directory. * * If neither the configuration nor home directory exist, * g_get_user_config_dir() will return {tmp}/{user_name}/.config/ where * the temporary directory {tmp} and the {user_name} are determined * according to platform rules. * * In any case, we always return some non-empty string, whether it * corresponds to an existing directory or not. * * In config files such as gimprc, the string ${gimp_dir} expands to * this directory. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string is in the encoding used for filenames by * GLib, which isn't necessarily UTF-8 (on Windows it is always * UTF-8.) * @returns The user-specific GIMP settings directory. */ function directory(): string; /** * Flush all internal changes to the user interface * * This procedure takes no arguments and returns nothing except a * success status. Its purpose is to flush all pending updates of image * manipulations to the user interface. It should be called whenever * appropriate. * @returns TRUE on success. */ function displays_flush(): boolean; /** * Reconnect displays from one image to another image. * * This procedure connects all displays of the old_image to the * new_image. If the old_image has no display or new_image already has * a display the reconnect is not performed and the procedure returns * without success. You should rarely need to use this function. * @param old_image The old image (must have at least one display). * @param new_image The new image (must not have a display). * @returns TRUE on success. */ function displays_reconnect(old_image: Image, new_image: Image): boolean; /** * Dodgeburn image with varying exposure. * * Dodgeburn. More details here later. * @param drawable The affected drawable. * @param exposure The exposure of the strokes. * @param dodgeburn_type The type either dodge or burn. * @param dodgeburn_mode The mode. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function dodgeburn( drawable: Drawable, exposure: number, dodgeburn_type: DodgeBurnType | null, dodgeburn_mode: TransferMode | null, strokes: number[], ): boolean; /** * Dodgeburn image with varying exposure. This is the same as the * gimp_dodgeburn() function except that the exposure, type and mode * are taken from the tools option dialog. If the dialog has not been * activated then the defaults as used by the dialog will be used. * * Dodgeburn. More details here later. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function dodgeburn_default(drawable: Drawable, strokes: number[]): boolean; function double_array_get_values(array: Array): number[]; function double_array_set_values(array: Array, values: number[], static_data: boolean): void; /** * Close the drawable selection dialog. * * Closes an open drawable selection dialog. * @param callback The name of the callback registered for this pop-up. * @returns TRUE on success. */ function drawables_close_popup(callback: string): boolean; /** * Invokes the drawable selection dialog. * * Opens a dialog letting a user choose an drawable. * @param callback The callback PDB proc to call when user chooses an drawable. * @param popup_title Title of the drawable selection dialog. * @param drawable_type The name of the GIMP_TYPE_DRAWABLE subtype. * @param initial_drawable The drawable to set as the initial choice. * @param parent_window An optional parent window handle for the popup to be set transient to. * @returns TRUE on success. */ function drawables_popup( callback: string, popup_title: string, drawable_type: string, initial_drawable?: Drawable | null, parent_window?: GLib.Bytes | null, ): boolean; /** * Sets the selected drawable in a drawable selection dialog. * * Sets the selected drawable in a drawable selection dialog. * @param callback The name of the callback registered for this pop-up. * @param drawable The drawable to set as selected. * @returns TRUE on success. */ function drawables_set_popup(callback: string, drawable: Drawable): boolean; /** * Retrieve the list of loaded paint dynamics. * * This procedure returns a list of the paint dynamics that are * currently available. * @param filter An optional regular expression used to filter the list. * @returns The list of paint dynamics names. The returned value must be freed with g_strfreev(). */ function dynamics_get_name_list(filter?: string | null): string[]; /** * Refresh current paint dynamics. This function always succeeds. * * This procedure retrieves all paint dynamics currently in the user's * paint dynamics path and updates the paint dynamics dialogs * accordingly. * @returns TRUE on success. */ function dynamics_refresh(): boolean; /** * Copy from the specified drawables. * * If there is a selection in the image, then the area specified by the * selection is copied from the specified drawables and placed in an * internal GIMP edit buffer. It can subsequently be retrieved using * the gimp_edit_paste() command. If there is no selection, then the * specified drawables' contents will be stored in the internal GIMP * edit buffer. * This procedure will return %FALSE if the selected area lies * completely outside the bounds of the current drawables and there is * nothing to copy from. * All the drawables must belong to the same image. * @param drawables Drawables to copy from. * @returns TRUE if the cut was successful, FALSE if there was nothing to copy from. */ function edit_copy(drawables: Drawable[]): boolean; /** * Copy from the projection. * * If there is a selection in the image, then the area specified by the * selection is copied from the projection and placed in an internal * GIMP edit buffer. It can subsequently be retrieved using the * gimp_edit_paste() command. If there is no selection, then the * projection's contents will be stored in the internal GIMP edit * buffer. * @param image The image to copy from. * @returns TRUE if the copy was successful. */ function edit_copy_visible(image: Image): boolean; /** * Cut from the specified drawables. * * If there is a selection in the image, then the area specified by the * selection is cut from the specified drawables and placed in an * internal GIMP edit buffer. It can subsequently be retrieved using * the gimp_edit_paste() command. If there is no selection and only one * specified drawable, then the specified drawable will be removed and * its contents stored in the internal GIMP edit buffer. * This procedure will return %FALSE if the selected area lies * completely outside the bounds of the current drawables and there is * nothing to cut from. * @param drawables The drawables to cut from. * @returns TRUE if the cut was successful, FALSE if there was nothing to copy from. */ function edit_cut(drawables: Drawable[]): boolean; /** * Copy into a named buffer. * * This procedure works like gimp_edit_copy(), but additionally stores * the copied buffer into a named buffer that will stay available for * later pasting, regardless of any intermediate copy or cut * operations. * @param drawables The drawables to copy from. * @param buffer_name The name of the buffer to create. * @returns The real name given to the buffer, or NULL if the copy failed. The returned value must be freed with g_free(). */ function edit_named_copy(drawables: Drawable[], buffer_name: string): string; /** * Copy from the projection into a named buffer. * * This procedure works like gimp_edit_copy_visible(), but additionally * stores the copied buffer into a named buffer that will stay * available for later pasting, regardless of any intermediate copy or * cut operations. * @param image The image to copy from. * @param buffer_name The name of the buffer to create. * @returns The real name given to the buffer, or NULL if the copy failed. The returned value must be freed with g_free(). */ function edit_named_copy_visible(image: Image, buffer_name: string): string; /** * Cut into a named buffer. * * This procedure works like gimp_edit_cut(), but additionally stores * the cut buffer into a named buffer that will stay available for * later pasting, regardless of any intermediate copy or cut * operations. * @param drawables The drawables to cut from. * @param buffer_name The name of the buffer to create. * @returns The real name given to the buffer, or NULL if the cut failed. The returned value must be freed with g_free(). */ function edit_named_cut(drawables: Drawable[], buffer_name: string): string; /** * Paste named buffer to the specified drawable. * * This procedure works like gimp_edit_paste() but pastes a named * buffer instead of the global buffer. * @param drawable The drawable to paste to. * @param buffer_name The name of the buffer to paste. * @param paste_into Clear selection, or paste behind it? * @returns The new floating selection. */ function edit_named_paste(drawable: Drawable, buffer_name: string, paste_into: boolean): Layer; /** * Paste named buffer to a new image. * * This procedure works like gimp_edit_paste_as_new_image() but pastes * a named buffer instead of the global buffer. * @param buffer_name The name of the buffer to paste. * @returns The new image. */ function edit_named_paste_as_new_image(buffer_name: string): Image; /** * Paste buffer to the specified drawable. * * This procedure pastes a copy of the internal GIMP edit buffer to the * specified drawable. The GIMP edit buffer will be empty unless a call * was previously made to either [func`Gimp`.edit_cut] or * [func`Gimp`.edit_copy]. The \"paste_into\" option specifies whether * to clear the current image selection, or to paste the buffer * \"behind\" the selection. This allows the selection to act as a mask * for the pasted buffer. Anywhere that the selection mask is non-zero, * the pasted buffer will show through. The pasted data may be a * floating selection when relevant, layers otherwise. If the image has * a floating selection at the time of pasting, the old floating * selection will be anchored to its drawable before the new floating * selection is added. * This procedure returns the new drawables (floating or not). If the * result is a floating selection, it will already be attached to the * specified drawable, and a subsequent call to * [func`Gimp`.floating_sel_attach] is not needed. * @param drawable The drawable to paste to. * @param paste_into Clear selection, or paste behind it? * @returns The list of pasted layers. The returned value must be freed with g_free(). */ function edit_paste(drawable: Drawable, paste_into: boolean): Drawable[]; /** * Paste buffer to a new image. * * This procedure pastes a copy of the internal GIMP edit buffer to a * new image. The GIMP edit buffer will be empty unless a call was * previously made to either gimp_edit_cut() or gimp_edit_copy(). This * procedure returns the new image or -1 if the edit buffer was empty. * @returns The new image. */ function edit_paste_as_new_image(): Image; /** * Retrieves #GimpEnumDesc associated with the given value, or %NULL. * @param enum_class a #GEnumClass * @param value a value from @enum_class * @returns the value's #GimpEnumDesc. */ function enum_get_desc(enum_class: GObject.EnumClass, value: number): EnumDesc | null; /** * Checks if `value` is valid for the enum registered as `enum_type`. * If the value exists in that enum, its name, nick and its translated * description and help are returned (if `value_name,` `value_nick,` * `value_desc` and `value_help` are not %NULL). * @param enum_type the #GType of a registered enum * @param value an integer value * @returns %TRUE if @value is valid for the @enum_type, %FALSE otherwise */ function enum_get_value(enum_type: GObject.GType, value: number): [boolean, string, string, string, string]; /** * Retrieves the array of human readable and translatable descriptions * and help texts for enum values. * @param enum_type a #GType * @returns a %NULL terminated constant array of #GimpEnumDesc */ function enum_get_value_descriptions(enum_type: GObject.GType): EnumDesc; /** * Sets the array of human readable and translatable descriptions * and help texts for enum values. * @param enum_type a #GType * @param descriptions a %NULL terminated constant static array of #GimpEnumDesc */ function enum_set_value_descriptions(enum_type: GObject.GType, descriptions: EnumDesc): void; /** * Retrieves the translated abbreviation for a given `enum_value`. * @param enum_class a #GEnumClass * @param enum_value a #GEnumValue from @enum_class * @returns the translated abbreviation of the enum value */ function enum_value_get_abbrev(enum_class: GObject.EnumClass, enum_value: GObject.EnumValue): string; /** * Retrieves the translated description for a given `enum_value`. * @param enum_class a #GEnumClass * @param enum_value a #GEnumValue from @enum_class * @returns the translated description of the enum value */ function enum_value_get_desc(enum_class: GObject.EnumClass, enum_value: GObject.EnumValue): string; /** * Retrieves the translated help for a given `enum_value`. * @param enum_class a #GEnumClass * @param enum_value a #GEnumValue from @enum_class * @returns the translated help of the enum value */ function enum_value_get_help(enum_class: GObject.EnumClass, enum_value: GObject.EnumValue): string; /** * This function gives access to the list of enums registered by libgimp. * The returned array is static and must not be modified. * @returns an array with type names */ function enums_get_type_names(): string[]; /** * This function makes sure all the enum types are registered * with the #GType system. This is intended for use by language * bindings that need the symbols early, before gimp_main is run. * It's not necessary for plug-ins to call this directly, because * the normal plug-in initialization code will handle it implicitly. */ function enums_init(): void; /** * Erase using the current brush. * * This tool erases using the current brush mask. If the specified * drawable contains an alpha channel, then the erased pixels will * become transparent. Otherwise, the eraser tool replaces the contents * of the drawable with the background color. Like paintbrush, this * tool linearly interpolates between the specified stroke coordinates. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @param hardness How to apply the brush. * @param method The paint method to use. * @returns TRUE on success. */ function eraser( drawable: Drawable, strokes: number[], hardness: BrushApplicationMode | null, method: PaintApplicationMode | null, ): boolean; /** * Erase using the current brush. * * This tool erases using the current brush mask. This function * performs exactly the same as the gimp_eraser() function except that * the tools arguments are obtained from the eraser option dialog. It * this dialog has not been activated then the dialogs default values * will be used. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function eraser_default(drawable: Drawable, strokes: number[]): boolean; /** * This function returns a copy of `str` with all underline converted * to two adjacent underlines. This comes in handy when needing to display * strings with underlines (like filenames) in a place that would convert * them to mnemonics. * @param str Underline infested string (or %NULL) * @returns A (possibly escaped) copy of @str which should be freed using g_free() when it is not needed any longer. */ function escape_uline(str?: string | null): string; /** * Returns whether file plug-ins should default to exporting the * image's color profile. * @returns TRUE if preferences are set to export the color profile. */ function export_color_profile(): boolean; /** * Returns whether file plug-ins should default to exporting the * image's comment. * @returns TRUE if preferences are set to export the comment. */ function export_comment(): boolean; /** * Returns whether file plug-ins should default to exporting Exif * metadata, according preferences (original settings is %FALSE since * metadata can contain sensitive information). * @returns TRUE if preferences are set to export Exif. */ function export_exif(): boolean; /** * Returns whether file plug-ins should default to exporting IPTC * metadata, according preferences (original settings is %FALSE since * metadata can contain sensitive information). * @returns TRUE if preferences are set to export IPTC. */ function export_iptc(): boolean; /** * Returns whether file plug-ins should default to exporting the * image's comment. * @returns TRUE if preferences are set to export the thumbnail. */ function export_thumbnail(): boolean; /** * Returns whether file plug-ins should default to exporting XMP * metadata, according preferences (original settings is %FALSE since * metadata can contain sensitive information). * @returns TRUE if preferences are set to export XMP. */ function export_xmp(): boolean; /** * Creates a thumbnail of `image` for the given `file` * * This procedure creates a thumbnail for the given `file` and stores it * according to relevant standards. * In particular, it will follow the [Free Desktop Thumbnail Managing * Standard](https://specifications.freedesktop.org/thumbnail-spec/late * st/thumbsave.html) when relevant. * * The thumbnail is stored so that it belongs to the given `file`. This * means you have to save `image` under this name first. As a fallback, * the call will work if `image` was exported or imported as `file`. In * any other case, this procedure will fail. * @param image The image. * @param file The file the thumbnail belongs to. * @returns TRUE on success. */ function file_create_thumbnail(image: Image, file: Gio.File): boolean; /** * Unexpands `file'`s path using gimp_config_path_unexpand() and * returns the unexpanded path. * * The inverse operation of gimp_file_new_for_config_path(). * @param file a #GFile * @returns a newly allocated NUL-terminated UTF-8 string, or %NULL if unexpanding failed. */ function file_get_config_path(file: Gio.File): string; /** * This function works like gimp_filename_to_utf8() and returns * a UTF-8 encoded string that does not need to be freed. * * It converts a #GFile's path or uri to UTF-8 temporarily. The * return value is a pointer to a string that is guaranteed to be * valid only during the current iteration of the main loop or until * the next call to gimp_file_get_utf8_name(). * * The only purpose of this function is to provide an easy way to pass * a #GFile's name to a function that expects an UTF-8 encoded string. * * See g_file_get_parse_name(). * @param file a #GFile * @returns A temporarily valid UTF-8 representation of @file's name. This string must not be changed or freed. */ function file_get_utf8_name(file: Gio.File): string; /** * This function checks if `file'`s URI ends with `extension`. It behaves * like g_str_has_suffix() on g_file_get_uri(), except that the string * comparison is done case-insensitively using g_ascii_strcasecmp(). * @param file a #GFile * @param extension an ASCII extension * @returns %TRUE if @file's URI ends with @extension, %FALSE otherwise. */ function file_has_extension(file: Gio.File, extension: string): boolean; /** * Loads an image file by invoking the right load handler. * * This procedure invokes the correct file load handler using magic if * possible, and falling back on the file's extension and/or prefix if * not. * @param run_mode The run mode. * @param file The file to load. * @returns The output image. */ function file_load(run_mode: RunMode | null, file: Gio.File): Image; /** * Loads an image file as a layer for an existing image. * * This procedure behaves like the file-load procedure but opens the * specified image as a layer for an existing image. The returned layer * needs to be added to the existing image with * gimp_image_insert_layer(). * @param run_mode The run mode. * @param image Destination image. * @param file The file to load. * @returns The layer created when loading the image file. */ function file_load_layer(run_mode: RunMode | null, image: Image, file: Gio.File): Layer; /** * Loads an image file as layers for an existing image. * * This procedure behaves like the file-load procedure but opens the * specified image as layers for an existing image. The returned layers * needs to be added to the existing image with * gimp_image_insert_layer(). * @param run_mode The run mode. * @param image Destination image. * @param file The file to load. * @returns The list of loaded layers. The returned value must be freed with g_free(). */ function file_load_layers(run_mode: RunMode | null, image: Image, file: Gio.File): Layer[]; /** * Expands `path` using gimp_config_path_expand() and returns a #GFile * for the expanded path. * * To reverse the expansion, use gimp_file_get_config_path(). * @param path a NUL-terminated string in UTF-8 encoding * @returns a newly allocated #GFile, or %NULL if the expansion failed. */ function file_new_for_config_path(path: string): Gio.File | null; /** * Saves to XCF or export `image` to any supported format by extension. * * This procedure invokes the correct file save/export handler * according to `file'`s extension and/or prefix. * * The `options` argument is currently unused and should be set to %NULL * right now. * @param run_mode The run mode. * @param image Input image. * @param file The file to save or export the image in. * @param options Export option settings. * @returns TRUE on success. */ function file_save( run_mode: RunMode | null, image: Image, file: Gio.File, options?: ExportOptions | null, ): boolean; /** * Shows `file` in the system file manager. * @param file a #GFile * @returns %TRUE on success, %FALSE otherwise. On %FALSE, @error is set. */ function file_show_in_file_manager(file: Gio.File): boolean; /** * Convert a filename in the filesystem's encoding to UTF-8 * temporarily. The return value is a pointer to a string that is * guaranteed to be valid only during the current iteration of the * main loop or until the next call to gimp_filename_to_utf8(). * * The only purpose of this function is to provide an easy way to pass * a filename in the filesystem encoding to a function that expects an * UTF-8 encoded filename. * @param filename The filename to be converted to UTF-8. * @returns A temporarily valid UTF-8 representation of @filename. This string must not be changed or freed. */ function filename_to_utf8(filename: string): string; /** * Retrieves the first #GimpFlagsDesc that matches the given value, or %NULL. * @param flags_class a #GFlagsClass * @param value a value from @flags_class * @returns the value's #GimpFlagsDesc. */ function flags_get_first_desc(flags_class: GObject.FlagsClass, value: number): FlagsDesc | null; /** * Checks if `value` is valid for the flags registered as `flags_type`. * If the value exists in that flags, its name, nick and its * translated description and help are returned (if `value_name,` * `value_nick,` `value_desc` and `value_help` are not %NULL). * @param flags_type the #GType of registered flags * @param value an integer value * @returns %TRUE if @value is valid for the @flags_type, %FALSE otherwise */ function flags_get_first_value( flags_type: GObject.GType, value: number, ): [boolean, string, string, string, string]; /** * Retrieves the array of human readable and translatable descriptions * and help texts for flags values. * @param flags_type a #GType * @returns a %NULL terminated constant array of #GimpFlagsDesc */ function flags_get_value_descriptions(flags_type: GObject.GType): FlagsDesc; /** * Sets the array of human readable and translatable descriptions * and help texts for flags values. * @param flags_type a #GType * @param descriptions a %NULL terminated constant static array of #GimpFlagsDesc */ function flags_set_value_descriptions(flags_type: GObject.GType, descriptions: FlagsDesc): void; /** * Retrieves the translated abbreviation for a given `flags_value`. * @param flags_class a #GFlagsClass * @param flags_value a #GFlagsValue from @flags_class * @returns the translated abbreviation of the flags value */ function flags_value_get_abbrev(flags_class: GObject.FlagsClass, flags_value: GObject.FlagsValue): string; /** * Retrieves the translated description for a given `flags_value`. * @param flags_class a #GFlagsClass * @param flags_value a #GFlagsValue from @flags_class * @returns the translated description of the flags value */ function flags_value_get_desc(flags_class: GObject.FlagsClass, flags_value: GObject.FlagsValue): string; /** * Retrieves the translated help for a given `flags_value`. * @param flags_class a #GFlagsClass * @param flags_value a #GFlagsValue from @flags_class * @returns the translated help of the flags value */ function flags_value_get_help(flags_class: GObject.FlagsClass, flags_value: GObject.FlagsValue): string; /** * Anchor the specified floating selection to its associated drawable. * * This procedure anchors the floating selection to its associated * drawable. This is similar to merging with a merge type of * ClipToBottomLayer. The floating selection layer is no longer valid * after this operation. * @param floating_sel The floating selection. * @returns TRUE on success. */ function floating_sel_anchor(floating_sel: Layer): boolean; /** * Attach the specified layer as floating to the specified drawable. * * This procedure attaches the layer as floating selection to the * drawable. * @param layer The layer (is attached as floating selection). * @param drawable The drawable (where to attach the floating selection). * @returns TRUE on success. */ function floating_sel_attach(layer: Layer, drawable: Drawable): boolean; /** * Remove the specified floating selection from its associated * drawable. * * This procedure removes the floating selection completely, without * any side effects. The associated drawable is then set to active. * @param floating_sel The floating selection. * @returns TRUE on success. */ function floating_sel_remove(floating_sel: Layer): boolean; /** * Transforms the specified floating selection into a layer. * * This procedure transforms the specified floating selection into a * layer with the same offsets and extents. The composited image will * look precisely the same, but the floating selection layer will no * longer be clipped to the extents of the drawable it was attached to. * The floating selection will become the active layer. This procedure * will not work if the floating selection has a different base type * from the underlying image. This might be the case if the floating * selection is above an auxiliary channel or a layer mask. * @param floating_sel The floating selection. * @returns TRUE on success. */ function floating_sel_to_layer(floating_sel: Layer): boolean; /** * Close the font selection dialog. * * Closes an open font selection dialog. * @param font_callback The name of the callback registered in the PDB for this dialog. * @returns TRUE on success. */ function fonts_close_popup(font_callback: string): boolean; /** * Retrieve the list of loaded fonts. * * This procedure returns a list of the fonts that are currently * available. * Each font returned can be used as input to * [func`Gimp`.context_set_font]. * @param filter An optional regular expression used to filter the list. * @returns The list of fonts. The returned value must be freed with g_free(). */ function fonts_get_list(filter?: string | null): Font[]; /** * Invokes the Gimp font selection dialog. * * Opens a dialog letting a user choose a font. * @param font_callback The callback PDB proc to call when user chooses a font. * @param popup_title Title of the font selection dialog. * @param initial_font The name of the initial font choice. * @param parent_window An optional parent window handle for the popup to be set transient to. * @returns TRUE on success. */ function fonts_popup( font_callback: string, popup_title: string, initial_font?: Font | null, parent_window?: GLib.Bytes | null, ): boolean; /** * Refresh current fonts. This function always succeeds. * * This procedure retrieves all fonts currently in the user's font path * and updates the font dialogs accordingly. Depending on the amount of * fonts on the system, this can take considerable time. * @returns TRUE on success. */ function fonts_refresh(): boolean; /** * Sets the current font in a font selection dialog. * * Sets the current font in a font selection dialog. * @param font_callback The name of the callback registered in the PDB for the dialog. * @param font The font to set as selected. * @returns TRUE on success. */ function fonts_set_popup(font_callback: string, font: Font): boolean; /** * Retrieve a copy of the current color management configuration. * @returns A copy of the core's #GimpColorConfig. You should unref this copy if you don't need it any longer. */ function get_color_configuration(): ColorConfig; /** * Get the default image comment as specified in the Preferences. * * Returns a copy of the default image comment. * @returns Default image comment. The returned value must be freed with g_free(). */ function get_default_comment(): string; /** * Get the default unit (taken from the user's locale). * * Returns the default unit. * @returns Default unit. */ function get_default_unit(): Unit; /** * Returns the list of images currently open. * * This procedure returns the list of images currently open in GIMP. * @returns The list of images currently open. The returned value must be freed with g_free(). */ function get_images(): Image[]; /** * Get the list of modules which should not be loaded. * * Returns a copy of the list of modules which should not be loaded. * @returns The list of modules. The returned value must be freed with g_free(). */ function get_module_load_inhibit(): string; /** * Get the monitor resolution as specified in the Preferences. * * Returns the resolution of the monitor in pixels/inch. This value is * taken from the Preferences (or the windowing system if this is set * in the Preferences) and there's no guarantee for the value to be * reasonable. * @returns TRUE on success. */ function get_monitor_resolution(): [boolean, number, number]; /** * Returns the number of threads set explicitly by the user in the * preferences. This information can be used by plug-ins wishing to * follow user settings for multi-threaded implementations. * @returns the preferred number of threads to use. */ function get_num_processors(): number; /** * Look up a global parasite. * * Finds and returns the global parasite that was previously attached. * @param name The name of the parasite to find. * @returns The found parasite. */ function get_parasite(name: string): Parasite; /** * List all parasites. * * Returns a list of all currently attached global parasites. * @returns The names of currently attached parasites. The returned value must be freed with g_strfreev(). */ function get_parasite_list(): string[]; /** * This function returns the plug-in's #GimpPDB instance, which is a * singleton that can exist exactly once per running plug-in. * @returns The plug-in's #GimpPDB singleton. */ function get_pdb(): PDB | null; /** * This function returns the plug-in's #GimpPlugIn instance, which is * a a singleton that can exist exactly once per running plug-in. * @returns The plug-in's #GimpPlugIn singleton. */ function get_plug_in(): PlugIn | null; /** * Returns the plug-in's executable name. * @returns the executable name */ function get_progname(): string; /** * Returns the PID of the host GIMP process. * * This procedure returns the process ID of the currently running GIMP. * @returns The PID. */ function getpid(): number; /** * Queries the gimprc file parser for information on a specified token. * * This procedure is used to locate additional information contained in * the gimprc file considered extraneous to the operation of GIMP. * Plug-ins that need configuration information can expect it will be * stored in the user gimprc file and can use this procedure to * retrieve it. This query procedure will return the value associated * with the specified token. This corresponds _only_ to entries with * the format: (<token> <value>). The value must be a * string. Entries not corresponding to this format will cause warnings * to be issued on gimprc parsing and will not be queryable. * @param token The token to query for. * @returns The value associated with the queried token. The returned value must be freed with g_free(). */ function gimprc_query(token: string): string; /** * Sets a gimprc token to a value and saves it in the gimprc. * * This procedure is used to add or change additional information in * the gimprc file that is considered extraneous to the operation of * GIMP. Plug-ins that need configuration information can use this * function to store it, and gimp_gimprc_query() to retrieve it. This * will accept _only_ string values in UTF-8 encoding. * @param token The token to add or modify. * @param value The value to set the token to. * @returns TRUE on success. */ function gimprc_set(token: string, value: string): boolean; /** * Close the gradient selection dialog. * * Closes an open gradient selection dialog. * @param gradient_callback The name of the callback registered for this pop-up. * @returns TRUE on success. */ function gradients_close_popup(gradient_callback: string): boolean; /** * Retrieve the list of loaded gradients. * * This procedure returns a list of the gradients that are currently * loaded. * Each gradient returned can be used as input to * [func`Gimp`.context_set_gradient]. * @param filter An optional regular expression used to filter the list. * @returns The list of gradients. The returned value must be freed with g_free(). */ function gradients_get_list(filter?: string | null): Gradient[]; /** * Invokes the Gimp gradients selection dialog. * * Opens a dialog letting a user choose a gradient. * @param gradient_callback The callback PDB proc to call when user chooses a gradient. * @param popup_title Title of the gradient selection dialog. * @param initial_gradient The initial gradient choice. * @param parent_window An optional parent window handle for the popup to be set transient to. * @returns TRUE on success. */ function gradients_popup( gradient_callback: string, popup_title: string, initial_gradient?: Gradient | null, parent_window?: GLib.Bytes | null, ): boolean; /** * Refresh current gradients. This function always succeeds. * * This procedure retrieves all gradients currently in the user's * gradient path and updates the gradient dialogs accordingly. * @returns TRUE on success. */ function gradients_refresh(): boolean; /** * Sets the current gradient in a gradient selection dialog. * * Sets the current gradient in a gradient selection dialog. * @param gradient_callback The name of the callback registered for this pop-up. * @param gradient The gradient to set as selected. * @returns TRUE on success. */ function gradients_set_popup(gradient_callback: string, gradient: Gradient): boolean; /** * Heal from the source to the dest drawable using the current brush * * This tool heals the source drawable starting at the specified source * coordinates to the dest drawable. For image healing, if the sum of * the src coordinates and subsequent stroke offsets exceeds the * extents of the src drawable, then no paint is transferred. The * healing tool is capable of transforming between any image types * except RGB->Indexed. * @param drawable The affected drawable. * @param src_drawable The source drawable. * @param src_x The x coordinate in the source image. * @param src_y The y coordinate in the source image. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function heal( drawable: Drawable, src_drawable: Drawable, src_x: number, src_y: number, strokes: number[], ): boolean; /** * Heal from the source to the dest drawable using the current brush * * This tool heals from the source drawable starting at the specified * source coordinates to the dest drawable. This function performs * exactly the same as the gimp_heal() function except that the tools * arguments are obtained from the healing option dialog. It this * dialog has not been activated then the dialogs default values will * be used. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function heal_default(drawable: Drawable, strokes: number[]): boolean; /** * Load a help page. * * This procedure loads the specified help page into the helpbrowser or * what ever is configured as help viewer. The help page is identified * by its domain and ID: if help_domain is NULL, we use the help_domain * which was registered using the gimp_plugin_help_register() * procedure. If help_domain is NULL and no help domain was registered, * the help domain of the main GIMP installation is used. * @param help_domain The help domain in which help_id is registered. * @param help_id The help page's ID. * @returns TRUE on success. */ function help(help_domain: string | null, help_id: string): boolean; /** * Returns the directory of the current icon theme. * * This is a constant value given at plug-in configuration time. * @returns the icon theme directory */ function icon_theme_dir(): string; /** * Returns the top installation directory of GIMP. On Unix the * compile-time defined installation prefix is used. On Windows, the * installation directory as deduced from the executable's full * filename is used. On OSX we ask [NSBundle mainBundle] for the * resource path to check if GIMP is part of a relocatable bundle. * * In config files such as gimprc, the string ${gimp_installation_dir} * expands to this directory. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string is in the encoding used for filenames by * GLib, which isn't necessarily UTF-8. (On Windows it always is * UTF-8.) * @returns The toplevel installation directory of GIMP. */ function installation_directory(): string; function int32_array_get_values(array: Array): number[]; function int32_array_set_values(array: Array, values: number[], static_data: boolean): void; /** * Checks if `identifier` is canonical and non-%NULL. * * Canonical identifiers are e.g. expected by the PDB for procedure * and parameter names. Every character of the input string must be * either '-', 'a-z', 'A-Z' or '0-9'. * @param identifier The identifier string to check. * @returns %TRUE if @identifier is canonical, %FALSE otherwise. */ function is_canonical_identifier(identifier: string): boolean; /** * Returns the top directory for GIMP locale files. If the environment * variable GIMP3_LOCALEDIR exists, that is used. It should be an * absolute pathname. Otherwise, on Unix the compile-time defined * directory is used. On Windows, the installation directory as deduced * from the executable's full filename is used. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string encoding depends on the system where GIMP * is running: on UNIX it's in the encoding used for filenames by * the C library (which isn't necessarily UTF-8); on Windows it's UTF-8. * * On UNIX the returned string can be passed directly to the bindtextdomain() * function from libintl; on Windows the returned string can be converted to * UTF-16 and passed to the wbindtextdomain() function from libintl. * @returns The top directory for GIMP locale files. */ function locale_directory(): string; /** * The main plug-in function that must be called with the plug-in's * [class`Gimp`.PlugIn] subclass #GType and the 'argc' and 'argv' that are passed * to the platform's `main()`. * * For instance, in Python, you will want to end your plug-in with this * call: * * ```py * Gimp.main(MyPlugIn.__gtype__, sys.argv) * ``` * * For C plug-ins, use instead the [func`Gimp`.MAIN] macro * @param plug_in_type the type of the #GimpPlugIn subclass of the plug-in * @param argv the arguments * @returns an exit status as defined by the C library, on success `EXIT_SUCCESS`. */ function main(plug_in_type: GObject.GType, argv: string[]): number; /** * Displays a dialog box with a message. * * Displays a dialog box with a message. Useful for status or error * reporting. The message must be in UTF-8 encoding. * @param message Message to display in the dialog. * @returns TRUE on success. */ function message(message: string): boolean; /** * Returns the current state of where warning messages are displayed. * * This procedure returns the way g_message warnings are displayed. * They can be shown in a dialog box or printed on the console where * gimp was started. * @returns The current handler type. */ function message_get_handler(): MessageHandlerType; /** * Controls where warning messages are displayed. * * This procedure controls how g_message warnings are displayed. They * can be shown in a dialog box or printed on the console where gimp * was started. * @param handler The new handler type. * @returns TRUE on success. */ function message_set_handler(handler: MessageHandlerType | null): boolean; /** * Returns the monitor number to be used for plug-in windows. * * This is a constant value given at plug-in configuration time. * @returns the monitor number */ function monitor_number(): number; /** * Paint in the current brush with optional fade out parameter and pull * colors from a gradient. * * This tool is the standard paintbrush. It draws linearly interpolated * lines through the specified stroke coordinates. It operates on the * specified drawable in the foreground color with the active brush. * The 'fade-out' parameter is measured in pixels and allows the brush * stroke to linearly fall off. The pressure is set to the maximum at * the beginning of the stroke. As the distance of the stroke nears the * fade-out value, the pressure will approach zero. The gradient-length * is the distance to spread the gradient over. It is measured in * pixels. If the gradient-length is 0, no gradient is used. * @param drawable The affected drawable. * @param fade_out Fade out parameter. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @param method The paint method to use. * @param gradient_length Length of gradient to draw. * @returns TRUE on success. */ function paintbrush( drawable: Drawable, fade_out: number, strokes: number[], method: PaintApplicationMode | null, gradient_length: number, ): boolean; /** * Paint in the current brush. The fade out parameter and pull colors * from a gradient parameter are set from the paintbrush options * dialog. If this dialog has not been activated then the dialog * defaults will be used. * * This tool is similar to the standard paintbrush. It draws linearly * interpolated lines through the specified stroke coordinates. It * operates on the specified drawable in the foreground color with the * active brush. The 'fade-out' parameter is measured in pixels and * allows the brush stroke to linearly fall off (value obtained from * the option dialog). The pressure is set to the maximum at the * beginning of the stroke. As the distance of the stroke nears the * fade-out value, the pressure will approach zero. The gradient-length * (value obtained from the option dialog) is the distance to spread * the gradient over. It is measured in pixels. If the gradient-length * is 0, no gradient is used. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function paintbrush_default(drawable: Drawable, strokes: number[]): boolean; /** * Close the palette selection dialog. * * Closes an open palette selection dialog. * @param palette_callback The name of the callback registered for this pop-up. * @returns TRUE on success. */ function palettes_close_popup(palette_callback: string): boolean; /** * Retrieves a list of all of the available palettes * * This procedure returns a complete listing of available palettes. * Each palette returned can be used as input to * [func`Gimp`.context_set_palette]. * @param filter An optional regular expression used to filter the list. * @returns The list of palettes. The returned value must be freed with g_free(). */ function palettes_get_list(filter?: string | null): Palette[]; /** * Invokes the Gimp palette selection dialog. * * Opens a dialog letting a user choose a palette. * @param palette_callback The callback PDB proc to call when user chooses a palette. * @param popup_title Title of the palette selection dialog. * @param initial_palette The palette to set as the initial choice. * @param parent_window An optional parent window handle for the popup to be set transient to. * @returns TRUE on success. */ function palettes_popup( palette_callback: string, popup_title: string, initial_palette?: Palette | null, parent_window?: GLib.Bytes | null, ): boolean; /** * Refreshes current palettes. This function always succeeds. * * This procedure retrieves all palettes currently in the user's * palette path and updates the palette dialogs accordingly. * @returns TRUE on success. */ function palettes_refresh(): boolean; /** * Sets the current palette in a palette selection dialog. * * Sets the current palette in a palette selection dialog. * @param palette_callback The name of the callback registered for this pop-up. * @param palette The palette to set as selected. * @returns TRUE on success. */ function palettes_set_popup(palette_callback: string, palette: Palette): boolean; /** * Creates a new #GimpParamSpecArray specifying a * [type`Array]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecArray. */ function param_spec_array( name: string, nick: string, blurb: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecBrush specifying a * [type`Brush]` property. See also [func`Gimp`.param_spec_resource]. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether %NULL is a valid value. * @param default_value Default brush. * @param default_to_context Whether the context is the context's brush. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecBrush. */ function param_spec_brush( name: string, nick: string, blurb: string, none_ok: boolean, default_value: Brush | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecChannel specifying a * [type`Channel]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecChannel. */ function param_spec_channel( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecChoice specifying a * #G_TYPE_STRING property. * This %GimpParamSpecChoice takes ownership of the reference on `choice`. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param choice the %GimpChoice describing allowed choices. * @param default_value * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecChoice. */ function param_spec_choice( name: string, nick: string, blurb: string, choice: Choice, default_value: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_choice_get_choice(pspec: GObject.ParamSpec): Choice; function param_spec_choice_get_default(pspec: GObject.ParamSpec): string; /** * Creates a new #GParamSpec instance specifying a #GeglColor property. * Note that the `default_color` is duplicated, so reusing object will * not change the default color of the returned %GimpParamSpecColor. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param has_alpha %TRUE if the alpha channel has relevance. * @param default_color the default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_color( name: string, nick: string, blurb: string, has_alpha: boolean, default_color: Gegl.Color, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GParamSpec instance specifying a #GeglColor property. * @param name canonical name of the property specified * @param nick nick name for the property specified * @param blurb description of the property specified * @param has_alpha %TRUE if the alpha channel has relevance. * @param default_color_string the default value for the property specified * @param flags flags for the property specified * @returns a newly created parameter specification */ function param_spec_color_from_string( name: string, nick: string, blurb: string, has_alpha: boolean, default_color_string: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_color_has_alpha(pspec: GObject.ParamSpec): boolean; /** * Creates a param spec to hold a filename, dir name, * or list of file or dir names. * See g_param_spec_internal() for more information. * @param name Canonical name of the param * @param nick Nickname of the param * @param blurb Brief description of param. * @param type a #GimpConfigPathType value. * @param default_value Value to use if none is assigned. * @param flags a combination of #GParamFlags * @returns a newly allocated #GParamSpec instance */ function param_spec_config_path( name: string, nick: string, blurb: string, type: ConfigPathType | null, default_value: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Tells whether the path param encodes a filename, * dir name, or list of file or dir names. * @param pspec A #GParamSpec for a path param * @returns a #GimpConfigPathType value */ function param_spec_config_path_type(pspec: GObject.ParamSpec): ConfigPathType; /** * Creates a new #GimpParamSpecCoreObjectArray specifying a * [type`CoreObjectArray]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param object_type GType of the array's elements. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecCoreObjectArray. */ function param_spec_core_object_array( name: string, nick: string, blurb: string, object_type: GObject.GType, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_core_object_array_get_object_type(pspec: GObject.ParamSpec): GObject.GType; /** * Creates a new #GimpParamSpecDisplay specifying a * [type`Display]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecDisplay. */ function param_spec_display( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_display_none_allowed(pspec: GObject.ParamSpec): boolean; /** * Creates a new #GimpParamSpecDoubleArray specifying a * %GIMP_TYPE_DOUBLE_ARRAY property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecDoubleArray. */ function param_spec_double_array( name: string, nick: string, blurb: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecDrawable specifying a * [type`Drawable]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecDrawable. */ function param_spec_drawable( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecDrawableFilter specifying a * [type`DrawableFilter]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecPath. */ function param_spec_drawable_filter( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_drawable_filter_none_allowed(pspec: GObject.ParamSpec): boolean; /** * Creates a new #GimpParamSpecExportOptions specifying a * #G_TYPE_INT property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecExportOptions. */ function param_spec_export_options( name: string, nick: string, blurb: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a param spec to hold a file param. * See g_param_spec_internal() for more information. * @param name Canonical name of the param * @param nick Nickname of the param * @param blurb Brief description of param. * @param action The type of file to expect. * @param none_ok Whether %NULL is allowed. * @param default_value File to use if none is assigned. * @param flags a combination of #GParamFlags * @returns a newly allocated #GParamSpec instance */ function param_spec_file( name: string, nick: string, blurb: string, action: FileChooserAction | null, none_ok: boolean, default_value: Gio.File | null, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_file_get_action(pspec: GObject.ParamSpec): FileChooserAction; function param_spec_file_none_allowed(pspec: GObject.ParamSpec): boolean; /** * Change the file action tied to `pspec`. * @param pspec a #GParamSpec to hold a #GFile value. * @param action new action for @pspec. */ function param_spec_file_set_action(pspec: GObject.ParamSpec, action: FileChooserAction | null): void; /** * Creates a new #GimpParamSpecFont specifying a * [type`Font]` property. See also [func`Gimp`.param_spec_resource]. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether %NULL is a valid value. * @param default_value Default font. * @param default_to_context Whether the context is the context's font. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecFont. */ function param_spec_font( name: string, nick: string, blurb: string, none_ok: boolean, default_value: Font | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecGradient specifying a * [type`Gradient]` property. See also [func`Gimp`.param_spec_resource]. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether %NULL is a valid value. * @param default_value Default gradient. * @param default_to_context Whether the context is the context's gradient. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecGradient. */ function param_spec_gradient( name: string, nick: string, blurb: string, none_ok: boolean, default_value: Gradient | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecGroupLayer specifying a * [type`GroupLayer]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether %NULL is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecGroupLayer. */ function param_spec_group_layer( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecImage specifying a * [type`Image]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecImage. */ function param_spec_image( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_image_none_allowed(pspec: GObject.ParamSpec): boolean; /** * Creates a new #GimpParamSpecInt32Array specifying a * %GIMP_TYPE_INT32_ARRAY property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecInt32Array. */ function param_spec_int32_array( name: string, nick: string, blurb: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecItem specifying a * [type`Item]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecItem. */ function param_spec_item( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_item_none_allowed(pspec: GObject.ParamSpec): boolean; /** * Creates a new #GimpParamSpecLayer specifying a * [type`Layer]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecLayer. */ function param_spec_layer( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecLayerMask specifying a * [type`LayerMask]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecLayerMask. */ function param_spec_layer_mask( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a param spec to hold a #GimpMatrix2 value. * See g_param_spec_internal() for more information. * @param name Canonical name of the param * @param nick Nickname of the param * @param blurb Brief description of param. * @param default_value Value to use if none is assigned. * @param flags a combination of #GParamFlags * @returns a newly allocated #GParamSpec instance */ function param_spec_matrix2( name: string, nick: string, blurb: string, default_value: Matrix2, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a param spec to hold a #GimpMatrix3 value. * See g_param_spec_internal() for more information. * @param name Canonical name of the param * @param nick Nickname of the param * @param blurb Brief description of param. * @param default_value Value to use if none is assigned. * @param flags a combination of #GParamFlags * @returns a newly allocated #GParamSpec instance */ function param_spec_matrix3( name: string, nick: string, blurb: string, default_value: Matrix3, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a param spec to hold a memory size value. * See g_param_spec_internal() for more information. * @param name Canonical name of the param * @param nick Nickname of the param * @param blurb Brief description of param. * @param minimum Smallest allowed value of the parameter. * @param maximum Largest allowed value of the parameter. * @param default_value Value to use if none is assigned. * @param flags a combination of #GParamFlags * @returns a newly allocated #GParamSpec instance */ function param_spec_memsize( name: string, nick: string, blurb: string, minimum: number, maximum: number, default_value: number, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * This function duplicates `pspec` appropriately, depending on the * accurate spec type. * @param pspec a [struct@Gimp.ParamSpecObject]. * @returns a newly created param spec. */ function param_spec_object_duplicate(pspec: GObject.ParamSpec): GObject.ParamSpec; /** * Get the default object value of the param spec. * * If the `pspec` has been registered with a specific default (which can * be verified with [func`Gimp`.ParamSpecObject.has_default]), it will be * returned, though some specific subtypes may support returning dynamic * default (e.g. based on context). * @param pspec a #GObject #GParamSpec * @returns the default value. */ function param_spec_object_get_default(pspec: GObject.ParamSpec): T; /** * This function tells whether a default was set, typically with * [func`Gimp`.ParamSpecObject.set_default] or any other way. It * does not guarantee that the default is an actual object (it may be * %NULL if valid as a default). * @param pspec a #GObject #GParamSpec * @returns whether a default value was set. */ function param_spec_object_has_default(pspec: GObject.ParamSpec): boolean; /** * Set the default object value of the param spec. This will switch the * `has_default` flag so that [func`Gimp`.ParamSpecObject.has_default] * will now return %TRUE. * * A %NULL `default_value` still counts as a default (unless the specific * `pspec` does not allow %NULL as a default). * @param pspec a #GObject #GParamSpec * @param default_value a default value. */ function param_spec_object_set_default(pspec: GObject.ParamSpec, default_value?: GObject.Object | null): void; /** * Creates a new #GimpParamSpecPalette specifying a * [type`Palette]` property. See also [func`Gimp`.param_spec_resource]. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether %NULL is a valid value. * @param default_value Default palette. * @param default_to_context Whether the context is the context's palette. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecPalette. */ function param_spec_palette( name: string, nick: string, blurb: string, none_ok: boolean, default_value: Palette | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecParasite specifying a * [type`Parasite]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecParasite. */ function param_spec_parasite( name: string, nick: string, blurb: string, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecPath specifying a * [type`Path]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecPath. */ function param_spec_path( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecPattern specifying a * [type`Pattern]` property. See also [func`Gimp`.param_spec_resource]. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether %NULL is a valid value. * @param default_value Default pattern. * @param default_to_context Whether the context is the context's pattern. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecPattern. */ function param_spec_pattern( name: string, nick: string, blurb: string, none_ok: boolean, default_value: Pattern | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecResource specifying a [type`Resource]` property. * See [func`GObject`.ParamSpec.internal] for details on property names. * * `default_to_context` cannot be %TRUE for a `resource_type` of value * [class`Gimp`.Resource], but only for specific subtypes. If it is * %TRUE, `default_value` must be %NULL. Instead of a fixed default, * whatever is the context's resource for the given type at run time * will be used as dynamic default. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param resource_type a %GType, subtype of [class@Gimp.Resource]. * @param none_ok Whether %NULL is a valid value. * @param default_value Default resource. * @param default_to_context Whether the context is the context's resource for the given @resource_type. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecResource. */ function param_spec_resource( name: string, nick: string, blurb: string, resource_type: GObject.GType, none_ok: boolean, default_value: Resource | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_resource_defaults_to_context(pspec: GObject.ParamSpec): boolean; function param_spec_resource_none_allowed(pspec: GObject.ParamSpec): boolean; /** * Creates a new #GimpParamSpecSelection specifying a * [type`Selection]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecSelection. */ function param_spec_selection( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a new #GimpParamSpecTextLayer specifying a * [type`TextLayer]` property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param none_ok Whether no is a valid value. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecTextLayer. */ function param_spec_text_layer( name: string, nick: string, blurb: string, none_ok: boolean, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; /** * Creates a param spec to hold a units param. * See g_param_spec_internal() for more information. * @param name Canonical name of the param * @param nick Nickname of the param * @param blurb Brief description of param. * @param allow_pixel Whether "pixels" is an allowed unit. * @param allow_percent Whether "percent" is an allowed unit. * @param default_value Unit to use if none is assigned. * @param flags a combination of #GParamFlags * @returns a newly allocated #GParamSpec instance */ function param_spec_unit( name: string, nick: string, blurb: string, allow_pixel: boolean, allow_percent: boolean, default_value: Unit, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_unit_percent_allowed(pspec: GObject.ParamSpec): boolean; function param_spec_unit_pixel_allowed(pspec: GObject.ParamSpec): boolean; /** * Creates a new #GimpParamSpecValueArray specifying a * [type`GObject`.ValueArray] property. * * See g_param_spec_internal() for details on property names. * @param name Canonical name of the property specified. * @param nick Nick name of the property specified. * @param blurb Description of the property specified. * @param element_spec #GParamSpec the contained array's elements have comply to, or %NULL. * @param flags Flags for the property specified. * @returns The newly created #GimpParamSpecValueArray. */ function param_spec_value_array( name: string, nick: string, blurb: string, element_spec: GObject.ParamSpec | null, flags: GObject.ParamFlags | null, ): GObject.ParamSpec; function param_spec_value_array_get_element_spec(pspec: GObject.ParamSpec): GObject.ParamSpec; /** * Close the pattern selection dialog. * * Closes an open pattern selection dialog. * @param pattern_callback The name of the callback registered for this pop-up. * @returns TRUE on success. */ function patterns_close_popup(pattern_callback: string): boolean; /** * Retrieve a complete listing of the available patterns. * * This procedure returns a complete listing of available GIMP * patterns. * Each pattern returned can be used as input to * [func`Gimp`.context_set_pattern]. * @param filter An optional regular expression used to filter the list. * @returns The list of patterns. The returned value must be freed with g_free(). */ function patterns_get_list(filter?: string | null): Pattern[]; /** * Invokes the Gimp pattern selection. * * Opens the pattern selection dialog. * @param pattern_callback The callback PDB proc to call when the user chooses a pattern. * @param popup_title Title of the pattern selection dialog. * @param initial_pattern The pattern to set as the initial choice. * @param parent_window An optional parent window handle for the popup to be set transient to. * @returns TRUE on success. */ function patterns_popup( pattern_callback: string, popup_title: string, initial_pattern?: Pattern | null, parent_window?: GLib.Bytes | null, ): boolean; /** * Refresh current patterns. This function always succeeds. * * This procedure retrieves all patterns currently in the user's * pattern path and updates all pattern dialogs accordingly. * @returns TRUE on success. */ function patterns_refresh(): boolean; /** * Sets the current pattern in a pattern selection dialog. * * Sets the current pattern in a pattern selection dialog. * @param pattern_callback The name of the callback registered for this pop-up. * @param pattern The pattern to set as selected. * @returns TRUE on success. */ function patterns_set_popup(pattern_callback: string, pattern: Pattern): boolean; /** * Paint in the current brush without sub-pixel sampling. * * This tool is the standard pencil. It draws linearly interpolated * lines through the specified stroke coordinates. It operates on the * specified drawable in the foreground color with the active brush. * The brush mask is treated as though it contains only black and white * values. Any value below half is treated as black; any above half, as * white. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function pencil(drawable: Drawable, strokes: number[]): boolean; /** * Returns a #GeglBuffer that's either backed by the `pixbuf'`s pixels, * or a copy of them. This function tries to not copy the `pixbuf'`s * pixels. If the pixbuf's rowstride is a multiple of its bpp, a * simple reference to the `pixbuf'`s pixels is made and `pixbuf` will * be kept around for as long as the buffer exists; otherwise the * pixels are copied. * @param pixbuf a #GdkPixbuf * @returns a new #GeglBuffer. */ function pixbuf_create_buffer(pixbuf: GdkPixbuf.Pixbuf): Gegl.Buffer; /** * Returns the Babl format that corresponds to the `pixbuf'`s pixel format. * @param pixbuf a #GdkPixbuf * @returns the @pixbuf's pixel format */ function pixbuf_get_format(pixbuf: GdkPixbuf.Pixbuf): Babl.Object; /** * Returns the ICC profile attached to the `pixbuf,` or %NULL if there * is none. * @param pixbuf a #GdkPixbuf * @returns The ICC profile data, or %NULL. The value should be freed with g_free(). */ function pixbuf_get_icc_profile(pixbuf: GdkPixbuf.Pixbuf): Uint8Array | null; /** * Converts a `value` specified in pixels to `unit`. * @param pixels value in pixels * @param unit unit to convert to * @param resolution resolution in DPI * @returns @pixels converted to units. */ function pixels_to_units(pixels: number, unit: Unit, resolution: number): number; function pixpipe_params_build(params: PixPipeParams): string; function pixpipe_params_free(params: PixPipeParams): void; function pixpipe_params_init(params: PixPipeParams): void; function pixpipe_params_parse(parameters: string, params: PixPipeParams): void; /** * Cancels a running progress. * * This function cancels the currently running progress. * @param progress_callback The name of the callback registered for this progress. * @returns TRUE on success. */ function progress_cancel(progress_callback: string): boolean; /** * Ends the progress bar for the current plug-in. * * Ends the progress display for the current plug-in. Most plug-ins * don't need to call this, they just exit when the work is done. It is * only valid to call this procedure from a plug-in. * @returns TRUE on success. */ function progress_end(): boolean; /** * Returns the native handle of the toplevel window this plug-in's * progress is or would be displayed in. * * This function returns the native handle allowing to identify the * toplevel window this plug-in's progress is displayed in. It should * still work even if the progress bar has not been initialized yet, * unless the plug-in wasn't called from a GUI. * This handle can be of various types (integer, string, etc.) * depending on the platform you are running on which is why it returns * a GBytes. There are usually no reasons to call this directly. * @returns The progress bar's toplevel window's handle. */ function progress_get_window_handle(): GLib.Bytes; /** * Initializes the progress bar for the current plug-in. * * Initializes the progress bar for the current plug-in. It is only * valid to call this procedure from a plug-in. * @param message Message to use in the progress dialog. * @returns TRUE on success. */ function progress_init(message: string): boolean; function progress_install_vtable( vtable: ProgressVtable, user_data?: any | null, user_data_destroy?: GLib.DestroyNotify | null, ): string; /** * Pulses the progress bar for the current plug-in. * * Updates the progress bar for the current plug-in. It is only valid * to call this procedure from a plug-in. Use this function instead of * gimp_progress_update() if you cannot tell how much progress has been * made. This usually causes the the progress bar to enter \"activity * mode\", where a block bounces back and forth. * @returns TRUE on success. */ function progress_pulse(): boolean; /** * Changes the text in the progress bar for the current plug-in. * * This function changes the text in the progress bar for the current * plug-in. Unlike gimp_progress_init() it does not change the * displayed value. * @param message Message to use in the progress dialog. * @returns TRUE on success. */ function progress_set_text(message?: string | null): boolean; /** * Uninstalls a temporary progress procedure that was installed using * gimp_progress_install(). * @param progress_callback the name of the temporary procedure to uninstall */ function progress_uninstall(progress_callback: string): void; /** * Updates the progress bar for the current plug-in. * * The library will handle over-updating by possibly dropping silently * some updates when they happen too close next to each other (either * time-wise or step-wise). * The caller does not have to take care of this aspect of progression * and can focus on computing relevant progression steps. * @param percentage Percentage of progress completed (in the range from 0.0 to 1.0). * @returns TRUE on success. */ function progress_update(percentage: number): boolean; /** * Forcefully causes the GIMP library to exit and close down its * connection to main gimp application. This function never returns. */ function quit(): void; /** * This function proposes reasonable settings for increments and display * digits. These can be used for instance on #GtkRange or other widgets * using a #GtkAdjustment typically. * Note that it will never return `digits` with value 0. If you know that * your input needs to display integer values, there is no need to set * `digits`. * * There is no universal answer to the best increments and number of * decimal places. It often depends on context of what the value is * meant to represent. This function only tries to provide sensible * generic values which can be used when it doesn't matter too much or * for generated GUI for instance. If you know exactly how you want to * show and interact with a given range, you don't have to use this * function. * @param lower the lower value. * @param upper the higher value. */ function range_estimate_settings(lower: number, upper: number): [number, number, number]; /** * Calculates the intersection of two rectangles. * @param x1 origin of first rectangle * @param y1 origin of first rectangle * @param width1 width of first rectangle * @param height1 height of first rectangle * @param x2 origin of second rectangle * @param y2 origin of second rectangle * @param width2 width of second rectangle * @param height2 height of second rectangle * @returns %TRUE if the intersection is non-empty, %FALSE otherwise */ function rectangle_intersect( x1: number, y1: number, width1: number, height1: number, x2: number, y2: number, width2: number, height2: number, ): [boolean, number, number, number, number]; /** * Calculates the union of two rectangles. * @param x1 origin of first rectangle * @param y1 origin of first rectangle * @param width1 width of first rectangle * @param height1 height of first rectangle * @param x2 origin of second rectangle * @param y2 origin of second rectangle * @param width2 width of second rectangle * @param height2 height of second rectangle */ function rectangle_union( x1: number, y1: number, width1: number, height1: number, x2: number, y2: number, width2: number, height2: number, ): [number, number, number, number]; /** * Returns whether or not GimpDialog should automatically add a help * button if help_func and help_id are given. * * This is a constant value given at plug-in configuration time. * @returns the show_help_button boolean */ function show_help_button(): boolean; /** * Smudge image with varying pressure. * * This tool simulates a smudge using the current brush. High pressure * results in a greater smudge of paint while low pressure results in a * lesser smudge. * @param drawable The affected drawable. * @param pressure The pressure of the smudge strokes. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function smudge(drawable: Drawable, pressure: number, strokes: number[]): boolean; /** * Smudge image with varying pressure. * * This tool simulates a smudge using the current brush. It behaves * exactly the same as gimp_smudge() except that the pressure value is * taken from the smudge tool options or the options default if the * tools option dialog has not been activated. * @param drawable The affected drawable. * @param strokes Array of stroke coordinates: { s1.x, s1.y, s2.x, s2.y, ..., sn.x, sn.y }. * @returns TRUE on success. */ function smudge_default(drawable: Drawable, strokes: number[]): boolean; /** * Returns %TRUE if we have dependencies to generate backtraces. If * `optimal` is %TRUE, the function will return %TRUE only when we * are able to generate optimal traces (i.e. with GDB or LLDB); * otherwise we return %TRUE even if only backtrace() API is available. * * On Win32, we return TRUE if Dr. Mingw is built-in, FALSE otherwise. * * Note: this function is not crash-safe, i.e. you should not try to use * it in a callback when the program is already crashing. In such a * case, call gimp_stack_trace_print() or gimp_stack_trace_query() * directly. * @param optimal whether we get optimal traces. */ function stack_trace_available(optimal: boolean): boolean; /** * Attempts to generate a stack trace at current code position in * `prog_name`. `prog_name` is mostly a helper and can be set to NULL. * Nevertheless if set, it has to be the current program name (argv[0]). * This function is not meant to generate stack trace for third-party * programs, and will attach the current process id only. * Internally, this function uses `gdb` or `lldb` if they are available, * or the stacktrace() API on platforms where it is available. It always * fails on Win32. * * The stack trace, once generated, will either be printed to `stream` or * returned as a newly allocated string in `trace,` if not %NULL. * * In some error cases (e.g. segmentation fault), trying to allocate * more memory will trigger more segmentation faults and therefore loop * our error handling (which is just wrong). Therefore printing to a * file description is an implementation without any memory allocation. * @param prog_name the program to attach to. * @param stream a FILE* stream. * @returns %TRUE if a stack trace could be generated, %FALSE otherwise. */ function stack_trace_print(prog_name: string, stream: any | null): [boolean, string]; /** * This is mostly the same as g_on_error_query() except that we use our * own backtrace function, much more complete. * `prog_name` must be the current program name (argv[0]). * It does nothing on Win32. * @param prog_name the program to attach to. */ function stack_trace_query(prog_name: string): void; /** * This function returns a copy of `str` stripped of underline * characters. This comes in handy when needing to strip mnemonics * from menu paths etc. * * In some languages, mnemonics are handled by adding the mnemonic * character in brackets (like "File (_F)"). This function recognizes * this construct and removes the whole bracket construction to get * rid of the mnemonic (see bug 157561). * @param str underline infested string (or %NULL) * @returns A (possibly stripped) copy of @str which should be freed using g_free() when it is not needed any longer. */ function strip_uline(str?: string | null): string; /** * Returns the top directory for GIMP config files. If the environment * variable GIMP3_SYSCONFDIR exists, that is used. It should be an * absolute pathname. Otherwise, on Unix the compile-time defined * directory is used. On Windows, the installation directory as deduced * from the executable's full filename is used. * * In config files such as gimprc, the string ${gimp_sysconf_dir} * expands to this directory. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string is in the encoding used for filenames by * GLib, which isn't necessarily UTF-8. (On Windows it always is * UTF-8.). * @returns The top directory for GIMP config files. */ function sysconf_directory(): string; /** * Returns the default top directory for GIMP temporary files. If the * environment variable GIMP3_TEMPDIR exists, that is used. It * should be an absolute pathname. Otherwise, a subdirectory of the * directory returned by g_get_tmp_dir() is used. * * In config files such as gimprc, the string ${gimp_temp_dir} expands * to this directory. * * Note that the actual directories used for GIMP temporary files can * be overridden by the user in the preferences dialog. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string is in the encoding used for filenames by * GLib, which isn't necessarily UTF-8. (On Windows it always is * UTF-8.). * @returns The default top directory for GIMP temporary files. */ function temp_directory(): string; /** * Generates a unique temporary file. * * Generates a unique file using the temp path supplied in the user's * gimprc. * @param extension The extension the file will have. * @returns The new temp file. */ function temp_file(extension?: string | null): Gio.File; /** * Add text at the specified location as a floating selection or a new * layer. * * The x and y parameters together control the placement of the new * text by specifying the upper left corner of the text bounding box. * If the specified drawable parameter is valid, the text will be * created as a floating selection attached to the drawable. If the * drawable parameter is not valid (%NULL), the text will appear as a * new layer. Finally, a border can be specified around the final * rendered text. The border is measured in pixels. * The size is always in pixels. If you need to display a font in * points, divide the size in points by 72.0 and multiply it by the * image's vertical resolution. * @param image The image. * @param drawable The affected drawable: (%NULL for a new text layer). * @param x The x coordinate for the left of the text bounding box. * @param y The y coordinate for the top of the text bounding box. * @param text The text to generate (in UTF-8 encoding). * @param border The size of the border. * @param antialias Antialiasing. * @param size The size of text in pixels. * @param font The font. * @returns The new text layer or %NULL if no layer was created. */ function text_font( image: Image, drawable: Drawable | null, x: number, y: number, text: string, border: number, antialias: boolean, size: number, font: Font, ): Layer | null; /** * Get extents of the bounding box for the specified text. * * This tool returns the width and height of a bounding box for the * specified text rendered with the specified font information. Ascent * and descent of the glyph extents are returned as well. * The ascent is the distance from the baseline to the highest point of * the character. This is positive if the glyph ascends above the * baseline. The descent is the distance from the baseline to the * lowest point of the character. This is positive if the glyph * descends below the baseline. * The size is always in pixels. If you need to set a font in points, * divide the size in points by 72.0 and multiply it by the vertical * resolution of the image you are taking into account. * @param text The text to generate (in UTF-8 encoding). * @param size The size of text in either pixels or points. * @param font The name of the font. * @returns TRUE on success. */ function text_get_extents_font( text: string, size: number, font: Font, ): [boolean, number, number, number, number]; /** * Returns the tile height GIMP is using. * * This is a constant value given at plug-in configuration time. * @returns the tile_height */ function tile_height(): number; /** * Returns the tile width GIMP is using. * * This is a constant value given at plug-in configuration time. * @returns the tile_width */ function tile_width(): number; /** * Retrieves the translation context that has been previously set * using gimp_type_set_translation_context(). You should not need to * use this function directly, use gimp_enum_get_value() or * gimp_enum_value_get_desc() instead. * @param type a #GType * @returns the translation context associated with @type or %NULL if no context was set */ function type_get_translation_context(type: GObject.GType): string; /** * Retrieves the gettext translation domain identifier that has been * previously set using gimp_type_set_translation_domain(). You should * not need to use this function directly, use gimp_enum_get_value() * or gimp_enum_value_get_desc() instead. * @param type a #GType * @returns the translation domain associated with @type or %NULL if no domain was set */ function type_get_translation_domain(type: GObject.GType): string; /** * This function attaches a constant string as a translation context * to a #GType. The only purpose of this function is to use it when * registering a #G_TYPE_ENUM with translatable value names. * @param type a #GType * @param context a constant string that identifies a translation context or %NULL */ function type_set_translation_context(type: GObject.GType, context: string): void; /** * This function attaches a constant string as a gettext translation * domain identifier to a #GType. The only purpose of this function is * to use it when registering a #G_TYPE_ENUM with translatable value * names. * @param type a #GType * @param domain a constant string that identifies a translation domain or %NULL */ function type_set_translation_domain(type: GObject.GType, domain: string): void; /** * Converts a `value` specified in `unit` to pixels. * @param value value in units * @param unit unit of @value * @param resolution resloution in DPI * @returns @value converted to pixels. */ function units_to_pixels(value: number, unit: Unit, resolution: number): number; /** * Converts a `value` specified in `unit` to points. * @param value value in units * @param unit unit of @value * @param resolution resloution in DPI * @returns @value converted to points. */ function units_to_points(value: number, unit: Unit, resolution: number): number; /** * Returns the timestamp of the user interaction that should be set on * the plug-in window. This is handled transparently, plug-in authors * do not have to care about it. * * This is a constant value given at plug-in configuration time. * @returns timestamp for plug-in window */ function user_time(): number; /** * Creates a (possibly trimmed) copy of `str`. The string is cut if it * exceeds `max_chars` characters or on the first newline. The fact * that the string was trimmed is indicated by appending an ellipsis. * @param str an UTF-8 encoded string (or %NULL) * @param max_chars the maximum number of characters before the string get trimmed * @returns A (possibly trimmed) copy of @str which should be freed using g_free() when it is not needed any longer. */ function utf8_strtrim(str: string | null, max_chars: number): string; /** * Gets the contents of a %GIMP_TYPE_DOUBLE_ARRAY #GValue * @param value A valid value of type %GIMP_TYPE_DOUBLE_ARRAY * @returns The contents of @value */ function value_dup_double_array(value: GObject.Value | any): number[]; /** * Gets the contents of a %GIMP_TYPE_INT32_ARRAY #GValue * @param value A valid value of type %GIMP_TYPE_INT32_ARRAY * @returns The contents of @value */ function value_dup_int32_array(value: GObject.Value | any): number[]; /** * Gets the contents of a %GIMP_TYPE_DOUBLE_ARRAY #GValue * @param value A valid value of type %GIMP_TYPE_DOUBLE_ARRAY * @returns The contents of @value */ function value_get_double_array(value: GObject.Value | any): number[]; /** * Gets the contents of a %GIMP_TYPE_INT32_ARRAY #GValue * @param value A valid value of type %GIMP_TYPE_INT32_ARRAY * @returns The contents of @value */ function value_get_int32_array(value: GObject.Value | any): number[]; /** * Sets the contents of `value` to `data`. * @param value A valid value of type %GIMP_TYPE_DOUBLE_ARRAY * @param data A #gdouble array */ function value_set_double_array(value: GObject.Value | any, data: number[]): void; /** * Sets the contents of `value` to `data`. * @param value A valid value of type %GIMP_TYPE_INT32_ARRAY * @param data A #gint32 array */ function value_set_int32_array(value: GObject.Value | any, data: number[]): void; /** * Sets the contents of `value` to `data,` without copying the data. * @param value A valid value of type %GIMP_TYPE_DOUBLE_ARRAY * @param data A #gdouble array */ function value_set_static_double_array(value: GObject.Value | any, data: number[]): void; /** * Sets the contents of `value` to `data,` without copying the data. * @param value A valid value of type %GIMP_TYPE_INT32_ARRAY * @param data A #gint32 array */ function value_set_static_int32_array(value: GObject.Value | any, data: number[]): void; /** * Sets the contents of `value` to `data,` and takes ownership of `data`. * @param value A valid value of type %GIMP_TYPE_DOUBLE_ARRAY * @param data A #gdouble array */ function value_take_double_array(value: GObject.Value | any, data: number[]): void; /** * Sets the contents of `value` to `data,` and takes ownership of `data`. * @param value A valid value of type %GIMP_TYPE_int32_ARRAY * @param data A #gint32 array */ function value_take_int32_array(value: GObject.Value | any, data: number[]): void; /** * Computes the sum of two 2D vectors. The resulting #GimpVector2 is * stored in `result`. * @param vector1 a pointer to the first #GimpVector2. * @param vector2 a pointer to the second #GimpVector2. */ function vector2_add(vector1: Vector2, vector2: Vector2): Vector2; /** * Computes the difference of two 2D vectors (`vector1` minus `vector2`). * The resulting #GimpVector2 is stored in `result`. * @param vector1 a pointer to the first #GimpVector2. * @param vector2 a pointer to the second #GimpVector2. */ function vector2_sub(vector1: Vector2, vector2: Vector2): Vector2; /** * Computes the sum of two 3D vectors. The resulting #GimpVector3 is * stored in `result`. * @param vector1 a pointer to the first #GimpVector3. * @param vector2 a pointer to the second #GimpVector3. */ function vector3_add(vector1: Vector3, vector2: Vector3): Vector3; /** * Computes the difference of two 3D vectors (`vector1` minus `vector2`). * The resulting #GimpVector3 is stored in `result`. * @param vector1 a pointer to the first #GimpVector3. * @param vector2 a pointer to the second #GimpVector3. */ function vector3_sub(vector1: Vector3, vector2: Vector3): Vector3; /** * \"Compute screen (sx, sy) - (sx + w, sy + h) to 3D unit square * mapping. The plane to map to is given in the z field of p. The * observer is located at position vp (vp->z != 0.0).\" * * In other words, this computes the projection of the point (`x,` `y)` * to the plane z = `p->`z (parallel to XY), from the `vp` point of view * through the screen (`sx,` `sy)`->(`sx` + `w,` `sy` + `h)` * @param sx the abscissa of the upper-left screen rectangle. * @param sy the ordinate of the upper-left screen rectangle. * @param w the width of the screen rectangle. * @param h the height of the screen rectangle. * @param x the abscissa of the point in the screen rectangle to map. * @param y the ordinate of the point in the screen rectangle to map. * @param vp the position of the observer. * @param p the resulting point. */ function vector_2d_to_3d( sx: number, sy: number, w: number, h: number, x: number, y: number, vp: Vector3, p: Vector3, ): void; /** * This function is identical to gimp_vector_2d_to_3d() but the * position of the `observer` and the resulting point `p` are passed by * value rather than by reference. * @param sx the abscissa of the upper-left screen rectangle. * @param sy the ordinate of the upper-left screen rectangle. * @param w the width of the screen rectangle. * @param h the height of the screen rectangle. * @param x the abscissa of the point in the screen rectangle to map. * @param y the ordinate of the point in the screen rectangle to map. * @param vp position of the observer. * @param p the resulting point. * @returns the computed #GimpVector3 point. */ function vector_2d_to_3d_val( sx: number, sy: number, w: number, h: number, x: number, y: number, vp: Vector3, p: Vector3, ): Vector3; /** * Convert the given 3D point to 2D (project it onto the viewing * plane, (sx, sy, 0) - (sx + w, sy + h, 0). The input is assumed to * be in the unit square (0, 0, z) - (1, 1, z). The viewpoint of the * observer is passed in vp. * * This is basically the opposite of gimp_vector_2d_to_3d(). * @param sx the abscissa of the upper-left screen rectangle. * @param sy the ordinate of the upper-left screen rectangle. * @param w the width of the screen rectangle. * @param h the height of the screen rectangle. * @param vp position of the observer. * @param p the 3D point to project to the plane. */ function vector_3d_to_2d( sx: number, sy: number, w: number, h: number, vp: Vector3, p: Vector3, ): [number, number]; /** * Returns the host GIMP version. * * This procedure returns the version number of the currently running * GIMP. * @returns GIMP version number. The returned value must be freed with g_free(). */ function version(): string; /** * Returns the window manager class to be used for plug-in windows. * * This is a constant value given at plug-in configuration time. * @returns the window manager class */ function wm_class(): string; interface BatchFunc { (procedure: Procedure, run_mode: RunMode, command: string, config: ProcedureConfig): ValueArray; } interface ExportGetCapabilitiesFunc { (procedure: Procedure, config: ProcedureConfig, options: ExportOptions): ExportCapabilities; } interface ExtractVectorFunc { ( procedure: Procedure, run_mode: RunMode, file: Gio.File, metadata: Metadata, config: ProcedureConfig | null, ): boolean; } interface ModuleQueryFunc { (module: GObject.TypeModule): ModuleInfo; } interface ModuleRegisterFunc { (module: GObject.TypeModule): boolean; } interface ProgressFunc { (min: number, max: number, current: number): void; } interface ProgressVtableEndFunc { (): void; } interface ProgressVtableGetWindowFunc { (): GLib.Bytes; } interface ProgressVtablePulseFunc { (): void; } interface ProgressVtableSetTextFunc { (message: string): void; } interface ProgressVtableSetValueFunc { (percentage: number): void; } interface ProgressVtableStartFunc { (message: string, cancelable: boolean): void; } interface PutPixelFunc { (x: number, y: number, color: number): void; } interface RenderFunc { (x: number, y: number): void; } interface RunExportFunc { ( procedure: Procedure, run_mode: RunMode, image: Image, file: Gio.File, options: ExportOptions, metadata: Metadata, config: ProcedureConfig, ): ValueArray; } interface RunFunc { (procedure: Procedure, config: ProcedureConfig): ValueArray; } interface RunImageFunc { ( procedure: Procedure, run_mode: RunMode, image: Image, drawables: Drawable[], config: ProcedureConfig, ): ValueArray; } interface RunLoadFunc { ( procedure: Procedure, run_mode: RunMode, file: Gio.File, metadata: Metadata, flags: MetadataLoadFlags, config: ProcedureConfig, ): ValueArray; } interface RunThumbnailFunc { (procedure: Procedure, file: Gio.File, size: number, config: ProcedureConfig): ValueArray; } interface RunVectorLoadFunc { ( procedure: Procedure, run_mode: RunMode, file: Gio.File, width: number, height: number, extracted_data: VectorLoadData, metadata: Metadata, flags: MetadataLoadFlags, config: ProcedureConfig, ): ValueArray; } type DoubleArray = object | null; type Int32Array = object | null; /** * The types of images and layers an export procedure can handle */ /** * The types of images and layers an export procedure can handle */ export namespace ExportCapabilities { export const $gtype: GObject.GType; } enum ExportCapabilities { /** * Handles RGB images */ CAN_HANDLE_RGB, /** * Handles grayscale images */ CAN_HANDLE_GRAY, /** * Handles indexed images */ CAN_HANDLE_INDEXED, /** * Handles two-color indexed images */ CAN_HANDLE_BITMAP, /** * Handles alpha channels */ CAN_HANDLE_ALPHA, /** * Handles layers */ CAN_HANDLE_LAYERS, /** * Handles animation of layers */ CAN_HANDLE_LAYERS_AS_ANIMATION, /** * Handles layer masks */ CAN_HANDLE_LAYER_MASKS, /** * Handles layer effects */ CAN_HANDLE_LAYER_EFFECTS, /** * Needs alpha channels */ NEEDS_ALPHA, /** * Needs to crop content to image bounds */ NEEDS_CROP, } /** * What metadata to load when importing images. */ /** * What metadata to load when importing images. */ export namespace MetadataLoadFlags { export const $gtype: GObject.GType; } enum MetadataLoadFlags { /** * Do not load the metadata */ NONE, /** * Load the comment */ COMMENT, /** * Load the resolution */ RESOLUTION, /** * Load the orientation (rotation) */ ORIENTATION, /** * Load the colorspace */ COLORSPACE, /** * Load all of the above */ ALL, } /** * What kinds of metadata to save when exporting images. */ /** * What kinds of metadata to save when exporting images. */ export namespace MetadataSaveFlags { export const $gtype: GObject.GType; } enum MetadataSaveFlags { /** * Save EXIF */ EXIF, /** * Save XMP */ XMP, /** * Save IPTC */ IPTC, /** * Save a thumbnail of the image */ THUMBNAIL, /** * Save the image's color profile * Since: 2.10.10 */ COLOR_PROFILE, /** * Save the image's comment * Since: 3.0 */ COMMENT, /** * Save all of the above */ ALL, } /** * The cases when a #GimpProcedure should be shown as sensitive. */ /** * The cases when a #GimpProcedure should be shown as sensitive. */ export namespace ProcedureSensitivityMask { export const $gtype: GObject.GType; } enum ProcedureSensitivityMask { /** * Handles image with one selected drawable. */ DRAWABLE, /** * Handles image with several selected drawables. */ DRAWABLES, /** * Handles image with no selected drawables. */ NO_DRAWABLES, /** * Handles no image. */ NO_IMAGE, ALWAYS, } namespace BatchProcedure { // Constructor properties interface interface ConstructorProps extends Procedure.ConstructorProps {} } /** * Batch procedures implement an interpreter able to run commands as input. * * In particular, batch procedures will be available on the command line * through the `--batch-interpreter` option to switch the chosen interpreter. * Then any command given through the `--batch` option will have to be in the * chosen language. * * It makes GIMP usable on the command line, but also to process small scripts * (without making full-featured plug-ins), fully in command line without * graphical interface. */ class BatchProcedure extends Procedure { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( plug_in: PlugIn, name: string, interpreter_name: string, proc_type: PDBProcType, run_func: BatchFunc, run_data_destroy?: GLib.DestroyNotify | null, ): BatchProcedure; // Conflicted with Gimp.Procedure.new static ['new'](...args: never[]): any; // Methods /** * Returns the procedure's interpreter name, as set with * [method`BatchProcedure`.set_interpreter_name]. * @returns The procedure's interpreter name. */ get_interpreter_name(): string; /** * Associates an interpreter name with a batch procedure. * * This name can be used for any public-facing strings, such as * graphical interface labels or command line usage. E.g. the command * line interface could list all available interface, displaying both a * procedure name and a "pretty printing" title. * * Note that since the format name is public-facing, it is recommended * to localize it at runtime, for instance through gettext, like: * * ```c * gimp_batch_procedure_set_interpreter_name (procedure, _("Python 3")); * ``` * * Some language would indeed localize even some technical terms or * acronyms, even if sometimes just to rewrite them with the local * writing system. * @param interpreter_name A public-facing name for the interpreter, e.g. "Python 3". */ set_interpreter_name(interpreter_name: string): void; } namespace Brush { // Constructor properties interface interface ConstructorProps extends Resource.ConstructorProps, ConfigInterface.ConstructorProps {} } /** * Installable object used by painting and stroking tools. */ class Brush extends Resource implements ConfigInterface { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](name: string): Brush; // Static methods /** * Returns the brush with the given name. * * Return an existing brush having the given name. Returns %NULL when * no brush exists of that name. * @param name The name of the brush. */ static get_by_name(name: string): Brush | null; // Conflicted with Gimp.Resource.get_by_name static get_by_name(...args: never[]): any; // Methods /** * Gets the rotation angle of a generated brush. * * Gets the angle of rotation for a generated brush. Returns an error * when called for a non-parametric brush. * @returns TRUE on success. */ get_angle(): [boolean, number]; /** * Gets the aspect ratio of a generated brush. * * Gets the aspect ratio of a generated brush. Returns an error when * called for a non-parametric brush. The aspect ratio is a double * between 0.0 and 1000.0. * @returns TRUE on success. */ get_aspect_ratio(): [boolean, number]; /** * Gets pixel data of the brush within the bounding box specified by `max_width` * and `max_height`. The data will be scaled down so that it fits within this * size without changing its ratio. If the brush is smaller than this size to * begin with, it will not be scaled up. * * If `max_width` or `max_height` are %NULL, the buffer is returned in the brush's * native size. * * When the brush is parametric or a raster mask, only the mask (as returned by * [method`Gimp`.Brush.get_mask]) will be set. The returned buffer will be NULL. * * Make sure you called [func`Gegl`.init] before calling any function using * `GEGL`. * @param max_width a maximum width for the returned buffer. * @param max_height a maximum height for the returned buffer. * @param format an optional Babl format. * @returns a [class@Gegl.Buffer] of %NULL if the brush is parametric or mask only. */ get_buffer(max_width: number, max_height: number, format: Babl.Object): Gegl.Buffer; /** * Gets the hardness of a generated brush. * * Gets the hardness of a generated brush. The hardness of a brush is * the amount its intensity fades at the outside edge, as a double * between 0.0 and 1.0. Returns an error when called for a * non-parametric brush. * @returns TRUE on success. */ get_hardness(): [boolean, number]; /** * Gets information about the brush. * * Gets information about the brush: brush extents (width and height), * color depth and mask depth (bpp). The color bpp is zero when the * brush is parametric versus raster. * @returns TRUE on success. */ get_info(): [boolean, number, number, number, number]; /** * Gets mask data of the brush within the bounding box specified by `max_width` * and `max_height`. The data will be scaled down so that it fits within this * size without changing its ratio. If the brush is smaller than this size to * begin with, it will not be scaled up. * * If `max_width` or `max_height` are %NULL, the buffer is returned in the brush's * native size. * * Make sure you called [func`Gegl`.init] before calling any function using * `GEGL`. * @param max_width a maximum width for the returned buffer. * @param max_height a maximum height for the returned buffer. * @param format an optional Babl format. * @returns a [class@Gegl.Buffer] representing the @brush mask. */ get_mask(max_width: number, max_height: number, format: Babl.Object): Gegl.Buffer; /** * Gets the radius of a generated brush. * * Gets the radius of a generated brush. Returns an error when called * for a non-parametric brush. * @returns TRUE on success. */ get_radius(): [boolean, number]; /** * Gets the shape of a generated brush. * * Gets the shape of a generated brush. Returns an error when called * for a non-parametric brush. The choices for shape are Circle * (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), * and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). Other shapes might be * added in the future. * @returns TRUE on success. */ get_shape(): [boolean, BrushGeneratedShape]; /** * Gets the brush spacing, the stamping frequency. * * Returns the spacing setting for the brush. Spacing is an integer * between 0 and 1000 which represents a percentage of the maximum of * the width and height of the mask. Both parametric and raster brushes * have a spacing. * @returns The brush spacing. */ get_spacing(): number; /** * Gets the number of spikes for a generated brush. * * Gets the number of spikes for a generated brush. Returns an error * when called for a non-parametric brush. * @returns TRUE on success. */ get_spikes(): [boolean, number]; /** * Whether the brush is generated (parametric versus raster). * * Returns TRUE when brush is parametric. * @returns TRUE if the brush is generated. */ is_generated(): boolean; /** * Sets the rotation angle of a generated brush. * * Sets the rotation angle for a generated brush. Sets the angle modulo * 180, in the range [-180.0, 180.0]. Returns the clamped value. * Returns an error when brush is non-parametric or not editable. * @param angle_in The desired brush rotation angle in degrees. * @returns TRUE on success. */ set_angle(angle_in: number): [boolean, number]; /** * Sets the aspect ratio of a generated brush. * * Sets the aspect ratio for a generated brush. Clamps aspect ratio to * [0.0, 1000.0]. Returns the clamped value. Returns an error when * brush is non-parametric or not editable. * @param aspect_ratio_in The desired brush aspect ratio. * @returns TRUE on success. */ set_aspect_ratio(aspect_ratio_in: number): [boolean, number]; /** * Sets the hardness of a generated brush. * * Sets the hardness for a generated brush. Clamps hardness to [0.0, * 1.0]. Returns the clamped value. Returns an error when brush is * non-parametric or not editable. * @param hardness_in The desired brush hardness. * @returns TRUE on success. */ set_hardness(hardness_in: number): [boolean, number]; /** * Sets the radius of a generated brush. * * Sets the radius for a generated brush. Clamps radius to [0.0, * 32767.0]. Returns the clamped value. Returns an error when brush is * non-parametric or not editable. * @param radius_in The desired brush radius in pixel. * @returns TRUE on success. */ set_radius(radius_in: number): [boolean, number]; /** * Sets the shape of a generated brush. * * Sets the shape of a generated brush. Returns an error when brush is * non-parametric or not editable. The choices for shape are Circle * (GIMP_BRUSH_GENERATED_CIRCLE), Square (GIMP_BRUSH_GENERATED_SQUARE), * and Diamond (GIMP_BRUSH_GENERATED_DIAMOND). * @param shape_in The brush shape. * @returns TRUE on success. */ set_shape(shape_in: BrushGeneratedShape | null): [boolean, BrushGeneratedShape]; /** * Sets the brush spacing. * * Set the spacing for the brush. The spacing must be an integer * between 0 and 1000. Both parametric and raster brushes have a * spacing. Returns an error when the brush is not editable. Create a * new or copied brush or to get an editable brush. * @param spacing The brush spacing. * @returns TRUE on success. */ set_spacing(spacing: number): boolean; /** * Sets the number of spikes for a generated brush. * * Sets the number of spikes for a generated brush. Clamps spikes to * [2,20]. Returns the clamped value. Returns an error when brush is * non-parametric or not editable. * @param spikes_in The desired number of spikes. * @returns TRUE on success. */ set_spikes(spikes_in: number): [boolean, 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 Channel { // Constructor properties interface interface ConstructorProps extends Drawable.ConstructorProps {} } /** * Functions for manipulating channels. */ class Channel extends Drawable { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( image: Image, name: string, width: number, height: number, opacity: number, color: Gegl.Color, ): Channel; static new_from_component(image: Image, component: ChannelType, name: string): Channel; // Static methods /** * Returns a #GimpChannel representing `channel_id`. This function * calls gimp_item_get_by_id() and returns the item if it is channel * or %NULL otherwise. * @param channel_id The channel id. */ static get_by_id(channel_id: number): Channel | null; // Methods /** * Combine two channel masks. * * This procedure combines two channel masks. The result is stored in * the first channel. * @param channel2 The channel2. * @param operation The selection operation. * @param offx x offset between upper left corner of channels: (second - first). * @param offy y offset between upper left corner of channels: (second - first). * @returns TRUE on success. */ combine_masks(channel2: Channel, operation: ChannelOps | null, offx: number, offy: number): boolean; /** * Copy a channel. * * This procedure copies the specified channel and returns the copy. * The new channel still needs to be added to the image, as this is not * automatic. Add the new channel with gimp_image_insert_channel(). * @returns The newly copied channel. */ copy(): Channel; /** * Get the compositing color of the specified channel. * * This procedure returns the specified channel's compositing color. * @returns The channel compositing color. */ get_color(): Gegl.Color; /** * Get the opacity of the specified channel. * * This procedure returns the specified channel's opacity. * @returns The channel opacity. */ get_opacity(): number; /** * Get the composite method of the specified channel. * * This procedure returns the specified channel's composite method. If * it is TRUE, then the channel is composited with the image so that * masked regions are shown. Otherwise, selected regions are shown. * @returns The channel composite method. */ get_show_masked(): boolean; /** * Set the compositing color of the specified channel. * * This procedure sets the specified channel's compositing color. * @param color The new channel compositing color. * @returns TRUE on success. */ set_color(color: Gegl.Color): boolean; /** * Set the opacity of the specified channel. * * This procedure sets the specified channel's opacity. * @param opacity The new channel opacity. * @returns TRUE on success. */ set_opacity(opacity: number): boolean; /** * Set the composite method of the specified channel. * * This procedure sets the specified channel's composite method. If it * is TRUE, then the channel is composited with the image so that * masked regions are shown. Otherwise, selected regions are shown. * @param show_masked The new channel composite method. * @returns TRUE on success. */ set_show_masked(show_masked: boolean): boolean; } namespace Choice { // Signal callback interfaces interface SensitivityChanged { (object: string): void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } class Choice extends GObject.Object { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](): Choice; // 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: 'sensitivity-changed', callback: (_source: this, object: string) => void): number; connect_after(signal: 'sensitivity-changed', callback: (_source: this, object: string) => void): number; emit(signal: 'sensitivity-changed', object: string): void; // Methods /** * This procedure adds a new possible value to `choice` list of values. * The `id` is an optional integer identifier. This can be useful for instance * when you want to work with different enum values mapped to each `nick`. * @param nick the nick of @choice. * @param id optional integer ID for @nick. * @param label the label of @choice. * @param help optional longer help text for @nick. */ add(nick: string, id: number, label: string, help: string): void; /** * Returns the documentation strings for `nick`. * @param nick the possible value's nick you need documentation for. * @param label the label of @nick. * @param help the help text of @nick. * @returns %TRUE if @nick is found, %FALSE otherwise. */ get_documentation(nick: string, label: string, help: string): boolean; /** * Returns the longer documentation for `nick`. * @param nick the nick to lookup. * @returns the help text of @nick. */ get_help(nick: string): string; get_id(nick: string): number; get_label(nick: string): string; /** * This procedure checks if the given `nick` is valid and refers to * an existing choice. * @param nick the nick to check. * @returns Whether the choice is valid. */ is_valid(nick: string): boolean; /** * This procedure returns the list of nicks allowed for `choice`. * @returns The list of @choice's nicks. */ list_nicks(): string[]; /** * Change the sensitivity of a possible `nick`. Technically a non-sensitive `nick` * means it cannot be chosen anymore (so [method`Gimp`.Choice.is_valid] will * return %FALSE; nevertheless [method`Gimp`.Choice.list_nicks] and other * functions to get information about a choice will still function). * @param nick the nick to lookup. * @param sensitive */ set_sensitive(nick: string, sensitive: boolean): void; } namespace ColorConfig { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, ConfigInterface.ConstructorProps { cmyk_profile: ConfigPath; cmykProfile: ConfigPath; display_optimize: boolean; displayOptimize: boolean; display_profile: ConfigPath; displayProfile: ConfigPath; display_profile_from_gdk: boolean; displayProfileFromGdk: boolean; display_rendering_intent: ColorRenderingIntent; displayRenderingIntent: ColorRenderingIntent; display_use_black_point_compensation: boolean; displayUseBlackPointCompensation: boolean; gray_profile: ConfigPath; grayProfile: ConfigPath; mode: ColorManagementMode; out_of_gamut_color: Gegl.Color; outOfGamutColor: Gegl.Color; rgb_profile: ConfigPath; rgbProfile: ConfigPath; show_hsv: boolean; showHsv: boolean; show_rgb_u8: boolean; showRgbU8: boolean; simulation_gamut_check: boolean; simulationGamutCheck: boolean; simulation_optimize: boolean; simulationOptimize: boolean; simulation_profile: ConfigPath; simulationProfile: ConfigPath; simulation_rendering_intent: ColorRenderingIntent; simulationRenderingIntent: ColorRenderingIntent; simulation_use_black_point_compensation: boolean; simulationUseBlackPointCompensation: boolean; } } /** * Color management settings. */ class ColorConfig extends GObject.Object implements ConfigInterface { static $gtype: GObject.GType; // Properties get cmyk_profile(): ConfigPath; set cmyk_profile(val: ConfigPath); get cmykProfile(): ConfigPath; set cmykProfile(val: ConfigPath); get display_optimize(): boolean; set display_optimize(val: boolean); get displayOptimize(): boolean; set displayOptimize(val: boolean); get display_profile(): ConfigPath; set display_profile(val: ConfigPath); get displayProfile(): ConfigPath; set displayProfile(val: ConfigPath); get display_profile_from_gdk(): boolean; set display_profile_from_gdk(val: boolean); get displayProfileFromGdk(): boolean; set displayProfileFromGdk(val: boolean); get display_rendering_intent(): ColorRenderingIntent; set display_rendering_intent(val: ColorRenderingIntent); get displayRenderingIntent(): ColorRenderingIntent; set displayRenderingIntent(val: ColorRenderingIntent); get display_use_black_point_compensation(): boolean; set display_use_black_point_compensation(val: boolean); get displayUseBlackPointCompensation(): boolean; set displayUseBlackPointCompensation(val: boolean); get gray_profile(): ConfigPath; set gray_profile(val: ConfigPath); get grayProfile(): ConfigPath; set grayProfile(val: ConfigPath); get mode(): ColorManagementMode; set mode(val: ColorManagementMode); get out_of_gamut_color(): Gegl.Color; set out_of_gamut_color(val: Gegl.Color); get outOfGamutColor(): Gegl.Color; set outOfGamutColor(val: Gegl.Color); get rgb_profile(): ConfigPath; set rgb_profile(val: ConfigPath); get rgbProfile(): ConfigPath; set rgbProfile(val: ConfigPath); get show_hsv(): boolean; set show_hsv(val: boolean); get showHsv(): boolean; set showHsv(val: boolean); get show_rgb_u8(): boolean; set show_rgb_u8(val: boolean); get showRgbU8(): boolean; set showRgbU8(val: boolean); get simulation_gamut_check(): boolean; set simulation_gamut_check(val: boolean); get simulationGamutCheck(): boolean; set simulationGamutCheck(val: boolean); get simulation_optimize(): boolean; set simulation_optimize(val: boolean); get simulationOptimize(): boolean; set simulationOptimize(val: boolean); get simulation_profile(): ConfigPath; set simulation_profile(val: ConfigPath); get simulationProfile(): ConfigPath; set simulationProfile(val: ConfigPath); get simulation_rendering_intent(): ColorRenderingIntent; set simulation_rendering_intent(val: ColorRenderingIntent); get simulationRenderingIntent(): ColorRenderingIntent; set simulationRenderingIntent(val: ColorRenderingIntent); get simulation_use_black_point_compensation(): boolean; set simulation_use_black_point_compensation(val: boolean); get simulationUseBlackPointCompensation(): boolean; set simulationUseBlackPointCompensation(val: boolean); // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Methods get_cmyk_color_profile(): ColorProfile; get_display_bpc(): boolean; get_display_color_profile(): ColorProfile; get_display_intent(): ColorRenderingIntent; get_display_optimize(): boolean; get_display_profile_from_gdk(): boolean; get_gray_color_profile(): ColorProfile; get_mode(): ColorManagementMode; get_out_of_gamut_color(): Gegl.Color; get_rgb_color_profile(): ColorProfile; get_simulation_bpc(): boolean; get_simulation_color_profile(): ColorProfile; get_simulation_gamut_check(): boolean; get_simulation_intent(): ColorRenderingIntent; get_simulation_optimize(): boolean; // 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 ColorProfile { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } /** * Definitions and Functions relating to LCMS. */ class ColorProfile extends GObject.Object { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static new_d50_gray_lab_trc(): ColorProfile; static new_d65_gray_linear(): ColorProfile; static new_d65_gray_srgb_trc(): ColorProfile; static new_from_file(file: Gio.File): ColorProfile; static new_from_icc_profile(data: Uint8Array | string): ColorProfile; static new_from_lcms_profile(lcms_profile?: any | null): ColorProfile; static new_rgb_adobe(): ColorProfile; static new_rgb_srgb(): ColorProfile; static new_rgb_srgb_linear(): ColorProfile; // Static methods /** * This function takes a #Babl format and returns the lcms format to * be used with that `format`. It also returns a #Babl format to be * used instead of the passed `format,` which usually is the same as * `format,` unless lcms doesn't support `format`. * * Note that this function currently only supports RGB, RGBA, R'G'B', * R'G'B'A, Y, YA, Y', Y'A and the cairo-RGB24 and cairo-ARGB32 formats. * @param format a #Babl format */ static get_lcms_format(format: Babl.Object): [Babl.Object | null, number]; // Methods get_copyright(): string; get_description(): string; /** * This function takes a #GimpColorProfile and a #Babl format and * returns a new #Babl format with `profile'`s RGB primaries and TRC, * and `format'`s pixel layout. * @param format a #Babl format * @param intent a #GimpColorRenderingIntent * @returns the new #Babl format. */ get_format(format: Babl.Object, intent: ColorRenderingIntent | null): Babl.Object; /** * This function returns `profile` as ICC profile data. The returned * memory belongs to `profile` and must not be modified or freed. * @returns a pointer to the IIC profile data. */ get_icc_profile(): Uint8Array; /** * This function returns a string containing `profile'`s "title", a * string that can be used to label the profile in a user interface. * * Unlike gimp_color_profile_get_description(), this function always * returns a string (as a fallback, it returns "(unnamed profile)"). * @returns the @profile's label. The returned value belongs to @profile and must not be modified or freed. */ get_label(): string; /** * This function returns `profile'`s cmsHPROFILE. The returned * value belongs to `profile` and must not be modified or freed. * @returns a pointer to the cmsHPROFILE. */ get_lcms_profile(): any | null; get_manufacturer(): string; get_model(): string; /** * This function returns the #Babl space of `profile,` for the * specified `intent`. * @param intent a #GimpColorRenderingIntent * @returns the new #Babl space. */ get_space(intent: ColorRenderingIntent | null): Babl.Object; /** * This function return a string containing a multi-line summary of * `profile'`s description, model, manufacturer and copyright, to be * used as detailed information about the profile in a user * interface. * @returns the @profile's summary. The returned value belongs to @profile and must not be modified or freed. */ get_summary(): string; is_cmyk(): boolean; /** * Compares two profiles. * @param profile2 a #GimpColorProfile * @returns %TRUE if the profiles are equal, %FALSE otherwise. */ is_equal(profile2: ColorProfile): boolean; is_gray(): boolean; /** * This function determines is the ICC profile represented by a GimpColorProfile * is a linear RGB profile or not, some profiles that are LUTs though linear * will also return FALSE; * @returns %TRUE if the profile is a matrix shaping profile with linear TRCs, %FALSE otherwise. */ is_linear(): boolean; is_rgb(): boolean; /** * This function creates a new RGB #GimpColorProfile with a linear TRC * and `profile'`s RGB chromacities and whitepoint. * @returns the new #GimpColorProfile, or %NULL if @profile is not an RGB profile or not matrix-based. */ new_linear_from_color_profile(): ColorProfile | null; /** * This function creates a new RGB #GimpColorProfile with a sRGB gamma * TRC and `profile'`s RGB chromacities and whitepoint. * @returns the new #GimpColorProfile, or %NULL if @profile is not an RGB profile or not matrix-based. */ new_srgb_trc_from_color_profile(): ColorProfile | null; /** * This function saves `profile` to `file` as ICC profile. * @param file a #GFile * @returns %TRUE on success, %FALSE if an error occurred. */ save_to_file(file: Gio.File): boolean; } namespace ColorTransform { // Signal callback interfaces interface Progress { (object: number): void; } // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } /** * Definitions and Functions relating to LCMS. */ class ColorTransform extends GObject.Object { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( src_profile: ColorProfile, src_format: Babl.Object, dest_profile: ColorProfile, dest_format: Babl.Object, rendering_intent: ColorRenderingIntent, flags: ColorTransformFlags, ): ColorTransform; static new_proofing( src_profile: ColorProfile, src_format: Babl.Object, dest_profile: ColorProfile, dest_format: Babl.Object, proof_profile: ColorProfile, proof_intent: ColorRenderingIntent, display_intent: ColorRenderingIntent, flags: ColorTransformFlags, ): ColorTransform; // 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: 'progress', callback: (_source: this, object: number) => void): number; connect_after(signal: 'progress', callback: (_source: this, object: number) => void): number; emit(signal: 'progress', object: number): void; // Static methods /** * This function checks if a GimpColorTransform is needed at all. * @param src_profile source #GimpColorProfile * @param dest_profile destination #GimpColorProfile */ static can_gegl_copy(src_profile: ColorProfile, dest_profile: ColorProfile): boolean; // Methods /** * This function transforms buffer into another buffer. * * See gimp_color_transform_new(): only the pixel encoding of * `src_buffer'`s and `dest_buffer'`s formats honored, their color * spaces are ignored. The transform always takes place between the * color spaces determined by `transform'`s color profiles. * @param src_buffer source #GeglBuffer * @param src_rect rectangle in @src_buffer * @param dest_buffer destination #GeglBuffer * @param dest_rect rectangle in @dest_buffer */ process_buffer( src_buffer: Gegl.Buffer, src_rect: Gegl.Rectangle, dest_buffer: Gegl.Buffer, dest_rect: Gegl.Rectangle, ): void; /** * This function transforms a contiguous line of pixels. * * See gimp_color_transform_new(): only the pixel encoding of * `src_format` and `dest_format` is honored, their color spaces are * ignored. The transform always takes place between the color spaces * determined by `transform'`s color profiles. * @param src_format #Babl format of @src_pixels * @param src_pixels pointer to the source pixels * @param dest_format #Babl format of @dest_pixels * @param dest_pixels pointer to the destination pixels * @param length number of pixels to process */ process_pixels( src_format: Babl.Object, src_pixels: any | null, dest_format: Babl.Object, dest_pixels: any | null, length: number, ): void; } class ConfigPath { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; // Static methods /** * Paths as stored in gimprc and other config files have to be treated * special. The string may contain special identifiers such as for * example ${gimp_dir} that have to be substituted before use. Also * the user's filesystem may be in a different encoding than UTF-8 * (which is what is used for the gimprc). This function does the * variable substitution for you and can also attempt to convert to * the filesystem encoding. * * To reverse the expansion, use gimp_config_path_unexpand(). * @param path a NUL-terminated string in UTF-8 encoding * @param recode whether to convert to the filesystem's encoding */ static expand(path: string, recode: boolean): string; /** * Paths as stored in the gimprc have to be treated special. The * string may contain special identifiers such as for example * ${gimp_dir} that have to be substituted before use. Also the user's * filesystem may be in a different encoding than UTF-8 (which is what * is used for the gimprc). * * This function runs `path` through gimp_config_path_expand() and * gimp_path_parse(), then turns the filenames returned by * gimp_path_parse() into GFile using g_file_new_for_path(). * @param path a NUL-terminated string in UTF-8 encoding */ static expand_to_files(path: string): Gio.File[]; /** * The inverse operation of gimp_config_path_expand() * * This function takes a `path` and tries to substitute the first * elements by well-known special identifiers such as for example * ${gimp_dir}. The unexpanded path can then be stored in gimprc and * other config files. * * If `recode` is %TRUE then `path` is in local filesystem encoding, * if `recode` is %FALSE then `path` is assumed to be UTF-8. * @param path a NUL-terminated string * @param recode whether @path is in filesystem encoding or UTF-8 */ static unexpand(path: string, recode: boolean): string; } namespace Display { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { id: number; } } /** * Functions to create, delete and flush displays (views) on an image. */ class Display extends GObject.Object { static $gtype: GObject.GType; // Properties get id(): number; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](image: Image): Display; // Static methods /** * Returns a #GimpDisplay representing `display_id`. * * Note: in most use cases, you should not need to retrieve a * #GimpDisplay by its ID, which is mostly internal data and not * reusable across sessions. Use the appropriate functions for your use * case instead. * @param display_id The display id. */ static get_by_id(display_id: number): Display | null; /** * Returns TRUE if the display ID is valid. * * This procedure checks if the given display ID is valid and refers to * an existing display. * * *Note*: in most use cases, you should not use this function. If you * got a [class`Gimp`.Display] from the API, you should trust it is * valid. This function is mostly for internal usage. * @param display_id The display ID to check. */ static id_is_valid(display_id: number): boolean; /** * Returns the display to be used for plug-in windows. * * This is a constant value given at plug-in configuration time. * Will return %NULL if GIMP has been started with no GUI, either * via "--no-interface" flag, or a console build. */ static name(): string; // Methods /** * Delete the specified display. * * This procedure removes the specified display. If this is the last * remaining display for the underlying image, then the image is * deleted also. Note that the display is closed no matter if the image * is dirty or not. Better save the image before calling this * procedure. * @returns TRUE on success. */ ['delete'](): boolean; /** * Note: in most use cases, you should not need a display's ID which is * mostly internal data and not reusable across sessions. * @returns the display ID. */ get_id(): number; /** * Get a handle to the native window for an image display. * * This procedure returns a handle to the native window for a given * image display. * It can be different types of data depending on the platform you are * running on. For example in the X backend of GDK, a native window * handle is an Xlib XID whereas on Wayland, it is a string handle. A * value of NULL is returned for an invalid display or if this function * is unimplemented for the windowing system that is being used. * @returns The native window handle or NULL. */ get_window_handle(): GLib.Bytes; /** * Returns TRUE if the display is valid. * * This procedure checks if the given display is valid and refers to * an existing display. * @returns Whether the display is valid. */ is_valid(): boolean; /** * Present the specified display. * * This procedure presents the specified display at the top of the * display stack. * @returns TRUE on success. */ present(): boolean; } namespace Drawable { // Constructor properties interface interface ConstructorProps extends Item.ConstructorProps {} } /** * Functions to manipulate drawables. */ abstract class Drawable extends Item { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Returns a #GimpDrawable representing `drawable_id`. This function * calls gimp_item_get_by_id() and returns the item if it is drawable * or %NULL otherwise. * @param drawable_id The drawable id. */ static get_by_id(drawable_id: number): Drawable | null; // Methods /** * This procedure appends the specified drawable effect at the top of the * effect list of `drawable`. * * The `drawable` argument must be the same as the one used when you * created the effect with [ctor`Gimp`.DrawableFilter.new]. * Some effects may be slower than others to render. In order to * minimize processing time, it is preferred to customize the * operation's arguments as received with * [method`Gimp`.DrawableFilter.get_config] before adding the effect. * @param filter The drawable filter to append. */ append_filter(filter: DrawableFilter): void; /** * Modify brightness/contrast in the specified drawable. * * This procedures allows the brightness and contrast of the specified * drawable to be modified. Both 'brightness' and 'contrast' parameters * are defined between -1.0 and 1.0. * @param brightness Brightness adjustment. * @param contrast Contrast adjustment. * @returns TRUE on success. */ brightness_contrast(brightness: number, contrast: number): boolean; /** * Modify the color balance of the specified drawable. * * Modify the color balance of the specified drawable. There are three * axis which can be modified: cyan-red, magenta-green, and * yellow-blue. Negative values increase the amount of the former, * positive values increase the amount of the latter. Color balance can * be controlled with the 'transfer_mode' setting, which allows * shadows, mid-tones, and highlights in an image to be affected * differently. The 'preserve-lum' parameter, if TRUE, ensures that the * luminosity of each pixel remains fixed. * @param transfer_mode Transfer mode. * @param preserve_lum Preserve luminosity values at each pixel. * @param cyan_red Cyan-Red color balance. * @param magenta_green Magenta-Green color balance. * @param yellow_blue Yellow-Blue color balance. * @returns TRUE on success. */ color_balance( transfer_mode: TransferMode | null, preserve_lum: boolean, cyan_red: number, magenta_green: number, yellow_blue: number, ): boolean; /** * Render the drawable as a grayscale image seen through a colored * glass. * * Desaturates the drawable, then tints it with the specified color. * This tool is only valid on RGB color images. It will not operate on * grayscale drawables. * @param hue Hue in degrees. * @param saturation Saturation in percent. * @param lightness Lightness in percent. * @returns TRUE on success. */ colorize_hsl(hue: number, saturation: number, lightness: number): boolean; /** * Modifies the intensity curve(s) for specified drawable. * * Modifies the intensity mapping for one channel in the specified * drawable. The channel can be either an intensity component, or the * value. The 'values' parameter is an array of doubles which * explicitly defines how each pixel value in the drawable will be * modified. Use the gimp_drawable_curves_spline() function to modify * intensity levels with Catmull Rom splines. * @param channel The channel to modify. * @param values The explicit curve. * @returns TRUE on success. */ curves_explicit(channel: HistogramChannel | null, values: number[]): boolean; /** * Modifies the intensity curve(s) for specified drawable. * * Modifies the intensity mapping for one channel in the specified * drawable. The channel can be either an intensity component, or the * value. The 'points' parameter is an array of doubles which define a * set of control points which describe a Catmull Rom spline which * yields the final intensity curve. Use the * gimp_drawable_curves_explicit() function to explicitly modify * intensity levels. * @param channel The channel to modify. * @param points The spline control points: { cp1.x, cp1.y, cp2.x, cp2.y, ... }. * @returns TRUE on success. */ curves_spline(channel: HistogramChannel | null, points: number[]): boolean; /** * Desaturate the contents of the specified drawable, with the * specified formula. * * This procedure desaturates the contents of the specified drawable, * with the specified formula. This procedure only works on drawables * of type RGB color. * @param desaturate_mode The formula to use to desaturate. * @returns TRUE on success. */ desaturate(desaturate_mode: DesaturateMode | null): boolean; /** * Fill the area by a seed fill starting at the specified coordinates. * * This procedure does a seed fill at the specified coordinates, using * various parameters from the current context. * In the case of merged sampling, the x and y coordinates are relative * to the image's origin; otherwise, they are relative to the * drawable's origin. * * This procedure is affected by the following context setters: * gimp_context_set_opacity(), gimp_context_set_paint_mode(), * gimp_context_set_foreground(), gimp_context_set_background(), * gimp_context_set_pattern(), gimp_context_set_sample_threshold(), * gimp_context_set_sample_merged(), * gimp_context_set_sample_criterion(), * gimp_context_set_diagonal_neighbors(), gimp_context_set_antialias(). * @param fill_type The type of fill. * @param x The x coordinate of this bucket fill's application. * @param y The y coordinate of this bucket fill's application. * @returns TRUE on success. */ edit_bucket_fill(fill_type: FillType | null, x: number, y: number): boolean; /** * Clear selected area of drawable. * * This procedure clears the specified drawable. If the drawable has an * alpha channel, the cleared pixels will become transparent. If the * drawable does not have an alpha channel, cleared pixels will be set * to the background color. This procedure only affects regions within * a selection if there is a selection active. * * This procedure is affected by the following context setters: * gimp_context_set_background(). * @returns TRUE on success. */ edit_clear(): boolean; /** * Fill selected area of drawable. * * This procedure fills the specified drawable according to fill mode. * This procedure only affects regions within a selection if there is a * selection active. If you want to fill the whole drawable, regardless * of the selection, use gimp_drawable_fill(). * * This procedure is affected by the following context setters: * gimp_context_set_opacity(), gimp_context_set_paint_mode(), * gimp_context_set_foreground(), gimp_context_set_background(), * gimp_context_set_pattern(). * @param fill_type The type of fill. * @returns TRUE on success. */ edit_fill(fill_type: FillType | null): boolean; /** * Draw a gradient between the starting and ending coordinates with the * specified gradient type. * * This tool requires information on the gradient type. It creates the * specified variety of gradient using the starting and ending * coordinates as defined for each gradient type. For shapeburst * gradient types, the context's distance metric is also relevant and * can be updated with gimp_context_set_distance_metric(). * * This procedure is affected by the following context setters: * gimp_context_set_opacity(), gimp_context_set_paint_mode(), * gimp_context_set_foreground(), gimp_context_set_background(), * gimp_context_set_gradient() and all gradient property settings, * gimp_context_set_distance_metric(). * @param gradient_type The type of gradient. * @param offset Offset relates to the starting and ending coordinates specified for the blend. This parameter is mode dependent. * @param supersample Do adaptive supersampling. * @param supersample_max_depth Maximum recursion levels for supersampling. * @param supersample_threshold Supersampling threshold. * @param dither Use dithering to reduce banding. * @param x1 The x coordinate of this gradient's starting point. * @param y1 The y coordinate of this gradient's starting point. * @param x2 The x coordinate of this gradient's ending point. * @param y2 The y coordinate of this gradient's ending point. * @returns TRUE on success. */ edit_gradient_fill( gradient_type: GradientType | null, offset: number, supersample: boolean, supersample_max_depth: number, supersample_threshold: number, dither: boolean, x1: number, y1: number, x2: number, y2: number, ): boolean; /** * Stroke the specified item * * This procedure strokes the specified item, painting along its * outline (e.g. along a path, or along a channel's boundary), with the * active paint method and brush, or using a plain line with * configurable properties. * * This procedure is affected by the following context setters: * gimp_context_set_opacity(), gimp_context_set_paint_mode(), * gimp_context_set_paint_method(), gimp_context_set_stroke_method(), * gimp_context_set_foreground(), gimp_context_set_brush() and all * brush property settings, gimp_context_set_gradient() and all * gradient property settings, gimp_context_set_line_width() and all * line property settings, gimp_context_set_antialias(). * @param item The item to stroke. * @returns TRUE on success. */ edit_stroke_item(item: Item): boolean; /** * Stroke the current selection * * This procedure strokes the current selection, painting along the * selection boundary with the active paint method and brush, or using * a plain line with configurable properties. The paint is applied to * the specified drawable regardless of the active selection. * * This procedure is affected by the following context setters: * gimp_context_set_opacity(), gimp_context_set_paint_mode(), * gimp_context_set_paint_method(), gimp_context_set_stroke_method(), * gimp_context_set_foreground(), gimp_context_set_brush() and all * brush property settings, gimp_context_set_gradient() and all * gradient property settings, gimp_context_set_line_width() and all * line property settings, gimp_context_set_antialias(). * @returns TRUE on success. */ edit_stroke_selection(): boolean; /** * Equalize the contents of the specified drawable. * * This procedure equalizes the contents of the specified drawable. * Each intensity channel is equalized independently. The equalized * intensity is given as inten' = (255 - inten). The 'mask_only' option * specifies whether to adjust only the area of the image within the * selection bounds, or the entire image based on the histogram of the * selected area. If there is no selection, the entire image is * adjusted based on the histogram for the entire image. * @param mask_only Equalization option. * @returns TRUE on success. */ equalize(mask_only: boolean): boolean; /** * Extract a color model component. * * Extract a color model component. * @param component Component (RGB Red (0), RGB Green (1), RGB Blue (2), Hue (3), HSV Saturation (4), HSV Value (5), HSL Saturation (6), HSL Lightness (7), CMYK Cyan (8), CMYK Magenta (9), CMYK Yellow (10), CMYK Key (11), Y'CbCr Y' (12), Y'CbCr Cb (13), Y'CbCr Cr (14), LAB L (15), LAB A (16), LAB B (17), LCH C(ab) (18), LCH H(ab) (19), Alpha (20)). * @param invert Invert the extracted component. * @param linear Use linear output instead of gamma corrected. * @returns TRUE on success. */ extract_component(component: number, invert: boolean, linear: boolean): boolean; /** * Fill the drawable with the specified fill mode. * * This procedure fills the drawable. If the fill mode is foreground * the current foreground color is used. If the fill mode is * background, the current background color is used. If the fill type * is white, then white is used. Transparent fill only affects layers * with an alpha channel, in which case the alpha channel is set to * transparent. If the drawable has no alpha channel, it is filled to * white. No fill leaves the drawable's contents undefined. * This procedure is unlike gimp_drawable_edit_fill() or the bucket * fill tool because it fills regardless of a selection. Its main * purpose is to fill a newly created drawable before adding it to the * image. This operation cannot be undone. * @param fill_type The type of fill. * @returns TRUE on success. */ fill(fill_type: FillType | null): boolean; /** * Extract the foreground of a drawable using a given trimap. * * Image Segmentation by Uniform Color Clustering, see * https://www.inf.fu-berlin.de/inst/pubs/tr-b-05-07.pdf * @param mode The algorithm to use. * @param mask Tri-Map. * @returns TRUE on success. */ foreground_extract(mode: ForegroundExtractMode | null, mask: Drawable): boolean; /** * Free the specified drawable's shadow data (if it exists). * * This procedure is intended as a memory saving device. If any shadow * memory has been allocated, it will be freed automatically when the * drawable is removed from the image, or when the plug-in procedure * which allocated it returns. * @returns TRUE on success. */ free_shadow(): boolean; /** * Returns the bytes per pixel. * * This procedure returns the number of bytes per pixel. * @returns Bytes per pixel. */ get_bpp(): number; /** * Returns a #GeglBuffer of a specified drawable. The buffer can be used * like any other GEGL buffer. Its data will we synced back with the core * drawable when the buffer gets destroyed, or when gegl_buffer_flush() * is called. * @returns The #GeglBuffer. See Also: gimp_drawable_get_shadow_buffer() */ get_buffer(): Gegl.Buffer; /** * Returns the list of filters applied to the drawable. * * This procedure returns the list of filters which are currently * applied non-destructively to `drawable`. The order of filters is from * topmost to bottommost. * @returns The list of filters on the drawable. The returned value must be freed with g_free(). */ get_filters(): DrawableFilter[]; /** * Returns the #Babl format of the drawable. * @returns The #Babl format. */ get_format(): Babl.Object; /** * Returns the height of the drawable. * * This procedure returns the specified drawable's height in pixels. * @returns Height of drawable. */ get_height(): number; /** * Returns the offsets for the drawable. * * This procedure returns the specified drawable's offsets. This only * makes sense if the drawable is a layer since channels are anchored. * The offsets of a channel will be returned as 0. * @returns TRUE on success. */ get_offsets(): [boolean, number, number]; /** * Gets the value of the pixel at the specified coordinates. * * This procedure gets the pixel value at the specified coordinates. * @param x_coord The x coordinate. * @param y_coord The y coordinate. * @returns The pixel color. */ get_pixel(x_coord: number, y_coord: number): Gegl.Color; /** * Returns a #GeglBuffer of a specified drawable's shadow tiles. The * buffer can be used like any other GEGL buffer. Its data will we * synced back with the core drawable's shadow tiles when the buffer * gets destroyed, or when gegl_buffer_flush() is called. * @returns The #GeglBuffer. */ get_shadow_buffer(): Gegl.Buffer; /** * Retrieves a thumbnail pixbuf for the drawable identified by * `drawable`. The thumbnail will be not larger than the requested * size. * @param src_x the x coordinate of the area * @param src_y the y coordinate of the area * @param src_width the width of the area * @param src_height the height of the area * @param dest_width the requested thumbnail width (<= 1024 pixels) * @param dest_height the requested thumbnail height (<= 1024 pixels) * @param alpha how to handle an alpha channel * @returns a new #GdkPixbuf */ get_sub_thumbnail( src_x: number, src_y: number, src_width: number, src_height: number, dest_width: number, dest_height: number, alpha: PixbufTransparency | null, ): GdkPixbuf.Pixbuf; /** * Retrieves thumbnail data for the drawable identified by `drawable`. * The thumbnail will be not larger than the requested size. * @param src_x the x coordinate of the area * @param src_y the y coordinate of the area * @param src_width the width of the area * @param src_height the height of the area * @param dest_width the requested thumbnail width (<= 1024 pixels) * @param dest_height the requested thumbnail height (<= 1024 pixels) * @returns thumbnail data or %NULL if @drawable is invalid. */ get_sub_thumbnail_data( src_x: number, src_y: number, src_width: number, src_height: number, dest_width: number, dest_height: number, ): [GLib.Bytes, number, number, number]; /** * Retrieves a thumbnail pixbuf for the drawable identified by * `drawable`. The thumbnail will be not larger than the requested * size. * @param width the requested thumbnail width (<= 1024 pixels) * @param height the requested thumbnail height (<= 1024 pixels) * @param alpha how to handle an alpha channel * @returns a new #GdkPixbuf */ get_thumbnail(width: number, height: number, alpha: PixbufTransparency | null): GdkPixbuf.Pixbuf; /** * Retrieves thumbnail data for the drawable identified by `drawable`. * The thumbnail will be not larger than the requested size. * @param width the requested thumbnail width (<= 1024 pixels) * @param height the requested thumbnail height (<= 1024 pixels) * @returns thumbnail data or %NULL if @drawable is invalid. */ get_thumbnail_data(width: number, height: number): [GLib.Bytes | null, number, number, number]; /** * Returns the #Babl thumbnail format of the drawable. * @returns The #Babl thumbnail format. */ get_thumbnail_format(): Babl.Object; /** * Returns the width of the drawable. * * This procedure returns the specified drawable's width in pixels. * @returns Width of drawable. */ get_width(): number; /** * Returns TRUE if the drawable has an alpha channel. * * This procedure returns whether the specified drawable has an alpha * channel. This can only be true for layers, and the associated type * will be one of: { RGBA , GRAYA, INDEXEDA }. * @returns Does the drawable have an alpha channel? */ has_alpha(): boolean; /** * Returns information on the intensity histogram for the specified * drawable. * * This tool makes it possible to gather information about the * intensity histogram of a drawable. A channel to examine is first * specified. This can be either value, red, green, or blue, depending * on whether the drawable is of type color or grayscale. Second, a * range of intensities are specified. The gimp_drawable_histogram() * function returns statistics based on the pixels in the drawable that * fall under this range of values. Mean, standard deviation, median, * number of pixels, and percentile are all returned. Additionally, the * total count of pixels in the image is returned. Counts of pixels are * weighted by any associated alpha values and by the current selection * mask. That is, pixels that lie outside an active selection mask will * not be counted. Similarly, pixels with transparent alpha values will * not be counted. The returned mean, std_dev and median are in the * range (0..255) for 8-bit images or if the plug-in is not * precision-aware, and in the range (0.0..1.0) otherwise. * @param channel The channel to query. * @param start_range Start of the intensity measurement range. * @param end_range End of the intensity measurement range. * @returns TRUE on success. */ histogram( channel: HistogramChannel | null, start_range: number, end_range: number, ): [boolean, number, number, number, number, number, number]; /** * Modify hue, lightness, and saturation in the specified drawable. * * This procedure allows the hue, lightness, and saturation in the * specified drawable to be modified. The 'hue-range' parameter * provides the capability to limit range of affected hues. The * 'overlap' parameter provides blending into neighboring hue channels * when rendering. * @param hue_range Range of affected hues. * @param hue_offset Hue offset in degrees. * @param lightness Lightness modification. * @param saturation Saturation modification. * @param overlap Overlap other hue channels. * @returns TRUE on success. */ hue_saturation( hue_range: HueRange | null, hue_offset: number, lightness: number, saturation: number, overlap: number, ): boolean; /** * Invert the contents of the specified drawable. * * This procedure inverts the contents of the specified drawable. Each * intensity channel is inverted independently. The inverted intensity * is given as inten' = (255 - inten). If 'linear' is TRUE, the * drawable is inverted in linear space. * @param linear Whether to invert in linear space. * @returns TRUE on success. */ invert(linear: boolean): boolean; /** * Returns whether the drawable is a grayscale type. * * This procedure returns TRUE if the specified drawable is of type { * Gray, GrayA }. * @returns TRUE if the drawable is a grayscale type. */ is_gray(): boolean; /** * Returns whether the drawable is an indexed type. * * This procedure returns TRUE if the specified drawable is of type { * Indexed, IndexedA }. * @returns TRUE if the drawable is an indexed type. */ is_indexed(): boolean; /** * Returns whether the drawable is an RGB type. * * This procedure returns TRUE if the specified drawable is of type { * RGB, RGBA }. * @returns TRUE if the drawable is an RGB type. */ is_rgb(): boolean; /** * Modifies intensity levels in the specified drawable. * * This tool allows intensity levels in the specified drawable to be * remapped according to a set of parameters. The low/high input levels * specify an initial mapping from the source intensities. The gamma * value determines how intensities between the low and high input * intensities are interpolated. A gamma value of 1.0 results in a * linear interpolation. Higher gamma values result in more high-level * intensities. Lower gamma values result in more low-level * intensities. The low/high output levels constrain the final * intensity mapping--that is, no final intensity will be lower than * the low output level and no final intensity will be higher than the * high output level. This tool is only valid on RGB color and * grayscale images. * @param channel The channel to modify. * @param low_input Intensity of lowest input. * @param high_input Intensity of highest input. * @param clamp_input Clamp input values before applying output levels. * @param gamma Gamma adjustment factor. * @param low_output Intensity of lowest output. * @param high_output Intensity of highest output. * @param clamp_output Clamp final output values. * @returns TRUE on success. */ levels( channel: HistogramChannel | null, low_input: number, high_input: number, clamp_input: boolean, gamma: number, low_output: number, high_output: number, clamp_output: boolean, ): boolean; /** * Automatically modifies intensity levels in the specified drawable. * * This procedure allows intensity levels in the specified drawable to * be remapped according to a set of guessed parameters. It is * equivalent to clicking the \"Auto\" button in the Levels tool. * @returns TRUE on success. */ levels_stretch(): boolean; /** * Find the bounding box of the current selection in relation to the * specified drawable. * * This procedure returns whether there is a selection. If there is * one, the upper left and lower right-hand corners of its bounding box * are returned. These coordinates are specified relative to the * drawable's origin, and bounded by the drawable's extents. Please * note that the pixel specified by the lower right-hand coordinate of * the bounding box is not part of the selection. The selection ends at * the upper left corner of this pixel. This means the width of the * selection can be calculated as (x2 - x1), its height as (y2 - y1). * Note that the returned boolean does NOT correspond with the returned * region being empty or not, it always returns whether the selection * is non_empty. See gimp_drawable_mask_intersect() for a boolean * return value which is more useful in most cases. * @returns TRUE if there is a selection. */ mask_bounds(): [boolean, number, number, number, number]; /** * Find the bounding box of the current selection in relation to the * specified drawable. * * This procedure returns whether there is an intersection between the * drawable and the selection. Unlike gimp_drawable_mask_bounds(), the * intersection's bounds are returned as x, y, width, height. * If there is no selection this function returns TRUE and the returned * bounds are the extents of the whole drawable. * @returns TRUE if the returned area is not empty. */ mask_intersect(): [boolean, number, number, number, number]; /** * This procedure applies the specified drawable effect on `drawable` * and merge it (therefore before any non-destructive effects are * computed). * * The `drawable` argument must be the same as the one used when you * created the effect with [ctor`Gimp`.DrawableFilter.new]. * Once this is run, `filter` is not valid anymore and you should not * try to do anything with it. In particular, you must customize the * operation's arguments as received with * [method`Gimp`.DrawableFilter.get_config] or set the filter's opacity * and blend mode before merging the effect. * @param filter The drawable filter to merge. */ merge_filter(filter: DrawableFilter): void; /** * Merge the layer effect filters to the specified drawable. * * This procedure combines the contents of the drawable's filter stack * (for export) with the specified drawable. * @returns TRUE on success. */ merge_filters(): boolean; /** * Merge the shadow buffer with the specified drawable. * * This procedure combines the contents of the drawable's shadow buffer * (for temporary processing) with the specified drawable. The 'undo' * parameter specifies whether to add an undo step for the operation. * Requesting no undo is useful for such applications as 'auto-apply'. * @param undo Push merge to undo stack? * @returns TRUE on success. */ merge_shadow(undo: boolean): boolean; /** * Offset the drawable by the specified amounts in the X and Y * directions * * This procedure offsets the specified drawable by the amounts * specified by 'offset_x' and 'offset_y'. If 'wrap_around' is set to * TRUE, then portions of the drawable which are offset out of bounds * are wrapped around. Alternatively, the undefined regions of the * drawable can be filled with transparency or the background color, as * specified by the 'fill-type' parameter. * @param wrap_around wrap image around or fill vacated regions. * @param fill_type fill vacated regions of drawable with background or transparent. * @param color fills in the background color when fill_type is set to OFFSET-COLOR. * @param offset_x offset by this amount in X direction. * @param offset_y offset by this amount in Y direction. * @returns TRUE on success. */ offset( wrap_around: boolean, fill_type: OffsetType | null, color: Gegl.Color, offset_x: number, offset_y: number, ): boolean; /** * Posterize the specified drawable. * * This procedures reduces the number of shades allows in each * intensity channel to the specified 'levels' parameter. * @param levels Levels of posterization. * @returns TRUE on success. */ posterize(levels: number): boolean; /** * Sets the value of the pixel at the specified coordinates. * * This procedure sets the pixel value at the specified coordinates. * Note that this function is not undoable, you should use it only on * drawables you just created yourself. * @param x_coord The x coordinate. * @param y_coord The y coordinate. * @param color The pixel color. * @returns TRUE on success. */ set_pixel(x_coord: number, y_coord: number, color: Gegl.Color): boolean; /** * Perform shadows and highlights correction. * * This filter allows adjusting shadows and highlights in the image * separately. The implementation closely follow its counterpart in the * Darktable photography software. * @param shadows Adjust exposure of shadows. * @param highlights Adjust exposure of highlights. * @param whitepoint Shift white point. * @param radius Spatial extent. * @param compress Compress the effect on shadows/highlights and preserve midtones. * @param shadows_ccorrect Adjust saturation of shadows. * @param highlights_ccorrect Adjust saturation of highlights. * @returns TRUE on success. */ shadows_highlights( shadows: number, highlights: number, whitepoint: number, radius: number, compress: number, shadows_ccorrect: number, highlights_ccorrect: number, ): boolean; /** * Threshold the specified drawable. * * This procedures generates a threshold map of the specified drawable. * All pixels between the values of 'low_threshold' and * 'high_threshold', on the scale of 'channel' are replaced with white, * and all other pixels with black. * @param channel The channel to base the threshold on. * @param low_threshold The low threshold value. * @param high_threshold The high threshold value. * @returns TRUE on success. */ threshold(channel: HistogramChannel | null, low_threshold: number, high_threshold: number): boolean; /** * Returns the drawable's type. * * This procedure returns the drawable's type. * @returns The drawable's type. */ type(): ImageType; /** * Returns the drawable's type with alpha. * * This procedure returns the drawable's type as if had an alpha * channel. If the type is currently Gray, for instance, the returned * type would be GrayA. If the drawable already has an alpha channel, * the drawable's type is simply returned. * @returns The drawable's type with alpha. */ type_with_alpha(): ImageType; /** * Update the specified region of the drawable. * * This procedure updates the specified region of the drawable. The (x, * y) coordinate pair is relative to the drawable's origin, not to the * image origin. Therefore, the entire drawable can be updated using * (0, 0, width, height). * @param x x coordinate of upper left corner of update region. * @param y y coordinate of upper left corner of update region. * @param width Width of update region. * @param height Height of update region. * @returns TRUE on success. */ update(x: number, y: number, width: number, height: number): boolean; } namespace DrawableFilter { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { id: number; } } /** * Operations on drawable filters: creation, editing. */ class DrawableFilter extends GObject.Object { static $gtype: GObject.GType; // Properties get id(): number; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](drawable: Drawable, operation_name: string, name?: string | null): DrawableFilter; // Static methods static get_by_id(filter_id: number): DrawableFilter | null; /** * Returns %TRUE if the drawable filter ID is valid. * * This procedure checks if the given drawable filter ID is valid and * refers to an existing filter. * @param filter_id The filter ID to check. */ static id_is_valid(filter_id: number): boolean; // Methods /** * Delete a drawable filter. * * This procedure deletes the specified filter. This must not be done * if the drawable whose this filter was applied to was already deleted * or if the drawable was already removed from the image. * Do not use anymore the `filter` object after having deleted it. * @returns TRUE on success. */ ['delete'](): boolean; /** * Get the blending mode of the specified filter. * * This procedure returns the specified filter's mode. * @returns The effect blending mode. */ get_blend_mode(): LayerMode; /** * Get the #GimpConfig with properties that match `filter'`s arguments. * * The config object will be created at the first call of this method * and its properties will be synced with the settings of this filter as * set in the core application. * * Further changes to the config's properties are not synced back * immediately with the core application. Use * [method`Gimp`.Drawable.update] to trigger an actual update. * @returns The #GimpDrawableFilterConfig. Further calls will return the same object. */ get_config(): DrawableFilterConfig; get_id(): number; /** * Get a drawable filter's name. * * This procedure returns the specified filter's name. * Since it is not possible to set a drawable filter's name yet, this * will be the operation's name. Eventually this filter's name will be * a free form field so do not rely on this information for any * processing. * @returns The filter's name. The returned value must be freed with g_free(). */ get_name(): string; /** * Get the opacity of the specified filter. * * This procedure returns the specified filter's opacity. * @returns The filter's opacity. */ get_opacity(): number; /** * Get a drawable filter's operation name. * * This procedure returns the specified filter's operation name. * @returns The filter's operation name. The returned value must be freed with g_free(). */ get_operation_name(): string; /** * Get the visibility of the specified filter. * * This procedure returns the specified filter's visibility. * @returns The filter visibility. */ get_visible(): boolean; /** * Returns TRUE if the `drawable_filter` is valid. * * This procedure checks if the given filter is valid and refers to an * existing %GimpDrawableFilter. * @returns Whether @drawable_filter is valid. */ is_valid(): boolean; /** * When a filter has one or several auxiliary inputs, you can use this * function to set them. * * The change is not synced immediately with the core application. * Use [method`Gimp`.Drawable.update] to trigger an actual update. * @param input_pad_name name of the filter's input pad. * @param input the drawable to use as auxiliary input. */ set_aux_input(input_pad_name: string, input: Drawable): void; /** * This procedure sets the blend mode of `filter`. * * The change is not synced immediately with the core application. * Use [method`Gimp`.Drawable.update] to trigger an actual update. * @param mode blend mode. */ set_blend_mode(mode: LayerMode | null): void; /** * This procedure sets the opacity of `filter` on a range from 0.0 * (transparent) to 1.0 (opaque). * * The change is not synced immediately with the core application. * Use [method`Gimp`.Drawable.update] to trigger an actual update. * @param opacity the opacity. */ set_opacity(opacity: number): void; /** * Set the visibility of the specified filter. * * This procedure sets the specified filter's visibility. * The drawable won't be immediately rendered. Use * [method`Gimp`.Drawable.update] to trigger an update. * @param visible The new filter visibility. * @returns TRUE on success. */ set_visible(visible: boolean): boolean; /** * Syncs the #GimpConfig with properties that match `filter'`s arguments. * This procedure updates the settings of the specified filter all at * once, including the arguments of the [class`Gimp`.DrawableFilterConfig] * obtained with [method`Gimp`.DrawableFilter.get_config] as well as the * blend mode and opacity. * * In particular, if the image is displayed, rendering will be frozen * and will happen only once for all changed settings. */ update(): void; } namespace DrawableFilterConfig { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } /** * The base class for [class`DrawableFilter]` specific config objects. * * A drawable filter config is created by a [class`DrawableFilter]` using * [method`DrawableFilter`.get_config] and its properties match the * filter's arguments in number, order and type. */ abstract class DrawableFilterConfig extends GObject.Object { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; } namespace ExportOptions { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { capabilities: ExportCapabilities; } } /** * A class holding generic export options. * * Note: right now, GIMP does not provide any generic export option to * manipulate, and there is practically no reason for you to create this * object yourself. In Export PDB procedure, or again in functions such * as [func`Gimp`.file_save], you may just pass %NULL. * * In the future, this object will enable to pass various generic * options, such as ability to crop or resize images at export time. */ class ExportOptions extends GObject.Object { static $gtype: GObject.GType; // Properties /** * What [flags`ExportCapabilities]` are supported. */ get capabilities(): ExportCapabilities; set capabilities(val: ExportCapabilities); // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Methods /** * Takes an image to be exported, possibly creating a temporary copy * modified according to export settings in `options` (such as the * capabilities of the export format). * * If necessary, a copy is created, converted and modified, `image` * changed to point to the new image and the procedure returns * [enum`Gimp`.ExportReturn.EXPORT]. * In this case, you must take care of deleting the created image using * [method`Image`.delete] once the image has been exported, unless you * were planning to display it with [ctor`Display`.new], or you will leak * memory. * * If [enum`Gimp`.ExportReturn.IGNORE] is returned, then `image` is still the * original image. You should neither modify it, nor should you delete * it in the end. If you wish to temporarily modify the image before * export anyway, call [method`Image`.duplicate] when * [enum`Gimp`.ExportReturn.IGNORE] was returned. * @param image the image. * @returns An enum of #GimpExportReturn. */ get_image(image: Image): [ExportReturn, Image]; } namespace ExportProcedure { // Constructor properties interface interface ConstructorProps extends FileProcedure.ConstructorProps { capabilities: ExportCapabilities; supports_comment: boolean; supportsComment: boolean; supports_exif: boolean; supportsExif: boolean; supports_iptc: boolean; supportsIptc: boolean; supports_profile: boolean; supportsProfile: boolean; supports_thumbnail: boolean; supportsThumbnail: boolean; supports_xmp: boolean; supportsXmp: boolean; } } /** * Export procedures implement image export. * * Registered export procedures will be automatically available in the export * interfaces and functions of GIMP. The detection (to decide which file is * redirected to which plug-in procedure) depends on the various methods set * with [class`FileProcedure]` API. */ class ExportProcedure extends FileProcedure { static $gtype: GObject.GType; // Properties /** * What #GimpExportCapabilities are supported */ get capabilities(): ExportCapabilities; set capabilities(val: ExportCapabilities); /** * Whether the export procedure supports storing a comment. */ get supports_comment(): boolean; set supports_comment(val: boolean); /** * Whether the export procedure supports storing a comment. */ get supportsComment(): boolean; set supportsComment(val: boolean); /** * Whether the export procedure supports EXIF. */ get supports_exif(): boolean; set supports_exif(val: boolean); /** * Whether the export procedure supports EXIF. */ get supportsExif(): boolean; set supportsExif(val: boolean); /** * Whether the export procedure supports IPTC. */ get supports_iptc(): boolean; set supports_iptc(val: boolean); /** * Whether the export procedure supports IPTC. */ get supportsIptc(): boolean; set supportsIptc(val: boolean); /** * Whether the export procedure supports ICC color profiles. */ get supports_profile(): boolean; set supports_profile(val: boolean); /** * Whether the export procedure supports ICC color profiles. */ get supportsProfile(): boolean; set supportsProfile(val: boolean); /** * Whether the export procedure supports storing a thumbnail. */ get supports_thumbnail(): boolean; set supports_thumbnail(val: boolean); /** * Whether the export procedure supports storing a thumbnail. */ get supportsThumbnail(): boolean; set supportsThumbnail(val: boolean); /** * Whether the export procedure supports XMP. */ get supports_xmp(): boolean; set supports_xmp(val: boolean); /** * Whether the export procedure supports XMP. */ get supportsXmp(): boolean; set supportsXmp(val: boolean); // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( plug_in: PlugIn, name: string, proc_type: PDBProcType, export_metadata: boolean, run_func: RunExportFunc, run_data_destroy?: GLib.DestroyNotify | null, ): ExportProcedure; // Conflicted with Gimp.Procedure.new static ['new'](...args: never[]): any; // Methods get_support_comment(): boolean; get_support_exif(): boolean; get_support_iptc(): boolean; get_support_profile(): boolean; get_support_thumbnail(): boolean; get_support_xmp(): boolean; /** * Sets default #GimpExportCapabilities for image export. * * `capabilities` and `get_capabilities_func` are overlapping arguments. * Either set `capabilities` if your format capabilities are stable or * `get_capabilities_func` if they depend on other options. * If `get_capabilities_func` is set, `capabilities` must be 0. * * If set, `get_capabilities_func` will be called every time an argument * in the [class`Gimp`.ProcedureConfig] is edited and it will be used to * edit the export capabilities dynamically. * @param capabilities a #GimpExportCapabilities bitfield. * @param get_capabilities_func callback function to update export options * @param get_capabilities_data_destroy free function for @get_capabilities_data, or %NULL */ set_capabilities( capabilities: ExportCapabilities | null, get_capabilities_func?: ExportGetCapabilitiesFunc | null, get_capabilities_data_destroy?: GLib.DestroyNotify | null, ): void; /** * Determine whether `procedure` supports exporting a comment. By default, * it won't (so there is usually no reason to run this function with * %FALSE). * * This will have several consequences: * * - Automatically adds a standard argument "include-comment" in the end * of the argument list of `procedure,` with relevant blurb and * description. * - If used with other gimp_export_procedure_set_support_*() functions, * they will always be ordered the same (the order of the calls don't * matter), keeping all export procedures consistent. * - Generated GimpExportProcedureDialog will contain the metadata * options, once again always in the same order and with consistent * GUI style across plug-ins. * - API from [class`ProcedureConfig]` will automatically process these * properties to decide whether to export a given metadata or not. * * By default, the value will be [func`export_comment]`. * @param supports whether a comment can be stored. */ set_support_comment(supports: boolean): void; /** * Determine whether `procedure` supports exporting Exif data. By default, * it won't (so there is usually no reason to run this function with * %FALSE). * * This will have several consequences: * * - Automatically adds a standard argument "include-exif" in the * end of the argument list of `procedure,` with relevant blurb and * description. * - If used with other gimp_export_procedure_set_support_*() functions, * they will always be ordered the same (the order of the calls don't * matter), keeping all export procedures consistent. * - Generated GimpExportProcedureDialog will contain the metadata * options, once again always in the same order and with consistent * GUI style across plug-ins. * - API from [class`ProcedureConfig]` will automatically process these * properties to decide whether to export a given metadata or not. * * By default, the value will be [func`export_exif]`. * @param supports whether Exif metadata are supported. */ set_support_exif(supports: boolean): void; /** * Determine whether `procedure` supports exporting IPTC data. By default, * it won't (so there is usually no reason to run this function with * %FALSE). * * This will have several consequences: * * - Automatically adds a standard argument "include-iptc" in the * end of the argument list of `procedure,` with relevant blurb and * description. * - If used with other gimp_export_procedure_set_support_*() functions, * they will always be ordered the same (the order of the calls don't * matter), keeping all export procedures consistent. * - Generated GimpExportProcedureDialog will contain the metadata * options, once again always in the same order and with consistent * GUI style across plug-ins. * - API from [class`ProcedureConfig]` will automatically process these * properties to decide whether to export a given metadata or not. * * By default, the value will be [func`export_iptc]`. * @param supports whether IPTC metadata are supported. */ set_support_iptc(supports: boolean): void; /** * Determine whether `procedure` supports exporting ICC color profiles. By * default, it won't (so there is usually no reason to run this function * with %FALSE). * * This will have several consequences: * * - Automatically adds a standard argument "include-color-profile" in * the end of the argument list of `procedure,` with relevant blurb and * description. * - If used with other gimp_export_procedure_set_support_*() functions, * they will always be ordered the same (the order of the calls don't * matter), keeping all export procedures consistent. * - Generated GimpExportProcedureDialog will contain the metadata * options, once again always in the same order and with consistent * GUI style across plug-ins. * - API from [class`ProcedureConfig]` will automatically process these * properties to decide whether to export a given metadata or not. * * By default, the value will be [func`export_color_profile]`. * @param supports whether color profiles can be stored. */ set_support_profile(supports: boolean): void; /** * Determine whether `procedure` supports exporting a thumbnail. By default, * it won't (so there is usually no reason to run this function with * %FALSE). * * This will have several consequences: * * - Automatically adds a standard argument "include-thumbnail" in the * end of the argument list of `procedure,` with relevant blurb * and description. * - If used with other gimp_export_procedure_set_support_*() functions, * they will always be ordered the same (the order of the calls don't * matter), keeping all export procedures consistent. * - Generated GimpExportProcedureDialog will contain the metadata * options, once again always in the same order and with consistent * GUI style across plug-ins. * - API from [class`ProcedureConfig]` will automatically process these * properties to decide whether to export a given metadata or not. * * By default, the value will be [func`export_thumbnail]`. * @param supports whether a thumbnail can be stored. */ set_support_thumbnail(supports: boolean): void; /** * Determine whether `procedure` supports exporting XMP data. By default, * it won't (so there is usually no reason to run this function with * %FALSE). * * This will have several consequences: * * - Automatically adds a standard argument "include-xmp" in the * end of the argument list of `procedure,` with relevant blurb and * description. * - If used with other gimp_export_procedure_set_support_*() functions, * they will always be ordered the same (the order of the calls don't * matter), keeping all export procedures consistent. * - Generated GimpExportProcedureDialog will contain the metadata * options, once again always in the same order and with consistent * GUI style across plug-ins. * - API from [class`ProcedureConfig]` will automatically process these * properties to decide whether to export a given metadata or not. * * By default, the value will be [func`export_xmp]`. * @param supports whether XMP metadata are supported. */ set_support_xmp(supports: boolean): void; } namespace FileProcedure { // Constructor properties interface interface ConstructorProps extends Procedure.ConstructorProps {} } /** * File procedures implement file support. They cannot be created directly. * Instead, you will create an instance of one of the sublasses (such as export * or load procedures). This provides a common interface for file-related * functions on these objects. */ abstract class FileProcedure extends Procedure { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Methods /** * Returns the procedure's extensions as set with * [method`FileProcedure`.set_extensions]. * @returns The procedure's registered extensions. */ get_extensions(): string; /** * Returns the procedure's format name, as set with * [method`FileProcedure`.set_format_name]. * @returns The procedure's format name. */ get_format_name(): string; /** * Returns the procedure's 'handles remote' flags as set with * [method`FileProcedure`.set_handles_remote]. * @returns The procedure's 'handles remote' flag */ get_handles_remote(): boolean; /** * Returns the procedure's magics as set with [method`FileProcedure`.set_magics]. * @returns The procedure's registered magics. */ get_magics(): string; /** * Returns the procedure's mime-type as set with * [method`FileProcedure`.set_mime_types]. * @returns The procedure's registered mime-types. */ get_mime_types(): string; /** * Returns the procedure's prefixes as set with * [method`FileProcedure`.set_prefixes]. * @returns The procedure's registered prefixes. */ get_prefixes(): string; /** * Returns the procedure's priority as set with * [method`FileProcedure`.set_priority]. * @returns The procedure's registered priority. */ get_priority(): number; /** * Registers the given list of extensions as something this procedure can * handle. * @param extensions A comma separated list of extensions this procedure can handle (i.e. "jpg,jpeg"). */ set_extensions(extensions: string): void; /** * Associates a format name with a file handler procedure. * * This name can be used for any public-facing strings, such as * graphical interface labels. An example usage would be * %GimpExportProcedureDialog title looking like "Export Image as %s". * * Note that since the format name is public-facing, it is recommended * to localize it at runtime, for instance through gettext, like: * * ```c * gimp_file_procedure_set_format_name (procedure, _("JPEG")); * ``` * * Some language would indeed localize even some technical terms or * acronyms, even if sometimes just to rewrite them with the local * writing system. * @param format_name A public-facing name for the format, e.g. "PNG". */ set_format_name(format_name: string): void; /** * Registers a file procedure as capable of handling arbitrary remote * URIs via GIO. * * When `handles_remote` is set to %TRUE, the procedure will get a * #GFile passed that can point to a remote file. * * When `handles_remote` is set to %FALSE, the procedure will get a * local [iface`Gio`.File] passed and can use [method`Gio`.File.get_path] to get * to a filename that can be used with whatever non-GIO means of dealing with * the file. * @param handles_remote The procedure's 'handles remote' flag. */ set_handles_remote(handles_remote: boolean): void; /** * Registers the list of magic file information this procedure can handle. * @param magics A comma-separated list of magic file information (i.e. "0,string,GIF"). */ set_magics(magics: string): void; /** * Associates MIME types with a file handler procedure. * * Registers MIME types for a file handler procedure. This allows GIMP * to determine the MIME type of the file opened or saved using this * procedure. It is recommended that only one MIME type is registered * per file procedure; when registering more than one MIME type, GIMP * will associate the first one with files opened or saved with this * procedure. * @param mime_types A comma-separated list of MIME types, such as "image/jpeg". */ set_mime_types(mime_types: string): void; /** * It should almost never be necessary to register prefixes with file * procedures, because most sorts of URIs should be handled by GIO. * @param prefixes A comma separated list of prefixes this procedure can handle (i.e. "http:,ftp:"). */ set_prefixes(prefixes: string): void; /** * Sets the priority of a file handler procedure. * * When more than one procedure matches a given file, the procedure with the * lowest priority is used; if more than one procedure has the lowest priority, * it is unspecified which one of them is used. The default priority for file * handler procedures is 0. * @param priority The procedure's priority. */ set_priority(priority: number): void; } namespace Font { // Constructor properties interface interface ConstructorProps extends Resource.ConstructorProps, ConfigInterface.ConstructorProps {} } /** * Installable object used by text tools. */ class Font extends Resource implements ConfigInterface { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Returns a font with the given name. * * If several fonts are named identically, the one which is returned by * this function should be considered random. This can be used when you * know you won't have multiple fonts of this name or that you don't * want to choose (non-interactive scripts, etc.). * If you need more control, you should use [func`fonts_get_list]` * instead. * Returns %NULL when no font exists of that name. * @param name The name of the font. */ static get_by_name(name: string): Font | null; // Conflicted with Gimp.Resource.get_by_name static get_by_name(...args: never[]): any; // Methods /** * Returns a [struct`Pango`.FontDescription] representing `font`. * @returns a %PangoFontDescription representing @font. */ get_pango_font_description(): Pango.FontDescription; // 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 Gradient { // Constructor properties interface interface ConstructorProps extends Resource.ConstructorProps, ConfigInterface.ConstructorProps {} } /** * Installable object used by the gradient rendering tool. */ class Gradient extends Resource implements ConfigInterface { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](name: string): Gradient; // Static methods /** * Returns the gradient with the given name. * * Returns an existing gradient having the given name. Returns %NULL * when no gradient exists of that name. * @param name The name of the gradient. */ static get_by_name(name: string): Gradient | null; // Conflicted with Gimp.Resource.get_by_name static get_by_name(...args: never[]): any; // Methods /** * Sample the gradient in custom positions. * * Samples the color of the gradient at positions from a list. The left * endpoint of the gradient corresponds to position 0.0, and the right * endpoint corresponds to 1.0. Returns a list of colors, one for each * sample. * @param positions The list of positions to sample along the gradient. * @param reverse Use the reverse gradient. * @returns Color samples. The returned value must be freed with gimp_color_array_free(). */ get_custom_samples(positions: number[], reverse: boolean): Gegl.Color[]; /** * Gets the number of segments of the gradient * * Gets the number of segments of the gradient * @returns Number of segments. */ get_number_of_segments(): number; /** * Sample the gradient in uniform parts. * * Samples colors uniformly across the gradient. It returns a list of * colors for each sample. The minimum number of samples to take is 2, * in which case the returned colors will correspond to the `{ 0.0, 1.0 * }` positions in the gradient. For example, if the number of samples * is 3, the procedure will return the colors at positions `{ 0.0, 0.5, * 1.0 }`. * @param num_samples The number of samples to take. * @param reverse Use the reverse gradient. * @returns Color samples. The returned value must be freed with gimp_color_array_free(). */ get_uniform_samples(num_samples: number, reverse: boolean): Gegl.Color[]; /** * Gets the gradient segment's blending function * * Gets the blending function of the segment at the index. * Returns an error when the segment index is out of range. * @param segment The index of a segment within the gradient. * @returns TRUE on success. */ segment_get_blending_function(segment: number): [boolean, GradientSegmentType]; /** * Gets the gradient segment's coloring type * * Gets the coloring type of the segment at the index. * Returns an error when the segment index is out of range. * @param segment The index of a segment within the gradient. * @returns TRUE on success. */ segment_get_coloring_type(segment: number): [boolean, GradientSegmentColor]; /** * Gets the left endpoint color of the segment * * Gets the left endpoint color of the indexed segment of the gradient. * Returns an error when the segment index is out of range. * @param segment The index of a segment within the gradient. * @returns The return color. */ segment_get_left_color(segment: number): Gegl.Color; /** * Gets the left endpoint position of a segment * * Gets the position of the left endpoint of the segment of the * gradient. * Returns an error when the segment index is out of range. * @param segment The index of a segment within the gradient. * @returns TRUE on success. */ segment_get_left_pos(segment: number): [boolean, number]; /** * Gets the midpoint position of the segment * * Gets the position of the midpoint of the segment of the gradient. * Returns an error when the segment index is out of range. * @param segment The index of a segment within the gradient. * @returns TRUE on success. */ segment_get_middle_pos(segment: number): [boolean, number]; /** * Gets the right endpoint color of the segment * * Gets the color of the right endpoint color of the segment of the * gradient. * Returns an error when the segment index is out of range. * @param segment The index of a segment within the gradient. * @returns The return color. */ segment_get_right_color(segment: number): Gegl.Color; /** * Gets the right endpoint position of the segment * * Gets the position of the right endpoint of the segment of the * gradient. * Returns an error when the segment index is out of range. * @param segment The index of a segment within the gradient. * @returns TRUE on success. */ segment_get_right_pos(segment: number): [boolean, number]; /** * Blend the colors of the segment range. * * Blends the colors (but not the opacity) of the range of segments. * The colors' transition will then be uniform across the range. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @returns TRUE on success. */ segment_range_blend_colors(start_segment: number, end_segment: number): boolean; /** * Blend the opacity of the segment range. * * Blends the opacity (but not the colors) of the range of segments. * The opacity's transition will then be uniform across the range. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @returns TRUE on success. */ segment_range_blend_opacity(start_segment: number, end_segment: number): boolean; /** * Delete the segment range * * Deletes a range of segments. * Returns an error when a segment index is out of range, or gradient * is not editable. Deleting all the segments is undefined behavior. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @returns TRUE on success. */ segment_range_delete(start_segment: number, end_segment: number): boolean; /** * Flip the segment range * * Reverses the order of segments in a range, and swaps the left and * right colors in each segment. As if the range as a 1D line were * rotated in a plane. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @returns TRUE on success. */ segment_range_flip(start_segment: number, end_segment: number): boolean; /** * Move the position of an entire segment range by a delta. * * Moves the position of an entire segment range by a delta. The actual * delta (which is returned) will be limited by the control points of * the neighboring segments. * Returns the actual delta. Returns an error when a segment index is * out of range, or gradient is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @param delta The delta to move the segment range. * @param control_compress Whether or not to compress the neighboring segments. * @returns The final delta by which the range moved. */ segment_range_move( start_segment: number, end_segment: number, delta: number, control_compress: boolean, ): number; /** * Uniformly redistribute the segment range's handles * * Redistributes the handles of the segment range of the gradient, so * they'll be evenly spaced. A handle is where two segments meet. * Segments will then have the same width. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @returns TRUE on success. */ segment_range_redistribute_handles(start_segment: number, end_segment: number): boolean; /** * Replicate the segment range * * Replicates a segment range a given number of times. Instead of the * original segment range, several smaller scaled copies of it will * appear in equal widths. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @param replicate_times The number of replicas for each segment. * @returns TRUE on success. */ segment_range_replicate(start_segment: number, end_segment: number, replicate_times: number): boolean; /** * Sets the blending function of a range of segments * * Sets the blending function of a range of segments. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @param blending_function The blending function. * @returns TRUE on success. */ segment_range_set_blending_function( start_segment: number, end_segment: number, blending_function: GradientSegmentType | null, ): boolean; /** * Sets the coloring type of a range of segments * * Sets the coloring type of a range of segments. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @param coloring_type The coloring type. * @returns TRUE on success. */ segment_range_set_coloring_type( start_segment: number, end_segment: number, coloring_type: GradientSegmentColor | null, ): boolean; /** * Splits each segment in the segment range at midpoint * * Splits each segment in the segment range at its midpoint. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @returns TRUE on success. */ segment_range_split_midpoint(start_segment: number, end_segment: number): boolean; /** * Splits each segment in the segment range uniformly * * Splits each segment in the segment range uniformly into to the * number of parts given. * Returns an error when a segment index is out of range, or gradient * is not editable. * @param start_segment Index of the first segment to operate on. * @param end_segment Index of the last segment to operate on. If negative, the range will extend to the end segment. * @param split_parts The number of uniform divisions to split each segment to. * @returns TRUE on success. */ segment_range_split_uniform(start_segment: number, end_segment: number, split_parts: number): boolean; /** * Sets the left endpoint color of a segment * * Sets the color of the left endpoint the indexed segment of the * gradient. The alpha channel of the [class`Gegl`.Color] is taken into * account. * Returns an error when gradient is not editable or index is out of * range. * @param segment The index of a segment within the gradient. * @param color The color to set. * @returns TRUE on success. */ segment_set_left_color(segment: number, color: Gegl.Color): boolean; /** * Sets the left endpoint position of the segment * * Sets the position of the left endpoint of the segment of the * gradient. The final position will be the given fraction from the * midpoint to the left to the midpoint of the current segment. * Returns the final position. Returns an error when gradient is not * editable or segment index is out of range. * @param segment The index of a segment within the gradient. * @param pos The position to set the guidepoint to. * @returns TRUE on success. */ segment_set_left_pos(segment: number, pos: number): [boolean, number]; /** * Sets the midpoint position of the segment * * Sets the midpoint position of the segment of the gradient. The final * position will be the given fraction between the two endpoints of the * segment. * Returns the final position. Returns an error when gradient is not * editable or segment index is out of range. * @param segment The index of a segment within the gradient. * @param pos The position to set the guidepoint to. * @returns TRUE on success. */ segment_set_middle_pos(segment: number, pos: number): [boolean, number]; /** * Sets the right endpoint color of the segment * * Sets the right endpoint color of the segment of the gradient. The * alpha channel of the [class`Gegl`.Color] is taken into account. * Returns an error when gradient is not editable or segment index is * out of range. * @param segment The index of a segment within the gradient. * @param color The color to set. * @returns TRUE on success. */ segment_set_right_color(segment: number, color: Gegl.Color): boolean; /** * Sets the right endpoint position of the segment * * Sets the right endpoint position of the segment of the gradient. The * final position will be the given fraction from the midpoint of the * current segment to the midpoint of the segment to the right. * Returns the final position. Returns an error when gradient is not * editable or segment index is out of range. * @param segment The index of a segment within the gradient. * @param pos The position to set the right endpoint to. * @returns TRUE on success. */ segment_set_right_pos(segment: number, pos: number): [boolean, 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 GroupLayer { // Constructor properties interface interface ConstructorProps extends Layer.ConstructorProps {} } /** * Operations on a group layer. */ class GroupLayer extends Layer { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](image: Image, name?: string | null): GroupLayer; // Static methods /** * Returns a #GimpGroupLayer representing `layer_id`. This function calls * gimp_item_get_by_id() and returns the item if it is a group layer or * %NULL otherwise. * @param layer_id The layer id. */ static get_by_id(layer_id: number): GroupLayer | null; // Methods /** * Merge the passed group layer's layers into one normal layer. * * This procedure combines the layers of the passed group layer into a * single normal layer, replacing the group. * The group layer is expected to be attached to an image. * @returns The resulting layer. */ merge(): Layer; } namespace Image { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { id: number; } } /** * Operations on complete images: creation, resizing/rescaling, and * operations involving multiple layers. */ class Image extends GObject.Object { static $gtype: GObject.GType; // Properties get id(): number; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](width: number, height: number, type: ImageBaseType): Image; static new_with_precision(width: number, height: number, type: ImageBaseType, precision: Precision): Image; // Static methods /** * Set dither matrix for conversion to indexed * * This procedure sets the dither matrix used when converting images to * INDEXED mode with positional dithering. * @param width Width of the matrix (0 to reset to default matrix). * @param height Height of the matrix (0 to reset to default matrix). * @param matrix The matrix -- all values must be >= 1. */ static convert_set_dither_matrix(width: number, height: number, matrix: GLib.Bytes | Uint8Array): boolean; static get_by_id(image_id: number): Image | null; /** * Returns TRUE if the image ID is valid. * * This procedure checks if the given image ID is valid and refers to * an existing image. * @param image_id The image ID to check. */ static id_is_valid(image_id: number): boolean; /** * Retrieves a thumbnail from metadata if present. * @param file A #GFile image */ static metadata_load_thumbnail(file: Gio.File): Image | null; // Methods /** * Add a horizontal guide to an image. * * This procedure adds a horizontal guide to an image. It takes the * input image and the y-position of the new guide as parameters. It * returns the guide ID of the new guide. * @param yposition The guide's y-offset from top of image. * @returns The new guide. */ add_hguide(yposition: number): number; /** * Add a sample point to an image. * * This procedure adds a sample point to an image. It takes the input * image and the position of the new sample points as parameters. It * returns the sample point ID of the new sample point. * @param position_x The sample point's x-offset from left of image. * @param position_y The sample point's y-offset from top of image. * @returns The new sample point. */ add_sample_point(position_x: number, position_y: number): number; /** * Add a vertical guide to an image. * * This procedure adds a vertical guide to an image. It takes the input * image and the x-position of the new guide as parameters. It returns * the guide ID of the new guide. * @param xposition The guide's x-offset from left of image. * @returns The new guide. */ add_vguide(xposition: number): number; /** * Add a parasite to an image. * * This procedure attaches a parasite to an image. It has no return * values. * @param parasite The parasite to attach to an image. * @returns TRUE on success. */ attach_parasite(parasite: Parasite): boolean; /** * Remove empty borders from the image * * Remove empty borders from the `image` based on empty borders of the * input `drawable`. * * The input drawable serves as a base for detecting cropping extents * (transparency or background color). * With a %NULL input drawable, the image itself will serve as a base * for detecting cropping extents. * @param drawable Input drawable. * @returns TRUE on success. */ autocrop(drawable?: Drawable | null): boolean; /** * Crop the selected layers based on empty borders of the input * drawable * * Crop the selected layers of the input `image` based on empty borders * of the input `drawable`. * The input drawable serves as a base for detecting cropping extents * (transparency or background color), and is not necessarily among the * cropped layers (the current selected layers). * With a %NULL input drawable, the image itself will serve as a base * for detecting cropping extents. * @param drawable Input drawable. * @returns TRUE on success. */ autocrop_selected_layers(drawable?: Drawable | null): boolean; /** * Set the image dirty count to 0. * * This procedure sets the specified image's dirty count to 0, allowing * operations to occur without having a 'dirtied' image. This is * especially useful for creating and loading images which should not * initially be considered dirty, even though layers must be created, * filled, and installed in the image. Note that save plug-ins must NOT * call this function themselves after saving the image. * @returns TRUE on success. */ clean_all(): boolean; /** * Convert the image's layers to a color profile * * This procedure converts from the image's color profile (or the * default profile if none is set) to the given color profile. * * Only RGB and grayscale color profiles are accepted, according to the * image's type. * @param profile The color profile to convert to. * @param intent Rendering intent. * @param bpc Black point compensation. * @returns %TRUE on success. */ convert_color_profile(profile: ColorProfile, intent: ColorRenderingIntent | null, bpc: boolean): boolean; /** * Convert the image's layers to a color profile * * This procedure converts from the image's color profile (or the * default RGB or grayscale profile if none is set) to an ICC profile * specified by 'file'. Only RGB and grayscale color profiles are * accepted, according to the image's type. * @param file The file containing the new color profile. * @param intent Rendering intent. * @param bpc Black point compensation. * @returns TRUE on success. */ convert_color_profile_from_file(file: Gio.File, intent: ColorRenderingIntent | null, bpc: boolean): boolean; /** * Convert specified image to grayscale * * This procedure converts the specified image to grayscale. This * process requires an image in RGB or Indexed color mode. * @returns TRUE on success. */ convert_grayscale(): boolean; /** * Convert specified image to and Indexed image * * This procedure converts the specified image to 'indexed' color. This * process requires an image in RGB or Grayscale mode. The * 'palette_type' specifies what kind of palette to use, A type of '0' * means to use an optimal palette of 'num_cols' generated from the * colors in the image. A type of '1' means to re-use the previous * palette (not currently implemented). A type of '2' means to use the * so-called WWW-optimized palette. Type '3' means to use only black * and white colors. A type of '4' means to use a palette from the gimp * palettes directories. The 'dither type' specifies what kind of * dithering to use. '0' means no dithering, '1' means standard * Floyd-Steinberg error diffusion, '2' means Floyd-Steinberg error * diffusion with reduced bleeding, '3' means dithering based on pixel * location ('Fixed' dithering). * @param dither_type The dither type to use. * @param palette_type The type of palette to use. * @param num_cols The number of colors to quantize to, ignored unless (palette_type == GIMP_CONVERT_PALETTE_GENERATE). * @param alpha_dither Dither transparency to fake partial opacity. * @param remove_unused Remove unused or duplicate color entries from final palette, ignored if (palette_type == GIMP_CONVERT_PALETTE_GENERATE). * @param palette The name of the custom palette to use, ignored unless (palette_type == GIMP_CONVERT_PALETTE_CUSTOM). * @returns TRUE on success. */ convert_indexed( dither_type: ConvertDitherType | null, palette_type: ConvertPaletteType | null, num_cols: number, alpha_dither: boolean, remove_unused: boolean, palette: string, ): boolean; /** * Convert the image to the specified precision * * This procedure converts the image to the specified precision. Note * that indexed images cannot be converted and are always in * GIMP_PRECISION_U8. * @param precision The new precision. * @returns TRUE on success. */ convert_precision(precision: Precision | null): boolean; /** * Convert specified image to RGB color * * This procedure converts the specified image to RGB color. This * process requires an image in Grayscale or Indexed color mode. No * image content is lost in this process aside from the colormap for an * indexed image. * @returns TRUE on success. */ convert_rgb(): boolean; /** * Crop the image to the specified extents. * * This procedure crops the image so that it's new width and height are * equal to the supplied parameters. Offsets are also provided which * describe the position of the previous image's content. All channels * and layers within the image are cropped to the new image extents; * this includes the image selection mask. If any parameters are out of * range, an error is returned. * @param new_width New image width: (0 < new_width <= width). * @param new_height New image height: (0 < new_height <= height). * @param offx X offset: (0 <= offx <= (width - new_width)). * @param offy Y offset: (0 <= offy <= (height - new_height)). * @returns TRUE on success. */ crop(new_width: number, new_height: number, offx: number, offy: number): boolean; /** * Delete the specified image. * * If there are no displays associated with this image it will be * deleted. This means that you can not delete an image through the PDB * that was created by the user. If the associated display was however * created through the PDB and you know the display ID, you may delete * the display. Removal of the last associated display will then delete * the image. * @returns TRUE on success. */ ['delete'](): boolean; /** * Deletes a guide from an image. * * This procedure takes an image and a guide ID as input and removes * the specified guide from the specified image. * @param guide The ID of the guide to be removed. * @returns TRUE on success. */ delete_guide(guide: number): boolean; /** * Deletes a sample point from an image. * * This procedure takes an image and a sample point ID as input and * removes the specified sample point from the specified image. * @param sample_point The ID of the sample point to be removed. * @returns TRUE on success. */ delete_sample_point(sample_point: number): boolean; /** * Removes a parasite from an image. * * This procedure detaches a parasite from an image. It has no return * values. * @param name The name of the parasite to detach from an image. * @returns TRUE on success. */ detach_parasite(name: string): boolean; /** * Duplicate the specified image * * This procedure duplicates the specified image, copying all layers, * channels, and image information. * @returns The new, duplicated image. */ duplicate(): Image; /** * save a path as an SVG file. * * This procedure creates an SVG file to save a Path object, that is, a * path. The resulting file can be edited using a vector graphics * application, or later reloaded into GIMP. Pass %NULL as the 'path' * argument to export all paths in the image. * @param file The SVG file to create. * @param path The path object to export, or %NULL for all in the image. * @returns TRUE on success. */ export_path_to_file(file: Gio.File, path?: Path | null): boolean; /** * Save a path as an SVG string. * * This procedure works like [method`Gimp`.Image.export_path_to_file] * but creates a string rather than a file. The string is * NULL-terminated and holds a complete XML document. Pass %NULL as the * 'path' argument to export all paths in the image. * @param path The path object to export, or %NULL for all in the image. * @returns A string whose contents are a complete SVG document. The returned value must be freed with g_free(). */ export_path_to_string(path?: Path | null): string; /** * Find next guide on an image. * * This procedure takes an image and a guide ID as input and finds the * guide ID of the successor of the given guide ID in the image's guide * list. If the supplied guide ID is 0, the procedure will return the * first Guide. The procedure will return 0 if given the final guide ID * as an argument or the image has no guides. * @param guide The ID of the current guide (0 if first invocation). * @returns The next guide's ID. */ find_next_guide(guide: number): number; /** * Find next sample point on an image. * * This procedure takes an image and a sample point ID as input and * finds the sample point ID of the successor of the given sample point * ID in the image's sample point list. If the supplied sample point ID * is 0, the procedure will return the first sample point. The * procedure will return 0 if given the final sample point ID as an * argument or the image has no sample points. * @param sample_point The ID of the current sample point (0 if first invocation). * @returns The next sample point's ID. */ find_next_sample_point(sample_point: number): number; /** * Flatten all visible layers into a single layer. Discard all * invisible layers. * * This procedure combines the visible layers in a manner analogous to * merging with the CLIP_TO_IMAGE merge type. Non-visible layers are * discarded, and the resulting image is stripped of its alpha channel. * @returns The resulting layer. */ flatten(): Layer; /** * Flips the image horizontally or vertically. * * This procedure flips (mirrors) the image. * @param flip_type Type of flip. * @returns TRUE on success. */ flip(flip_type: OrientationType | null): boolean; /** * Return the drawable the floating selection is attached to. * * This procedure returns the drawable the image's floating selection * is attached to, if it exists. If it doesn't exist, -1 is returned as * the drawable ID. * @returns The drawable the floating selection is attached to. */ floating_sel_attached_to(): Drawable; /** * Freeze the image's channel list. * * This procedure freezes the channel list of the image, suppressing * any updates to the Channels dialog in response to changes to the * image's channels. This can significantly improve performance while * applying changes affecting the channel list. * * Each call to gimp_image_freeze_channels() should be matched by a * corresponding call to gimp_image_thaw_channels(), undoing its * effects. * @returns TRUE on success. */ freeze_channels(): boolean; /** * Freeze the image's layer list. * * This procedure freezes the layer list of the image, suppressing any * updates to the Layers dialog in response to changes to the image's * layers. This can significantly improve performance while applying * changes affecting the layer list. * * Each call to gimp_image_freeze_layers() should be matched by a * corresponding call to gimp_image_thaw_layers(), undoing its effects. * @returns TRUE on success. */ freeze_layers(): boolean; /** * Freeze the image's path list. * * This procedure freezes the path list of the image, suppressing any * updates to the Paths dialog in response to changes to the image's * path. This can significantly improve performance while applying * changes affecting the path list. * * Each call to gimp_image_freeze_paths() should be matched by a * corresponding call to gimp_image_thaw_paths (), undoing its effects. * @returns TRUE on success. */ freeze_paths(): boolean; /** * Get the base type of the image. * * This procedure returns the image's base type. Layers in the image * must be of this subtype, but can have an optional alpha channel. * @returns The image's base type. */ get_base_type(): ImageBaseType; /** * Find a channel with a given name in an image. * * This procedure returns the channel with the given name in the * specified image. * @param name The name of the channel to find. * @returns The channel with the specified name. */ get_channel_by_name(name: string): Channel; /** * Find a channel with a given tattoo in an image. * * This procedure returns the channel with the given tattoo in the * specified image. * @param tattoo The tattoo of the channel to find. * @returns The channel with the specified tattoo. */ get_channel_by_tattoo(tattoo: number): Channel; /** * Returns the list of channels contained in the specified image. * * This procedure returns the list of channels contained in the * specified image. This does not include the selection mask, or layer * masks. The order is from topmost to bottommost. Note that * \"channels\" are custom channels and do not include the image's * color components. * @returns The list of channels contained in the image. The returned value must be freed with g_free(). */ get_channels(): Channel[]; /** * Returns the image's color profile * * This procedure returns the image's color profile, or NULL if the * image has no color profile assigned. * @returns The image's color profile. The returned value must be freed with [method@GObject.Object.unref]. */ get_color_profile(): ColorProfile; /** * Returns if the specified image's image component is active. * * This procedure returns if the specified image's image component * (i.e. Red, Green, Blue intensity channels in an RGB image) is active * or inactive -- whether or not it can be modified. If the specified * component is not valid for the image type, an error is returned. * @param component The image component. * @returns Component is active. */ get_component_active(component: ChannelType | null): boolean; /** * Returns if the specified image's image component is visible. * * This procedure returns if the specified image's image component * (i.e. Red, Green, Blue intensity channels in an RGB image) is * visible or invisible -- whether or not it can be seen. If the * specified component is not valid for the image type, an error is * returned. * @param component The image component. * @returns Component is visible. */ get_component_visible(component: ChannelType | null): boolean; /** * Get the default mode for newly created layers of this image. * * Returns the default mode for newly created layers of this image. * @returns The layer mode. */ get_default_new_layer_mode(): LayerMode; /** * Returns the color profile that is used for the image. * * This procedure returns the color profile that is actually used for * this image, which is the profile returned by * [method`Gimp`.Image.get_color_profile] if the image has a profile * assigned, or the default profile from preferences, for the given * color space, if no profile is assigned to the image. If there is no * default profile configured in preferences either, a generated default * profile is returned. * @returns The color profile. The returned value must be freed with [method@GObject.Object.unref]. */ get_effective_color_profile(): ColorProfile; /** * Returns the exported file for the specified image. * * This procedure returns the file associated with the specified image * if the image was exported a non-native GIMP format. If the image was * not exported, this procedure returns %NULL. * @returns The exported file. */ get_exported_file(): Gio.File; /** * Returns the file for the specified image. * * This procedure returns the file associated with the specified image. * The image has a file only if it was loaded or imported from a file * or has since been saved or exported. Otherwise, this function * returns %NULL. See also gimp-image-get-imported-file to get the * current file if it was imported from a non-GIMP file format and not * yet saved, or gimp-image-get-exported-file if the image has been * exported to a non-GIMP file format. * @returns The file. */ get_file(): Gio.File; /** * Return the floating selection of the image. * * This procedure returns the image's floating selection, if it exists. * If it doesn't exist, -1 is returned as the layer ID. * @returns The image's floating selection. */ get_floating_sel(): Layer; /** * Get orientation of a guide on an image. * * This procedure takes an image and a guide ID as input and returns * the orientations of the guide. * @param guide The guide. * @returns The guide's orientation. */ get_guide_orientation(guide: number): OrientationType; /** * Get position of a guide on an image. * * This procedure takes an image and a guide ID as input and returns * the position of the guide relative to the top or left of the image. * @param guide The guide. * @returns The guide's position relative to top or left of image. */ get_guide_position(guide: number): number; /** * Return the height of the image * * This procedure returns the image's height. This value is independent * of any of the layers in this image. This is the \"canvas\" height. * @returns The image's height. */ get_height(): number; get_id(): number; /** * Returns the imported file for the specified image. * * This procedure returns the file associated with the specified image * if the image was imported from a non-native Gimp format. If the * image was not imported, or has since been saved in the native Gimp * format, this procedure returns %NULL. * @returns The imported file. */ get_imported_file(): Gio.File; /** * Returns the position of the item in its level of its item tree. * * This procedure determines the position of the specified item in its * level in its item tree in the image. If the item doesn't exist in * the image, or the item is not part of an item tree, an error is * returned. * @param item The item. * @returns The position of the item in its level in the item tree. */ get_item_position(item: Item): number; /** * Find a layer with a given name in an image. * * This procedure returns the layer with the given name in the * specified image. * @param name The name of the layer to find. * @returns The layer with the specified name. */ get_layer_by_name(name: string): Layer; /** * Find a layer with a given tattoo in an image. * * This procedure returns the layer with the given tattoo in the * specified image. * @param tattoo The tattoo of the layer to find. * @returns The layer with the specified tattoo. */ get_layer_by_tattoo(tattoo: number): Layer; /** * Returns the list of root layers contained in the specified image. * * This procedure returns the list of root layers contained in the * specified image. The order of layers is from topmost to bottommost. * Note that this is not the full list of layers, but only the root * layers, i.e. layers with no parents themselves. If you need all * layers, it is up to you to verify that any of these layers is a * group layer with gimp_item_is_group() and to obtain its children * with gimp_item_get_children() (possibly recursively checking if * these have children too). * @returns The list of layers contained in the image. The returned value must be freed with g_free(). */ get_layers(): Layer[]; /** * Returns the image's metadata. * * Returns exif/iptc/xmp metadata from the image. * @returns The exif/ptc/xmp metadata, or %NULL if there is none. */ get_metadata(): Metadata | null; /** * Returns the specified image's name. * * This procedure returns the image's name. If the image has a filename * or an URI, then the returned name contains the filename's or URI's * base name (the last component of the path). Otherwise it is the * translated string \"Untitled\". The returned name is formatted like * the image name in the image window title, it may contain '[]', * '(imported)' etc. and should only be used to label user interface * elements. Never use it to construct filenames. * @returns The name. The returned value must be freed with g_free(). */ get_name(): string; /** * Returns the image's colormap * * This procedure returns the image's colormap as a %GimpPalette. If * the image is not in Indexed color mode, %NULL is returned. * @returns The image's colormap palette. */ get_palette(): Palette; /** * Look up a parasite in an image * * Finds and returns the parasite that was previously attached to an * image. * @param name The name of the parasite to find. * @returns The found parasite. */ get_parasite(name: string): Parasite; /** * List all parasites. * * Returns a list of the names of all currently attached parasites. * These names can later be used to get the actual #GimpParasite with * gimp_image_get_parasite() when needed. * @returns The names of currently attached parasites. The returned value must be freed with g_strfreev(). */ get_parasite_list(): string[]; /** * Find a path with a given name in an image. * * This procedure returns the path with the given name in the specified * image. * @param name The name of the path to find. * @returns The path with the specified name. */ get_path_by_name(name: string): Path; /** * Find a path with a given tattoo in an image. * * This procedure returns the path with the given tattoo in the * specified image. * @param tattoo The tattoo of the path to find. * @returns The path with the specified tattoo. */ get_path_by_tattoo(tattoo: number): Path; /** * Returns the list of paths contained in the specified image. * * This procedure returns the list of paths contained in the specified * image. * @returns The list of paths contained in the image. The returned value must be freed with g_free(). */ get_paths(): Path[]; /** * Get the precision of the image. * * This procedure returns the image's precision. * @returns The image's precision. */ get_precision(): Precision; /** * Returns the specified image's resolution. * * This procedure returns the specified image's resolution in dots per * inch. This value is independent of any of the layers in this image. * @returns TRUE on success. */ get_resolution(): [boolean, number, number]; /** * Get position of a sample point on an image. * * This procedure takes an image and a sample point ID as input and * returns the position of the sample point relative to the top and * left of the image. * @param sample_point The guide. * @returns The sample point's x-offset relative to left of image. */ get_sample_point_position(sample_point: number): [number, number]; /** * Returns the specified image's selected channels. * * This procedure returns the list of selected channels in the * specified image. * @returns The list of selected channels in the image. The returned value must be freed with g_free(). */ get_selected_channels(): Channel[]; /** * Get the image's selected drawables * * This procedure returns the list of selected drawable in the * specified image. This can be either layers, channels, or a layer * mask. * The active drawables are the active image channels. If there are * none, these are the active image layers. If the active image layer * has a layer mask and the layer mask is in edit mode, then the layer * mask is the active drawable. * @returns The list of selected drawables in the image. The returned value must be freed with g_free(). */ get_selected_drawables(): Drawable[]; /** * Returns the specified image's selected layers. * * This procedure returns the list of selected layers in the specified * image. * @returns The list of selected layers in the image. The returned value must be freed with g_free(). */ get_selected_layers(): Layer[]; /** * Returns the specified image's selected paths. * * This procedure returns the list of selected paths in the specified * image. * @returns The list of selected paths in the image. The returned value must be freed with g_free(). */ get_selected_paths(): Path[]; /** * Returns the specified image's selection. * * This will always return a valid ID for a selection -- which is * represented as a channel internally. * @returns The selection channel. */ get_selection(): Selection; /** * Returns whether the image has Black Point Compensation enabled for * its simulation * * This procedure returns whether the image has Black Point * Compensation enabled for its simulation * @returns The Black Point Compensation status. */ get_simulation_bpc(): boolean; /** * Returns the image's simulation rendering intent * * This procedure returns the image's simulation rendering intent. * @returns The image's simulation rendering intent. */ get_simulation_intent(): ColorRenderingIntent; /** * Returns the image's simulation color profile * * This procedure returns the image's simulation color profile, or NULL if * the image has no simulation color profile assigned. * @returns The image's simulation color profile. The returned value must be freed with g_object_unref(). */ get_simulation_profile(): ColorProfile; /** * Returns the tattoo state associated with the image. * * This procedure returns the tattoo state of the image. Use only by * save/load plug-ins that wish to preserve an images tattoo state. * Using this function at other times will produce unexpected results. * @returns The tattoo state. */ get_tattoo_state(): number; /** * Retrieves a thumbnail pixbuf for `image`. * The thumbnail will be not larger than the requested size. * @param width the requested thumbnail width (<= 1024 pixels) * @param height the requested thumbnail height (<= 1024 pixels) * @param alpha how to handle an alpha channel * @returns a new #GdkPixbuf */ get_thumbnail(width: number, height: number, alpha: PixbufTransparency | null): GdkPixbuf.Pixbuf; /** * Get a thumbnail of an image. * * This function gets data from which a thumbnail of an image preview * can be created. Maximum x or y dimension is 1024 pixels. The pixels * are returned in RGB[A] or GRAY[A] format. The bpp return value * gives the number of bytes per pixel in the image. * @param width The requested thumbnail width. * @param height The requested thumbnail height. * @returns the thumbnail data. */ get_thumbnail_data(width: number, height: number): [GLib.Bytes, number, number, number]; /** * Returns the specified image's unit. * * This procedure returns the specified image's unit. This value is * independent of any of the layers in this image. See the * gimp_unit_*() procedure definitions for the valid range of unit IDs * and a description of the unit system. * @returns The unit. */ get_unit(): Unit; /** * Return the width of the image * * This procedure returns the image's width. This value is independent * of any of the layers in this image. This is the \"canvas\" width. * @returns The image's width. */ get_width(): number; /** * Returns the XCF file for the specified image. * * This procedure returns the XCF file associated with the image. If * there is no such file, this procedure returns %NULL. * @returns The imported XCF file. */ get_xcf_file(): Gio.File; /** * Sets the background color of an image's grid. * * This procedure gets the background color of an image's grid. * @returns The image's grid background color. */ grid_get_background_color(): Gegl.Color; /** * Sets the foreground color of an image's grid. * * This procedure gets the foreground color of an image's grid. * @returns The image's grid foreground color. */ grid_get_foreground_color(): Gegl.Color; /** * Gets the offset of an image's grid. * * This procedure retrieves the horizontal and vertical offset of an * image's grid. It takes the image as parameter. * @returns TRUE on success. */ grid_get_offset(): [boolean, number, number]; /** * Gets the spacing of an image's grid. * * This procedure retrieves the horizontal and vertical spacing of an * image's grid. It takes the image as parameter. * @returns TRUE on success. */ grid_get_spacing(): [boolean, number, number]; /** * Gets the style of an image's grid. * * This procedure retrieves the style of an image's grid. * @returns The image's grid style. */ grid_get_style(): GridStyle; /** * Gets the background color of an image's grid. * * This procedure sets the background color of an image's grid. * @param bgcolor The new background color. * @returns TRUE on success. */ grid_set_background_color(bgcolor: Gegl.Color): boolean; /** * Gets the foreground color of an image's grid. * * This procedure sets the foreground color of an image's grid. * @param fgcolor The new foreground color. * @returns TRUE on success. */ grid_set_foreground_color(fgcolor: Gegl.Color): boolean; /** * Sets the offset of an image's grid. * * This procedure sets the horizontal and vertical offset of an image's * grid. * @param xoffset The image's grid horizontal offset. * @param yoffset The image's grid vertical offset. * @returns TRUE on success. */ grid_set_offset(xoffset: number, yoffset: number): boolean; /** * Sets the spacing of an image's grid. * * This procedure sets the horizontal and vertical spacing of an * image's grid. * @param xspacing The image's grid horizontal spacing. * @param yspacing The image's grid vertical spacing. * @returns TRUE on success. */ grid_set_spacing(xspacing: number, yspacing: number): boolean; /** * Sets the style unit of an image's grid. * * This procedure sets the style of an image's grid. It takes the image * and the new style as parameters. * @param style The image's grid style. * @returns TRUE on success. */ grid_set_style(style: GridStyle | null): boolean; /** * Import paths from an SVG file. * * This procedure imports paths from an SVG file. SVG elements other * than paths and basic shapes are ignored. * @param file The SVG file to import. * @param merge Merge paths into a single path object. * @param scale Scale the SVG to image dimensions. * @returns TRUE on success. */ import_paths_from_file(file: Gio.File, merge: boolean, scale: boolean): [boolean, Path[]]; /** * Import paths from an SVG string. * * This procedure works like [method`Gimp`.Image.import_paths_from_file] * but takes a string rather than reading the SVG from a file. This * allows you to write scripts that generate SVG and feed it to GIMP. * @param string A string that must be a complete and valid SVG document. * @param length Number of bytes in string or -1 if the string is NULL terminated. * @param merge Merge paths into a single path object. * @param scale Scale the SVG to image dimensions. * @returns TRUE on success. */ import_paths_from_string(string: string, length: number, merge: boolean, scale: boolean): [boolean, Path[]]; /** * Add the specified channel to the image. * * This procedure adds the specified channel to the image at the given * position. Since channel groups are not currently supported, the * parent argument must always be 0. The position argument specifies * the location of the channel inside the stack, starting from the top * (0) and increasing. If the position is specified as -1, then the * channel is inserted above the active channel. * @param channel The channel. * @param parent The parent channel. * @param position The channel position. * @returns TRUE on success. */ insert_channel(channel: Channel, parent: Channel | null, position: number): boolean; /** * Add the specified layer to the image. * * This procedure adds the specified layer to the image at the given * position. If the specified parent is a valid layer group (See * gimp_item_is_group() and gimp_layer_group_new()) then the layer is * added inside the group. If the parent is 0, the layer is added * inside the main stack, outside of any group. The position argument * specifies the location of the layer inside the stack (or the group, * if a valid parent was supplied), starting from the top (0) and * increasing. If the position is specified as -1 and the parent is * specified as 0, then the layer is inserted above the active layer, * or inside the group if the active layer is a layer group. The layer * type must be compatible with the image base type. * @param layer The layer. * @param parent The parent layer. * @param position The layer position. * @returns TRUE on success. */ insert_layer(layer: Layer, parent: Layer | null, position: number): boolean; /** * Add the specified path to the image. * * This procedure adds the specified path to the image at the given * position. Since path groups are not currently supported, the parent * argument must always be 0. The position argument specifies the * location of the path inside the stack, starting from the top (0) and * increasing. If the position is specified as -1, then the path is * inserted above the active path. * @param path The path. * @param parent The parent path. * @param position The path position. * @returns TRUE on success. */ insert_path(path: Path, parent: Path | null, position: number): boolean; /** * Checks if the image has unsaved changes. * * This procedure checks the specified image's dirty count to see if it * needs to be saved. Note that saving the image does not automatically * set the dirty count to 0, you need to call gimp_image_clean_all() * after calling a save procedure to make the image clean. * @returns TRUE if the image has unsaved changes. */ is_dirty(): boolean; /** * Returns TRUE if the image is valid. * * This procedure checks if the given image is valid and refers to * an existing image. * @returns Whether the image is valid. */ is_valid(): boolean; /** * Lower the specified item in its level in its item tree * * This procedure lowers the specified item one step in the item tree. * The procedure call will fail if there is no item below it. * @param item The item to lower. * @returns TRUE on success. */ lower_item(item: Item): boolean; /** * Lower the specified item to the bottom of its level in its item tree * * This procedure lowers the specified item to bottom of its level in * the item tree. It will not move the layer if there is no layer below * it. * @param item The item to lower to bottom. * @returns TRUE on success. */ lower_item_to_bottom(item: Item): boolean; /** * Merge the layer passed and the first visible layer below. * * This procedure combines the passed layer and the first visible layer * below it using the specified merge type. A merge type of * EXPAND_AS_NECESSARY expands the final layer to encompass the areas * of the visible layers. A merge type of CLIP_TO_IMAGE clips the final * layer to the extents of the image. A merge type of * CLIP_TO_BOTTOM_LAYER clips the final layer to the size of the * bottommost layer. * @param merge_layer The layer to merge down from. * @param merge_type The type of merge. * @returns The resulting layer. */ merge_down(merge_layer: Layer, merge_type: MergeType | null): Layer; /** * Merge the visible image layers into one. * * This procedure combines the visible layers into a single layer using * the specified merge type. A merge type of EXPAND_AS_NECESSARY * expands the final layer to encompass the areas of the visible * layers. A merge type of CLIP_TO_IMAGE clips the final layer to the * extents of the image. A merge type of CLIP_TO_BOTTOM_LAYER clips the * final layer to the size of the bottommost layer. * @param merge_type The type of merge. * @returns The resulting layer. */ merge_visible_layers(merge_type: MergeType | null): Layer; /** * Filters the `metadata` retrieved from the image with * [method`Gimp`.Image.metadata_save_prepare], taking into account the * passed `flags`. * * *Note: There is normally no need to call this function because it's * already called by [class`ExportProcedure]` after the `run()` * callback.* * * Note that the `image` passed to this function might be different * from the image passed to `gimp_image_metadata_save_prepare()`, due * to whatever file export conversion happened in the meantime * * This can be used as an alternative to core metadata handling when you * want to save metadata yourself and you need only filtering * processing. * @param mime_type The saved file's mime-type * @param metadata The metadata to export * @param flags Flags to specify what of the metadata to save * @param file The file @image was saved to or NULL if file was not saved yet * @returns Filtered metadata or %NULL in case of failure. Use [GObject.Object.unref] when returned metadata are no longer needed */ metadata_save_filter( mime_type: string, metadata: Metadata, flags: MetadataSaveFlags | null, file: Gio.File, ): Metadata; /** * Gets the image metadata for storing it in an exported file. * * *Note: There is normally no need to call this function because it's * already called by [class`ExportProcedure]` at the start and the * metadata is passed to the `run()` callback.* * * *You may call it separately for instance if you set `export_metadata` * to %NULL in [ctor`Gimp`.ExportProcedure.new] to prevent `libgimp` * from trying to store the metadata in the exported file, yet you wish * to process and store the metadata yourself using custom API.* * * The `suggested_flags` are determined from what kind of metadata (Exif, * XMP, ...) is actually present in the image and the preferences for * metadata exporting. * The calling application may still ignore `suggested_flags,` for * instance to follow the settings from a previous export in the same * session, or a previous export of the same image. But it should not * override the preferences without a good reason since it is a data * leak. * * The suggested value for [flags`Gimp`.MetadataSaveFlags.THUMBNAIL] is * determined by whether there was a thumbnail in the previously * imported image. * @param mime_type The saved file's mime-type * @param suggested_flags Suggested default values for the metadata to export. * @returns The image's metadata, prepared for saving. */ metadata_save_prepare(mime_type: string, suggested_flags: MetadataSaveFlags | null): Metadata; /** * Determine the color at the given coordinates * * This tool determines the color at the specified coordinates. The * returned color is an RGB triplet even for grayscale and indexed * drawables. If the coordinates lie outside of the extents of the * specified drawables, then an error is returned. All drawables must * belong to the image and be of the same type. * If only one drawable is given and it has an alpha channel, the * algorithm examines the alpha value of the drawable at the * coordinates. If the alpha value is completely transparent (0), then * an error is returned. With several drawables specified, the * composite image with only these drawables is used. * If the sample_merged parameter is TRUE, the data of the composite * image will be used instead of that for the specified drawables. This * is equivalent to sampling for colors after merging all visible * layers. In the case of a merged sampling, the supplied drawables are * ignored. * @param drawables The drawables to pick from. * @param x x coordinate of upper-left corner of rectangle. * @param y y coordinate of upper-left corner of rectangle. * @param sample_merged Use the composite image, not the drawables. * @param sample_average Average the color of all the pixels in a specified radius. * @param average_radius The radius of pixels to average. * @returns TRUE on success. */ pick_color( drawables: Drawable[], x: number, y: number, sample_merged: boolean, sample_average: boolean, average_radius: number, ): [boolean, Gegl.Color]; /** * Find the layer visible at the specified coordinates. * * This procedure finds the layer which is visible at the specified * coordinates. Layers which do not qualify are those whose extents do * not pass within the specified coordinates, or which are transparent * at the specified coordinates. This procedure will return -1 if no * layer is found. * @param x The x coordinate for the pick. * @param y The y coordinate for the pick. * @returns The layer found at the specified coordinates. */ pick_correlate_layer(x: number, y: number): Layer; /** * Execute the color profile conversion policy. * * Process the image according to the color profile policy as set in * Preferences. * If GIMP is running as a GUI and interactive is TRUE, a dialog may be * presented to the user depending on the policy. Otherwise, if the * policy does not mandate the conversion to perform, the conversion to * the preferred RGB or grayscale profile will happen, defaulting to * built-in profiles if no preferred profiles were set in * `Preferences`. * This function should be used only if you want to follow user * settings. If you intend to convert to a specific profile, call * preferably gimp_image_convert_color_profile(). And if you wish to * leave whatever profile an image has, do not call any of these * functions. * Finally it is unnecessary to call this function in a format load * procedure because this is called automatically by the core code when * loading any image. You should only call this function explicitly * when loading an image through a PDB call. * @param interactive Querying the user through a dialog is a possibility. * @returns TRUE on success. */ policy_color_profile(interactive: boolean): boolean; /** * Execute the \"Orientation\" metadata policy. * * Process the image according to the rotation policy as set in * Preferences. If GIMP is running as a GUI and interactive is TRUE, a * dialog may be presented to the user depending on the set policy. * Otherwise, if the policy does not mandate the action to perform, the * image will be rotated following the Orientation metadata. * If you wish absolutely to rotate a loaded image following the * Orientation metadata, do not use this function and process the * metadata yourself. Indeed even with `interactive` to FALSE, user * settings may leave the image unrotated. * Finally it is unnecessary to call this function in a format load * procedure because this is called automatically by the core code when * loading any image. You should only call this function explicitly * when loading an image through a PDB call. * @param interactive Querying the user through a dialog is a possibility. * @returns TRUE on success. */ policy_rotate(interactive: boolean): boolean; /** * Raise the specified item in its level in its item tree * * This procedure raises the specified item one step in the item tree. * The procedure call will fail if there is no item above it. * @param item The item to raise. * @returns TRUE on success. */ raise_item(item: Item): boolean; /** * Raise the specified item to the top of its level in its item tree * * This procedure raises the specified item to top of its level in the * item tree. It will not move the item if there is no item above it. * @param item The item to raise to top. * @returns TRUE on success. */ raise_item_to_top(item: Item): boolean; /** * Remove the specified channel from the image. * * This procedure removes the specified channel from the image. If the * channel doesn't exist, an error is returned. * @param channel The channel. * @returns TRUE on success. */ remove_channel(channel: Channel): boolean; /** * Remove the specified layer from the image. * * This procedure removes the specified layer from the image. If the * layer doesn't exist, an error is returned. If there are no layers * left in the image, this call will fail. If this layer is the last * layer remaining, the image will become empty and have no active * layer. * @param layer The layer. * @returns TRUE on success. */ remove_layer(layer: Layer): boolean; /** * Remove the specified path from the image. * * This procedure removes the specified path from the image. If the * path doesn't exist, an error is returned. * @param path The path object. * @returns TRUE on success. */ remove_path(path: Path): boolean; /** * Reorder the specified item within its item tree * * Reorders or moves item within an item tree. Requires parent is %NULL * or a GroupLayer, else returns error. When parent is not %NULL and * item is in parent, reorders item within parent group. When parent is * not %NULL and item is not in parent, moves item into parent group. * When parent is %NULL, moves item from current parent to top level. * * Requires item is in same tree as not %NULL parent, else returns * error. Layers, Channels, and Paths are in separate trees. * * Requires item is not ancestor of parent, else returns error, to * preclude cycles. * @param item The item to reorder. * @param parent The new parent item. * @param position The new position of the item. * @returns TRUE on success. */ reorder_item(item: Item, parent: Item | null, position: number): boolean; /** * Resize the image to the specified extents. * * This procedure resizes the image so that it's new width and height * are equal to the supplied parameters. Offsets are also provided * which describe the position of the previous image's content. All * channels within the image are resized according to the specified * parameters; this includes the image selection mask. All layers * within the image are repositioned according to the specified * offsets. * @param new_width New image width. * @param new_height New image height. * @param offx x offset between upper left corner of old and new images: (new - old). * @param offy y offset between upper left corner of old and new images: (new - old). * @returns TRUE on success. */ resize(new_width: number, new_height: number, offx: number, offy: number): boolean; /** * Resize the image to fit all layers. * * This procedure resizes the image to the bounding box of all layers * of the image. All channels within the image are resized to the new * size; this includes the image selection mask. All layers within the * image are repositioned to the new image area. * @returns TRUE on success. */ resize_to_layers(): boolean; /** * Rotates the image by the specified degrees. * * This procedure rotates the image. * @param rotate_type Angle of rotation. * @returns TRUE on success. */ rotate(rotate_type: RotationType | null): boolean; /** * Scale the image using the default interpolation method. * * This procedure scales the image so that its new width and height are * equal to the supplied parameters. All layers and channels within the * image are scaled according to the specified parameters; this * includes the image selection mask. The interpolation method used can * be set with gimp_context_set_interpolation(). * @param new_width New image width. * @param new_height New image height. * @returns TRUE on success. */ scale(new_width: number, new_height: number): boolean; /** * Create a selection by selecting all pixels (in the specified * drawable) with the same (or similar) color to that specified. * * This tool creates a selection over the specified image. A by-color * selection is determined by the supplied color under the constraints * of the current context settings. Essentially, all pixels (in the * drawable) that have color sufficiently close to the specified color * (as determined by the threshold and criterion context values) are * included in the selection. To select transparent regions, the color * specified must also have minimum alpha. * * This procedure is affected by the following context setters: * gimp_context_set_antialias(), gimp_context_set_feather(), * gimp_context_set_feather_radius(), gimp_context_set_sample_merged(), * gimp_context_set_sample_criterion(), * gimp_context_set_sample_threshold(), * gimp_context_set_sample_transparent(). * * In the case of a merged sampling, the supplied drawable is ignored. * @param operation The selection operation. * @param drawable The affected drawable. * @param color The color to select. * @returns TRUE on success. */ select_color(operation: ChannelOps | null, drawable: Drawable, color: Gegl.Color): boolean; /** * Create a selection by selecting all pixels around specified * coordinates with the same (or similar) color to that at the * coordinates. * * This tool creates a contiguous selection over the specified image. A * contiguous color selection is determined by a seed fill under the * constraints of the current context settings. Essentially, the color * at the specified coordinates (in the drawable) is measured and the * selection expands outwards from that point to any adjacent pixels * which are not significantly different (as determined by the * threshold and criterion context settings). This process continues * until no more expansion is possible. If antialiasing is turned on, * the final selection mask will contain intermediate values based on * close misses to the threshold bar at pixels along the seed fill * boundary. * * This procedure is affected by the following context setters: * gimp_context_set_antialias(), gimp_context_set_feather(), * gimp_context_set_feather_radius(), gimp_context_set_sample_merged(), * gimp_context_set_sample_criterion(), * gimp_context_set_sample_threshold(), * gimp_context_set_sample_transparent(), * gimp_context_set_diagonal_neighbors(). * * In the case of a merged sampling, the supplied drawable is ignored. * If the sample is merged, the specified coordinates are relative to * the image origin; otherwise, they are relative to the drawable's * origin. * @param operation The selection operation. * @param drawable The affected drawable. * @param x x coordinate of initial seed fill point: (image coordinates). * @param y y coordinate of initial seed fill point: (image coordinates). * @returns TRUE on success. */ select_contiguous_color(operation: ChannelOps | null, drawable: Drawable, x: number, y: number): boolean; /** * Create an elliptical selection over the specified image. * * This tool creates an elliptical selection over the specified image. * The elliptical region can be either added to, subtracted from, or * replace the contents of the previous selection mask. * * This procedure is affected by the following context setters: * gimp_context_set_antialias(), gimp_context_set_feather(), * gimp_context_set_feather_radius(). * @param operation The selection operation. * @param x x coordinate of upper-left corner of ellipse bounding box. * @param y y coordinate of upper-left corner of ellipse bounding box. * @param width The width of the ellipse. * @param height The height of the ellipse. * @returns TRUE on success. */ select_ellipse(operation: ChannelOps | null, x: number, y: number, width: number, height: number): boolean; /** * Transforms the specified item into a selection * * This procedure renders the item's outline into the current selection * of the image the item belongs to. What exactly the item's outline is * depends on the item type: for layers, it's the layer's alpha * channel, for vectors the vector's shape. * * This procedure is affected by the following context setters: * gimp_context_set_antialias(), gimp_context_set_feather(), * gimp_context_set_feather_radius(). * @param operation The desired operation with current selection. * @param item The item to render to the selection. * @returns TRUE on success. */ select_item(operation: ChannelOps | null, item: Item): boolean; /** * Create a polygonal selection over the specified image. * * This tool creates a polygonal selection over the specified image. * The polygonal region can be either added to, subtracted from, or * replace the contents of the previous selection mask. The polygon is * specified through an array of floating point numbers and its length. * The length of array must be 2n, where n is the number of points. * Each point is defined by 2 floating point values which correspond to * the x and y coordinates. If the final point does not connect to the * starting point, a connecting segment is automatically added. * * This procedure is affected by the following context setters: * gimp_context_set_antialias(), gimp_context_set_feather(), * gimp_context_set_feather_radius(). * @param operation The selection operation. * @param segs Array of points: { p1.x, p1.y, p2.x, p2.y, ..., pn.x, pn.y}. * @returns TRUE on success. */ select_polygon(operation: ChannelOps | null, segs: number[]): boolean; /** * Create a rectangular selection over the specified image; * * This tool creates a rectangular selection over the specified image. * The rectangular region can be either added to, subtracted from, or * replace the contents of the previous selection mask. * * This procedure is affected by the following context setters: * gimp_context_set_feather(), gimp_context_set_feather_radius(). * @param operation The selection operation. * @param x x coordinate of upper-left corner of rectangle. * @param y y coordinate of upper-left corner of rectangle. * @param width The width of the rectangle. * @param height The height of the rectangle. * @returns TRUE on success. */ select_rectangle( operation: ChannelOps | null, x: number, y: number, width: number, height: number, ): boolean; /** * Create a rectangular selection with round corners over the specified * image; * * This tool creates a rectangular selection with round corners over * the specified image. The rectangular region can be either added to, * subtracted from, or replace the contents of the previous selection * mask. * * This procedure is affected by the following context setters: * gimp_context_set_antialias(), gimp_context_set_feather(), * gimp_context_set_feather_radius(). * @param operation The selection operation. * @param x x coordinate of upper-left corner of rectangle. * @param y y coordinate of upper-left corner of rectangle. * @param width The width of the rectangle. * @param height The height of the rectangle. * @param corner_radius_x The corner radius in X direction. * @param corner_radius_y The corner radius in Y direction. * @returns TRUE on success. */ select_round_rectangle( operation: ChannelOps | null, x: number, y: number, width: number, height: number, corner_radius_x: number, corner_radius_y: number, ): boolean; /** * Sets the image's color profile * * This procedure sets the image's color profile. * @param profile A #GimpColorProfile, or %NULL. * @returns %TRUE on success. */ set_color_profile(profile?: ColorProfile | null): boolean; /** * Sets the image's color profile from an ICC file * * This procedure sets the image's color profile from a file containing * an ICC profile, or unsets it if NULL is passed as 'file'. This * procedure does no color conversion. However, it will change the * pixel format of all layers to contain the babl space matching the * profile. You must call this procedure before adding layers to the * image. * @param file The file containing the new color profile. * @returns TRUE on success. */ set_color_profile_from_file(file: Gio.File): boolean; /** * Sets if the specified image's image component is active. * * This procedure sets if the specified image's image component (i.e. * Red, Green, Blue intensity channels in an RGB image) is active or * inactive -- whether or not it can be modified. If the specified * component is not valid for the image type, an error is returned. * @param component The image component. * @param active Component is active. * @returns TRUE on success. */ set_component_active(component: ChannelType | null, active: boolean): boolean; /** * Sets if the specified image's image component is visible. * * This procedure sets if the specified image's image component (i.e. * Red, Green, Blue intensity channels in an RGB image) is visible or * invisible -- whether or not it can be seen. If the specified * component is not valid for the image type, an error is returned. * @param component The image component. * @param visible Component is visible. * @returns TRUE on success. */ set_component_visible(component: ChannelType | null, visible: boolean): boolean; /** * Sets the specified XCF image's file. * * This procedure sets the specified image's file. * This is to set the XCF file associated with your image. In * particular, do not use this function to set the imported file in * file import plug-ins. This is done by the core process. * @param file The new image file. * @returns TRUE on success. */ set_file(file: Gio.File): boolean; /** * Set the image's metadata. * * Sets exif/iptc/xmp metadata on the image, or deletes it if * `metadata` is %NULL. * @param metadata The exif/ptc/xmp metadata. * @returns TRUE on success. */ set_metadata(metadata: Metadata): boolean; /** * Set the image's colormap to a copy of `palette` * * This procedure changes the image's colormap to an exact copy of * `palette` and returns the palette of `image`. * If the image is not in Indexed color mode, nothing happens and %NULL * is returned. * @param new_palette The palette to copy from. * @returns The image's colormap palette. */ set_palette(new_palette: Palette): Palette; /** * Sets the specified image's resolution. * * This procedure sets the specified image's resolution in dots per * inch. This value is independent of any of the layers in this image. * No scaling or resizing is performed. * @param xresolution The new image resolution in the x-axis, in dots per inch. * @param yresolution The new image resolution in the y-axis, in dots per inch. * @returns TRUE on success. */ set_resolution(xresolution: number, yresolution: number): boolean; /** * Sets the specified image's selected channels. * * The channels are set as the selected channels in the image. Any * previous selected layers or channels are unselected. An exception is * a previously existing floating selection, in which case this * procedure will return an execution error. * @param channels The list of channels to select. * @returns TRUE on success. */ set_selected_channels(channels: Channel[]): boolean; /** * Sets the specified image's selected layers. * * The layers are set as the selected layers in the image. Any previous * selected layers or channels are unselected. An exception is a * previously existing floating selection, in which case this procedure * will return an execution error. * @param layers The list of layers to select. * @returns TRUE on success. */ set_selected_layers(layers: Layer[]): boolean; /** * Sets the specified image's selected paths. * * The paths are set as the selected paths in the image. * @param paths The list of paths to select. * @returns TRUE on success. */ set_selected_paths(paths: Path[]): boolean; /** * Sets whether the image has Black Point Compensation enabled for its * simulation * * This procedure whether the image has Black Point Compensation * enabled for its simulation * @param bpc The Black Point Compensation status. * @returns TRUE on success. */ set_simulation_bpc(bpc: boolean): boolean; /** * Sets the image's simulation rendering intent * * This procedure sets the image's simulation rendering intent. * @param intent A GimpColorRenderingIntent. * @returns TRUE on success. */ set_simulation_intent(intent: ColorRenderingIntent | null): boolean; /** * Sets the image's simulation color profile * * This procedure sets the image's simulation color profile. * @param profile A #GimpColorProfile, or %NULL. * @returns %TRUE on success. */ set_simulation_profile(profile?: ColorProfile | null): boolean; /** * Sets the image's simulation color profile from an ICC file * * This procedure sets the image's simulation color profile from a file * containing an ICC profile, or unsets it if NULL is passed as 'file'. * This procedure does no color conversion. * @param file The file containing the new simulation color profile. * @returns TRUE on success. */ set_simulation_profile_from_file(file: Gio.File): boolean; /** * Set the tattoo state associated with the image. * * This procedure sets the tattoo state of the image. Use only by * save/load plug-ins that wish to preserve an images tattoo state. * Using this function at other times will produce unexpected results. * A full check of uniqueness of states in layers, channels and paths * will be performed by this procedure and a execution failure will be * returned if this fails. A failure will also be returned if the new * tattoo state value is less than the maximum tattoo value from all of * the tattoos from the paths, layers and channels. After the image * data has been loaded and all the tattoos have been set then this is * the last procedure that should be called. If effectively does a * status check on the tattoo values that have been set to make sure * that all is OK. * @param tattoo_state The new image tattoo state. * @returns TRUE on success. */ set_tattoo_state(tattoo_state: number): boolean; /** * Sets the specified image's unit. * * This procedure sets the specified image's unit. No scaling or * resizing is performed. This value is independent of any of the * layers in this image. See the gimp_unit_*() procedure definitions * for the valid range of unit IDs and a description of the unit * system. * @param unit The new image unit. * @returns TRUE on success. */ set_unit(unit: Unit): boolean; /** * The channels are set as the selected channels in the image. Any previous * selected layers or channels are unselected. An exception is a previously * existing floating selection, in which case this procedure will return an * execution error. * @param channels The list of channels to select. * @returns TRUE on success. */ take_selected_channels(channels: Channel[]): boolean; /** * The layers are set as the selected layers in the image. Any previous * selected layers or channels are unselected. An exception is a previously * existing floating selection, in which case this procedure will return an * execution error. * @param layers The list of layers to select. * @returns TRUE on success. */ take_selected_layers(layers: Layer[]): boolean; /** * The paths are set as the selected paths in the image. Any previous * selected paths are unselected. * @param paths The list of paths to select. * @returns TRUE on success. */ take_selected_paths(paths: Path[]): boolean; /** * Thaw the image's channel list. * * This procedure thaws the channel list of the image, re-enabling * updates to the Channels dialog. * * This procedure should match a corresponding call to * gimp_image_freeze_channels(). * @returns TRUE on success. */ thaw_channels(): boolean; /** * Thaw the image's layer list. * * This procedure thaws the layer list of the image, re-enabling * updates to the Layers dialog. * * This procedure should match a corresponding call to * gimp_image_freeze_layers(). * @returns TRUE on success. */ thaw_layers(): boolean; /** * Thaw the image's path list. * * This procedure thaws the path list of the image, re-enabling updates * to the Paths dialog. * * This procedure should match a corresponding call to * gimp_image_freeze_paths(). * @returns TRUE on success. */ thaw_paths(): boolean; /** * Disable the image's undo stack. * * This procedure disables the image's undo stack, allowing subsequent * operations to ignore their undo steps. This is generally called in * conjunction with gimp_image_undo_enable() to temporarily disable an * image undo stack. This is advantageous because saving undo steps can * be time and memory intensive. * @returns TRUE if the image undo has been disabled. */ undo_disable(): boolean; /** * Enable the image's undo stack. * * This procedure enables the image's undo stack, allowing subsequent * operations to store their undo steps. This is generally called in * conjunction with gimp_image_undo_disable() to temporarily disable an * image undo stack. * @returns TRUE if the image undo has been enabled. */ undo_enable(): boolean; /** * Freeze the image's undo stack. * * This procedure freezes the image's undo stack, allowing subsequent * operations to ignore their undo steps. This is generally called in * conjunction with gimp_image_undo_thaw() to temporarily disable an * image undo stack. This is advantageous because saving undo steps can * be time and memory intensive. gimp_image_undo_freeze() / * gimp_image_undo_thaw() and gimp_image_undo_disable() / * gimp_image_undo_enable() differ in that the former does not free up * all undo steps when undo is thawed, so is more suited to interactive * in-situ previews. It is important in this case that the image is * back to the same state it was frozen in before thawing, else 'undo' * behavior is undefined. * @returns TRUE if the image undo has been frozen. */ undo_freeze(): boolean; /** * Finish a group undo. * * This function must be called once for each * gimp_image_undo_group_start() call that is made. * @returns TRUE on success. */ undo_group_end(): boolean; /** * Starts a group undo. * * This function is used to start a group undo--necessary for logically * combining two or more undo operations into a single operation. This * call must be used in conjunction with a gimp_image_undo_group_end() * call. * @returns TRUE on success. */ undo_group_start(): boolean; /** * Check if the image's undo stack is enabled. * * This procedure checks if the image's undo stack is currently enabled * or disabled. This is useful when several plug-ins or scripts call * each other and want to check if their caller has already used * gimp_image_undo_disable() or gimp_image_undo_freeze(). * @returns TRUE if undo is enabled for this image. */ undo_is_enabled(): boolean; /** * Thaw the image's undo stack. * * This procedure thaws the image's undo stack, allowing subsequent * operations to store their undo steps. This is generally called in * conjunction with gimp_image_undo_freeze() to temporarily freeze an * image undo stack. gimp_image_undo_thaw() does NOT free the undo * stack as gimp_image_undo_enable() does, so is suited for situations * where one wishes to leave the undo stack in the same state in which * one found it despite non-destructively playing with the image in the * meantime. An example would be in-situ plug-in previews. Balancing * freezes and thaws and ensuring image consistency is the * responsibility of the caller. * @returns TRUE if the image undo has been thawed. */ undo_thaw(): boolean; /** * Unsets the active channel in the specified image. * * If an active channel exists, it is unset. There then exists no * active channel, and if desired, one can be set through a call to * 'Set Active Channel'. No error is returned in the case of no * existing active channel. * @returns TRUE on success. */ unset_active_channel(): boolean; } namespace ImageProcedure { // Constructor properties interface interface ConstructorProps extends Procedure.ConstructorProps {} } /** * A [class`Procedure]` subclass that makes it easier to write standard plug-in * procedures that operate on drawables. * * It automatically adds the standard * * ( [enum`RunMode]`, [class`Image]`, [class`Drawable]` ) * * arguments of an image procedure. It is possible to add additional * arguments. * * When invoked via [method`Procedure`.run], it unpacks these standard * arguments and calls `run_func` which is a [callback`RunImageFunc]`. The * "args" [struct`ValueArray]` of [callback`RunImageFunc]` only contains * additionally added arguments. */ class ImageProcedure extends Procedure { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( plug_in: PlugIn, name: string, proc_type: PDBProcType, run_func: RunImageFunc, run_data_destroy?: GLib.DestroyNotify | null, ): ImageProcedure; // Conflicted with Gimp.Procedure.new static ['new'](...args: never[]): any; } namespace Item { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { id: number; } } /** * Functions to manipulate items. */ abstract class Item extends GObject.Object { static $gtype: GObject.GType; // Properties get id(): number; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Returns a #GimpItem representing `item_id`. Since #GimpItem is an * abstract class, the real object type will actually be the proper * subclass. * * Note: in most use cases, you should not need to retrieve a #GimpItem * by its ID, which is mostly internal data and not reusable across * sessions. Use the appropriate functions for your use case instead. * @param item_id The item id. */ static get_by_id(item_id: number): Item | null; /** * Returns whether the item ID is a channel. * * This procedure returns %TRUE if the specified item ID is a channel. * * *Note*: in most use cases, you should not use this function. See * [func`Gimp`.Item.id_is_layer] for a discussion on alternatives. * @param item_id The item ID. */ static id_is_channel(item_id: number): boolean; /** * Returns whether the item ID is a drawable. * * This procedure returns %TRUE if the specified item ID is a drawable. * * *Note*: in most use cases, you should not use this function. See * [func`Gimp`.Item.id_is_layer] for a discussion on alternatives. * @param item_id The item ID. */ static id_is_drawable(item_id: number): boolean; /** * Returns whether the item ID is a group layer. * * This procedure returns %TRUE if the specified item ID is a group * layer. * * *Note*: in most use cases, you should not use this function. See * [func`Gimp`.Item.id_is_layer] for a discussion on alternatives. * @param item_id The item ID. */ static id_is_group_layer(item_id: number): boolean; /** * Returns whether the item ID is a layer. * * This procedure returns %TRUE if the specified item ID is a layer. * * *Note*: in most use cases, you should not use this function. If the * goal is to verify the accurate type for a [class`Gimp`.Item], you * should either use [method`Gimp`.Item.is_layer] or the specific * type-checking methods for the used language. * * For instance, in C: * * ```C * if (GIMP_IS_LAYER (item)) * do_something (); * ``` * * Or in the Python binding, you could run: * * ```py3 * if isinstance(item, Gimp.Layer): * do_something() * ``` * @param item_id The item ID. */ static id_is_layer(item_id: number): boolean; /** * Returns whether the item ID is a layer mask. * * This procedure returns %TRUE if the specified item ID is a layer * mask. * * *Note*: in most use cases, you should not use this function. See * [func`Gimp`.Item.id_is_layer] for a discussion on alternatives. * @param item_id The item. */ static id_is_layer_mask(item_id: number): boolean; /** * Returns whether the item ID is a path. * * This procedure returns %TRUE if the specified item ID is a path. * * *Note*: in most use cases, you should not use this function. See * [func`Gimp`.Item.id_is_layer] for a discussion on alternatives. * @param item_id The item ID. */ static id_is_path(item_id: number): boolean; /** * Returns whether the item ID is a selection. * * This procedure returns %TRUE if the specified item ID is a * selection. * * *Note*: in most use cases, you should not use this function. See * [func`Gimp`.Item.id_is_layer] for a discussion on alternatives. * @param item_id The item ID. */ static id_is_selection(item_id: number): boolean; /** * Returns whether the item ID is a text layer. * * This procedure returns %TRUE if the specified item ID is a text * layer. * * *Note*: in most use cases, you should not use this function. See * [func`Gimp`.Item.id_is_layer] for a discussion on alternatives. * @param item_id The item ID. */ static id_is_text_layer(item_id: number): boolean; /** * Returns %TRUE if the item ID is valid. * * This procedure checks if the given item ID is valid and refers to an * existing item. * * *Note*: in most use cases, you should not use this function. If you * got a [class`Gimp`.Item] from the API, you should trust it is valid. * This function is mostly for internal usage. * @param item_id The item ID to check. */ static id_is_valid(item_id: number): boolean; // Methods /** * Add a parasite to an item. * * This procedure attaches a parasite to an item. It has no return * values. * @param parasite The parasite to attach to the item. * @returns TRUE on success. */ attach_parasite(parasite: Parasite): boolean; /** * Delete a item. * * This procedure deletes the specified item. This must not be done if * the image containing this item was already deleted or if the item * was already removed from the image. The only case in which this * procedure is useful is if you want to get rid of a item which has * not yet been added to an image. * @returns TRUE on success. */ ['delete'](): boolean; /** * Removes a parasite from an item. * * This procedure detaches a parasite from an item. It has no return * values. * @param name The name of the parasite to detach from the item. * @returns TRUE on success. */ detach_parasite(name: string): boolean; /** * Returns the item's list of children. * * This procedure returns the list of items which are children of the * specified item. The order is topmost to bottommost. * @returns The item's list of children. The returned value must be freed with g_free(). */ get_children(): Item[]; /** * Get the color tag of the specified item. * * This procedure returns the specified item's color tag. * @returns The item's color tag. */ get_color_tag(): ColorTag; /** * Returns whether the item is expanded. * * This procedure returns %TRUE if the specified item is expanded. * @returns TRUE if the item is expanded, FALSE otherwise. */ get_expanded(): boolean; /** * Note: in most use cases, you should not need an item's ID which is * mostly internal data and not reusable across sessions. * @returns the item ID. */ get_id(): number; /** * Returns the item's image. * * This procedure returns the item's image. * @returns The item's image. */ get_image(): Image; /** * Get the 'lock content' state of the specified item. * * This procedure returns the specified item's lock content state. * @returns Whether the item's contents are locked. */ get_lock_content(): boolean; /** * Get the 'lock position' state of the specified item. * * This procedure returns the specified item's lock position state. * @returns Whether the item's position is locked. */ get_lock_position(): boolean; /** * Get the 'lock visibility' state of the specified item. * * This procedure returns the specified item's lock visibility state. * @returns Whether the item's visibility is locked. */ get_lock_visibility(): boolean; /** * Get the name of the specified item. * * This procedure returns the specified item's name. * @returns The item name. The returned value must be freed with g_free(). */ get_name(): string; /** * Look up a parasite in an item * * Finds and returns the parasite that is attached to an item. * @param name The name of the parasite to find. * @returns The found parasite. */ get_parasite(name: string): Parasite; /** * List all parasites. * * Returns a list of all parasites currently attached the an item. * @returns The names of currently attached parasites. The returned value must be freed with g_strfreev(). */ get_parasite_list(): string[]; /** * Returns the item's parent item. * * This procedure returns the item's parent item, if any. * @returns The item's parent item. */ get_parent(): Item; /** * Get the tattoo of the specified item. * * This procedure returns the specified item's tattoo. A tattoo is a * unique and permanent identifier attached to a item that can be used * to uniquely identify a item within an image even between sessions. * @returns The item tattoo. */ get_tattoo(): number; /** * Get the visibility of the specified item. * * This procedure returns the specified item's visibility. * @returns The item visibility. */ get_visible(): boolean; /** * Returns whether the item is a channel. * * This procedure returns TRUE if the specified item is a channel. * @returns TRUE if the item is a channel, FALSE otherwise. */ is_channel(): boolean; /** * Returns whether the item is a drawable. * * This procedure returns TRUE if the specified item is a drawable. * @returns TRUE if the item is a drawable, FALSE otherwise. */ is_drawable(): boolean; /** * Returns whether the item is a group item. * * This procedure returns %TRUE if the specified item is a group item * which can have children. * @returns TRUE if the item is a group, FALSE otherwise. */ is_group(): boolean; /** * Returns whether the item is a group layer. * * This procedure returns TRUE if the specified item is a group * layer. * @returns TRUE if the item is a group layer, FALSE otherwise. */ is_group_layer(): boolean; /** * Returns whether the item is a layer. * * This procedure returns TRUE if the specified item is a layer. * @returns TRUE if the item is a layer, FALSE otherwise. */ is_layer(): boolean; /** * Returns whether the item is a layer mask. * * This procedure returns TRUE if the specified item is a layer * mask. * @returns TRUE if the item is a layer mask, FALSE otherwise. */ is_layer_mask(): boolean; /** * Returns whether the item is a path. * * This procedure returns TRUE if the specified item is a path. * @returns TRUE if the item is a path, FALSE otherwise. */ is_path(): boolean; /** * Returns whether the item is a selection. * * This procedure returns TRUE if the specified item is a selection. * @returns TRUE if the item is a selection, FALSE otherwise. */ is_selection(): boolean; /** * Returns whether the item is a text layer. * * This procedure returns TRUE if the specified item is a text * layer. * @returns TRUE if the item is a text layer, FALSE otherwise. */ is_text_layer(): boolean; /** * Returns TRUE if the item is valid. * * This procedure checks if the given item is valid and refers to an * existing item. * @returns Whether the item is valid. */ is_valid(): boolean; /** * Set the color tag of the specified item. * * This procedure sets the specified item's color tag. * @param color_tag The new item color tag. * @returns TRUE on success. */ set_color_tag(color_tag: ColorTag | null): boolean; /** * Sets the expanded state of the item. * * This procedure expands or collapses the item. * @param expanded TRUE to expand the item, FALSE to collapse the item. * @returns TRUE on success. */ set_expanded(expanded: boolean): boolean; /** * Set the 'lock content' state of the specified item. * * This procedure sets the specified item's lock content state. * @param lock_content The new item 'lock content' state. * @returns TRUE on success. */ set_lock_content(lock_content: boolean): boolean; /** * Set the 'lock position' state of the specified item. * * This procedure sets the specified item's lock position state. * @param lock_position The new item 'lock position' state. * @returns TRUE on success. */ set_lock_position(lock_position: boolean): boolean; /** * Set the 'lock visibility' state of the specified item. * * This procedure sets the specified item's lock visibility state. * @param lock_visibility The new item 'lock visibility' state. * @returns TRUE on success. */ set_lock_visibility(lock_visibility: boolean): boolean; /** * Set the name of the specified item. * * This procedure sets the specified item's name. * @param name The new item name. * @returns TRUE on success. */ set_name(name: string): boolean; /** * Set the tattoo of the specified item. * * This procedure sets the specified item's tattoo. A tattoo is a * unique and permanent identifier attached to a item that can be used * to uniquely identify a item within an image even between sessions. * @param tattoo The new item tattoo. * @returns TRUE on success. */ set_tattoo(tattoo: number): boolean; /** * Set the visibility of the specified item. * * This procedure sets the specified item's visibility. * @param visible The new item visibility. * @returns TRUE on success. */ set_visible(visible: boolean): boolean; /** * Transform the specified item in 2d. * * This procedure transforms the specified item. * * The transformation is done by scaling by the x and y scale factors * about the point (source_x, source_y), then rotating around the same * point, then translating that point to the new position (dest_x, * dest_y). * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then transformed as * specified. The return value is the ID of the transformed floating * selection. * * If there is no selection or the item is not a drawable, the entire * item will be transformed according to the specified parameters. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_interpolation(), * gimp_context_set_transform_direction(), * gimp_context_set_transform_resize(). * @param source_x X coordinate of the transformation center. * @param source_y Y coordinate of the transformation center. * @param scale_x Amount to scale in x direction. * @param scale_y Amount to scale in y direction. * @param angle The angle of rotation (radians). * @param dest_x X coordinate of where the center goes. * @param dest_y Y coordinate of where the center goes. * @returns The transformed item. */ transform_2d( source_x: number, source_y: number, scale_x: number, scale_y: number, angle: number, dest_x: number, dest_y: number, ): Item; /** * Flip the specified item around a given line. * * This procedure flips the specified item. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then flipped. The axis to * flip around is specified by specifying two points from that line. * The return value is the ID of the flipped floating selection. * * If there is no selection or the item is not a drawable, the entire * item will be flipped around the specified axis. The return value * will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_interpolation(), * gimp_context_set_transform_direction(), * gimp_context_set_transform_resize(). * @param x0 horz. coord. of one end of axis. * @param y0 vert. coord. of one end of axis. * @param x1 horz. coord. of other end of axis. * @param y1 vert. coord. of other end of axis. * @returns The flipped item. */ transform_flip(x0: number, y0: number, x1: number, y1: number): Item; /** * Flip the specified item either vertically or horizontally. * * This procedure flips the specified item. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then flipped. If auto_center * is set to TRUE, the flip is around the selection's center. * Otherwise, the coordinate of the axis needs to be specified. The * return value is the ID of the flipped floating selection. * * If there is no selection or the item is not a drawable, the entire * item will be flipped around its center if auto_center is set to * TRUE, otherwise the coordinate of the axis needs to be specified. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_transform_resize(). * @param flip_type Type of flip. * @param auto_center Whether to automatically position the axis in the selection center. * @param axis coord. of flip axis. * @returns The flipped item. */ transform_flip_simple(flip_type: OrientationType | null, auto_center: boolean, axis: number): Item; /** * Transform the specified item in 2d. * * This procedure transforms the specified item. * * The transformation is done by assembling a 3x3 matrix from the * coefficients passed. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then transformed as * specified. The return value is the ID of the transformed floating * selection. * * If there is no selection or the item is not a drawable, the entire * item will be transformed according to the specified matrix. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_interpolation(), * gimp_context_set_transform_direction(), * gimp_context_set_transform_resize(). * @param coeff_0_0 coefficient (0,0) of the transformation matrix. * @param coeff_0_1 coefficient (0,1) of the transformation matrix. * @param coeff_0_2 coefficient (0,2) of the transformation matrix. * @param coeff_1_0 coefficient (1,0) of the transformation matrix. * @param coeff_1_1 coefficient (1,1) of the transformation matrix. * @param coeff_1_2 coefficient (1,2) of the transformation matrix. * @param coeff_2_0 coefficient (2,0) of the transformation matrix. * @param coeff_2_1 coefficient (2,1) of the transformation matrix. * @param coeff_2_2 coefficient (2,2) of the transformation matrix. * @returns The transformed item. */ transform_matrix( coeff_0_0: number, coeff_0_1: number, coeff_0_2: number, coeff_1_0: number, coeff_1_1: number, coeff_1_2: number, coeff_2_0: number, coeff_2_1: number, coeff_2_2: number, ): Item; /** * Perform a possibly non-affine transformation on the specified item. * * This procedure performs a possibly non-affine transformation on the * specified item by allowing the corners of the original bounding box * to be arbitrarily remapped to any values. * * The 4 coordinates specify the new locations of each corner of the * original bounding box. By specifying these values, any affine * transformation (rotation, scaling, translation) can be affected. * Additionally, these values can be specified such that the resulting * transformed item will appear to have been projected via a * perspective transform. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then transformed as * specified. The return value is the ID of the transformed floating * selection. * * If there is no selection or the item is not a drawable, the entire * item will be transformed according to the specified mapping. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_interpolation(), * gimp_context_set_transform_direction(), * gimp_context_set_transform_resize(). * @param x0 The new x coordinate of upper-left corner of original bounding box. * @param y0 The new y coordinate of upper-left corner of original bounding box. * @param x1 The new x coordinate of upper-right corner of original bounding box. * @param y1 The new y coordinate of upper-right corner of original bounding box. * @param x2 The new x coordinate of lower-left corner of original bounding box. * @param y2 The new y coordinate of lower-left corner of original bounding box. * @param x3 The new x coordinate of lower-right corner of original bounding box. * @param y3 The new y coordinate of lower-right corner of original bounding box. * @returns The transformed item. */ transform_perspective( x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, ): Item; /** * Rotate the specified item about given coordinates through the * specified angle. * * This function rotates the specified item. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then rotated by the * specified amount. If auto_center is set to TRUE, the rotation is * around the selection's center. Otherwise, the coordinate of the * center point needs to be specified. The return value is the ID of * the rotated floating selection. * * If there is no selection or the item is not a drawable, the entire * item will be rotated around its center if auto_center is set to * TRUE, otherwise the coordinate of the center point needs to be * specified. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_interpolation(), * gimp_context_set_transform_direction(), * gimp_context_set_transform_resize(). * @param angle The angle of rotation (radians). * @param auto_center Whether to automatically rotate around the selection center. * @param center_x The hor. coordinate of the center of rotation. * @param center_y The vert. coordinate of the center of rotation. * @returns The rotated item. */ transform_rotate(angle: number, auto_center: boolean, center_x: number, center_y: number): Item; /** * Rotate the specified item about given coordinates through the * specified angle. * * This function rotates the specified item. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then rotated by the * specified amount. If auto_center is set to TRUE, the rotation is * around the selection's center. Otherwise, the coordinate of the * center point needs to be specified. The return value is the ID of * the rotated floating selection. * * If there is no selection or the item is not a drawable, the entire * item will be rotated around its center if auto_center is set to * TRUE, otherwise the coordinate of the center point needs to be * specified. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_transform_resize(). * @param rotate_type Type of rotation. * @param auto_center Whether to automatically rotate around the selection center. * @param center_x The hor. coordinate of the center of rotation. * @param center_y The vert. coordinate of the center of rotation. * @returns The rotated item. */ transform_rotate_simple( rotate_type: RotationType | null, auto_center: boolean, center_x: number, center_y: number, ): Item; /** * Scale the specified item. * * This procedure scales the specified item. * * The 2 coordinates specify the new locations of the top-left and * bottom-roght corners of the original bounding box. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then scaled as specified. * The return value is the ID of the scaled floating selection. * * If there is no selection or the item is not a drawable, the entire * item will be scaled according to the specified coordinates. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_interpolation(), * gimp_context_set_transform_direction(), * gimp_context_set_transform_resize(). * @param x0 The new x coordinate of the upper-left corner of the scaled region. * @param y0 The new y coordinate of the upper-left corner of the scaled region. * @param x1 The new x coordinate of the lower-right corner of the scaled region. * @param y1 The new y coordinate of the lower-right corner of the scaled region. * @returns The scaled item. */ transform_scale(x0: number, y0: number, x1: number, y1: number): Item; /** * Shear the specified item about its center by the specified * magnitude. * * This procedure shears the specified item. * * The shear type parameter indicates whether the shear will be applied * horizontally or vertically. The magnitude can be either positive or * negative and indicates the extent (in pixels) to shear by. * * If a selection exists and the item is a drawable, the portion of the * drawable which lies under the selection is cut from the drawable and * made into a floating selection which is then sheared as specified. * The return value is the ID of the sheared floating selection. * * If there is no selection or the item is not a drawable, the entire * item will be sheared according to the specified parameters. * The return value will be equal to the item ID supplied as input. * * This procedure is affected by the following context setters: * gimp_context_set_interpolation(), * gimp_context_set_transform_direction(), * gimp_context_set_transform_resize(). * @param shear_type Type of shear. * @param magnitude The magnitude of the shear. * @returns The sheared item. */ transform_shear(shear_type: OrientationType | null, magnitude: number): Item; /** * Translate the item by the specified offsets. * * This procedure translates the item by the amounts specified in the * off_x and off_y arguments. These can be negative, and are considered * offsets from the current position. The offsets will be rounded to * the nearest pixel unless the item is a path. * @param off_x Offset in x direction. * @param off_y Offset in y direction. * @returns The translated item. */ transform_translate(off_x: number, off_y: number): Item; } namespace Layer { // Constructor properties interface interface ConstructorProps extends Drawable.ConstructorProps {} } /** * Operations on a single layer. */ class Layer extends Drawable { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( image: Image, name: string | null, width: number, height: number, type: ImageType, opacity: number, mode: LayerMode, ): Layer; static new_from_drawable(drawable: Drawable, dest_image: Image): Layer; static new_from_pixbuf( image: Image, name: string, pixbuf: GdkPixbuf.Pixbuf, opacity: number, mode: LayerMode, progress_start: number, progress_end: number, ): Layer; static new_from_surface( image: Image, name: string, surface: cairo.Surface, progress_start: number, progress_end: number, ): Layer; static new_from_visible(image: Image, dest_image: Image, name?: string | null): Layer; // Static methods /** * Get the specified mask's layer. * * This procedure returns the specified mask's layer , or -1 if none * exists. * @param mask Mask for which to return the layer. */ static from_mask(mask: LayerMask): Layer; /** * Returns a #GimpLayer representing `layer_id`. This function calls * gimp_item_get_by_id() and returns the item if it is layer or %NULL * otherwise. * @param layer_id The layer id. */ static get_by_id(layer_id: number): Layer | null; // Methods /** * Add an alpha channel to the layer if it doesn't already have one. * * This procedure adds an additional component to the specified layer * if it does not already possess an alpha channel. An alpha channel * makes it possible to clear and erase to transparency, instead of the * background color. This transforms layers of type RGB to RGBA, GRAY * to GRAYA, and INDEXED to INDEXEDA. * @returns TRUE on success. */ add_alpha(): boolean; /** * Add a layer mask to the specified layer. * * This procedure adds a layer mask to the specified layer. Layer masks * serve as an additional alpha channel for a layer. This procedure * will fail if a number of prerequisites aren't met. The layer cannot * already have a layer mask. The specified mask must exist and have * the same dimensions as the layer. The layer must have been created * for use with the specified image and the mask must have been created * with the procedure 'gimp-layer-create-mask'. * @param mask The mask to add to the layer. * @returns TRUE on success. */ add_mask(mask: LayerMask): boolean; /** * Copy a layer. * * This procedure copies the specified layer and returns the copy. The * newly copied layer is for use within the original layer's image. It * should not be subsequently added to any other image. * @returns The newly copied layer. The object belongs to libgimp and you should not free it. */ copy(): Layer; /** * Create a layer mask for the specified layer. * * This procedure creates a layer mask for the specified layer. * Layer masks serve as an additional alpha channel for a layer. * Different types of masks are allowed for initialisation: * - white mask (leaves the layer fully visible); * - black mask (gives the layer complete transparency); * - the layer's alpha channel (either a copy, or a transfer, which * leaves the layer fully visible, but which may be more useful than a * white mask); * - the current selection; * - a grayscale copy of the layer; * - or a copy of the active channel. * * The layer mask still needs to be added to the layer. This can be * done with a call to gimp_layer_add_mask(). * * gimp_layer_create_mask() will fail if there are no active channels * on the image, when called with 'ADD-CHANNEL-MASK'. It will return a * black mask when called with 'ADD-ALPHA-MASK' or * 'ADD-ALPHA-TRANSFER-MASK' on a layer with no alpha channels, or with * 'ADD-SELECTION-MASK' when there is no selection on the image. * @param mask_type The type of mask. * @returns The newly created mask. */ create_mask(mask_type: AddMaskType | null): LayerMask; /** * Remove the alpha channel from the layer if it has one. * * This procedure removes the alpha channel from a layer, blending all * (partially) transparent pixels in the layer against the background * color. This transforms layers of type RGBA to RGB, GRAYA to GRAY, * and INDEXEDA to INDEXED. * @returns TRUE on success. */ flatten(): boolean; /** * Get the apply mask setting of the specified layer. * * This procedure returns the specified layer's apply mask setting. If * the value is TRUE, then the layer mask for this layer is currently * being composited with the layer's alpha channel. * @returns The layer's apply mask setting. */ get_apply_mask(): boolean; /** * Get the blend space of the specified layer. * * This procedure returns the specified layer's blend space. * @returns The layer blend space. */ get_blend_space(): LayerColorSpace; /** * Get the composite mode of the specified layer. * * This procedure returns the specified layer's composite mode. * @returns The layer composite mode. */ get_composite_mode(): LayerCompositeMode; /** * Get the composite space of the specified layer. * * This procedure returns the specified layer's composite space. * @returns The layer composite space. */ get_composite_space(): LayerColorSpace; /** * Get the edit mask setting of the specified layer. * * This procedure returns the specified layer's edit mask setting. If * the value is TRUE, then the layer mask for this layer is currently * active, and not the layer. * @returns The layer's edit mask setting. */ get_edit_mask(): boolean; /** * Get the lock alpha channel setting of the specified layer. * * This procedure returns the specified layer's lock alpha channel * setting. * @returns The layer's lock alpha channel setting. */ get_lock_alpha(): boolean; /** * Get the specified layer's mask if it exists. * * This procedure returns the specified layer's mask, or -1 if none * exists. * @returns The layer mask. */ get_mask(): LayerMask; /** * Get the combination mode of the specified layer. * * This procedure returns the specified layer's combination mode. * @returns The layer combination mode. */ get_mode(): LayerMode; /** * Get the opacity of the specified layer. * * This procedure returns the specified layer's opacity. * @returns The layer opacity. */ get_opacity(): number; /** * Get the show mask setting of the specified layer. * * This procedure returns the specified layer's show mask setting. This * controls whether the layer or its mask is visible. TRUE indicates * that the mask should be visible. If the layer has no mask, then this * function returns an error. * @returns The layer's show mask setting. */ get_show_mask(): boolean; /** * Is the specified layer a floating selection? * * This procedure returns whether the layer is a floating selection. * Floating selections are special cases of layers which are attached * to a specific drawable. * @returns TRUE if the layer is a floating selection. */ is_floating_sel(): boolean; /** * Remove the specified layer mask from the layer. * * This procedure removes the specified layer mask from the layer. If * the mask doesn't exist, an error is returned. * @param mode Removal mode. * @returns TRUE on success. */ remove_mask(mode: MaskApplyMode | null): boolean; /** * Resize the layer to the specified extents. * * This procedure resizes the layer so that its new width and height * are equal to the supplied parameters. Offsets are also provided * which describe the position of the previous layer's content. This * operation only works if the layer has been added to an image. * @param new_width New layer width. * @param new_height New layer height. * @param offx x offset between upper left corner of old and new layers: (old - new). * @param offy y offset between upper left corner of old and new layers: (old - new). * @returns TRUE on success. */ resize(new_width: number, new_height: number, offx: number, offy: number): boolean; /** * Resize a layer to the image size. * * This procedure resizes the layer so that it's new width and height * are equal to the width and height of its image container. * @returns TRUE on success. */ resize_to_image_size(): boolean; /** * Scale the layer using the default interpolation method. * * This procedure scales the layer so that its new width and height are * equal to the supplied parameters. The 'local-origin' parameter * specifies whether to scale from the center of the layer, or from the * image origin. This operation only works if the layer has been added * to an image. The interpolation method used can be set with * gimp_context_set_interpolation(). * @param new_width New layer width. * @param new_height New layer height. * @param local_origin Use a local origin (as opposed to the image origin). * @returns TRUE on success. */ scale(new_width: number, new_height: number, local_origin: boolean): boolean; /** * Set the apply mask setting of the specified layer. * * This procedure sets the specified layer's apply mask setting. This * controls whether the layer's mask is currently affecting the alpha * channel. If there is no layer mask, this function will return an * error. * @param apply_mask The new layer's apply mask setting. * @returns TRUE on success. */ set_apply_mask(apply_mask: boolean): boolean; /** * Set the blend space of the specified layer. * * This procedure sets the specified layer's blend space. * @param blend_space The new layer blend space. * @returns TRUE on success. */ set_blend_space(blend_space: LayerColorSpace | null): boolean; /** * Set the composite mode of the specified layer. * * This procedure sets the specified layer's composite mode. * @param composite_mode The new layer composite mode. * @returns TRUE on success. */ set_composite_mode(composite_mode: LayerCompositeMode | null): boolean; /** * Set the composite space of the specified layer. * * This procedure sets the specified layer's composite space. * @param composite_space The new layer composite space. * @returns TRUE on success. */ set_composite_space(composite_space: LayerColorSpace | null): boolean; /** * Set the edit mask setting of the specified layer. * * This procedure sets the specified layer's edit mask setting. This * controls whether the layer or it's mask is currently active for * editing. If the specified layer has no layer mask, then this * procedure will return an error. * @param edit_mask The new layer's edit mask setting. * @returns TRUE on success. */ set_edit_mask(edit_mask: boolean): boolean; /** * Set the lock alpha channel setting of the specified layer. * * This procedure sets the specified layer's lock alpha channel * setting. * @param lock_alpha The new layer's lock alpha channel setting. * @returns TRUE on success. */ set_lock_alpha(lock_alpha: boolean): boolean; /** * Set the combination mode of the specified layer. * * This procedure sets the specified layer's combination mode. * @param mode The new layer combination mode. * @returns TRUE on success. */ set_mode(mode: LayerMode | null): boolean; /** * Set the layer offsets. * * This procedure sets the offsets for the specified layer. The offsets * are relative to the image origin and can be any values. This * operation is valid only on layers which have been added to an image. * @param offx Offset in x direction. * @param offy Offset in y direction. * @returns TRUE on success. */ set_offsets(offx: number, offy: number): boolean; /** * Set the opacity of the specified layer. * * This procedure sets the specified layer's opacity. * @param opacity The new layer opacity. * @returns TRUE on success. */ set_opacity(opacity: number): boolean; /** * Set the show mask setting of the specified layer. * * This procedure sets the specified layer's show mask setting. This * controls whether the layer or its mask is visible. TRUE indicates * that the mask should be visible. If there is no layer mask, this * function will return an error. * @param show_mask The new layer's show mask setting. * @returns TRUE on success. */ set_show_mask(show_mask: boolean): boolean; } namespace LayerMask { // Constructor properties interface interface ConstructorProps extends Channel.ConstructorProps {} } class LayerMask extends Channel { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Returns a #GimpLayerMask representing `layer_mask_id`. This function * calls gimp_item_get_by_id() and returns the item if it is * layer_mask or %NULL otherwise. * @param layer_mask_id The layer_mask id. */ static get_by_id(layer_mask_id: number): LayerMask | null; } namespace LoadProcedure { // Constructor properties interface interface ConstructorProps extends FileProcedure.ConstructorProps {} } /** * A [class`Procedure]` subclass that makes it easier to write file load * procedures. * * It automatically adds the standard * * ( [enum`RunMode]`, [iface`Gio`.File] ) * * arguments and the standard * * ( [class`Image]` ) * * return value of a load procedure. It is possible to add additional * arguments. * * When invoked via [method`Procedure`.run], it unpacks these standard * arguments and calls `run_func` which is a [callback`RunImageFunc]`. The * "args" [struct`ValueArray]` of [callback`RunImageFunc]` only contains * additionally added arguments. */ class LoadProcedure extends FileProcedure { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( plug_in: PlugIn, name: string, proc_type: PDBProcType, run_func: RunLoadFunc, run_data_destroy?: GLib.DestroyNotify | null, ): LoadProcedure; // Conflicted with Gimp.Procedure.new static ['new'](...args: never[]): any; // Methods /** * Returns the procedure's 'handles raw' flag as set with * [method`GimpLoadProcedure`.set_handles_raw]. * @returns The procedure's 'handles raw' flag. */ get_handles_raw(): boolean; /** * Returns the procedure's thumbnail loader procedure as set with * [method`GimpLoadProcedure`.set_thumbnail_loader]. * @returns The procedure's thumbnail loader procedure */ get_thumbnail_loader(): string; /** * Registers a load procedure as capable of handling raw digital camera loads. * * Note that you cannot call this function on [class`VectorLoadProcedure]` * subclass objects. * @param handles_raw The procedure's handles raw flag. */ set_handles_raw(handles_raw: boolean): void; /** * Associates a thumbnail loader with a file load procedure. * * Some file formats allow for embedded thumbnails, other file formats * contain a scalable image or provide the image data in different * resolutions. A file plug-in for such a format may register a * special procedure that allows GIMP to load a thumbnail preview of * the image. This procedure is then associated with the standard * load procedure using this function. * @param thumbnail_proc The name of the thumbnail load procedure. */ set_thumbnail_loader(thumbnail_proc: string): void; } /** * Functions to (de)serialize a given memory size. */ class Memsize { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; // Static methods /** * Parses a string representation of a memory size as returned by * gimp_memsize_serialize(). * @param string a string as returned by gimp_memsize_serialize() */ static deserialize(string: string): [boolean, number]; /** * Creates a string representation of a given memory size. This string * can be parsed by gimp_memsize_deserialize() and can thus be used in * config files. It should not be displayed to the user. If you need a * nice human-readable string please use g_format_size(). * @param memsize memory size in bytes */ static serialize(memsize: number): string; } namespace Metadata { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } /** * Basic functions for handling #GimpMetadata objects. */ class Metadata extends GObject.Object { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](): Metadata; // Static methods /** * Deserializes a string of XML that has been created by * gimp_metadata_serialize(). * @param metadata_xml A string of serialized metadata XML. */ static deserialize(metadata_xml: string): Metadata; /** * Generate Version 4 UUID/GUID. */ static get_guid(): string; /** * Returns whether `tag` is supported in a file of type `mime_type`. * @param tag A metadata tag name * @param mime_type A mime type */ static is_tag_supported(tag: string, mime_type: string): boolean; /** * Loads #GimpMetadata from `file`. * @param file The #GFile to load the metadata from */ static load_from_file(file: Gio.File): Metadata; // Methods add_xmp_history(state_status: string): void; /** * Duplicates a #GimpMetadata instance. * @returns The new #GimpMetadata, or %NULL if @metadata is %NULL. */ duplicate(): Metadata; /** * Returns values based on Exif.Photo.ColorSpace, Xmp.exif.ColorSpace, * Exif.Iop.InteroperabilityIndex, Exif.Nikon3.ColorSpace, * Exif.Canon.ColorSpace of `metadata`. * @returns The colorspace specified by above tags. */ get_colorspace(): MetadataColorspace; /** * Returns values based on Exif.Image.XResolution, * Exif.Image.YResolution and Exif.Image.ResolutionUnit of `metadata`. * @returns %TRUE on success, %FALSE otherwise. */ get_resolution(): [boolean, number, number, Unit | null]; /** * Saves `metadata` to `file`. * @param file The file to save the metadata to * @returns %TRUE on success, %FALSE otherwise. */ save_to_file(file: Gio.File): boolean; /** * Serializes `metadata` into an XML string that can later be deserialized * using gimp_metadata_deserialize(). * @returns The serialized XML string. */ serialize(): string; /** * Sets Exif.Image.BitsPerSample on `metadata`. * @param bits_per_sample Bits per pixel, per component */ set_bits_per_sample(bits_per_sample: number): void; /** * Sets Exif.Photo.ColorSpace, Xmp.exif.ColorSpace, * Exif.Iop.InteroperabilityIndex, Exif.Nikon3.ColorSpace, * Exif.Canon.ColorSpace of `metadata`. * @param colorspace The color space. */ set_colorspace(colorspace: MetadataColorspace | null): void; /** * Sets `Iptc.Application2.DateCreated`, `Iptc.Application2.TimeCreated`, * `Exif.Image.DateTime`, `Exif.Image.DateTimeOriginal`, * `Exif.Photo.DateTimeOriginal`, `Exif.Photo.DateTimeDigitized`, * `Exif.Photo.OffsetTime`, `Exif.Photo.OffsetTimeOriginal`, * `Exif.Photo.OffsetTimeDigitized`, `Xmp.xmp.CreateDate`, `Xmp.xmp.ModifyDate`, * `Xmp.xmp.MetadataDate`, `Xmp.photoshop.DateCreated` of `metadata`. * @param datetime A #GDateTime value */ set_creation_date(datetime: GLib.DateTime): void; /** * Sets the tags from a piece of Exif data on `metadata`. * @param exif_data The blob of Exif data to set * @returns %TRUE on success, %FALSE otherwise. */ set_from_exif(exif_data: Uint8Array | string): boolean; /** * Sets the tags from a piece of IPTC data on `metadata`. * @param iptc_data The blob of Iptc data to set * @returns %TRUE on success, %FALSE otherwise. */ set_from_iptc(iptc_data: Uint8Array | string): boolean; /** * Sets the tags from a piece of XMP data on `metadata`. * @param xmp_data The blob of XMP data to set * @returns %TRUE on success, %FALSE otherwise. */ set_from_xmp(xmp_data: Uint8Array | string): boolean; /** * Sets Exif.Image.ImageWidth and Exif.Image.ImageLength on `metadata`. * If already present, also sets Exif.Photo.PixelXDimension and * Exif.Photo.PixelYDimension. * @param width Width in pixels * @param height Height in pixels */ set_pixel_size(width: number, height: number): void; /** * Sets Exif.Image.XResolution, Exif.Image.YResolution and * Exif.Image.ResolutionUnit of `metadata`. * @param xres The image's X Resolution, in ppi * @param yres The image's Y Resolution, in ppi * @param unit The image's unit */ set_resolution(xres: number, yres: number, unit: Unit): void; } namespace Module { // Constructor properties interface interface ConstructorProps extends GObject.TypeModule.ConstructorProps, GObject.TypePlugin.ConstructorProps { auto_load: boolean; autoLoad: boolean; on_disk: boolean; onDisk: boolean; } } /** * #GimpModule is a generic mechanism to dynamically load modules into * GIMP. It is a #GTypeModule subclass, implementing module loading * using #GModule. #GimpModule does not know which functionality is * implemented by the modules, it just provides a framework to get * arbitrary #GType implementations loaded from disk. */ class Module extends GObject.TypeModule implements GObject.TypePlugin { static $gtype: GObject.GType; // Properties get auto_load(): boolean; set auto_load(val: boolean); get autoLoad(): boolean; set autoLoad(val: boolean); get on_disk(): boolean; get onDisk(): boolean; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](file: Gio.File, auto_load: boolean, verbose: boolean): Module; // Static methods /** * This function is never called directly. Use GIMP_MODULE_ERROR() instead. */ static error_quark(): GLib.Quark; static query(module: GObject.TypeModule): ModuleInfo; static register(module: GObject.TypeModule): boolean; // Virtual methods vfunc_modified(): void; // Methods /** * Returns whether this `module` in automatically loaded at startup. * @returns The @module's 'auto_load' property. */ get_auto_load(): boolean; /** * Returns #GFile of the `module,` * @returns The @module's #GFile. */ get_file(): Gio.File; get_info(): ModuleInfo; get_last_error(): string; get_state(): ModuleState; is_loaded(): boolean; is_on_disk(): boolean; /** * Queries the module without actually registering any of the types it * may implement. After successful query, gimp_module_get_info() can be * used to get further about the module. * @returns %TRUE on success. */ query_module(): boolean; /** * Sets the `auto_load` property of the module * @param auto_load Pass %FALSE to exclude this module from auto-loading */ set_auto_load(auto_load: boolean): void; // Inherited methods /** * Calls the `complete_interface_info` function from the * #GTypePluginClass of `plugin`. There should be no need to use this * function outside of the GObject type system itself. * @param instance_type the #GType of an instantiatable type to which the interface is added * @param interface_type the #GType of the interface whose info is completed * @param info the #GInterfaceInfo to fill in */ complete_interface_info( instance_type: GObject.GType, interface_type: GObject.GType, info: GObject.InterfaceInfo, ): void; /** * Calls the `complete_type_info` function from the #GTypePluginClass of `plugin`. * There should be no need to use this function outside of the GObject * type system itself. * @param g_type the #GType whose info is completed * @param info the #GTypeInfo struct to fill in * @param value_table the #GTypeValueTable to fill in */ complete_type_info( g_type: GObject.GType, info: GObject.TypeInfo, value_table: GObject.TypeValueTable, ): void; /** * Calls the `unuse_plugin` function from the #GTypePluginClass of * `plugin`. There should be no need to use this function outside of * the GObject type system itself. */ unuse(): void; /** * Calls the `use_plugin` function from the #GTypePluginClass of * `plugin`. There should be no need to use this function outside of * the GObject type system itself. */ use(): void; // Conflicted with GObject.TypeModule.use use(...args: never[]): any; /** * 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 ModuleDB { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, Gio.ListModel.ConstructorProps {} } /** * Keeps a list of #GimpModule's found in a given searchpath. */ class ModuleDB extends GObject.Object implements Gio.ListModel { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](verbose: boolean): ModuleDB; // Methods /** * Return the #G_SEARCHPATH_SEPARATOR delimited list of module filenames * which are excluded from auto-loading. * @returns the @db's @load_inhibit string. */ get_load_inhibit(): string; /** * Returns the 'verbose' setting of `db`. * @returns the 'verbose' setting. */ get_verbose(): boolean; /** * Scans the directories contained in `module_path` and creates a * #GimpModule instance for every loadable module contained in the * directories. * @param module_path A #G_SEARCHPATH_SEPARATOR delimited list of directories to load modules from. */ load(module_path: string): void; /** * Does the same as gimp_module_db_load(), plus removes all #GimpModule * instances whose modules have been deleted from disk. * * Note that the #GimpModule's will just be removed from the internal * list and not freed as this is not possible with #GTypeModule * instances which actually implement types. * @param module_path A #G_SEARCHPATH_SEPARATOR delimited list of directories to load modules from. */ refresh(module_path: string): void; /** * Sets the `load_inhibit` flag for all #GimpModule's which are kept * by `db` (using gimp_module_set_load_inhibit()). * @param load_inhibit A #G_SEARCHPATH_SEPARATOR delimited list of module filenames to exclude from auto-loading. */ set_load_inhibit(load_inhibit: string): void; /** * Sets the 'verbose' setting of `db`. * @param verbose the new 'verbose' setting */ set_verbose(verbose: boolean): void; // Inherited methods /** * Gets the type of the items in `list`. * * All items returned from g_list_model_get_item() are of the type * returned by this function, or a subtype, or if the type is an * interface, they are an implementation of that interface. * * The item type of a #GListModel can not change during the life of the * model. * @returns the #GType of the items contained in @list. */ get_item_type(): GObject.GType; /** * Gets the number of items in `list`. * * Depending on the model implementation, calling this function may be * less efficient than iterating the list with increasing values for * `position` until g_list_model_get_item() returns %NULL. * @returns the number of items in @list. */ get_n_items(): number; /** * Get the item at `position`. * * If `position` is greater than the number of items in `list,` %NULL is * returned. * * %NULL is never returned for an index that is smaller than the length * of the list. * * This function is meant to be used by language bindings in place * of g_list_model_get_item(). * * See also: g_list_model_get_n_items() * @param position the position of the item to fetch * @returns the object at @position. */ get_item(position: number): A | null; /** * Emits the #GListModel::items-changed signal on `list`. * * This function should only be called by classes implementing * #GListModel. It has to be called after the internal representation * of `list` has been updated, because handlers connected to this signal * might query the new state of the list. * * Implementations must only make changes to the model (as visible to * its consumer) in places that will not cause problems for that * consumer. For models that are driven directly by a write API (such * as #GListStore), changes can be reported in response to uses of that * API. For models that represent remote data, changes should only be * made from a fresh mainloop dispatch. It is particularly not * permitted to make changes in response to a call to the #GListModel * consumer API. * * Stated another way: in general, it is assumed that code making a * series of accesses to the model via the API, without returning to the * mainloop, and without calling other code, will continue to view the * same contents of the model. * @param position the position at which @list changed * @param removed the number of items removed * @param added the number of items added */ items_changed(position: number, removed: number, added: number): void; /** * Get the item at `position`. If `position` is greater than the number of * items in `list,` %NULL is returned. * * %NULL is never returned for an index that is smaller than the length * of the list. See g_list_model_get_n_items(). * * The same #GObject instance may not appear more than once in a #GListModel. * @param position the position of the item to fetch */ vfunc_get_item(position: number): A | null; /** * Gets the type of the items in `list`. * * All items returned from g_list_model_get_item() are of the type * returned by this function, or a subtype, or if the type is an * interface, they are an implementation of that interface. * * The item type of a #GListModel can not change during the life of the * model. */ vfunc_get_item_type(): GObject.GType; /** * Gets the number of items in `list`. * * Depending on the model implementation, calling this function may be * less efficient than iterating the list with increasing values for * `position` until g_list_model_get_item() returns %NULL. */ vfunc_get_n_items(): number; /** * 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 PDB { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } /** * Provides access to the Procedural DataBase (PDB). */ class PDB extends GObject.Object { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Methods /** * Dumps the current contents of the procedural database * * This procedure dumps the contents of the procedural database to the * specified `file`. The file will contain all of the information * provided for each registered procedure. * @param file The dump file. * @returns TRUE on success. */ dump_to_file(file: Gio.File): boolean; /** * Retrieves the error message from the last procedure call. * * If a procedure call fails, then it might pass an error message with * the return values. Plug-ins that are using the libgimp C wrappers * don't access the procedure return values directly. Thus #GimpPDB * stores the error message and makes it available with this * function. The next procedure call unsets the error message again. * * The returned string is owned by `pdb` and must not be freed or * modified. * @returns the error message */ get_last_error(): string; /** * Retrieves the status from the last procedure call. * @returns the #GimpPDBStatusType. */ get_last_status(): PDBStatusType; /** * This function returns the [class`Procedure]` which is registered * with `procedure_name` if it exists, or returns %NULL otherwise. * * The returned [class`Procedure]` is owned by `pdb` and must not be modified. * @param procedure_name A procedure name * @returns A [class@Procedure], or %NULL. */ lookup_procedure(procedure_name: string): Procedure | null; /** * This function checks if a procedure exists in the procedural * database. * @param procedure_name A procedure name * @returns %TRUE if the procedure exists, %FALSE otherwise. */ procedure_exists(procedure_name: string): boolean; /** * Queries the procedural database for its contents using regular * expression matching. * * This function queries the contents of the procedural database. It * is supplied with eight arguments matching procedures on * * { name, blurb, help, help-id, authors, copyright, date, procedure type}. * * This is accomplished using regular expression matching. For * instance, to find all procedures with "jpeg" listed in the blurb, * all seven arguments can be supplied as ".*", except for the second, * which can be supplied as ".*jpeg.*". There are two return arguments * for this procedure. The first is the number of procedures matching * the query. The second is a concatenated list of procedure names * corresponding to those matching the query. If no matching entries * are found, then the returned string is NULL and the number of * entries is 0. * @param name The regex for procedure name. * @param blurb The regex for procedure blurb. * @param help The regex for procedure help. * @param help_id The regex for procedure help-id. * @param authors The regex for procedure authors. * @param copyright The regex for procedure copyright. * @param date The regex for procedure date. * @param proc_type The regex for procedure type: { 'Internal GIMP procedure', 'GIMP Plug-in', 'GIMP Extension', 'Temporary Procedure' }. * @returns The list of procedure names. Free with g_strfreev(). */ query_procedures( name: string, blurb: string, help: string, help_id: string, authors: string, copyright: string, date: string, proc_type: string, ): string[]; /** * Generates a unique temporary PDB name. * * This function generates a temporary PDB entry name that is * guaranteed to be unique. * @returns A unique temporary name for a temporary PDB entry. The returned value must be freed with g_free(). */ temp_procedure_name(): string; } namespace Palette { // Constructor properties interface interface ConstructorProps extends Resource.ConstructorProps, ConfigInterface.ConstructorProps {} } /** * Installable object, a small set of colors a user can choose from. */ class Palette extends Resource implements ConfigInterface { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](name: string): Palette; // Static methods /** * Returns the palette with the given name. * * Returns an existing palette having the given name. Returns %NULL * when no palette exists of that name. * @param name The name of the palette. */ static get_by_name(name: string): Palette | null; // Conflicted with Gimp.Resource.get_by_name static get_by_name(...args: never[]): any; // Methods /** * Appends an entry to the palette. * * Appends an entry to the palette. Neither color nor name must be * unique within the palette. When name is the empty string, this sets * the entry name to \"Untitled\". Returns the index of the entry. * Returns an error when palette is not editable. * @param entry_name A name for the entry. * @param color The color for the added entry. * @returns TRUE on success. */ add_entry(entry_name: string | null, color: Gegl.Color): [boolean, number]; /** * Deletes an entry from the palette. * * This function will fail and return %FALSE if the index is out or * range or if the palette is not editable. * Additionally if the palette belongs to an indexed image, it will * only be possible to delete palette colors not in use in the image. * @param entry_num The index of the entry to delete. * @returns TRUE on success. */ delete_entry(entry_num: number): boolean; /** * Get the count of colors in the palette. * * Returns the number of colors in the palette. * @returns The number of colors in the palette. */ get_color_count(): number; /** * This procedure returns a palette's colormap as an array of bytes with * all colors converted to a given Babl `format`. * * The byte-size of the returned colormap depends on the number of * colors and on the bytes-per-pixel size of `format`. E.g. that the * following equality is ensured: * * ```C * num_bytes == num_colors * babl_format_get_bytes_per_pixel (format) * ``` * * Therefore `num_colors` and `num_bytes` are kinda redundant since both * indicate the size of the return value in a different way. You may * both set them to %NULL but not at the same time. * @param format The desired color format. * @returns The palette's colormap. */ get_colormap(format: Babl.Object): [Uint8Array, number]; /** * Gets colors in the palette. * * Returns an array of colors in the palette. Free the returned array * with gimp_color_array_free(). * @returns The colors in the palette. The returned value must be freed with gimp_color_array_free(). */ get_colors(): Gegl.Color[]; /** * Gets the number of columns used to display the palette * * Gets the preferred number of columns to display the palette. * @returns The number of columns used to display this palette. */ get_columns(): number; /** * Gets the color of an entry in the palette. * * Returns the color of the entry at the given zero-based index into * the palette. Returns %NULL when the index is out of range. * @param entry_num The index of the entry to get the color of. * @returns The color at the index. */ get_entry_color(entry_num: number): Gegl.Color; /** * Gets the name of an entry in the palette. * * Gets the name of the entry at the zero-based index into the palette. * Returns an error when the index is out of range. * @param entry_num The entry to get. * @returns TRUE on success. */ get_entry_name(entry_num: number): [boolean, string]; /** * This procedure sets the entries in the specified palette in one go, * though they must all be in the same `format`. * * The number of entries depens on the `num_bytes` size of `colormap` and * the bytes-per-pixel size of `format`. * The procedure will fail if `num_bytes` is not an exact multiple of the * number of bytes per pixel of `format`. * @param format The desired color format. @colormap (array length=num_bytes): The new colormap values. * @param colormap * @param num_bytes The byte-size of @colormap. * @returns %TRUE on success. */ set_colormap(format: Babl.Object, colormap: number, num_bytes: number): boolean; /** * Sets the number of columns used to display the palette * * Set the number of colors shown per row when the palette is * displayed. Returns an error when the palette is not editable. The * maximum allowed value is 64. * @param columns The new number of columns. * @returns TRUE on success. */ set_columns(columns: number): boolean; /** * Sets the color of an entry in the palette. * * Sets the color of the entry at the zero-based index into the * palette. Returns an error when the index is out of range. Returns an * error when the palette is not editable. * @param entry_num The entry to get. * @param color The new color. * @returns TRUE on success. */ set_entry_color(entry_num: number, color: Gegl.Color): boolean; /** * Sets the name of an entry in the palette. * * Sets the name of the entry at the zero-based index into the palette. * Returns an error if the index is out or range. Returns an error if * the palette is not editable. * @param entry_num The entry to get. * @param entry_name The new name. * @returns TRUE on success. */ set_entry_name(entry_num: number, entry_name?: string | null): boolean; // 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; } class ParamBrush extends ParamResource { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamChannel extends ParamDrawable { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamColor extends ParamObject { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamDoubleArray extends ParamArray { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamDrawable extends ParamItem { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamFile extends ParamObject { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamFont extends ParamResource { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamGradient extends ParamResource { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamGroupLayer extends ParamLayer { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamInt32Array extends ParamArray { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamLayer extends ParamDrawable { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamLayerMask extends ParamChannel { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamPalette extends ParamResource { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamPath extends ParamItem { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamPattern extends ParamResource { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamResource extends ParamObject { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamSelection extends ParamChannel { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamTextLayer extends ParamLayer { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } class ParamUnit extends ParamObject { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } namespace Path { // Constructor properties interface interface ConstructorProps extends Item.ConstructorProps {} } /** * Functions for querying and manipulating path. */ class Path extends Item { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](image: Image, name: string): Path; static new_from_text_layer(image: Image, layer: Layer): Path; // Static methods /** * This function frees the memory allocated for the list and the strings * it contains. * @param path A list of directories as returned by gimp_path_parse(). */ static free(path: string[]): void; /** * Returns a #GimpPath representing `path_id`. This function * calls gimp_item_get_by_id() and returns the item if it is a path * or %NULL otherwise. * @param path_id The path id. */ static get_by_id(path_id: number): Path | null; /** * Note that you have to g_free() the returned string. * @param path A list of directories as returned by gimp_path_parse(). */ static get_user_writable_dir(path: string[]): string; static parse(path: string, max_paths: number, check: boolean): [string[], string[]]; static to_str(path: string[]): string; // Methods /** * Extends a bezier stroke with a conic bezier spline. * * Extends a bezier stroke with a conic bezier spline. Actually a cubic * bezier spline gets added that realizes the shape of a conic bezier * spline. * @param stroke_id The stroke ID. * @param x0 The x-coordinate of the control point. * @param y0 The y-coordinate of the control point. * @param x1 The x-coordinate of the end point. * @param y1 The y-coordinate of the end point. * @returns TRUE on success. */ bezier_stroke_conicto(stroke_id: number, x0: number, y0: number, x1: number, y1: number): boolean; /** * Extends a bezier stroke with a cubic bezier spline. * * Extends a bezier stroke with a cubic bezier spline. * @param stroke_id The stroke ID. * @param x0 The x-coordinate of the first control point. * @param y0 The y-coordinate of the first control point. * @param x1 The x-coordinate of the second control point. * @param y1 The y-coordinate of the second control point. * @param x2 The x-coordinate of the end point. * @param y2 The y-coordinate of the end point. * @returns TRUE on success. */ bezier_stroke_cubicto( stroke_id: number, x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, ): boolean; /** * Extends a bezier stroke with a lineto. * * Extends a bezier stroke with a lineto. * @param stroke_id The stroke ID. * @param x0 The x-coordinate of the lineto. * @param y0 The y-coordinate of the lineto. * @returns TRUE on success. */ bezier_stroke_lineto(stroke_id: number, x0: number, y0: number): boolean; /** * Adds a bezier stroke describing an ellipse the path object. * * Adds a bezier stroke describing an ellipse on the path object. * @param x0 The x-coordinate of the center. * @param y0 The y-coordinate of the center. * @param radius_x The radius in x direction. * @param radius_y The radius in y direction. * @param angle The angle the x-axis of the ellipse (radians, counterclockwise). * @returns The resulting stroke. */ bezier_stroke_new_ellipse( x0: number, y0: number, radius_x: number, radius_y: number, angle: number, ): number; /** * Adds a bezier stroke with a single moveto to the path object. * * Adds a bezier stroke with a single moveto to the path object. * @param x0 The x-coordinate of the moveto. * @param y0 The y-coordinate of the moveto. * @returns The resulting stroke. */ bezier_stroke_new_moveto(x0: number, y0: number): number; /** * Copy a path object. * * This procedure copies the specified path object and returns the * copy. * @returns The newly copied path object. */ copy(): Path; /** * List the strokes associated with the passed path. * * Returns an Array with the stroke-IDs associated with the passed * path. * @returns List of the strokes belonging to the path. The returned value must be freed with g_free(). */ get_strokes(): number[]; /** * remove the stroke from a path object. * * Remove the stroke from a path object. * @param stroke_id The stroke ID. * @returns TRUE on success. */ remove_stroke(stroke_id: number): boolean; /** * closes the specified stroke. * * Closes the specified stroke. * @param stroke_id The stroke ID. * @returns TRUE on success. */ stroke_close(stroke_id: number): boolean; /** * flips the given stroke. * * Rotates the given stroke around given center by angle (in degrees). * @param stroke_id The stroke ID. * @param flip_type Flip orientation, either vertical or horizontal. * @param axis axis coordinate about which to flip, in pixels. * @returns TRUE on success. */ stroke_flip(stroke_id: number, flip_type: OrientationType | null, axis: number): boolean; /** * flips the given stroke about an arbitrary axis. * * Flips the given stroke about an arbitrary axis. Axis is defined by * two coordinates in the image (in pixels), through which the flipping * axis passes. * @param stroke_id The stroke ID. * @param x1 X coordinate of the first point of the flipping axis. * @param y1 Y coordinate of the first point of the flipping axis. * @param x2 X coordinate of the second point of the flipping axis. * @param y2 Y coordinate of the second point of the flipping axis. * @returns TRUE on success. */ stroke_flip_free(stroke_id: number, x1: number, y1: number, x2: number, y2: number): boolean; /** * Measure the length of the given stroke. * * Measure the length of the given stroke. * @param stroke_id The stroke ID. * @param precision The precision used for approximating straight portions of the stroke. * @returns The length (in pixels) of the given stroke. */ stroke_get_length(stroke_id: number, precision: number): number; /** * Get point at a specified distance along the stroke. * * This will return the x,y position of a point at a given distance * along the stroke. The distance will be obtained by first digitizing * the curve internally and then walking along the curve. For a closed * stroke the start of the path is the first point on the path that was * created. This might not be obvious. If the stroke is not long * enough, a \"valid\" flag will be FALSE. * @param stroke_id The stroke ID. * @param dist The given distance. * @param precision The precision used for the approximation. * @returns TRUE on success. */ stroke_get_point_at_dist( stroke_id: number, dist: number, precision: number, ): [boolean, number, number, number, boolean]; /** * returns the control points of a stroke. * * returns the control points of a stroke. The interpretation of the * coordinates returned depends on the type of the stroke. For Gimp 2.4 * this is always a bezier stroke, where the coordinates are the * control points. * @param stroke_id The stroke ID. * @returns type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now). */ stroke_get_points(stroke_id: number): [PathStrokeType, number[], boolean]; /** * returns polygonal approximation of the stroke. * * returns polygonal approximation of the stroke. * @param stroke_id The stroke ID. * @param precision The precision used for the approximation. * @returns List of the coords along the path (x0, y0, x1, y1, ...). The returned value must be freed with g_free(). */ stroke_interpolate(stroke_id: number, precision: number): [number[], boolean]; /** * Adds a stroke of a given type to the path object. * * Adds a stroke of a given type to the path object. The coordinates of * the control points can be specified. For now only strokes of the * type GIMP_PATH_STROKE_TYPE_BEZIER are supported. The control points * are specified as a pair of double values for the x- and * y-coordinate. The Bezier stroke type needs a multiple of three * control points. Each Bezier segment endpoint (anchor, A) has two * additional control points (C) associated. They are specified in the * order CACCACCAC... * @param type type of the stroke (always GIMP_PATH_STROKE_TYPE_BEZIER for now). * @param controlpoints List of the x- and y-coordinates of the control points. * @param closed Whether the stroke is to be closed or not. * @returns The stroke ID of the newly created stroke. */ stroke_new_from_points(type: PathStrokeType | null, controlpoints: number[], closed: boolean): number; /** * reverses the specified stroke. * * Reverses the specified stroke. * @param stroke_id The stroke ID. * @returns TRUE on success. */ stroke_reverse(stroke_id: number): boolean; /** * rotates the given stroke. * * Rotates the given stroke around given center by angle (in degrees). * @param stroke_id The stroke ID. * @param center_x X coordinate of the rotation center. * @param center_y Y coordinate of the rotation center. * @param angle angle to rotate about. * @returns TRUE on success. */ stroke_rotate(stroke_id: number, center_x: number, center_y: number, angle: number): boolean; /** * scales the given stroke. * * Scale the given stroke. * @param stroke_id The stroke ID. * @param scale_x Scale factor in x direction. * @param scale_y Scale factor in y direction. * @returns TRUE on success. */ stroke_scale(stroke_id: number, scale_x: number, scale_y: number): boolean; /** * translate the given stroke. * * Translate the given stroke. * @param stroke_id The stroke ID. * @param off_x Offset in x direction. * @param off_y Offset in y direction. * @returns TRUE on success. */ stroke_translate(stroke_id: number, off_x: number, off_y: number): boolean; } namespace Pattern { // Constructor properties interface interface ConstructorProps extends Resource.ConstructorProps, ConfigInterface.ConstructorProps {} } /** * Installable object used by fill and clone tools. */ class Pattern extends Resource implements ConfigInterface { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Returns the pattern with the given name. * * Returns an existing pattern having the given name. Returns %NULL * when no pattern exists of that name. * @param name The name of the pattern. */ static get_by_name(name: string): Pattern | null; // Conflicted with Gimp.Resource.get_by_name static get_by_name(...args: never[]): any; // Methods /** * Gets pixel data of the pattern within the bounding box specified by `max_width` * and `max_height`. The data will be scaled down so that it fits within this * size without changing its ratio. If the pattern is smaller than this size to * begin with, it will not be scaled up. * * If `max_width` or `max_height` are %NULL, the buffer is returned in the pattern's * native size. * * Make sure you called [func`Gegl`.init] before calling any function using * `GEGL`. * @param max_width a maximum width for the returned buffer. * @param max_height a maximum height for the returned buffer. * @param format an optional Babl format. * @returns a [class@Gegl.Buffer]. */ get_buffer(max_width: number, max_height: number, format: Babl.Object): Gegl.Buffer; /** * Gets information about the pattern. * * Gets information about the pattern: the pattern extents (width and * height) and bytes per pixel. * @returns TRUE on success. */ get_info(): [boolean, 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 PlugIn { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { program_name: string; programName: string; read_channel: GLib.IOChannel; readChannel: GLib.IOChannel; write_channel: GLib.IOChannel; writeChannel: GLib.IOChannel; } } /** * The base class for plug-ins to derive from. * * GimpPlugIn manages the plug-in's [class`Procedure]` objects. The procedures a * plug-in implements are registered with GIMP by returning a list of their * names from either [vfunc`GimpPlugIn`.query_procedures] or * [vfunc`GimpPlugIn`.init_procedures]. * * Every GIMP plug-in has to be implemented as a subclass and make it known to * the libgimp infrastructure and the main GIMP application by passing its * `GType` to [func`MAIN]`. * * [func`MAIN]` passes the 'argc' and 'argv' of the platform's main() function, * along with the `GType`, to [func`main]`, which creates an instance of the * plug-in's `GimpPlugIn` subclass and calls its virtual functions, depending * on how the plug-in was called by GIMP. * * There are 3 different ways GIMP calls a plug-in: "query", "init" and "run". * * The plug-in is called in "query" mode once after it was installed, or when * the cached plug-in information in the config file "pluginrc" needs to be * recreated. In "query" mode, [vfunc`GimpPlugIn`.query_procedures] is called * and returns a list of procedure names the plug-in implements. This is the * "normal" place to register procedures, because the existence of most * procedures doesn't depend on things that change between GIMP sessions. * * The plug-in is called in "init" mode at each GIMP startup, and * [vfunc`PlugIn`.init_procedures] is called and returns a list of procedure * names this plug-in implements. This only happens if the plug-in actually * implements [vfunc`GimpPlugIn`.init_procedures]. A plug-in only needs to * implement init_procedures if the existence of its procedures can change * between GIMP sessions, for example if they depend on the presence of * external tools, or hardware like scanners, or online services, or whatever * variable circumstances. * * In order to register the plug-in's procedures with the main GIMP application * in the plug-in's "query" and "init" modes, [class`PlugIn]` calls * [vfunc`PlugIn`.create_procedure] on all procedure names in the exact order of * the list returned by [vfunc`PlugIn`.query_procedures] or * [vfunc`PlugIn`.init_procedures] and then registers the returned * [class`Procedure]`. * * The plug-in is called in "run" mode whenever one of the procedures it * implements is called by either the main GIMP application or any other * plug-in. In "run" mode, one of the procedure names returned by * [vfunc`PlugIn`.query_procedures] or [vfunc`PlugIn`.init_procedures] is passed * to [vfunc`PlugIn`.create_procedure] which must return a [class`Procedure]` for * the passed name. The procedure is then executed by calling * [method`Procedure`.run]. * * In any of the three modes, [vfunc`PlugIn`.quit] is called before the plug-in * process exits, so the plug-in can perform whatever cleanup necessary. */ class PlugIn extends GObject.Object { static $gtype: GObject.GType; // Properties /** * The program name as usually found on argv[0] */ set program_name(val: string); /** * The program name as usually found on argv[0] */ set programName(val: string); /** * The [struct`GLib`.IOChannel] to read from GIMP */ get read_channel(): GLib.IOChannel; /** * The [struct`GLib`.IOChannel] to read from GIMP */ get readChannel(): GLib.IOChannel; /** * The [struct`GLib`.IOChannel] to write to GIMP */ get write_channel(): GLib.IOChannel; /** * The [struct`GLib`.IOChannel] to write to GIMP */ get writeChannel(): GLib.IOChannel; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Returns the default top directory for GIMP plug-ins and modules. If * the environment variable GIMP3_PLUGINDIR exists, that is used. It * should be an absolute pathname. Otherwise, on Unix the compile-time * defined directory is used. On Windows, the installation directory * as deduced from the executable's full filename is used. * * Note that the actual directories used for GIMP plug-ins and modules * can be overridden by the user in the preferences dialog. * * In config files such as gimprc, the string ${gimp_plug_in_dir} * expands to this directory. * * The returned string is owned by GIMP and must not be modified or * freed. The returned string is in the encoding used for filenames by * GLib, which isn't necessarily UTF-8. (On Windows it always is * UTF-8.) */ static directory(): string; /** * Generic #GQuark error domain for plug-ins. Plug-ins are welcome to * create their own domain when they want to handle advanced error * handling. Often, you just want to pass an error message to the core. * This domain can be used for such simple usage. * * See #GError for information on error domains. */ static error_quark(): GLib.Quark; // Virtual methods /** * This method must be overridden by all plug-ins and return a newly * allocated #GimpProcedure named `name`. * * This method will be called for every `name` as returned by * [vfunc`PlugIn`.query_procedures] and [vfunc`PlugIn`.init_procedures] so care * must be taken to handle them all. Upon procedure registration, * [vfunc`PlugIn`.create_procedure] will be called in the order of the lists * returned by [vfunc`PlugIn`.query_procedures] and * [vfunc`PlugIn`.init_procedures] * @param procedure_name procedure name. */ vfunc_create_procedure(procedure_name: string): Procedure; /** * This method can be overridden by all plug-ins to return a newly allocated * list of allocated strings naming procedures registered by this plug-in. * It is different from [vfunc`PlugIn`.query_procedures] in that init happens * at every startup, whereas query happens only once in the life of a plug-in * (right after installation or update). Hence [vfunc`PlugIn`.init_procedures] * typically returns procedures dependent to runtime conditions (such as the * presence of a third-party tool), whereas [vfunc`PlugIn`.query_procedures] * would usually return procedures that are always available unconditionally. * * Most of the time, you only want to override * [vfunc`PlugIn`.query_procedures] and leave [vfunc`PlugIn`.init_procedures] * untouched. */ vfunc_init_procedures(): string[]; /** * This method can be overridden by all plug-ins to return a newly allocated * list of allocated strings naming the procedures registered by this * plug-in. See documentation of [vfunc`PlugIn`.init_procedures] for * differences. */ vfunc_query_procedures(): string[]; /** * This method can be overridden by a plug-in which needs to perform some * actions upon quitting. */ vfunc_quit(): void; /** * This method can be overridden by all plug-ins to customize * internationalization of the plug-in. * * This method will be called before initializing, querying or running * `procedure_name` (respectively with [vfunc`PlugIn`.init_procedures], * [vfunc`PlugIn`.query_procedures] or with the `run()` function set in * `gimp_image_procedure_new()`). * * By default, GIMP plug-ins look up gettext compiled message catalogs * in the subdirectory `locale/` under the plug-in folder (same folder * as `gimp_get_progname()`) with a text domain equal to the plug-in * name (regardless `procedure_name)`. It is unneeded to override this * method if you follow this localization scheme. * * If you wish to disable localization or localize with another system, * simply set the method to %NULL, or possibly implement this method * to do something useful for your usage while returning %FALSE. * * If you wish to tweak the `gettext_domain` or the `catalog_dir,` return * %TRUE and allocate appropriate `gettext_domain` and/or `catalog_dir` * (these use the default if set %NULL). * * Note that `catalog_dir` must be a relative path, encoded as UTF-8, * subdirectory of the directory of `gimp_get_progname()`. * The domain names "gimp30-std-plug-ins", "gimp30-script-fu" and * "gimp30-python" are reserved and can only be used with a %NULL * `catalog_dir`. These will use the translation catalogs installed for * core plug-ins, so you are not expected to use these for your * plug-ins, except if you are making a core plug-in. More domain * names may become reserved so we discourage using a gettext domain * starting with "gimp30-". * * When localizing your plug-in this way, GIMP also binds * `gettext_domain` to the UTF-8 encoding. * @param procedure_name procedure name. */ vfunc_set_i18n(procedure_name: string): [boolean, string, string]; // Methods /** * Add a new sub-menu to the GIMP menus. * * This function installs a sub-menu which does not belong to any * procedure at the location `menu_path`. * * For translations of `menu_label` to work properly, `menu_label` * should only be marked for translation but passed to this function * untranslated, for example using N_("Submenu"). GIMP will look up * the translation in the textdomain registered for the plug-in. * * See also: gimp_procedure_add_menu_path(). * @param menu_path The sub-menu's menu path. * @param menu_label The menu label of the sub-menu. */ add_menu_branch(menu_path: string, menu_label: string): void; /** * This function adds a temporary procedure to `plug_in`. It is usually * called from a %GIMP_PDB_PROC_TYPE_PERSISTENT procedure's * [vfunc`Procedure`.run]. * * A temporary procedure is a procedure which is only available while * one of your plug-in's "real" procedures is running. * * The procedure's type _must_ be * %GIMP_PDB_PROC_TYPE_TEMPORARY or the function will fail. * * NOTE: Normally, plug-in communication is triggered by the plug-in * and the GIMP core only responds to the plug-in's requests. You must * explicitly enable receiving of temporary procedure run requests * using either [method`PlugIn`.persistent_enable] or * [method`PlugIn`.persistent_process]. See their respective * documentation for details. * @param procedure A #GimpProcedure of type %GIMP_PDB_PROC_TYPE_TEMPORARY. */ add_temp_procedure(procedure: Procedure): void; /** * Retrieves the active error handler for procedure calls. * * This procedure retrieves the currently active error handler for * procedure calls made by the calling plug-in. See * gimp_plugin_set_pdb_error_handler() for details. * @returns Who is responsible for handling procedure call errors. */ get_pdb_error_handler(): PDBErrorHandler; /** * This function retrieves a temporary procedure from `plug_in` by the * procedure's `procedure_name`. * @param procedure_name The name of a [class@Procedure] added to @plug_in. * @returns The procedure if registered, or %NULL. */ get_temp_procedure(procedure_name: string): Procedure | null; /** * This function retrieves the list of temporary procedure of `plug_in` as * added with [method`PlugIn`.add_temp_procedure]. * @returns The list of procedures. */ get_temp_procedures(): Procedure[]; /** * Enables asynchronous processing of messages from the main GIMP * application. * * Normally, a plug-in is not called by GIMP except for the call to * the procedure it implements. All subsequent communication is * triggered by the plug-in and all messages sent from GIMP to the * plug-in are just answers to requests the plug-in made. * * If the plug-in however registered temporary procedures using * [method`PlugIn`.add_temp_procedure], it needs to be able to receive * requests to execute them. Usually this will be done by running * [method`PlugIn`.persistent_process] in an endless loop. * * If the plug-in cannot use [method`PlugIn`.persistent_process], i.e. if * it has a GUI and is hanging around in a [struct`GLib`.MainLoop], it * must call [method`PlugIn`.persistent_enable]. * * Note that the plug-in does not need to be a * [enum`Gimp`.PDBProcType.PERSISTENT] to register temporary procedures. * * See also: [method`PlugIn`.add_temp_procedure]. */ persistent_enable(): void; /** * Processes one message sent by GIMP and returns. * * Call this function in an endless loop after calling * [method`Gimp`.Procedure.persistent_ready] to process requests for * running temporary procedures. * * See [method`PlugIn`.persistent_enable] for an asynchronous way of * doing the same if running an endless loop is not an option. * * See also: [method`PlugIn`.add_temp_procedure]. * @param timeout The timeout (in ms) to use for the select() call. */ persistent_process(timeout: number): void; /** * This function removes a temporary procedure from `plug_in` by the * procedure's `procedure_name`. * @param procedure_name The name of a [class@Procedure] added to @plug_in. */ remove_temp_procedure(procedure_name: string): void; /** * Set a help domain and path for the `plug_in`. * * This function registers user documentation for the calling plug-in * with the GIMP help system. The `domain_uri` parameter points to the * root directory where the plug-in help is installed. For each * supported language there should be a file called 'gimp-help.xml' * that maps the help IDs to the actual help files. * * This function can only be called in the * [vfunc`PlugIn`.query_procedures] function of a plug-in. * @param domain_name The XML namespace of the plug-in's help pages. * @param domain_uri The root URI of the plug-in's help pages. */ set_help_domain(domain_name: string, domain_uri: Gio.File): void; /** * Sets an error handler for procedure calls. * * This procedure changes the way that errors in procedure calls are * handled. By default GIMP will raise an error dialog if a procedure * call made by a plug-in fails. Using this procedure the plug-in can * change this behavior. If the error handler is set to * %GIMP_PDB_ERROR_HANDLER_PLUGIN, then the plug-in is responsible for * calling gimp_pdb_get_last_error() and handling the error whenever * one if its procedure calls fails. It can do this by displaying the * error message or by forwarding it in its own return values. * @param handler Who is responsible for handling procedure call errors. */ set_pdb_error_handler(handler: PDBErrorHandler | null): void; } namespace Procedure { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { name: string; plug_in: PlugIn; plugIn: PlugIn; procedure_type: PDBProcType; procedureType: PDBProcType; } } /** * Procedures are registered functions which can be run across GIMP ecosystem. * They can be created by plug-ins and can then run by the core application * when called from menus (or through other interaction depending on specific * procedure subclasses). * * A plug-in can also run procedures created by the core, but also the ones * created by other plug-ins (see [class`PDB]`). */ class Procedure extends GObject.Object { static $gtype: GObject.GType; // Properties get name(): string; get plug_in(): PlugIn; get plugIn(): PlugIn; get procedure_type(): PDBProcType; get procedureType(): PDBProcType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( plug_in: PlugIn, name: string, proc_type: PDBProcType, run_func: RunFunc, run_data_destroy?: GLib.DestroyNotify | null, ): Procedure; // Virtual methods /** * called to install the procedure with the main GIMP * application. This is an implementation detail and must never * be called by any plug-in code. */ vfunc_install(): void; /** * called when the procedure is executed via gimp_procedure_run(). * the default implementation simply calls the procedure's #GimpRunFunc, * #GimpProcedure subclasses are free to modify the passed `args` and * call their own, subclass-specific run functions. * @param args */ vfunc_run(args: ValueArray): ValueArray; vfunc_set_sensitivity(sensitivity_mask: number): boolean; /** * called to uninstall the procedure from the main GIMP * application. This is an implementation detail and must never * be called by any plug-in code. */ vfunc_uninstall(): void; // Methods /** * Add a new boolean argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param value the default value. * @param flags argument flags. */ add_boolean_argument( name: string, nick: string, blurb: string | null, value: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new boolean auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param value the default value. * @param flags argument flags. */ add_boolean_aux_argument( name: string, nick: string, blurb: string | null, value: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new boolean return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param value the default value. * @param flags argument flags. */ add_boolean_return_value( name: string, nick: string, blurb: string | null, value: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpBrush argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok whether %NULL is a valid value. * @param default_value default value * @param default_to_context Use the context's brush as default value. * @param flags argument flags. */ add_brush_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, default_value: Brush | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpBrush auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param default_value default value * @param default_to_context Use the context's brush as default value. * @param flags argument flags. */ add_brush_aux_argument( name: string, nick: string, blurb: string | null, default_value: Brush | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpBrush return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_brush_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GBytes argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_bytes_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GBytes auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_bytes_aux_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GBytes return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_bytes_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpChannel argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_channel_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpChannel auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_channel_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpChannel return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_channel_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpChoice argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param choice the #GimpChoice * @param value the default value for #GimpChoice. * @param flags argument flags. */ add_choice_argument( name: string, nick: string, blurb: string | null, choice: Choice, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpChoice auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param choice the #GimpChoice * @param value the default value for #GimpChoice. * @param flags argument flags. */ add_choice_aux_argument( name: string, nick: string, blurb: string | null, choice: Choice, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpChoice return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param choice the #GimpChoice * @param value the default value for #GimpChoice. * @param flags argument flags. */ add_choice_return_value( name: string, nick: string, blurb: string | null, choice: Choice, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GeglColor argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param has_alpha whether the argument has transparency. * @param value the default #GeglColor value. * @param flags argument flags. */ add_color_argument( name: string, nick: string, blurb: string | null, has_alpha: boolean, value: Gegl.Color, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GeglColor auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param has_alpha whether the argument has transparency. * @param value the default #GeglColor value. * @param flags argument flags. */ add_color_aux_argument( name: string, nick: string, blurb: string | null, has_alpha: boolean, value: Gegl.Color, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GeglColor argument to `procedure` from a string representation. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param has_alpha whether the argument has transparency. * @param value the default #GeglColor value. * @param flags argument flags. */ add_color_from_string_argument( name: string, nick: string, blurb: string | null, has_alpha: boolean, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GeglColor auxiliary argument to `procedure` from a string representation. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param has_alpha whether the argument has transparency. * @param value the default #GeglColor value. * @param flags argument flags. */ add_color_from_string_aux_argument( name: string, nick: string, blurb: string | null, has_alpha: boolean, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GeglColor return value to `procedure` from a string representation. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param has_alpha whether the argument has transparency. * @param value the default #GeglColor value. * @param flags argument flags. */ add_color_from_string_return_value( name: string, nick: string, blurb: string | null, has_alpha: boolean, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GeglColor return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param has_alpha whether the argument has transparency. * @param value the default #GeglColor value. * @param flags argument flags. */ add_color_return_value( name: string, nick: string, blurb: string | null, has_alpha: boolean, value: Gegl.Color, flags: GObject.ParamFlags | null, ): void; /** * Add a new object array argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. @object_type the type of object stored in the array * @param object_type * @param flags argument flags. */ add_core_object_array_argument( name: string, nick: string, blurb: string | null, object_type: GObject.GType, flags: GObject.ParamFlags | null, ): void; /** * Add a new object array auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. @object_type the type of object stored in the array * @param object_type * @param flags argument flags. */ add_core_object_array_aux_argument( name: string, nick: string, blurb: string | null, object_type: GObject.GType, flags: GObject.ParamFlags | null, ): void; /** * Add a new object array return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. @object_type the type of object stored in the array * @param object_type * @param flags argument flags. */ add_core_object_array_return_value( name: string, nick: string, blurb: string | null, object_type: GObject.GType, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpDisplay argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_display_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpDisplay auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_display_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpDisplay return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_display_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new floating-point in double precision argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_double_argument( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new double array argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_double_array_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new double array auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_double_array_aux_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new double array return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_double_array_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new floating-point in double precision auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_double_aux_argument( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new floating-point in double precision return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_double_return_value( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpDrawable argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_drawable_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpDrawable auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_drawable_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpDrawable return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_drawable_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new enum argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param enum_type the #GType for this argument * @param value the default value. * @param flags argument flags. */ add_enum_argument( name: string, nick: string, blurb: string | null, enum_type: GObject.GType, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new enum auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param enum_type the #GType for this argument * @param value the default value. * @param flags argument flags. */ add_enum_aux_argument( name: string, nick: string, blurb: string | null, enum_type: GObject.GType, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new enum return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param enum_type the #GType for this argument * @param value the default value. * @param flags argument flags. */ add_enum_return_value( name: string, nick: string, blurb: string | null, enum_type: GObject.GType, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GFile argument to `procedure`. * @param name The name of the argument to be created. * @param nick The label used in #GimpProcedureDialog. * @param blurb A more detailed help description. * @param action The type of file to expect. * @param none_ok Whether %NULL is allowed. * @param default_file File to use if none is assigned. * @param flags Argument flags. */ add_file_argument( name: string, nick: string, blurb: string | null, action: FileChooserAction | null, none_ok: boolean, default_file: Gio.File | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GFile auxiliary argument to `procedure`. * @param name The name of the argument to be created. * @param nick The label used in #GimpProcedureDialog. * @param blurb A more detailed help description. * @param action The type of file to expect. * @param none_ok Whether %NULL is allowed. * @param default_file File to use if none is assigned. * @param flags Argument flags. */ add_file_aux_argument( name: string, nick: string, blurb: string | null, action: FileChooserAction | null, none_ok: boolean, default_file: Gio.File | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GFile return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_file_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpFont argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok whether %NULL is a valid value. * @param default_value default value * @param default_to_context Use the context's font as default value. * @param flags argument flags. */ add_font_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, default_value: Font | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpFont auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param default_value default value * @param default_to_context Use the context's font as default value. * @param flags argument flags. */ add_font_aux_argument( name: string, nick: string, blurb: string | null, default_value: Font | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpFont return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_font_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpGradient argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok whether %NULL is a valid value. * @param default_value default value * @param default_to_context Use the context's gradient as default value. * @param flags argument flags. */ add_gradient_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, default_value: Gradient | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpGradient auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param default_value default value * @param default_to_context Use the context's gradient as default value. * @param flags argument flags. */ add_gradient_aux_argument( name: string, nick: string, blurb: string | null, default_value: Gradient | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpGradient return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_gradient_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new [class`GroupLayer]` argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_group_layer_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new [class`GroupLayer]` auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_group_layer_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new [class`GroupLayer]` return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_group_layer_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpImage argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_image_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpImage auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_image_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpImage return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_image_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new integer array argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_int32_array_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new integer array auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_int32_array_aux_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new integer array return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_int32_array_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new integer argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_int_argument( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new integer auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_int_aux_argument( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new integer return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_int_return_value( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpItem argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_item_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpItem auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_item_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpItem return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_item_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpLayer argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_layer_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpLayer auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_layer_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpLayerMask argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_layer_mask_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpLayerMask auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_layer_mask_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpLayerMask return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_layer_mask_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpLayer return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_layer_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Adds a menu path to the procedure. Only procedures which have a menu * label can add a menu path. * * Menu paths are untranslated paths to known menus and submenus with the * syntax `/Path/To/Submenu`, for example `/Layer/Transform`. * GIMP will localize these. * Nevertheless you should localize unknown parts of the path. For instance, say * you want to create procedure to create customized layers and add a `Create` * submenu which you want to localize from your plug-in with gettext. You could * call: * * ```C * path = g_build_path ("/", "/Layer", _("Create"), NULL); * gimp_procedure_add_menu_path (procedure, path); * g_free (path); * ``` * * See also: gimp_plug_in_add_menu_branch(). * * GIMP menus also have a concept of named section. For instance, say you are * creating a plug-in which you want to show next to the "Export", "Export As" * plug-ins in the File menu. You would add it to the menu path "File/[Export]". * If you actually wanted to create a submenu called "[Export]" (with square * brackets), double the brackets: "File/[[Export]]" * * See also: https://gitlab.gnome.org/GNOME/gimp/-/blob/master/menus/image-menu.ui.in.in * * This function will place your procedure to the bottom of the selected path or * section. Order is not assured relatively to other plug-ins. * @param menu_path The @procedure's additional menu path. */ add_menu_path(menu_path: string): void; /** * Add a new #GimpPalette argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok whether %NULL is a valid value. * @param default_value default value * @param default_to_context Use the context's palette as default value. * @param flags argument flags. */ add_palette_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, default_value: Palette | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPalette auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param default_value default value * @param default_to_context Use the context's palette as default value. * @param flags argument flags. */ add_palette_aux_argument( name: string, nick: string, blurb: string | null, default_value: Palette | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPalette return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_palette_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new param argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param param_type the #GPParamType for this argument * @param flags argument flags. */ add_param_argument( name: string, nick: string, blurb: string | null, param_type: GObject.GType, flags: GObject.ParamFlags | null, ): void; /** * Add a new param auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param param_type the #GPParamType for this argument * @param flags argument flags. */ add_param_aux_argument( name: string, nick: string, blurb: string | null, param_type: GObject.GType, flags: GObject.ParamFlags | null, ): void; /** * Add a new param return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param param_type the #GPParamType for this argument * @param flags argument flags. */ add_param_return_value( name: string, nick: string, blurb: string | null, param_type: GObject.GType, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpParasite argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_parasite_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpParasite auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_parasite_aux_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpParasite return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_parasite_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPath argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_path_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPath auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_path_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPath return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_path_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPattern argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok whether %NULL is a valid value. * @param default_value default value * @param default_to_context Use the context's pattern as default value. * @param flags argument flags. */ add_pattern_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, default_value: Pattern | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPattern auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param default_value default value * @param default_to_context Use the context's pattern as default value. * @param flags argument flags. */ add_pattern_aux_argument( name: string, nick: string, blurb: string | null, default_value: Pattern | null, default_to_context: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpPattern return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_pattern_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpResource argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok whether %NULL is a valid value. * @param default_value default value. * @param flags argument flags. */ add_resource_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, default_value: Resource | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpResource auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param default_value default value. * @param flags argument flags. */ add_resource_aux_argument( name: string, nick: string, blurb: string | null, default_value: Resource | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpResource return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_resource_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpSelection argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_selection_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpSelection auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_selection_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpSelection return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_selection_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new string argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param value the default value. * @param flags argument flags. */ add_string_argument( name: string, nick: string, blurb: string | null, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new string array argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_string_array_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new string array auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_string_array_aux_argument( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new string array return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param flags argument flags. */ add_string_array_return_value( name: string, nick: string, blurb: string | null, flags: GObject.ParamFlags | null, ): void; /** * Add a new string auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param value the default value. * @param flags argument flags. */ add_string_aux_argument( name: string, nick: string, blurb: string | null, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new string return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param value the default value. * @param flags argument flags. */ add_string_return_value( name: string, nick: string, blurb: string | null, value: string, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpTextLayer argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_text_layer_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpTextLayer auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_text_layer_aux_argument( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpTextLayer return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param none_ok Whether no is a valid value. * @param flags argument flags. */ add_text_layer_return_value( name: string, nick: string, blurb: string | null, none_ok: boolean, flags: GObject.ParamFlags | null, ): void; /** * Add a new unsigned integer argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_uint_argument( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new unsigned integer auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_uint_aux_argument( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new unsigned integer return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param min the minimum value for this argument * @param max the maximum value for this argument * @param value the default value. * @param flags argument flags. */ add_uint_return_value( name: string, nick: string, blurb: string | null, min: number, max: number, value: number, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpUnit argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param show_pixels whether to allow pixels as a valid option * @param show_percent whether to allow percent as a valid option * @param value the default value. * @param flags argument flags. */ add_unit_argument( name: string, nick: string, blurb: string | null, show_pixels: boolean, show_percent: boolean, value: Unit, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpUnit auxiliary argument to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param show_pixels whether to allow pixels as a valid option * @param show_percent whether to allow percent as a valid option * @param value the default value. * @param flags argument flags. */ add_unit_aux_argument( name: string, nick: string, blurb: string | null, show_pixels: boolean, show_percent: boolean, value: Unit, flags: GObject.ParamFlags | null, ): void; /** * Add a new #GimpUnit return value to `procedure`. * @param name the name of the argument to be created. * @param nick the label used in #GimpProcedureDialog. * @param blurb a more detailed help description. * @param show_pixels whether to allow pixels as a valid option * @param show_percent whether to allow percent as a valid option * @param value the default value. * @param flags argument flags. */ add_unit_return_value( name: string, nick: string, blurb: string | null, show_pixels: boolean, show_percent: boolean, value: Unit, flags: GObject.ParamFlags | null, ): void; /** * Create a #GimpConfig with properties that match `procedure'`s arguments, to be * used in [method`Procedure`.run_config] method. * @returns The new #GimpConfig. */ create_config(): ProcedureConfig; /** * Searches the `procedure'`s arguments for a #GParamSpec called `name`. * @param name An argument name * @returns The @procedure's argument with @name if it exists, or %NULL otherwise. */ find_argument(name: string): GObject.ParamSpec; /** * Searches the `procedure'`s auxiliary arguments for a #GParamSpec * called `name`. * @param name An auxiliary argument name * @returns The @procedure's auxiliary argument with @name if it exists, or %NULL otherwise. */ find_aux_argument(name: string): GObject.ParamSpec; /** * Searches the `procedure'`s return values for a #GParamSpec called * `name`. * @param name A return value name * @returns The @procedure's return values with @name if it exists, or %NULL otherwise. */ find_return_value(name: string): GObject.ParamSpec; get_argument_sync(arg_name: string): ArgumentSync; get_arguments(): GObject.ParamSpec[]; get_authors(): string; get_aux_arguments(): GObject.ParamSpec[]; get_blurb(): string; get_copyright(): string; get_date(): string; get_help(): string; get_help_id(): string; /** * Gets the file of the icon if one was set for `procedure`. * @returns the icon #GFile or %NULL if no file was set. */ get_icon_file(): Gio.File | null; /** * Gets the name of the icon if one was set for `procedure`. * @returns the icon name or %NULL if no icon name was set. */ get_icon_name(): string | null; /** * Gets the #GdkPixbuf of the icon if an icon was set this way for * `procedure`. * @returns the icon pixbuf or %NULL if no icon name was set. */ get_icon_pixbuf(): GdkPixbuf.Pixbuf | null; /** * Gets the type of data set as `procedure'`s icon. Depending on the * result, you can call the relevant specific function, such as * [method`Procedure`.get_icon_name]. * @returns the #GimpIconType of @procedure's icon. */ get_icon_type(): IconType; /** * This function retrieves the list of image types the procedure can * operate on. See gimp_procedure_set_image_types(). * @returns The image types. */ get_image_types(): string; get_menu_label(): string; get_menu_paths(): string[]; get_name(): string; get_plug_in(): PlugIn; get_proc_type(): PDBProcType; get_return_values(): GObject.ParamSpec[]; get_sensitivity_mask(): number; /** * Provide the information if `procedure` is an internal procedure. Only * a procedure looked up in the [class`Gimp`.PDB] can be internal. * Procedures created by a plug-in in particular are never internal. * @returns Whether @procedure is an internal procedure or not. */ is_internal(): boolean; /** * Format the expected return values from procedures. * @param status the success status of the procedure run. * @param error an optional #GError. This parameter should be set if @status is either #GIMP_PDB_EXECUTION_ERROR or #GIMP_PDB_CALLING_ERROR. * @returns the expected #GimpValueArray as could be returned by a [callback@RunFunc]. */ new_return_values(status: PDBStatusType | null, error?: GLib.Error | null): ValueArray; /** * Notify the main GIMP application that the persistent procedure has * been properly initialized and is ready to run. * * This function _must_ be called from every procedure's [callback`RunFunc]` * that was created as [enum`Gimp`.PDBProcType.PERSISTENT]. * * Subsequently, extensions can process temporary procedure run * requests using either [method`PlugIn`.persistent_enable] or * [method`PlugIn`.persistent_process]. * * See also: [ctor`Procedure`.new]. */ persistent_ready(): void; /** * Runs `procedure,` calling the run_func given in [ctor`Procedure`.new]. * * Create `config` at default values with * [method`Gimp`.Procedure.create_config] then set any argument you wish * to change from defaults with [method`GObject`.Object.set]. * * If `config` is %NULL, the default arguments of `procedure` will be used. * @param config the @procedure's arguments. * @returns The @procedure's return values. */ run(config?: ProcedureConfig | null): ValueArray; /** * When the procedure's run() function exits, a #GimpProcedure's arguments * or auxiliary arguments can be automatically synced with a #GimpParasite of * the #GimpImage the procedure is running on. * * In order to enable this, set `sync` to %GIMP_ARGUMENT_SYNC_PARASITE. * * Currently, it is possible to sync a string argument of type * #GParamSpecString with an image parasite of the same name, for * example the "gimp-comment" parasite in file save procedures. * @param arg_name the name of one of @procedure's arguments or auxiliary arguments. * @param sync how to sync the argument or auxiliary argument. */ set_argument_sync(arg_name: string, sync: ArgumentSync | null): void; /** * Sets various attribution strings on `procedure`. * @param authors The @procedure's author(s). * @param copyright The @procedure's copyright. * @param date The @procedure's date (written or published). */ set_attribution(authors: string, copyright: string, date: string): void; /** * Sets various documentation strings on `procedure:` * * * `blurb` is used for instance as the `procedure'`s tooltip when represented in * the UI such as a menu entry. * * `help` is a free-form text that's meant as additional documentation for * developers of scripts and plug-ins. If the `blurb` and the argument names * and descriptions are enough for a quite self-explanatory procedure, you may * set `help` to %NULL, rather than setting an uninformative `help` (avoid * setting the same text as `blurb` or redundant information). * * Plug-ins are responsible for their own translations. You are expected to send * localized strings of `blurb` and `help` to GIMP if your plug-in is * internationalized. * @param blurb The @procedure's blurb. * @param help The @procedure's help text. * @param help_id The @procedure's help ID. */ set_documentation(blurb: string, help?: string | null, help_id?: string | null): void; /** * Sets the icon for `procedure` to the contents of an image file. * @param file a #GFile pointing to an image file. */ set_icon_file(file?: Gio.File | null): void; /** * Sets the icon for `procedure` to the icon referenced by `icon_name`. * @param icon_name an icon name. */ set_icon_name(icon_name?: string | null): void; /** * Sets the icon for `procedure` to `pixbuf`. * @param pixbuf a #GdkPixbuf. */ set_icon_pixbuf(pixbuf?: GdkPixbuf.Pixbuf | null): void; /** * This is a comma separated list of image types, or actually drawable * types, that this procedure can deal with. Wildcards are possible * here, so you could say "RGB\*" instead of "RGB, RGBA" or "\*" for all * image types. * * Supported types are "RGB", "GRAY", "INDEXED" and their variants * with alpha. * @param image_types The image types this procedure can operate on. */ set_image_types(image_types: string): void; /** * Sets the label to use for the `procedure'`s menu entry, The * location(s) where to register in the menu hierarchy is chosen using * gimp_procedure_add_menu_path(). * * Plug-ins are responsible for their own translations. You are expected to send * localized strings to GIMP if your plug-in is internationalized. * @param menu_label The @procedure's menu label. */ set_menu_label(menu_label: string): void; /** * Sets the cases when `procedure` is supposed to be sensitive or not. * * Note that it will be used by the core to determine whether to show a * procedure as sensitive (hence forbid running it otherwise), yet it * will not forbid thid-party plug-ins for instance to run manually your * registered procedure. Therefore you should still handle non-supported * cases appropriately by returning with %GIMP_PDB_EXECUTION_ERROR and a * suitable error message. * * Similarly third-party plug-ins should verify they are allowed to call * a procedure with [method`Procedure`.get_sensitivity_mask] when running * with dynamic contents. * * Note that by default, a procedure works on an image with one or more * drawables selected. Hence not setting the mask, setting it with 0 or * setting it with `GIMP_PROCEDURE_SENSITIVE_DRAWABLE | * GIMP_PROCEDURE_SENSITIVE_DRAWABLES` are equivalent. * @param sensitivity_mask A binary mask of [flags@Gimp.ProcedureSensitivityMask]. */ set_sensitivity_mask(sensitivity_mask: number): void; } namespace ProcedureConfig { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { procedure: Procedure; } } /** * The base class for [class`Procedure]` specific config objects and the main * interface to manage aspects of [class`Procedure]`'s arguments such as * persistency of the last used arguments across GIMP sessions. * * A procedure config is created by a [class`Procedure]` using * [method`Procedure`.create_config] and its properties match the * procedure's arguments and auxiliary arguments in number, order and * type. * * It implements the [struct`Config]` interface and therefore has all its * serialization and deserialization features. */ abstract class ProcedureConfig extends GObject.Object { static $gtype: GObject.GType; // Properties get procedure(): Procedure; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Methods /** * A utility function which will get the current string value of a * #GimpParamSpecChoice property in `config` and convert it to the * integer ID mapped to this value. * This makes it easy to work with an Enum type locally, within a plug-in code. * @param property_name the name of a #GimpParamSpecChoice property. */ get_choice_id(property_name: string): number; /** * A function for bindings to get a [type`ColorArray]` property. Getting * these with [method`GObject`.Object.get] or [method`GObject`.Object.get_property] won't * [work for the time being](https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492) * so all our boxed array types must be set and get using these * alternative functions instead. * * C plug-ins should just use [method`GObject`.Object.get]. * @param property_name the name of a #GParamSpecBoxed param spec with [type@ColorArray] value type. * @returns an array of #GObjects. */ get_color_array(property_name: string): Gegl.Color[]; /** * A function for bindings to get a [type`CoreObjectArray]` property. Getting * these with [method`GObject`.Object.get] or [method`GObject`.Object.get_property] won't * [work for the time being](https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492) * so all our boxed array types must be set and get using alternative * functions instead. * * C plug-ins should just use [method`GObject`.Object.get]. * @param property_name the name of a #GimpParamSpecCoreObjectArray param spec. * @returns an array of #GObjects. */ get_core_object_array(property_name: string): GObject.Object[]; /** * This function returns the [class`Procedure]` which created `config,` see * [method`Procedure`.create_config]. * @returns The procedure which created this config. */ get_procedure(): Procedure; /** * *Note: There is normally no need to call this function because it's * already called by [class`ExportProcedure]` after the `run()` callback.* * * *Only use this function if the [class`Metadata]` passed as argument of a * [class`ExportProcedure]`'s run() method needs to be written at a specific * point of the export, other than its end.* * * This function syncs back `config'`s export properties to the * metadata's [flags`MetadataSaveFlags]` and writes the metadata to * `file`. * * The metadata is only ever written once. If this function has been * called explicitly, it will do nothing when called a second time at the end of * the `run()` callback. * @param exported_image the image that was actually exported * @param file the file @exported_image was written to */ save_metadata(exported_image: Image, file: Gio.File): void; /** * A function for bindings to set a [type`ColorArray]` property. Setting * these with [method`GObject`.Object.set] or [method`GObject`.Object.set_property] won't * [work for the time being](https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492) * so all our boxed array types must be set and get using these * alternative functions instead. * * C plug-ins should just use [method`GObject`.Object.set]. * @param property_name the name of a #GParamSpecBoxed param spec with [type@ColorArray] value type. * @param colors an array of [class@Gegl.Color]. */ set_color_array(property_name: string, colors: Gegl.Color[]): void; /** * A function for bindings to set a [type`CoreObjectArray]` property. Setting * these with [method`GObject`.Object.set] or [method`GObject`.Object.set_property] won't * [work for the time being](https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492) * so all our boxed array types must be set and get using alternative * functions instead. * * C plug-ins should just use [method`GObject`.Object.set]. * @param property_name the name of a #GimpParamSpecCoreObjectArray param spec. * @param objects an array of #GObjects. */ set_core_object_array(property_name: string, objects: GObject.Object[]): void; } namespace Resource { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps, ConfigInterface.ConstructorProps { id: number; } } /** * Functions to manipulate resources. */ abstract class Resource extends GObject.Object implements ConfigInterface { static $gtype: GObject.GType; // Properties get id(): number; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Returns a #GimpResource representing `resource_id`. Since #GimpResource is an * abstract class, the real object type will actually be the proper * subclass. * * Note: in most use cases, you should not need to retrieve a * #GimpResource by its ID, which is mostly internal data and not * reusable across sessions. Use the appropriate functions for your use * case instead. * @param resource_id The resource id. */ static get_by_id(resource_id: number): Resource | null; /** * Returns the resource with the given `resource_type` and * `resource_name`. * @param resource_type The #GType of the resource. * @param resource_name The name of the resource. */ static get_by_name(resource_type: GObject.GType, resource_name: string): Resource | null; /** * Returns whether the resource ID is a brush. * * This procedure returns TRUE if the specified resource ID is a brush. * @param resource_id The resource ID. */ static id_is_brush(resource_id: number): boolean; /** * Returns whether the resource ID is a font. * * This procedure returns TRUE if the specified resource ID is a font. * @param resource_id The resource ID. */ static id_is_font(resource_id: number): boolean; /** * Returns whether the resource ID is a gradient. * * This procedure returns TRUE if the specified resource ID is a * gradient. * @param resource_id The resource ID. */ static id_is_gradient(resource_id: number): boolean; /** * Returns whether the resource ID is a palette. * * This procedure returns TRUE if the specified resource ID is a * palette. * @param resource_id The resource ID. */ static id_is_palette(resource_id: number): boolean; /** * Returns whether the resource ID is a pattern. * * This procedure returns TRUE if the specified resource ID is a * pattern. * @param resource_id The resource ID. */ static id_is_pattern(resource_id: number): boolean; /** * Returns TRUE if the resource ID is valid. * * This procedure checks if the given resource ID is valid and refers * to an existing resource. * * *Note*: in most use cases, you should not use this function. If you * got a [class`Gimp`.Resource] from the API, you should trust it is * valid. This function is mostly for internal usage. * @param resource_id The resource ID to check. */ static id_is_valid(resource_id: number): boolean; // Methods /** * Deletes a resource. * * Deletes a resource. Returns an error if the resource is not * deletable. Deletes the resource's data. You should not use the * resource afterwards. * @returns TRUE on success. */ ['delete'](): boolean; /** * Duplicates a resource. * * Returns a copy having a different, unique ID. * @returns A copy of the resource. */ duplicate(): Resource; /** * Note: in most use cases, you should not need a resource's ID which is * mostly internal data and not reusable across sessions. * @returns the resource ID. */ get_id(): number; /** * Returns the resource's name. * * This procedure returns the resource's name. * @returns The resource's name. The returned value must be freed with g_free(). */ get_name(): string; /** * Returns whether the resource is a brush. * * This procedure returns TRUE if the specified resource is a brush. * @returns TRUE if the resource is a brush, FALSE otherwise. */ is_brush(): boolean; /** * Whether the resource can be edited. * * Returns TRUE if you have permission to change the resource. * @returns TRUE if the resource can be edited. */ is_editable(): boolean; /** * Returns whether the resource is a font. * * This procedure returns TRUE if the specified resource is a font. * @returns TRUE if the resource is a font, FALSE otherwise. */ is_font(): boolean; /** * Returns whether the resource is a gradient. * * This procedure returns TRUE if the specified resource is a gradient. * @returns TRUE if the resource is a gradient, FALSE otherwise. */ is_gradient(): boolean; /** * Returns whether the resource is a palette. * * This procedure returns TRUE if the specified resource is a palette. * @returns TRUE if the resource is a palette, FALSE otherwise. */ is_palette(): boolean; /** * Returns whether the resource is a pattern. * * This procedure returns TRUE if the specified resource is a pattern. * @returns TRUE if the resource is a pattern, FALSE otherwise. */ is_pattern(): boolean; /** * Returns TRUE if the resource is valid. * * This procedure checks if the given resource is valid and refers to an * existing resource. * @returns Whether the resource is valid. */ is_valid(): boolean; /** * Renames a resource. When the name is in use, renames to a unique * name. * * Renames a resource. When the proposed name is already used, GIMP * generates a unique name. * @param new_name The proposed new name of the resource. * @returns TRUE on success. */ rename(new_name: string): boolean; // 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 Selection { // Constructor properties interface interface ConstructorProps extends Channel.ConstructorProps {} } /** * Functions for manipulating selections. */ class Selection extends Channel { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; // Static methods /** * Select all of the image. * * This procedure sets the selection mask to completely encompass the * image. Every pixel in the selection channel is set to 255. * @param image The image. */ static all(image: Image): boolean; /** * Border the image's selection * * This procedure borders the selection. Bordering creates a new * selection which is defined along the boundary of the previous * selection at every point within the specified radius. * @param image The image. * @param radius Radius of border (in pixels). */ static border(image: Image, radius: number): boolean; /** * Find the bounding box of the current selection. * * This procedure returns whether there is a selection for the * specified image. If there is one, the upper left and lower right * corners of the bounding box are returned. These coordinates are * relative to the image. Please note that the pixel specified by the * lower right coordinate of the bounding box is not part of the * selection. The selection ends at the upper left corner of this * pixel. This means the width of the selection can be calculated as * (x2 - x1), its height as (y2 - y1). * @param image The image. */ static bounds(image: Image): [boolean, boolean, number, number, number, number]; /** * Feather the image's selection * * This procedure feathers the selection. Feathering is implemented * using a gaussian blur. * @param image The image. * @param radius Radius of feather (in pixels). */ static feather(image: Image, radius: number): boolean; /** * Float the selection from the specified drawable with initial offsets * as specified. * * This procedure determines the region of the specified drawable that * lies beneath the current selection. The region is then cut from the * drawable and the resulting data is made into a new layer which is * instantiated as a floating selection. The offsets allow initial * positioning of the new floating selection. * @param image ignored * @param drawables The drawables from which to float selection. * @param offx x offset for translation. * @param offy y offset for translation. */ static float(image: Image, drawables: Drawable[], offx: number, offy: number): Layer; /** * Remove holes from the image's selection * * This procedure removes holes from the selection, that can come from * selecting a patchy area with the Fuzzy Select Tool. In technical * terms this procedure floods the selection. See the Algorithms page * in the developer wiki for details. * @param image The image. */ static flood(image: Image): boolean; /** * Returns a #GimpSelection representing `selection_id`. This function * calls gimp_item_get_by_id() and returns the item if it is selection * or %NULL otherwise. * @param selection_id The selection id. */ static get_by_id(selection_id: number): Selection | null; /** * Grow the image's selection * * This procedure grows the selection. Growing involves expanding the * boundary in all directions by the specified pixel amount. * @param image The image. * @param steps Steps of grow (in pixels). */ static grow(image: Image, steps: number): boolean; /** * Invert the selection mask. * * This procedure inverts the selection mask. For every pixel in the * selection channel, its new value is calculated as (255 - old-value). * @param image The image. */ static invert(image: Image): boolean; /** * Determine whether the selection is empty. * * This procedure returns TRUE if the selection for the specified image * is empty. * @param image The image. */ static is_empty(image: Image): boolean; /** * Deselect the entire image. * * This procedure deselects the entire image. Every pixel in the * selection channel is set to 0. * @param image The image. */ static none(image: Image): boolean; /** * Copy the selection mask to a new channel. * * This procedure copies the selection mask and stores the content in a * new channel. The new channel is automatically inserted into the * image's list of channels. * @param image The image. */ static save(image: Image): Channel; /** * Sharpen the selection mask. * * This procedure sharpens the selection mask. For every pixel in the * selection channel, if the value is > 127, the new pixel is * assigned a value of 255. This removes any \"anti-aliasing\" that * might exist in the selection mask's boundary. * @param image The image. */ static sharpen(image: Image): boolean; /** * Shrink the image's selection * * This procedure shrinks the selection. Shrinking involves trimming * the existing selection boundary on all sides by the specified number * of pixels. * @param image The image. * @param steps Steps of shrink (in pixels). */ static shrink(image: Image, steps: number): boolean; /** * Translate the selection by the specified offsets. * * This procedure actually translates the selection for the specified * image by the specified offsets. Regions that are translated from * beyond the bounds of the image are set to empty. Valid regions of * the selection which are translated beyond the bounds of the image * because of this call are lost. * @param image The image. * @param offx x offset for translation. * @param offy y offset for translation. */ static translate(image: Image, offx: number, offy: number): boolean; /** * Find the value of the selection at the specified coordinates. * * This procedure returns the value of the selection at the specified * coordinates. If the coordinates lie out of bounds, 0 is returned. * @param image The image. * @param x x coordinate of value. * @param y y coordinate of value. */ static value(image: Image, x: number, y: number): number; } namespace TextLayer { // Constructor properties interface interface ConstructorProps extends Layer.ConstructorProps {} } /** * Functions for querying and manipulating text layers. */ class TextLayer extends Layer { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](image: Image, text: string, font: Font, size: number, unit: Unit): TextLayer; // Conflicted with Gimp.Layer.new static ['new'](...args: never[]): any; // Static methods /** * Returns a #GimpTextLayer representing `layer_id`. This function calls * gimp_item_get_by_id() and returns the item if it is layer or %NULL * otherwise. * @param layer_id The layer id. */ static get_by_id(layer_id: number): TextLayer | null; // Methods /** * Check if antialiasing is used in the text layer. * * This procedure checks if antialiasing is enabled in the specified * text layer. * @returns A flag which is true if antialiasing is used for rendering the font in the text layer. */ get_antialias(): boolean; /** * Get the base direction used for rendering the text layer. * * This procedure returns the base direction used for rendering the * text in the text layer * @returns The based direction used for the text layer. */ get_base_direction(): TextDirection; /** * Get the color of the text in a text layer. * * This procedure returns the color of the text in a text layer. * @returns The color of the text. */ get_color(): Gegl.Color; /** * Get the font from a text layer as string. * * This procedure returns the font from a text layer. * @returns The font which is used in the specified text layer. */ get_font(): Font; /** * Get the font size from a text layer. * * This procedure returns the size of the font which is used in a text * layer. You will receive the size as a double 'font-size' in 'unit' * units. * @returns The font size. */ get_font_size(): [number, Unit]; /** * Get information about hinting in the specified text layer. * * This procedure provides information about the hinting that is being * used in a text layer. Hinting can be optimized for fidelity or * contrast or it can be turned entirely off. * @returns The hint style used for font outlines. */ get_hint_style(): TextHintStyle; /** * Get the line indentation of text layer. * * This procedure returns the indentation of the first line in a text * layer. * @returns The indentation value of the first line. */ get_indent(): number; /** * Get the text justification information of the text layer. * * This procedure returns the alignment of the lines in the text layer * relative to each other. * @returns The justification used in the text layer. */ get_justification(): TextJustification; /** * Check if kerning is used in the text layer. * * This procedure checks if kerning is enabled in the specified text * layer. * @returns A flag which is true if kerning is used in the text layer. */ get_kerning(): boolean; /** * Get the language used in the text layer. * * This procedure returns the language string which is set for the text * in the text layer. * @returns The language used in the text layer. The returned value must be freed with g_free(). */ get_language(): string; /** * Get the letter spacing used in a text layer. * * This procedure returns the additional spacing between the single * glyphs in a text layer. * @returns The letter-spacing value. */ get_letter_spacing(): number; /** * Get the spacing between lines of text. * * This procedure returns the line-spacing between lines of text in a * text layer. * @returns The line-spacing value. */ get_line_spacing(): number; /** * Get the markup from a text layer as string. * * This procedure returns the markup of the styles from a text layer. * The markup will be in the form of Pango's markup - See * https://www.pango.org/ for more information about Pango and its * markup. * @returns The markup which represents the style of the specified text layer. The returned value must be freed with g_free(). */ get_markup(): string; /** * Get the text from a text layer as string. * * This procedure returns the text from a text layer as a string. * @returns The text from the specified text layer. The returned value must be freed with g_free(). */ get_text(): string; /** * Resize the box of a text layer. * * This procedure changes the width and height of a text layer while * keeping it as a text layer and not converting it to a bitmap like * gimp_layer_resize() would do. * @param width The new box width in pixels. * @param height The new box height in pixels. * @returns TRUE on success. */ resize(width: number, height: number): boolean; /** * Enable/disable anti-aliasing in a text layer. * * This procedure enables or disables anti-aliasing of the text in a * text layer. * @param antialias Enable/disable antialiasing of the text. * @returns TRUE on success. */ set_antialias(antialias: boolean): boolean; /** * Set the base direction in the text layer. * * This procedure sets the base direction used in applying the Unicode * bidirectional algorithm when rendering the text. * @param direction The base direction of the text. * @returns TRUE on success. */ set_base_direction(direction: TextDirection | null): boolean; /** * Set the color of the text in the text layer. * * This procedure sets the text color in the text layer 'layer'. * @param color The color to use for the text. * @returns TRUE on success. */ set_color(color: Gegl.Color): boolean; /** * Set the font of a text layer. * * This procedure modifies the font used in the specified text layer. * @param font The new font to use. * @returns TRUE on success. */ set_font(font: Font): boolean; /** * Set the font size. * * This procedure changes the font size of a text layer. The size of * your font will be a double 'font-size' of 'unit' units. * @param font_size The font size. * @param unit The unit to use for the font size. * @returns TRUE on success. */ set_font_size(font_size: number, unit: Unit): boolean; /** * Control how font outlines are hinted in a text layer. * * This procedure sets the hint style for font outlines in a text * layer. This controls whether to fit font outlines to the pixel grid, * and if so, whether to optimize for fidelity or contrast. * @param style The new hint style. * @returns TRUE on success. */ set_hint_style(style: TextHintStyle | null): boolean; /** * Set the indentation of the first line in a text layer. * * This procedure sets the indentation of the first line in the text * layer. * @param indent The indentation for the first line. * @returns TRUE on success. */ set_indent(indent: number): boolean; /** * Set the justification of the text in a text layer. * * This procedure sets the alignment of the lines in the text layer * relative to each other. * @param justify The justification for your text. * @returns TRUE on success. */ set_justification(justify: TextJustification | null): boolean; /** * Enable/disable kerning in a text layer. * * This procedure enables or disables kerning in a text layer. * @param kerning Enable/disable kerning in the text. * @returns TRUE on success. */ set_kerning(kerning: boolean): boolean; /** * Set the language of the text layer. * * This procedure sets the language of the text in text layer. For some * scripts the language has an influence of how the text is rendered. * @param language The new language to use for the text layer. * @returns TRUE on success. */ set_language(language: string): boolean; /** * Adjust the letter spacing in a text layer. * * This procedure sets the additional spacing between the single glyphs * in a text layer. * @param letter_spacing The additional letter spacing to use. * @returns TRUE on success. */ set_letter_spacing(letter_spacing: number): boolean; /** * Adjust the line spacing in a text layer. * * This procedure sets the additional spacing used between lines a text * layer. * @param line_spacing The additional line spacing to use. * @returns TRUE on success. */ set_line_spacing(line_spacing: number): boolean; /** * Set the markup for a text layer from a string. * * This procedure sets the markup of the styles for a text layer. The * markup should be in the form of Pango's markup - See * https://docs.gtk.org/Pango/pango_markup.html for a reference. * Note that GIMP's text tool does not support all of Pango markup. Any * unsupported markup will still be applied to your text layer, yet * would be dropped as soon as you edit text with the tool. * @param markup The new markup to set. * @returns TRUE on success. */ set_markup(markup: string): boolean; /** * Set the text of a text layer. * * This procedure changes the text of a text layer. * @param text The new text to set. * @returns TRUE on success. */ set_text(text: string): boolean; } namespace ThumbnailProcedure { // Constructor properties interface interface ConstructorProps extends Procedure.ConstructorProps {} } class ThumbnailProcedure extends Procedure { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( plug_in: PlugIn, name: string, proc_type: PDBProcType, run_func: RunThumbnailFunc, run_data_destroy?: GLib.DestroyNotify | null, ): ThumbnailProcedure; // Conflicted with Gimp.Procedure.new static ['new'](...args: never[]): any; } namespace Unit { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps { abbreviation: string; digits: number; factor: number; id: number; name: string; symbol: string; } } /** * Provides operations on units, a collection of predefined units and * functions to create new units. */ class Unit extends GObject.Object { static $gtype: GObject.GType; // Properties get abbreviation(): string; get digits(): number; get factor(): number; get id(): number; get name(): string; get symbol(): string; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new'](name: string, factor: number, digits: number, symbol: string, abbreviation: string): Unit; // Static methods /** * The `format` string supports the following percent expansions: * * * `%n`: Name (long label) * * `%a`: Abbreviation (short label) * * `%%`: Literal percent * * `%f`: Factor (how many units make up an inch) * * `%y`: Symbol (e.g. `''` for `GIMP_UNIT_INCH`) * @param format A printf-like format string which is used to create the unit string. * @param unit A unit. */ static format_string(format: string, unit: Unit): string; /** * Returns the unique [class`Unit]` object corresponding to `unit_id,` * which is the integer identifier as returned by [method`Unit`.get_id]. * @param unit_id The unit id. */ static get_by_id(unit_id: number): Unit; /** * Returns the unique object representing inch unit. * * This procedure returns the unit representing inch. The returned * object is unique across the whole run. */ static inch(): Unit; /** * Returns the unique object representing millimeter unit. * * This procedure returns the unit representing millimeter. The * returned object is unique across the whole run. */ static mm(): Unit; /** * Returns the unique object representing percent dimensions relatively * to an image. * * This procedure returns the unit representing typographical points. * The returned object is unique across the whole run. */ static percent(): Unit; /** * Returns the unique object representing Pica unit. * * This procedure returns the unit representing Picas. * The returned object is unique across the whole run. */ static pica(): Unit; /** * Returns the unique object representing pixel unit. * * This procedure returns the unit representing pixel. The returned * object is unique across the whole run. */ static pixel(): Unit; /** * Returns the unique object representing typographical point unit. * * This procedure returns the unit representing typographical points. * The returned object is unique across the whole run. */ static point(): Unit; // Methods /** * This function returns the abbreviation of the unit (e.g. "in" for * inches). * It can be used as a short label for the unit in the interface. * For long labels, use [method`Unit`.get_name]. * * NOTE: This string must not be changed or freed. * @returns The unit's abbreviation. */ get_abbreviation(): string; get_deletion_flag(): boolean; /** * Returns the number of digits set for `unit`. * Built-in units' accuracy is approximately the same as an inch with * two digits. User-defined units can suggest a different accuracy. * * Note: the value is as-set by defaults or by the user and does not * necessary provide enough precision on high-resolution units. * When the information is needed for a specific unit, the use of * gimp_unit_get_scaled_digits() may be more appropriate. * * Returns 0 for `unit` == GIMP_UNIT_PIXEL. * @returns The suggested number of digits. */ get_digits(): number; /** * A #GimpUnit's `factor` is defined to be: * * distance_in_units == (`factor` * distance_in_inches) * * Returns 0 for `unit` == GIMP_UNIT_PIXEL. * @returns The unit's factor. */ get_factor(): number; /** * The ID can be used to retrieve the unit with [func`Unit`.get_by_id]. * * Note that this ID will be stable within a single session of GIMP, but * you should not expect this ID to stay the same across multiple runs. * @returns The unit's ID. */ get_id(): number; /** * This function returns the usual name of the unit (e.g. "inches"). * It can be used as the long label for the unit in the interface. * For short labels, use [method`Unit`.get_abbreviation]. * * NOTE: This string must not be changed or freed. * @returns The unit's name. */ get_name(): string; /** * Returns the number of digits a `unit` field should provide to get * enough accuracy so that every pixel position shows a different * value from neighboring pixels. * * Note: when needing digit accuracy to display a diagonal distance, * the `resolution` may not correspond to the unit's horizontal or * vertical resolution, but instead to the result of: * `distance_in_pixel / distance_in_inch`. * @param resolution the resolution in PPI. * @returns The suggested number of digits. */ get_scaled_digits(resolution: number): number; /** * This is e.g. "''" for UNIT_INCH. * * NOTE: This string must not be changed or freed. * @returns The unit's symbol. */ get_symbol(): string; /** * Returns whether the unit is built-in. * * This procedure returns `unit` is a built-in unit. In particular the * deletion flag cannot be set on built-in units. * @returns Whether @unit is built-in. */ is_built_in(): boolean; /** * Checks if the given `unit` is metric. A simplistic test is used * that looks at the unit's factor and checks if it is 2.54 multiplied * by some common powers of 10. Currently it checks for mm, cm, dm, m. * * See also: gimp_unit_get_factor() * @returns %TRUE if the @unit is metric. */ is_metric(): boolean; /** * Sets a #GimpUnit's `deletion_flag`. If the `deletion_flag` of a unit is * %TRUE when GIMP exits, this unit will not be saved in the users's * "unitrc" file. * * Trying to change the `deletion_flag` of a built-in unit will be silently * ignored. * @param deletion_flag The new deletion_flag. */ set_deletion_flag(deletion_flag: boolean): void; } namespace VectorLoadProcedure { // Constructor properties interface interface ConstructorProps extends LoadProcedure.ConstructorProps {} } /** * A [class`Procedure]` subclass that makes it easier to write load procedures * for vector image formats. * * It automatically adds the standard arguments: * ([enum`RunMode]`, [iface`Gio`.File], int width, int height) * * and the standard return value: ( [class`Image]` ) * * It is possible to add additional arguments. * * When invoked via [method`Procedure`.run], it unpacks these standard * arguments and calls `run_func` which is a [callback`RunImageFunc]`. The * [class`ProcedureConfig]` of [callback`Gimp`.RunVectorLoadFunc] contains * additionally added arguments but also the arguments added by this class. */ class VectorLoadProcedure extends LoadProcedure { static $gtype: GObject.GType; // Constructors constructor(properties?: Partial, ...args: any[]); _init(...args: any[]): void; static ['new']( plug_in: PlugIn, name: string, proc_type: PDBProcType, extract_func: ExtractVectorFunc, run_func: RunVectorLoadFunc, run_data_destroy?: GLib.DestroyNotify | null, ): VectorLoadProcedure; // Conflicted with Gimp.LoadProcedure.new static ['new'](...args: never[]): any; // Methods /** * Extracts native or suggested dimensions from `file,` which must be a vector * file in the right format supported by `procedure`. It is considered a * programming error to pass a file of invalid format. * @param file a [iface@Gio.File] which can be processed by @procedure. * @returns %TRUE if dimensions could be extracted. */ extract_dimensions(file: Gio.File): [boolean, VectorLoadData]; } class Array { static $gtype: GObject.GType; // Fields data: Uint8Array; length: number; static_data: boolean; // Constructors constructor( properties?: Partial<{ data: Uint8Array; length: number; static_data: boolean; }>, ); _init(...args: any[]): void; static ['new'](data: Uint8Array | string, static_data: boolean): Array; // Methods copy(): Array; free(): void; } type BatchProcedureClass = typeof BatchProcedure; type BrushClass = typeof Brush; type ChannelClass = typeof Channel; type ChoiceClass = typeof Choice; type ColorConfigClass = typeof ColorConfig; type ColorManagedInterface = typeof ColorManaged; type ColorProfileClass = typeof ColorProfile; type ColorTransformClass = typeof ColorTransform; abstract class Config { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; // Methods /** * Compares all read- and write-able properties from `src` and `dest` * that have all `flags` set. Differing values are then copied from * `src` to `dest`. If `flags` is 0, all differing read/write properties. * * Properties marked as "construct-only" are not touched. * @param dest another #GObject of the same type as @a. * @param flags a mask of GParamFlags * @returns %TRUE if @dest was modified, %FALSE otherwise */ copy(dest: Config, flags: GObject.ParamFlags | null): boolean; /** * Deserialize the #GimpConfig object. * @param scanner the #GScanner to use. * @param nest_level the nest level. * @param data client data. * @returns Whether serialization succeeded. */ deserialize(scanner: GLib.Scanner, nest_level: number, data?: any | null): boolean; /** * Opens the file specified by `file,` reads configuration data from it * and configures `config` accordingly. Basically this function creates * a properly configured [struct`GLib`.Scanner] for you and calls the deserialize * function of the `config'`s [iface`ConfigInterface]`. * @param file the file to read configuration from. * @param data user data passed to the deserialize implementation. * @returns Whether deserialization succeeded. */ deserialize_file(file: Gio.File, data?: any | null): boolean; /** * Configures `config` from `parasite`. Basically this function creates * a properly configured #GScanner for you and calls the deserialize * function of the `config'`s #GimpConfigInterface. * @param parasite parasite containing a serialized config string * @param data client data * @returns %TRUE if deserialization succeeded, %FALSE otherwise. */ deserialize_parasite(parasite: Parasite, data?: any | null): boolean; /** * This function uses the `scanner` to configure the properties of `config`. * @param scanner a #GScanner. * @param nest_level the nest level * @returns %TRUE on success, %FALSE otherwise. */ deserialize_properties(scanner: GLib.Scanner, nest_level: number): boolean; /** * This function deserializes a single property of `config`. You * shouldn't need to call this function directly. If possible, use * gimp_config_deserialize_properties() instead. * @param scanner a #GScanner. * @param nest_level the nest level * @returns %G_TOKEN_RIGHT_PAREN on success, otherwise the expected #GTokenType or %G_TOKEN_NONE if the expected token was found but couldn't be parsed. */ deserialize_property(scanner: GLib.Scanner, nest_level: number): GLib.TokenType; /** * Reads configuration data from `input` and configures `config` * accordingly. Basically this function creates a properly configured * #GScanner for you and calls the deserialize function of the * `config'`s #GimpConfigInterface. * @param input the input stream to read configuration from. * @param data user data passed to the deserialize implementation. * @returns Whether deserialization succeeded. */ deserialize_stream(input: Gio.InputStream, data?: any | null): boolean; /** * Configures `config` from `text`. Basically this function creates a * properly configured #GScanner for you and calls the deserialize * function of the `config'`s #GimpConfigInterface. * @param text string to deserialize (in UTF-8 encoding) * @param data client data * @returns %TRUE if deserialization succeeded, %FALSE otherwise. */ deserialize_string(text: string[], data?: any | null): boolean; /** * Creates a copy of the passed object by copying all object * properties. The default implementation of the #GimpConfigInterface * only works for objects that are completely defined by their * properties. * @returns the duplicated #GimpConfig object */ duplicate(): any | null; /** * Compares the two objects. The default implementation of the * #GimpConfigInterface compares the object properties and thus only * works for objects that are completely defined by their * properties. * @param b another #GObject of the same type as @a. * @returns %TRUE if the two objects are equal. */ is_equal_to(b: Config): boolean; /** * Resets the object to its default state. The default implementation of the * #GimpConfigInterface only works for objects that are completely defined by * their properties. */ reset(): void; /** * Serialize the #GimpConfig object. * @param writer the #GimpConfigWriter to use. * @param data client data * @returns Whether serialization succeeded. */ serialize(writer: ConfigWriter, data?: any | null): boolean; /** * This function writes all object properties that have been changed from * their default values to the `writer`. * @param writer a #GimpConfigWriter. * @returns %TRUE if serialization succeeded, %FALSE otherwise */ serialize_changed_properties(writer: ConfigWriter): boolean; /** * This function writes all object properties to the `writer`. * @param writer a #GimpConfigWriter. * @returns %TRUE if serialization succeeded, %FALSE otherwise */ serialize_properties(writer: ConfigWriter): boolean; /** * This function serializes a single object property to the `writer`. * @param param_spec a #GParamSpec. * @param writer a #GimpConfigWriter. * @returns %TRUE if serialization succeeded, %FALSE otherwise */ serialize_property(param_spec: GObject.ParamSpec, writer: ConfigWriter): boolean; /** * This function serializes a single object property to the `writer`. * @param prop_name the property's name. * @param writer a #GimpConfigWriter. * @returns %TRUE if serialization succeeded, %FALSE otherwise */ serialize_property_by_name(prop_name: string, writer: ConfigWriter): boolean; /** * Serializes the object properties of `config` to the given file * descriptor. * @param fd a file descriptor, opened for writing * @param data user data passed to the serialize implementation. * @returns %TRUE if serialization succeeded, %FALSE otherwise. */ serialize_to_fd(fd: number, data?: any | null): boolean; /** * Serializes the object properties of `config` to the file specified * by `file`. If a file with that name already exists, it is * overwritten. Basically this function opens `file` for you and calls * the serialize function of the `config'`s [iface`ConfigInterface]`. * @param file the file to write the configuration to. * @param header optional file header (must be ASCII only) * @param footer optional file footer (must be ASCII only) * @param data user data passed to the serialize implementation. * @returns %TRUE if serialization succeeded, %FALSE otherwise. */ serialize_to_file( file: Gio.File, header?: string | null, footer?: string | null, data?: any | null, ): boolean; /** * Serializes the object properties of `config` to a [struct`Parasite]`. * @param parasite_name the new parasite's name * @param parasite_flags the new parasite's flags * @param data user data passed to the serialize implementation. * @returns the newly allocated parasite. */ serialize_to_parasite(parasite_name: string, parasite_flags: number, data?: any | null): Parasite; /** * Serializes the object properties of `config` to the stream specified * by `output`. * @param output the #GOutputStream to write the configuration to. * @param header optional file header (must be ASCII only) * @param footer optional file footer (must be ASCII only) * @param data user data passed to the serialize implementation. * @returns Whether serialization succeeded. */ serialize_to_stream( output: Gio.OutputStream, header?: string | null, footer?: string | null, data?: any | null, ): boolean; /** * Serializes the object properties of `config` to a string. * @param data user data passed to the serialize implementation. * @returns a newly allocated NUL-terminated string. */ serialize_to_string(data?: any | null): string; } /** * Functions for writing config info to a file for libgimpconfig. */ class ConfigWriter { static $gtype: GObject.GType; // Constructors constructor(fd: number); _init(...args: any[]): void; static new_from_fd(fd: number): ConfigWriter; static new_from_file(file: Gio.File, atomic: boolean, header: string): ConfigWriter; static new_from_stream(output: Gio.OutputStream, header: string): ConfigWriter; static new_from_string(string: GLib.String): ConfigWriter; // Methods /** * Closes an element opened with gimp_config_writer_open(). */ close(): void; /** * Appends the `comment` to `str` and inserts linebreaks and hash-marks to * format it as a comment. Note that this function does not handle non-ASCII * characters. * @param comment the comment to write (ASCII only) */ comment(comment: string): void; /** * This function toggles whether the `writer` should create commented * or uncommented output. This feature is used to generate the * system-wide installed gimprc that documents the default settings. * * Since comments have to start at the beginning of a line, this * function will insert a newline if necessary. * @param enable %TRUE to enable comment mode, %FALSE to disable it */ comment_mode(enable: boolean): void; /** * Writes data to `writer`. * @param data The data to write */ data(data: Uint8Array | string): void; /** * This function finishes the work of `writer` and unrefs it * afterwards. It closes all open elements, appends an optional * comment and releases all resources allocated by `writer`. * * Using any function except gimp_config_writer_ref() or * gimp_config_writer_unref() after this function is forbidden * and will trigger warnings. * @param footer text to include as comment at the bottom of the file * @returns %TRUE if everything could be successfully written, %FALSE otherwise */ finish(footer: string): boolean; /** * Writes an identifier to `writer`. The `string` is *not* quoted and special * characters are *not* escaped. * @param identifier a NUL-terminated string */ identifier(identifier: string): void; linefeed(): void; /** * This function writes the opening parenthesis followed by `name`. * It also increases the indentation level and sets a mark that * can be used by gimp_config_writer_revert(). * @param name name of the element to open */ open(name: string): void; /** * Appends a space followed by `string` to the `writer`. Note that string * must not contain any special characters that might need to be escaped. * @param string a string to write * @param len number of bytes from @string or -1 if @string is NUL-terminated. */ print(string: string, len: number): void; /** * Adds a reference to a #GimpConfigWriter. * @returns the same @writer. */ ref(): ConfigWriter; /** * Reverts all changes to `writer` that were done since the last call * to gimp_config_writer_open(). This can only work if you didn't call * gimp_config_writer_close() yet. */ revert(): void; /** * Writes a string value to `writer`. The `string` is quoted and special * characters are escaped. * @param string a NUL-terminated string */ string(string: string): void; /** * Unref a #GimpConfigWriter. If the reference count drops to zero, the * writer is freed. * * Note that at least one of the references has to be dropped using * gimp_config_writer_finish(). */ unref(): void; } type DisplayClass = typeof Display; type DrawableClass = typeof Drawable; type DrawableFilterClass = typeof DrawableFilter; type DrawableFilterConfigClass = typeof DrawableFilterConfig; /** * This structure is used to register translatable descriptions and * help texts for enum values. See gimp_enum_set_value_descriptions(). */ class EnumDesc { static $gtype: GObject.GType; // Fields value: number; value_desc: string; value_help: string; // Constructors constructor( properties?: Partial<{ value: number; value_desc: string; value_help: string; }>, ); _init(...args: any[]): void; } type ExportOptionsClass = typeof ExportOptions; type ExportProcedureClass = typeof ExportProcedure; type FileProcedureClass = typeof FileProcedure; /** * This structure is used to register translatable descriptions and * help texts for flag values. See gimp_flags_set_value_descriptions(). */ class FlagsDesc { static $gtype: GObject.GType; // Fields value: number; value_desc: string; value_help: string; // Constructors constructor( properties?: Partial<{ value: number; value_desc: string; value_help: string; }>, ); _init(...args: any[]): void; } type FontClass = typeof Font; type GradientClass = typeof Gradient; type GroupLayerClass = typeof GroupLayer; type ImageClass = typeof Image; type ImageProcedureClass = typeof ImageProcedure; type ItemClass = typeof Item; type LayerClass = typeof Layer; type LayerMaskClass = typeof LayerMask; type LoadProcedureClass = typeof LoadProcedure; /** * A two by two matrix. */ class Matrix2 { static $gtype: GObject.GType; // Fields coeff: number[]; // Constructors constructor( properties?: Partial<{ coeff: number[]; }>, ); _init(...args: any[]): void; // Methods /** * Calculates the determinant of the given matrix. * @returns The determinant. */ determinant(): number; /** * Sets the matrix to the identity matrix. */ identity(): void; /** * Inverts the given matrix. */ invert(): void; /** * Multiplies two matrices and puts the result into the second one. * @param right The second input matrix which will be overwritten by the result. */ mult(right: Matrix2): void; /** * Transforms a point in 2D as specified by the transformation matrix. * @param x The source X coordinate. * @param y The source Y coordinate. */ transform_point(x: number, y: number): [number, number]; } /** * A three by three matrix. */ class Matrix3 { static $gtype: GObject.GType; // Fields coeff: number[]; // Constructors constructor( properties?: Partial<{ coeff: number[]; }>, ); _init(...args: any[]): void; // Methods /** * Applies the affine transformation given by six values to `matrix`. * The six values form define an affine transformation matrix as * illustrated below: * * ( a c e ) * ( b d f ) * ( 0 0 1 ) * @param a the 'a' coefficient * @param b the 'b' coefficient * @param c the 'c' coefficient * @param d the 'd' coefficient * @param e the 'e' coefficient * @param f the 'f' coefficient */ affine(a: number, b: number, c: number, d: number, e: number, f: number): void; /** * Calculates the determinant of the given matrix. * @returns The determinant. */ determinant(): number; /** * Checks if two matrices are equal. * @param matrix2 The second matrix * @returns %TRUE the matrices are equal, %FALSE otherwise */ equal(matrix2: Matrix3): boolean; /** * Sets the matrix to the identity matrix. */ identity(): void; /** * Inverts the given matrix. */ invert(): void; /** * Checks if the given matrix defines an affine transformation. * @returns %TRUE if the matrix defines an affine transformation, %FALSE otherwise */ is_affine(): boolean; /** * Checks if the given matrix is diagonal. * @returns %TRUE if the matrix is diagonal, %FALSE otherwise */ is_diagonal(): boolean; /** * Checks if the given matrix is the identity matrix. * @returns %TRUE if the matrix is the identity matrix, %FALSE otherwise */ is_identity(): boolean; /** * Checks if we'll need to interpolate when applying this matrix as * a transformation. * @returns %TRUE if all entries of the upper left 2x2 matrix are either 0 or 1, %FALSE otherwise */ is_simple(): boolean; /** * Multiplies two matrices and puts the result into the second one. * @param right The second input matrix which will be overwritten by the result. */ mult(right: Matrix3): void; /** * Rotates the matrix by theta degrees. * @param theta The angle of rotation (in radians). */ rotate(theta: number): void; /** * Scales the matrix by x and y * @param x X scale factor. * @param y Y scale factor. */ scale(x: number, y: number): void; /** * Transforms a point in 2D as specified by the transformation matrix. * @param x The source X coordinate. * @param y The source Y coordinate. * @param newx The transformed X coordinate. * @param newy The transformed Y coordinate. */ transform_point(x: number, y: number, newx: number, newy: number): void; /** * Translates the matrix by x and y. * @param x Translation in X direction. * @param y Translation in Y direction. */ translate(x: number, y: number): void; /** * Shears the matrix in the X direction. * @param amount X shear amount. */ xshear(amount: number): void; /** * Shears the matrix in the Y direction. * @param amount Y shear amount. */ yshear(amount: number): void; } /** * A four by four matrix. */ class Matrix4 { static $gtype: GObject.GType; // Fields coeff: number[]; // Constructors constructor( properties?: Partial<{ coeff: number[]; }>, ); _init(...args: any[]): void; // Methods /** * Sets the matrix to the identity matrix. */ identity(): void; /** * Multiplies two matrices and puts the result into the second one. * @param right The second input matrix which will be overwritten by the result. */ mult(right: Matrix4): void; to_deg(): [number, number, number]; /** * Transforms a point in 3D as specified by the transformation matrix. * @param x The source X coordinate. * @param y The source Y coordinate. * @param z The source Z coordinate. * @returns The transformed W coordinate. */ transform_point(x: number, y: number, z: number): [number, number, number, number]; } type MetadataClass = typeof Metadata; type ModuleClass = typeof Module; type ModuleDBClass = typeof ModuleDB; /** * This structure contains information about a loadable module. */ class ModuleInfo { static $gtype: GObject.GType; // Fields abi_version: number; purpose: string; author: string; version: string; copyright: string; date: string; // Constructors constructor( properties?: Partial<{ abi_version: number; purpose: string; author: string; version: string; copyright: string; date: string; }>, ); _init(...args: any[]): void; } type PDBClass = typeof PDB; type PaletteClass = typeof Palette; class ParamSpecObject { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; // Static methods /** * This function duplicates `pspec` appropriately, depending on the * accurate spec type. * @param pspec a [struct@Gimp.ParamSpecObject]. */ static duplicate(pspec: GObject.ParamSpec): GObject.ParamSpec; /** * Get the default object value of the param spec. * * If the `pspec` has been registered with a specific default (which can * be verified with [func`Gimp`.ParamSpecObject.has_default]), it will be * returned, though some specific subtypes may support returning dynamic * default (e.g. based on context). * @param pspec a #GObject #GParamSpec */ static get_default(pspec: GObject.ParamSpec): T; /** * This function tells whether a default was set, typically with * [func`Gimp`.ParamSpecObject.set_default] or any other way. It * does not guarantee that the default is an actual object (it may be * %NULL if valid as a default). * @param pspec a #GObject #GParamSpec */ static has_default(pspec: GObject.ParamSpec): boolean; /** * Set the default object value of the param spec. This will switch the * `has_default` flag so that [func`Gimp`.ParamSpecObject.has_default] * will now return %TRUE. * * A %NULL `default_value` still counts as a default (unless the specific * `pspec` does not allow %NULL as a default). * @param pspec a #GObject #GParamSpec * @param default_value a default value. */ static set_default(pspec: GObject.ParamSpec, default_value?: GObject.Object | null): void; } class ParamSpecObjectClass { static $gtype: GObject.GType; // Constructors _init(...args: any[]): void; } /** * Arbitrary pieces of data which can be attached to various GIMP objects. */ class Parasite { static $gtype: GObject.GType; // Fields name: string; flags: number; size: number; data: any[]; // Constructors constructor( properties?: Partial<{ name: string; flags: number; size: number; data: any[]; }>, ); _init(...args: any[]): void; static ['new'](name: string, flags: number, data?: number[] | null): Parasite; // Methods /** * Compare parasite's contents. * @param b a #GimpParasite * @returns %TRUE if @a and @b have same contents, %FALSE otherwise. */ compare(b: Parasite): boolean; /** * Create a new parasite with all the same values. * @returns a newly allocated #GimpParasite with same contents. */ copy(): Parasite; /** * Free `parasite'`s dynamically allocated memory. */ free(): void; /** * Gets the parasite's data. It may not necessarily be text, nor is it * guaranteed to be %NULL-terminated. It is your responsibility to know * how to deal with this data. * Even when you expect a nul-terminated string, it is advised not to * assume the returned data to be, as parasites can be edited by third * party scripts. You may end up reading out-of-bounds data. So you * should only ignore `num_bytes` when you all you care about is checking * if the parasite has contents. * @returns parasite's data. */ get_data(): number[]; get_flags(): number; get_name(): string; has_flag(flag: number): boolean; is_persistent(): boolean; /** * Compare parasite's names. * @param name a parasite name. * @returns %TRUE if @parasite is named @name, %FALSE otherwise. */ is_type(name: string): boolean; is_undoable(): boolean; } type PathClass = typeof Path; type PatternClass = typeof Pattern; /** * PLease somebody help documenting this. */ class PixPipeParams { static $gtype: GObject.GType; // Fields step: number; ncells: number; dim: number; cols: number; rows: number; cellwidth: number; cellheight: number; placement: string; rank: number[]; selection: string[]; // Constructors constructor( properties?: Partial<{ step: number; ncells: number; dim: number; cols: number; rows: number; cellwidth: number; cellheight: number; placement: string; rank: number[]; selection: string[]; }>, ); _init(...args: any[]): void; } type PlugInClass = typeof PlugIn; type ProcedureClass = typeof Procedure; type ProcedureConfigClass = typeof ProcedureConfig; class ProgressVtable { static $gtype: GObject.GType; // Fields start: ProgressVtableStartFunc; end: ProgressVtableEndFunc; set_text: ProgressVtableSetTextFunc; set_value: ProgressVtableSetValueFunc; pulse: ProgressVtablePulseFunc; get_window_handle: ProgressVtableGetWindowFunc; // Constructors _init(...args: any[]): void; } type ResourceClass = typeof Resource; /** * A wrapper around #GScanner with some convenience API. */ class Scanner { static $gtype: GObject.GType; // Constructors constructor(file: Gio.File); _init(...args: any[]): void; static new_file(file: Gio.File): Scanner; static new_stream(input: Gio.InputStream): Scanner; static new_string(text: string[]): Scanner; // Methods parse_boolean(): [boolean, boolean]; parse_color(): [boolean, Gegl.Color]; parse_data(): [boolean, Uint8Array]; parse_double(): [boolean, number]; parse_identifier(): [boolean, string]; parse_int(): [boolean, number]; parse_int64(): [boolean, number]; parse_matrix2(): [boolean, Matrix2]; parse_string(): [boolean, string]; parse_string_no_validate(): [boolean, string]; parse_token(token: GLib.TokenType | null): boolean; /** * Adds a reference to a #GimpScanner. * @returns the same @scanner. */ ref(): Scanner; /** * Unref a #GimpScanner. If the reference count drops to zero, the * scanner is freed. */ unref(): void; } type SelectionClass = typeof Selection; type TextLayerClass = typeof TextLayer; type ThumbnailProcedureClass = typeof ThumbnailProcedure; type UnitClass = typeof Unit; /** * The prime purpose of a #GimpValueArray is for it to be used as an * object property that holds an array of values. A #GimpValueArray wraps * an array of #GValue elements in order for it to be used as a boxed * type through %GIMP_TYPE_VALUE_ARRAY. */ class ValueArray { static $gtype: GObject.GType; // Constructors constructor(n_prealloced: number); _init(...args: any[]): void; static ['new'](n_prealloced: number): ValueArray; static new_from_values(values: (GObject.Value | any)[]): ValueArray; // Methods /** * Insert a copy of `value` as last element of `value_array`. If `value` is * %NULL, an uninitialized value is appended. * @param value #GValue to copy into #GimpValueArray, or %NULL * @returns the #GimpValueArray passed in as @value_array */ append(value?: GObject.Value | null): ValueArray; /** * Return an exact copy of a #GimpValueArray by duplicating all its values. * @returns a newly allocated #GimpValueArray. */ copy(): ValueArray; /** * Return a pointer to the value at `index` contained in `value_array`. This value * is supposed to be a [type`ColorArray]`. * * *Note*: most of the time, you should use the generic [method`Gimp`.ValueArray.index] * to retrieve a value, then the relevant `g_value_get_*()` function. * This alternative function is mostly there for bindings because * GObject-Introspection is [not able yet to process correctly known * boxed array types](https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492). * * There are no reasons to use this function in C code. * @param index index of the value of interest * @returns the [type@ColorArray] stored at @index in @value_array. */ get_color_array(index: number): Gegl.Color[]; /** * Return a pointer to the value at `index` contained in `value_array`. This value * is supposed to be a [type`CoreObjectArray]`. * * *Note*: most of the time, you should use the generic [method`Gimp`.ValueArray.index] * to retrieve a value, then the relevant `g_value_get_*()` function. * This alternative function is mostly there for bindings because * GObject-Introspection is [not able yet to process correctly known * boxed array types](https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492). * * There are no reasons to use this function in C code. * @param index index of the value of interest * @returns the [type@CoreObjectArray] stored at @index in @value_array. */ get_core_object_array(index: number): GObject.Object[]; /** * Return a pointer to the value at `index` contained in `value_array`. * * *Note*: in binding languages, some custom types fail to be correctly passed * through. For these types, you should use specific functions. * For instance, in the Python binding, a [type`ColorArray]` `GValue` * won't be usable with this function. You should use instead * [method`ValueArray`.get_color_array]. * @param index index of the value of interest * @returns pointer to a value at @index in @value_array */ index(index: number): unknown; /** * Insert a copy of `value` at specified position into `value_array`. If `value` * is %NULL, an uninitialized value is inserted. * @param index insertion position, must be <= gimp_value_array_length() * @param value #GValue to copy into #GimpValueArray, or %NULL * @returns the #GimpValueArray passed in as @value_array */ insert(index: number, value?: GObject.Value | null): ValueArray; length(): number; /** * Insert a copy of `value` as first element of `value_array`. If `value` is * %NULL, an uninitialized value is prepended. * @param value #GValue to copy into #GimpValueArray, or %NULL * @returns the #GimpValueArray passed in as @value_array */ prepend(value?: GObject.Value | null): ValueArray; /** * Adds a reference to a #GimpValueArray. * @returns the same @value_array */ ref(): ValueArray; /** * Remove the value at position `index` from `value_array`. * @param index position of value to remove, which must be less than gimp_value_array_length() * @returns the #GimpValueArray passed in as @value_array */ remove(index: number): ValueArray; truncate(n_values: number): void; /** * Unref a #GimpValueArray. If the reference count drops to zero, the * array including its contents are freed. */ unref(): void; } /** * A two dimensional vector. */ class Vector2 { static $gtype: GObject.GType; // Fields x: number; y: number; // Constructors constructor( properties?: Partial<{ x: number; y: number; }>, ); _init(...args: any[]): void; static ['new'](x: number, y: number): Vector2; // Static methods /** * Computes the sum of two 2D vectors. The resulting #GimpVector2 is * stored in `result`. * @param vector1 a pointer to the first #GimpVector2. * @param vector2 a pointer to the second #GimpVector2. */ static add(vector1: Vector2, vector2: Vector2): Vector2; /** * Computes the difference of two 2D vectors (`vector1` minus `vector2`). * The resulting #GimpVector2 is stored in `result`. * @param vector1 a pointer to the first #GimpVector2. * @param vector2 a pointer to the second #GimpVector2. */ static sub(vector1: Vector2, vector2: Vector2): Vector2; // Methods /** * This function is identical to gimp_vector2_add() but the vectors * are passed by value rather than by reference. * @param vector2 the second #GimpVector2. * @returns the resulting #GimpVector2. */ add_val(vector2: Vector2): Vector2; /** * Compute the cross product of two vectors. The result is a * #GimpVector2 which is orthogonal to both `vector1` and `vector2`. If * `vector1` and `vector2` are parallel, the result will be the nul * vector. * * Note that in 2D, this function is useful to test if two vectors are * parallel or not, or to compute the area spawned by two vectors. * @param vector2 a pointer to the second #GimpVector2. * @returns The cross product. */ cross_product(vector2: Vector2): Vector2; /** * Identical to [method`Vector2`.cross_product], but the * vectors are passed by value rather than by reference. * @param vector2 the second #GimpVector2. * @returns The cross product. */ cross_product_val(vector2: Vector2): Vector2; /** * Computes the inner (dot) product of two 2D vectors. * This product is zero if and only if the two vectors are orthogonal. * @param vector2 a pointer to the second #GimpVector2. * @returns The inner product. */ inner_product(vector2: Vector2): number; /** * Identical to [method`Vector2`.inner_product], but the * vectors are passed by value rather than by reference. * @param vector2 the second #GimpVector2. * @returns The inner product. */ inner_product_val(vector2: Vector2): number; /** * Computes the length of a 2D vector. * @returns the length of @vector (a positive gdouble). */ length(): number; /** * Identical to [method`Vector2`.length], but the vector is passed by value * rather than by reference. * @returns the length of @vector (a positive gdouble). */ length_val(): number; /** * Multiplies each component of the `vector` by `factor`. Note that this * is equivalent to multiplying the vectors length by `factor`. * @param factor a scalar. */ mul(factor: number): void; /** * Identical to [method`Vector2`.mul], but the vector is passed by value rather * than by reference. * @param factor a scalar. * @returns the resulting #GimpVector2. */ mul_val(factor: number): Vector2; /** * Negates the `vector` (i.e. negate all its coordinates). */ neg(): void; /** * Identical to [method`Vector2`.neg], but the vector * is passed by value rather than by reference. * @returns the negated #GimpVector2. */ neg_val(): Vector2; /** * Compute a normalized perpendicular vector to `vector` * @returns a #GimpVector2 perpendicular to @vector, with a length of 1.0. */ normal(): Vector2; /** * Identical to [method`Vector2`.normal], but the vector * is passed by value rather than by reference. * @returns a #GimpVector2 perpendicular to @vector, with a length of 1.0. */ normal_val(): Vector2; /** * Normalizes the `vector` so the length of the `vector` is 1.0. The nul * vector will not be changed. */ normalize(): void; /** * Identical to [method`Vector2`.normalize], but the * vector is passed by value rather than by reference. * @returns a #GimpVector2 parallel to @vector, pointing in the same direction but with a length of 1.0. */ normalize_val(): Vector2; /** * Rotates the `vector` counterclockwise by `alpha` radians. * @param alpha an angle (in radians). */ rotate(alpha: number): void; /** * Identical to [method`Vector2`.rotate], but the vector * is passed by value rather than by reference. * @param alpha an angle (in radians). * @returns a #GimpVector2 representing @vector rotated by @alpha radians. */ rotate_val(alpha: number): Vector2; /** * Sets the X and Y coordinates of `vector` to `x` and `y`. * @param x the X coordinate. * @param y the Y coordinate. */ set(x: number, y: number): void; /** * This function is identical to gimp_vector2_sub() but the vectors * are passed by value rather than by reference. * @param vector2 the second #GimpVector2. * @returns the resulting #GimpVector2. */ sub_val(vector2: Vector2): Vector2; } /** * A three dimensional vector. */ class Vector3 { static $gtype: GObject.GType; // Fields x: number; y: number; z: number; // Constructors constructor( properties?: Partial<{ x: number; y: number; z: number; }>, ); _init(...args: any[]): void; static ['new'](x: number, y: number, z: number): Vector3; // Static methods /** * Computes the sum of two 3D vectors. The resulting #GimpVector3 is * stored in `result`. * @param vector1 a pointer to the first #GimpVector3. * @param vector2 a pointer to the second #GimpVector3. */ static add(vector1: Vector3, vector2: Vector3): Vector3; /** * Computes the difference of two 3D vectors (`vector1` minus `vector2`). * The resulting #GimpVector3 is stored in `result`. * @param vector1 a pointer to the first #GimpVector3. * @param vector2 a pointer to the second #GimpVector3. */ static sub(vector1: Vector3, vector2: Vector3): Vector3; // Methods /** * This function is identical to gimp_vector3_add() but the vectors * are passed by value rather than by reference. * @param vector2 a #GimpVector3. * @returns the resulting #GimpVector3. */ add_val(vector2: Vector3): Vector3; /** * Compute the cross product of two vectors. The result is a * #GimpVector3 which is orthogonal to both `vector1` and `vector2`. If * `vector1` and `vector2` and parallel, the result will be the nul * vector. * * This function can be used to compute the normal of the plane * defined by `vector1` and `vector2`. * @param vector2 a pointer to the second #GimpVector3. * @returns The cross product. */ cross_product(vector2: Vector3): Vector3; /** * Identical to [method`Vector3`.cross_product], but the * vectors are passed by value rather than by reference. * @param vector2 the second #GimpVector3. * @returns The cross product. */ cross_product_val(vector2: Vector3): Vector3; /** * Computes the inner (dot) product of two 3D vectors. This product * is zero if and only if the two vectors are orthogonal. * @param vector2 a pointer to the second #GimpVector3. * @returns The inner product. */ inner_product(vector2: Vector3): number; /** * Identical to [method`Vector3`.inner_product], but the * vectors are passed by value rather than by reference. * @param vector2 the second #GimpVector3. * @returns The inner product. */ inner_product_val(vector2: Vector3): number; /** * Computes the length of a 3D vector. * @returns the length of @vector (a positive gdouble). */ length(): number; /** * Identical to [method`Vector3`.length], but the vector * is passed by value rather than by reference. * @returns the length of @vector (a positive gdouble). */ length_val(): number; /** * Multiplies each component of the `vector` by `factor`. Note that * this is equivalent to multiplying the vectors length by `factor`. * @param factor a scalar. */ mul(factor: number): void; /** * Identical to [method`Vector3`.mul], but the vector is * passed by value rather than by reference. * @param factor a scalar. * @returns the resulting #GimpVector3. */ mul_val(factor: number): Vector3; /** * Negates the `vector` (i.e. negate all its coordinates). */ neg(): void; /** * Identical to [method`Vector3`.neg], but the vector * is passed by value rather than by reference. * @returns the negated #GimpVector3. */ neg_val(): Vector3; /** * Normalizes the `vector` so the length of the `vector` is 1.0. The nul * vector will not be changed. */ normalize(): void; /** * Identical to [method`Vector3`.normalize], but the * vector is passed by value rather than by reference. * @returns a #GimpVector3 parallel to @vector, pointing in the same direction but with a length of 1.0. */ normalize_val(): Vector3; /** * Rotates the `vector` around the three axis (Z, Y, and X) by `alpha,` * `beta` and `gamma,` respectively. * * Note that the order of the rotation is very important. If you * expect a vector to be rotated around X, and then around Y, you will * have to call this function twice. Also, it is often wise to call * this function with only one of `alpha,` `beta` and `gamma` non-zero. * @param alpha the angle (in radian) of rotation around the Z axis. * @param beta the angle (in radian) of rotation around the Y axis. * @param gamma the angle (in radian) of rotation around the X axis. */ rotate(alpha: number, beta: number, gamma: number): void; /** * Identical to [method`Vector3`.rotate], but the vectors * are passed by value rather than by reference. * @param alpha the angle (in radian) of rotation around the Z axis. * @param beta the angle (in radian) of rotation around the Y axis. * @param gamma the angle (in radian) of rotation around the X axis. * @returns the rotated vector. */ rotate_val(alpha: number, beta: number, gamma: number): Vector3; /** * Sets the X, Y and Z coordinates of `vector` to `x,` `y` and `z`. * @param x the X coordinate. * @param y the Y coordinate. * @param z the Z coordinate. */ set(x: number, y: number, z: number): void; /** * This function is identical to gimp_vector3_sub() but the vectors * are passed by value rather than by reference. * @param vector2 a #GimpVector3. * @returns the resulting #GimpVector3. */ sub_val(vector2: Vector3): Vector3; } /** * A four dimensional vector. */ class Vector4 { static $gtype: GObject.GType; // Fields x: number; y: number; z: number; w: number; // Constructors constructor( properties?: Partial<{ x: number; y: number; z: number; w: number; }>, ); _init(...args: any[]): void; } class VectorLoadData { static $gtype: GObject.GType; // Fields width: number; width_unit: Unit; exact_width: boolean; height: number; height_unit: Unit; exact_height: boolean; correct_ratio: boolean; pixel_density: number; density_unit: Unit; exact_density: boolean; // Constructors _init(...args: any[]): void; } type VectorLoadProcedureClass = typeof VectorLoadProcedure; namespace ColorManaged { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } export interface ColorManagedNamespace { $gtype: GObject.GType; prototype: ColorManaged; } interface ColorManaged extends GObject.Object { // Methods /** * This function always returns a #GimpColorProfile and falls back to * gimp_color_profile_new_rgb_srgb() if the method is not implemented. * @returns The @managed's #GimpColorProfile. */ get_color_profile(): ColorProfile; get_icc_profile(): Uint8Array; /** * This function always returns a gboolean representing whether * Black Point Compensation is enabled * @returns The @managed's simulation Black Point Compensation value. */ get_simulation_bpc(): boolean; /** * This function always returns a #GimpColorRenderingIntent * @returns The @managed's simulation #GimpColorRenderingIntent. */ get_simulation_intent(): ColorRenderingIntent; /** * This function always returns a #GimpColorProfile * @returns The @managed's simulation #GimpColorProfile. */ get_simulation_profile(): ColorProfile; /** * Emits the "profile-changed" signal. */ profile_changed(): void; /** * Emits the "simulation-bpc-changed" signal. */ simulation_bpc_changed(): void; /** * Emits the "simulation-intent-changed" signal. */ simulation_intent_changed(): void; /** * Emits the "simulation-profile-changed" signal. */ simulation_profile_changed(): void; // Virtual methods /** * This function always returns a #GimpColorProfile and falls back to * gimp_color_profile_new_rgb_srgb() if the method is not implemented. */ vfunc_get_color_profile(): ColorProfile; vfunc_get_icc_profile(): Uint8Array; /** * This function always returns a gboolean representing whether * Black Point Compensation is enabled */ vfunc_get_simulation_bpc(): boolean; /** * This function always returns a #GimpColorRenderingIntent */ vfunc_get_simulation_intent(): ColorRenderingIntent; /** * This function always returns a #GimpColorProfile */ vfunc_get_simulation_profile(): ColorProfile; /** * Emits the "profile-changed" signal. */ vfunc_profile_changed(): void; /** * Emits the "simulation-bpc-changed" signal. */ vfunc_simulation_bpc_changed(): void; /** * Emits the "simulation-intent-changed" signal. */ vfunc_simulation_intent_changed(): void; /** * Emits the "simulation-profile-changed" signal. */ vfunc_simulation_profile_changed(): void; } export const ColorManaged: ColorManagedNamespace & { new (): ColorManaged; // This allows `obj instanceof ColorManaged` }; namespace ConfigInterface { // Constructor properties interface interface ConstructorProps extends GObject.Object.ConstructorProps {} } export interface ConfigInterfaceNamespace { $gtype: GObject.GType; prototype: ConfigInterface; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_data_path() includes a directory * below the user's gimp directory and one in the system-wide data * directory. * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) */ build_data_path(name: string): string; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_plug_in_path() includes a directory * below the user's gimp directory and one in the system-wide plug-in * directory. * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) */ build_plug_in_path(name: string): string; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_system_path() is just the read-only * parts of the search path constructed by gimp_config_build_plug_in_path(). * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) */ build_system_path(name: string): string; /** * Creates a search path as it is used in the gimprc file. The path * returned by gimp_config_build_writable_path() is just the writable * parts of the search path constructed by gimp_config_build_data_path(). * * Note that you cannot use this path directly with gimp_path_parse(). * As it is in the gimprc notation, you first need to expand and * recode it using gimp_config_path_expand(). * @param name directory name (in UTF-8 encoding) */ build_writable_path(name: string): string; deserialize_return(scanner: GLib.Scanner, expected_token: GLib.TokenType, nest_level: number): boolean; /** * Compares all properties of `a` and `b` that have all `flags` set. If * `flags` is 0, all properties are compared. * * If the two objects are not of the same type, only properties that * exist in both object classes and are of the same value_type are * compared. * @param a a #GObject * @param b another #GObject object * @param flags a mask of GParamFlags */ diff(a: GObject.Object, b: GObject.Object, flags: GObject.ParamFlags): GObject.ParamSpec[]; /** * This function is never called directly. Use GIMP_CONFIG_ERROR() instead. */ error_quark(): GLib.Quark; /** * Creates an exact copy of `pspec,` with all its properties, returns * %NULL if `pspec` is of an unknown type that can't be duplicated. * @param pspec the #GParamSpec to duplicate */ param_spec_duplicate(pspec: GObject.ParamSpec): GObject.ParamSpec; /** * Resets all writable properties of `object` to the default values as * defined in their #GParamSpec. Properties marked as "construct-only" * are not touched. * * If you want to reset a #GimpConfig object, please use gimp_config_reset(). * @param object a #GObject */ reset_properties(object: GObject.Object): void; /** * Resets the property named `property_name` to its default value. The * property must be writable and must not be marked as "construct-only". * @param object a #GObject * @param property_name name of the property to reset */ reset_property(object: GObject.Object, property_name: string): void; /** * This utility function appends a string representation of #GValue to `str`. * @param value a #GValue. * @param str a #GString. * @param escaped whether to escape string values. */ serialize_value(value: GObject.Value | any, str: GLib.String, escaped: boolean): boolean; /** * Escapes and quotes `val` and appends it to `string`. The escape * algorithm is different from the one used by g_strescape() since it * leaves non-ASCII characters intact and thus preserves UTF-8 * strings. Only control characters and quotes are being escaped. * @param string pointer to a #GString * @param val a string to append or %NULL */ string_append_escaped(string: GLib.String, val: string): void; /** * Compares all read- and write-able properties from `src` and `dest` * that have all `flags` set. Differing values are then copied from * `src` to `dest`. If `flags` is 0, all differing read/write properties. * * Properties marked as "construct-only" are not touched. * * If the two objects are not of the same type, only properties that * exist in both object classes and are of the same value_type are * synchronized * @param src a #GObject * @param dest another #GObject * @param flags a mask of GParamFlags */ sync(src: GObject.Object, dest: GObject.Object, flags: GObject.ParamFlags): boolean; /** * This function is a fancy wrapper around g_type_register_static(). * It creates a new object type as subclass of `parent_type,` installs * `pspecs` on it and makes the new type implement the #GimpConfig * interface. * @param parent_type type from which this type will be derived * @param type_name string used as the name of the new type * @param pspecs array of #GParamSpec to install as properties on the new type */ type_register(parent_type: GObject.GType, type_name: string, pspecs: GObject.ParamSpec[]): GObject.GType; } interface ConfigInterface extends GObject.Object {} export const ConfigInterface: ConfigInterfaceNamespace & { new (): ConfigInterface; // This allows `obj instanceof ConfigInterface` }; type BablFormat = Babl.Object; type ColorArray = Gegl.Color; type CoreObjectArray = GObject.Object; /** * 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 Gimp; } declare module 'gi://Gimp' { import Gimp30 from 'gi://Gimp?version=3.0'; export default Gimp30; } // END