From ebc4f9afab940e99a350ec99538194c2c64dc67b Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 7 Jul 2024 22:17:44 +0200 Subject: [PATCH] app, libgimp: initialize GimpGroupLayer. If the type is not registered, g_type_from_name() is not able to find the GType from the type name. Fixes: > gimp_gp_param_to_value: type name GimpGroupLayer is not registered Also add a bit more type handling code. --- app/plug-in/gimpgpparams.c | 3 +++ libgimp/gimp.c | 1 + libgimp/gimpgpparams-body.c | 11 +++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/plug-in/gimpgpparams.c b/app/plug-in/gimpgpparams.c index 90aa21721f..6e85616ec5 100644 --- a/app/plug-in/gimpgpparams.c +++ b/app/plug-in/gimpgpparams.c @@ -34,13 +34,16 @@ #include "core/gimpbrush.h" #include "core/gimpdisplay.h" #include "core/gimpgradient.h" +#include "core/gimpgrouplayer.h" #include "core/gimpimage.h" #include "core/gimplayer.h" #include "core/gimplayermask.h" #include "core/gimppalette.h" #include "core/gimppattern.h" #include "core/gimpselection.h" + #include "text/gimpfont.h" +#include "text/gimptextlayer.h" #include "core/gimpparamspecs.h" diff --git a/libgimp/gimp.c b/libgimp/gimp.c index 5d02804262..9b1b10e53a 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -434,6 +434,7 @@ gimp_main (GType plug_in_type, GIMP_TYPE_DRAWABLE, GIMP_TYPE_PARAM_DRAWABLE, GIMP_TYPE_LAYER, GIMP_TYPE_PARAM_LAYER, GIMP_TYPE_TEXT_LAYER, GIMP_TYPE_PARAM_TEXT_LAYER, + GIMP_TYPE_GROUP_LAYER, GIMP_TYPE_PARAM_GROUP_LAYER, GIMP_TYPE_CHANNEL, GIMP_TYPE_PARAM_CHANNEL, GIMP_TYPE_LAYER_MASK, GIMP_TYPE_PARAM_LAYER_MASK, GIMP_TYPE_SELECTION, GIMP_TYPE_PARAM_SELECTION, diff --git a/libgimp/gimpgpparams-body.c b/libgimp/gimpgpparams-body.c index 025e82fba0..23d6042b63 100644 --- a/libgimp/gimpgpparams-body.c +++ b/libgimp/gimpgpparams-body.c @@ -522,11 +522,18 @@ _gimp_param_spec_to_gp_param_def (GParamSpec *pspec, { type_name = "GimpParamDrawable"; } - else if (g_type_is_a (value_type, GIMP_TYPE_LAYER)) + else if (value_type == GIMP_TYPE_LAYER) { - /* g_type_is_a() because the core has layer subclasses */ type_name = "GimpParamLayer"; } + else if (value_type == GIMP_TYPE_TEXT_LAYER) + { + type_name = "GimpParamTextLayer"; + } + else if (value_type == GIMP_TYPE_GROUP_LAYER) + { + type_name = "GimpParamGroupLayer"; + } else if (value_type == GIMP_TYPE_CHANNEL) { type_name = "GimpParamChannel";