[gimp/wip/Jehan/classy-GIMP: 27/58] libgimp: GimpSaveProcedure() now uses GimpImage/GimpDrawable object...
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/Jehan/classy-GIMP: 27/58] libgimp: GimpSaveProcedure() now uses GimpImage/GimpDrawable object...
- Date: Tue, 20 Aug 2019 08:45:55 +0000 (UTC)
commit c222daf6806176e79d5679eaa70c3c40874606a6
Author: Jehan <jehan girinstud io>
Date: Wed Aug 14 14:59:40 2019 +0200
libgimp: GimpSaveProcedure() now uses GimpImage/GimpDrawable object...
... as parameters.
And GimpLoadProcedure() now expects the run() function to return a
GimpImage object.
libgimp/gimpimageprocedure.c | 2 -
libgimp/gimploadprocedure.c | 1 -
libgimp/gimpprocedure-params.h | 140 +++++++++++++++++++--------------------
libgimp/gimpsaveprocedure.c | 18 +++--
libgimp/gimpsaveprocedure.h | 8 +--
libgimp/gimpthumbnailprocedure.c | 1 -
plug-ins/common/film.c | 1 -
plug-ins/pagecurl/pagecurl.c | 1 -
plug-ins/print/print.c | 1 -
plug-ins/screenshot/screenshot.c | 1 -
10 files changed, 82 insertions(+), 92 deletions(-)
---
diff --git a/libgimp/gimpimageprocedure.c b/libgimp/gimpimageprocedure.c
index ea0a8d4e29..8addf1bdf8 100644
--- a/libgimp/gimpimageprocedure.c
+++ b/libgimp/gimpimageprocedure.c
@@ -84,13 +84,11 @@ gimp_image_procedure_constructed (GObject *object)
GIMP_PROC_ARG_IMAGE (procedure, "image",
"Image",
"The input image",
- FALSE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DRAWABLE (procedure, "drawable",
"Drawable",
"The input drawable",
- FALSE,
G_PARAM_READWRITE);
}
diff --git a/libgimp/gimploadprocedure.c b/libgimp/gimploadprocedure.c
index 636669d29b..f6ad692e8f 100644
--- a/libgimp/gimploadprocedure.c
+++ b/libgimp/gimploadprocedure.c
@@ -94,7 +94,6 @@ gimp_load_procedure_constructed (GObject *object)
GIMP_PROC_VAL_IMAGE (procedure, "image",
"Image",
"Output image",
- FALSE,
GIMP_PARAM_READWRITE);
}
diff --git a/libgimp/gimpprocedure-params.h b/libgimp/gimpprocedure-params.h
index 3df79e2525..f7aae6c6c0 100644
--- a/libgimp/gimpprocedure-params.h
+++ b/libgimp/gimpprocedure-params.h
@@ -376,185 +376,185 @@ G_BEGIN_DECLS
/* display */
-#define GIMP_PROC_ARG_DISPLAY(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_DISPLAY(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_display_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_DISPLAY, \
flags))
-#define GIMP_PROC_VAL_DISPLAY(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_DISPLAY(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_display_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_DISPLAY, \
flags))
/* image */
-#define GIMP_PROC_ARG_IMAGE(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_IMAGE(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_image_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_IMAGE, \
flags))
-#define GIMP_PROC_VAL_IMAGE(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_IMAGE(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_image_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_IMAGE, \
flags))
#define GIMP_VALUES_GET_IMAGE(args, n) \
- gimp_value_get_image_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_IMAGE(args, n, value) \
- gimp_value_set_image_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
/* item */
-#define GIMP_PROC_ARG_ITEM(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_ITEM(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_item_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_ITEM, \
flags))
-#define GIMP_PROC_VAL_ITEM(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_ITEM(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_item_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_ITEM, \
flags))
#define GIMP_VALUES_GET_ITEM(args, n) \
- gimp_value_get_item_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_ITEM(args, n, value) \
- gimp_value_set_item_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
/* drawable */
-#define GIMP_PROC_ARG_DRAWABLE(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_DRAWABLE(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_drawable_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_DRAWABLE, \
flags))
-#define GIMP_PROC_VAL_DRAWABLE(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_DRAWABLE(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_drawable_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_DRAWABLE, \
flags))
#define GIMP_VALUES_GET_DRAWABLE(args, n) \
- gimp_value_get_drawable_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_DRAWABLE(args, n, value) \
- gimp_value_set_drawable_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
/* layer */
-#define GIMP_PROC_ARG_LAYER(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_LAYER(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_layer_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_LAYER, \
flags))
-#define GIMP_PROC_VAL_LAYER(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_LAYER(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_layer_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_LAYER, \
flags))
#define GIMP_VALUES_GET_LAYER(args, n) \
- gimp_value_get_layer_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_LAYER(args, n, value) \
- gimp_value_set_layer_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
/* channel */
-#define GIMP_PROC_ARG_CHANNEL(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_CHANNEL(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_channel_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_CHANNEL, \
flags))
-#define GIMP_PROC_VAL_CHANNEL(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_CHANNEL(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_channel_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_CHANNEL, \
flags))
#define GIMP_VALUES_GET_CHANNEL(args, n) \
- gimp_value_get_channel_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_CHANNEL(args, n, value) \
- gimp_value_set_channel_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
/* layer mask */
-#define GIMP_PROC_ARG_LAYER_MASK(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_LAYER_MASK(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_layer_mask_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_LAYER_MASK, \
flags))
-#define GIMP_PROC_VAL_LAYER_MASK(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_LAYER_MASK(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_layer_mask_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_LAYER_MASK, \
flags))
#define GIMP_VALUES_GET_LAYER_MASK(args, n) \
- gimp_value_get_layer_mask_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_LAYER_MASK(args, n, value) \
- gimp_value_set_layer_mask_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
/* selection */
-#define GIMP_PROC_ARG_SELECTION(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_SELECTION(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_selection_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_SELECTION, \
flags))
-#define GIMP_PROC_VAL_SELECTION(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_SELECTION(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_selection_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_SELECTION, \
flags))
#define GIMP_VALUES_GET_SELECTION(args, n) \
- gimp_value_get_selection_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_SELECTION(args, n, value) \
- gimp_value_set_selection_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
/* vectors */
-#define GIMP_PROC_ARG_VECTORS(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_ARG_VECTORS(class, name, nick, blurb, flags) \
gimp_procedure_add_argument (procedure,\
- gimp_param_spec_vectors_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_VECTORS, \
flags))
-#define GIMP_PROC_VAL_VECTORS(class, name, nick, blurb, none_ok, flags) \
+#define GIMP_PROC_VAL_VECTORS(class, name, nick, blurb, flags) \
gimp_procedure_add_return_value (procedure,\
- gimp_param_spec_vectors_id (name, nick, blurb,\
- none_ok, \
+ g_param_spec_object (name, nick, blurb,\
+ GIMP_TYPE_VECTORS, \
flags))
#define GIMP_VALUES_GET_VECTORS(args, n) \
- gimp_value_get_vectors_id (gimp_value_array_index (args, n))
+ g_value_get_object (gimp_value_array_index (args, n))
#define GIMP_VALUES_SET_VECTORS(args, n, value) \
- gimp_value_set_vectors_id (gimp_value_array_index (args, n), value)
+ g_value_set_object (gimp_value_array_index (args, n), value)
G_END_DECLS
diff --git a/libgimp/gimpsaveprocedure.c b/libgimp/gimpsaveprocedure.c
index e68f1748e7..78136d972b 100644
--- a/libgimp/gimpsaveprocedure.c
+++ b/libgimp/gimpsaveprocedure.c
@@ -79,13 +79,11 @@ gimp_save_procedure_constructed (GObject *object)
GIMP_PROC_ARG_IMAGE (procedure, "image",
"Image",
"The image to save",
- FALSE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_DRAWABLE (procedure, "drawable",
"Drawable",
"The drawable to save",
- FALSE,
G_PARAM_READWRITE);
GIMP_PROC_ARG_STRING (procedure, "uri",
@@ -147,17 +145,17 @@ gimp_save_procedure_run (GimpProcedure *procedure,
GimpValueArray *remaining;
GimpValueArray *return_values;
GimpRunMode run_mode;
- gint32 image_id;
- gint32 drawable_id;
+ GimpImage *image;
+ GimpDrawable *drawable;
const gchar *uri;
GFile *file;
gint i;
- run_mode = GIMP_VALUES_GET_ENUM (args, 0);
- image_id = GIMP_VALUES_GET_IMAGE (args, 1);
- drawable_id = GIMP_VALUES_GET_DRAWABLE (args, 2);
- uri = GIMP_VALUES_GET_STRING (args, 3);
- /* raw_uri = GIMP_VALUES_GET_STRING (args, 4); */
+ run_mode = GIMP_VALUES_GET_ENUM (args, 0);
+ image = GIMP_VALUES_GET_IMAGE (args, 1);
+ drawable = GIMP_VALUES_GET_DRAWABLE (args, 2);
+ uri = GIMP_VALUES_GET_STRING (args, 3);
+ /* raw_uri = GIMP_VALUES_GET_STRING (args, 4); */
file = g_file_new_for_uri (uri);
@@ -172,7 +170,7 @@ gimp_save_procedure_run (GimpProcedure *procedure,
return_values = save_proc->priv->run_func (procedure,
run_mode,
- image_id, drawable_id,
+ image, drawable,
file,
remaining,
save_proc->priv->run_data);
diff --git a/libgimp/gimpsaveprocedure.h b/libgimp/gimpsaveprocedure.h
index 0e5000452d..e8c07f3d4f 100644
--- a/libgimp/gimpsaveprocedure.h
+++ b/libgimp/gimpsaveprocedure.h
@@ -33,8 +33,8 @@ G_BEGIN_DECLS
* GimpRunSaveFunc:
* @procedure: the #GimpProcedure that runs.
* @run_mode: the #GimpRunMode.
- * @image_id: the image to save.
- * @drawable_id: the drawable to save.
+ * @image: the image to save.
+ * @drawable: the drawable to save.
* @file: the #GFile to save to.
* @args: the @procedure's remaining arguments.
* @run_data: the run_data given in gimp_save_procedure_new().
@@ -48,8 +48,8 @@ G_BEGIN_DECLS
**/
typedef GimpValueArray * (* GimpRunSaveFunc) (GimpProcedure *procedure,
GimpRunMode run_mode,
- gint32 image_id,
- gint32 drawable_id,
+ GimpImage *image,
+ GimpDrawable *drawable,
GFile *file,
const GimpValueArray *args,
gpointer run_data);
diff --git a/libgimp/gimpthumbnailprocedure.c b/libgimp/gimpthumbnailprocedure.c
index 181b0a96e2..30a7400cc1 100644
--- a/libgimp/gimpthumbnailprocedure.c
+++ b/libgimp/gimpthumbnailprocedure.c
@@ -89,7 +89,6 @@ gimp_thumbnail_procedure_constructed (GObject *object)
GIMP_PROC_VAL_IMAGE (procedure, "image",
"Image",
"Thumbnail image",
- FALSE,
GIMP_PARAM_READWRITE);
GIMP_PROC_VAL_INT (procedure, "image-width",
diff --git a/plug-ins/common/film.c b/plug-ins/common/film.c
index e6cb9dfee4..7dff6b4be2 100644
--- a/plug-ins/common/film.c
+++ b/plug-ins/common/film.c
@@ -293,7 +293,6 @@ film_create_procedure (GimpPlugIn *plug_in,
GIMP_PROC_VAL_IMAGE (procedure, "new-image",
"New image",
"Outout image",
- FALSE,
G_PARAM_READWRITE);
}
diff --git a/plug-ins/pagecurl/pagecurl.c b/plug-ins/pagecurl/pagecurl.c
index f95eba6955..7a2d494c2a 100644
--- a/plug-ins/pagecurl/pagecurl.c
+++ b/plug-ins/pagecurl/pagecurl.c
@@ -265,7 +265,6 @@ pagecurl_create_procedure (GimpPlugIn *plug_in,
GIMP_PROC_VAL_LAYER (procedure, "curl-layer",
"Curl layer",
"The new layer with the curl.",
- FALSE,
G_PARAM_READWRITE);
}
diff --git a/plug-ins/print/print.c b/plug-ins/print/print.c
index 4fb761cf36..c550d3216f 100644
--- a/plug-ins/print/print.c
+++ b/plug-ins/print/print.c
@@ -536,7 +536,6 @@ print_temp_proc_install (gint32 image_ID)
GIMP_PROC_ARG_IMAGE (procedure, "image",
"Image",
"The image to notify about",
- FALSE,
G_PARAM_READWRITE);
gimp_plug_in_add_temp_procedure (plug_in, procedure);
diff --git a/plug-ins/screenshot/screenshot.c b/plug-ins/screenshot/screenshot.c
index 8b47b28483..24c03b3228 100644
--- a/plug-ins/screenshot/screenshot.c
+++ b/plug-ins/screenshot/screenshot.c
@@ -220,7 +220,6 @@ screenshot_create_procedure (GimpPlugIn *plug_in,
GIMP_PROC_VAL_IMAGE (procedure, "image",
"Image",
"Output image",
- FALSE,
G_PARAM_READWRITE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]