From 09e8e45d078f033ed49fc4bbfbb40d95a3af43dc Mon Sep 17 00:00:00 2001 From: Jehan Date: Thu, 3 Jul 2025 00:47:38 +0200 Subject: [PATCH] app, libgimp, pdb: have GimpTrcType into public libgimp. It is being used as filter arguments in 2 GIMP filters (curves and levels) so we want to be able to send this enum type through the wire. --- app/core/core-enums.h | 2 +- libgimp/gimp.def | 1 + libgimp/gimpenums.c.tail | 6 ++++-- libgimp/gimpenums.h | 20 ++++++++++++++++++++ pdb/enums.pl | 9 +++++++++ 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/app/core/core-enums.h b/app/core/core-enums.h index d6f42b279f..972e0ce725 100644 --- a/app/core/core-enums.h +++ b/app/core/core-enums.h @@ -480,7 +480,7 @@ typedef enum /*< pdb-skip >*/ GType gimp_trc_type_get_type (void) G_GNUC_CONST; -typedef enum /*< pdb-skip >*/ +typedef enum { GIMP_TRC_LINEAR, /*< desc="Linear" >*/ GIMP_TRC_NON_LINEAR, /*< desc="Non-Linear" >*/ diff --git a/libgimp/gimp.def b/libgimp/gimp.def index 7ca810869a..a5532405e3 100644 --- a/libgimp/gimp.def +++ b/libgimp/gimp.def @@ -1056,6 +1056,7 @@ EXPORTS gimp_thumbnail_procedure_new gimp_tile_height gimp_tile_width + gimp_trc_type_get_type gimp_unit_new gimp_user_time gimp_vector_load_procedure_extract_dimensions diff --git a/libgimp/gimpenums.c.tail b/libgimp/gimpenums.c.tail index dd3602236c..b1c0aa0e0a 100644 --- a/libgimp/gimpenums.c.tail +++ b/libgimp/gimpenums.c.tail @@ -64,7 +64,8 @@ static const GimpGetTypeFunc get_type_funcs[] = gimp_text_justification_get_type, gimp_transfer_mode_get_type, gimp_transform_direction_get_type, - gimp_transform_resize_get_type + gimp_transform_resize_get_type, + gimp_trc_type_get_type }; static const gchar * const type_names[] = @@ -130,7 +131,8 @@ static const gchar * const type_names[] = "GimpTextJustification", "GimpTransferMode", "GimpTransformDirection", - "GimpTransformResize" + "GimpTransformResize", + "GimpTRCType" }; static gboolean enums_initialized = FALSE; diff --git a/libgimp/gimpenums.h b/libgimp/gimpenums.h index fe93f095dc..74d1927141 100644 --- a/libgimp/gimpenums.h +++ b/libgimp/gimpenums.h @@ -278,6 +278,26 @@ typedef enum } GimpLayerMode; +#define GIMP_TYPE_TRC_TYPE (gimp_trc_type_get_type ()) + +GType gimp_trc_type_get_type (void) G_GNUC_CONST; + +/** + * GimpTRCType: + * @GIMP_TRC_LINEAR: GIMP_TRC_LINEAR + * @GIMP_TRC_NON_LINEAR: GIMP_TRC_NON_LINEAR + * @GIMP_TRC_PERCEPTUAL: GIMP_TRC_PERCEPTUAL + * + * Extracted from app/core/core-enums.h + **/ +typedef enum +{ + GIMP_TRC_LINEAR, + GIMP_TRC_NON_LINEAR, + GIMP_TRC_PERCEPTUAL +} GimpTRCType; + + void gimp_enums_init (void); const gchar ** gimp_enums_get_type_names (gint *n_type_names); diff --git a/pdb/enums.pl b/pdb/enums.pl index e34077c828..fc0c5ceefb 100644 --- a/pdb/enums.pl +++ b/pdb/enums.pl @@ -862,6 +862,15 @@ package Gimp::CodeGen::enums; GIMP_HISTOGRAM_ALPHA => '4', GIMP_HISTOGRAM_LUMINANCE => '5' } }, + GimpTRCType => + { contig => 1, + header => 'core/core-enums.h', + symbols => [ qw(GIMP_TRC_LINEAR GIMP_TRC_NON_LINEAR + GIMP_TRC_PERCEPTUAL) ], + mapping => { GIMP_TRC_LINEAR => '0', + GIMP_TRC_NON_LINEAR => '1', + GIMP_TRC_PERCEPTUAL => '2' } + }, GimpBrushApplicationMode => { contig => 1, header => 'paint/paint-enums.h',