[gimp] libgimpbase: add support for GParamParam in GPParamDef too
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpbase: add support for GParamParam in GPParamDef too
- Date: Mon, 5 Aug 2019 12:16:41 +0000 (UTC)
commit 7764f8b34bce41217f84e9f0973cc42fd97e6bae
Author: Michael Natterer <mitch gimp org>
Date: Mon Aug 5 14:12:19 2019 +0200
libgimpbase: add support for GParamParam in GPParamDef too
to describe param specs that describe param specs, yay.
libgimpbase/gimpprotocol.c | 18 ++++++++++++++++++
libgimpbase/gimpprotocol.h | 26 +++++++++++++++++---------
2 files changed, 35 insertions(+), 9 deletions(-)
---
diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c
index 6aa5937be7..90c6842b4a 100644
--- a/libgimpbase/gimpprotocol.c
+++ b/libgimpbase/gimpprotocol.c
@@ -1136,6 +1136,13 @@ _gp_param_def_read (GIOChannel *channel,
user_data))
return FALSE;
break;
+
+ case GP_PARAM_DEF_TYPE_PARAM_DEF:
+ if (! _gimp_wire_read_string (channel,
+ ¶m_def->meta.m_param_def.type_name, 1,
+ user_data))
+ return FALSE;
+ break;
}
return TRUE;
@@ -1171,6 +1178,10 @@ _gp_param_def_destroy (GPParamDef *param_def)
case GP_PARAM_DEF_TYPE_COLOR:
case GP_PARAM_DEF_TYPE_ID:
break;
+
+ case GP_PARAM_DEF_TYPE_PARAM_DEF:
+ g_free (param_def->meta.m_param_def.type_name);
+ break;
}
}
@@ -1403,6 +1414,13 @@ _gp_param_def_write (GIOChannel *channel,
user_data))
return FALSE;
break;
+
+ case GP_PARAM_DEF_TYPE_PARAM_DEF:
+ if (! _gimp_wire_write_string (channel,
+ ¶m_def->meta.m_param_def.type_name, 1,
+ user_data))
+ return FALSE;
+ break;
}
return TRUE;
diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h
index a91f334830..5b7177babc 100644
--- a/libgimpbase/gimpprotocol.h
+++ b/libgimpbase/gimpprotocol.h
@@ -56,7 +56,8 @@ typedef enum
GP_PARAM_DEF_TYPE_FLOAT,
GP_PARAM_DEF_TYPE_STRING,
GP_PARAM_DEF_TYPE_COLOR,
- GP_PARAM_DEF_TYPE_ID
+ GP_PARAM_DEF_TYPE_ID,
+ GP_PARAM_DEF_TYPE_PARAM_DEF
} GPParamDefType;
typedef enum
@@ -85,6 +86,7 @@ typedef struct _GPParamDefFloat GPParamDefFloat;
typedef struct _GPParamDefString GPParamDefString;
typedef struct _GPParamDefColor GPParamDefColor;
typedef struct _GPParamDefID GPParamDefID;
+typedef struct _GPParamDefParamDef GPParamDefParamDef;
typedef struct _GPParam GPParam;
typedef struct _GPParamArray GPParamArray;
typedef struct _GPParamStringArray GPParamStringArray;
@@ -190,6 +192,11 @@ struct _GPParamDefID
gint32 none_ok;
};
+struct _GPParamDefParamDef
+{
+ gchar *type_name;
+};
+
struct _GPParamDef
{
GPParamDefType param_def_type;
@@ -200,14 +207,15 @@ struct _GPParamDef
union
{
- GPParamDefInt m_int;
- GPParamDefUnit m_unit;
- GPParamDefEnum m_enum;
- GPParamDefBoolean m_boolean;
- GPParamDefFloat m_float;
- GPParamDefString m_string;
- GPParamDefColor m_color;
- GPParamDefID m_id;
+ GPParamDefInt m_int;
+ GPParamDefUnit m_unit;
+ GPParamDefEnum m_enum;
+ GPParamDefBoolean m_boolean;
+ GPParamDefFloat m_float;
+ GPParamDefString m_string;
+ GPParamDefColor m_color;
+ GPParamDefID m_id;
+ GPParamDefParamDef m_param_def;
} meta;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]