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.
This commit is contained in:
Jehan 2024-07-07 22:17:44 +02:00
parent d10a8c357f
commit ebc4f9afab
3 changed files with 13 additions and 2 deletions

View file

@ -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"

View file

@ -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,

View file

@ -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";