[gimp/wip/Jehan/classy-GIMP: 42/64] plug-in: port file-gbr to GimpImage/GimpDrawable.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/Jehan/classy-GIMP: 42/64] plug-in: port file-gbr to GimpImage/GimpDrawable.
- Date: Sun, 18 Aug 2019 19:59:49 +0000 (UTC)
commit 4feb00b2de9b7dd0cdc3aadccee1ab1911743505
Author: Jehan <jehan girinstud io>
Date: Wed Aug 14 16:00:14 2019 +0200
plug-in: port file-gbr to GimpImage/GimpDrawable.
plug-ins/common/Makefile.am | 2 --
plug-ins/common/file-gbr.c | 26 +++++++++++++-------------
plug-ins/common/plugin-defs.pl | 2 +-
3 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index 8f47057c59..bfc9c06ea5 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -674,8 +674,6 @@ file_dicom_LDADD = \
$(INTLLIBS) \
$(file_dicom_RC)
-file_gbr_CPPFLAGS = $(AM_CPPFLAGS) -DGIMP_DEPRECATED_REPLACE_NEW_API
-
file_gbr_SOURCES = \
file-gbr.c
diff --git a/plug-ins/common/file-gbr.c b/plug-ins/common/file-gbr.c
index ed2eaca7b0..fef1e28322 100644
--- a/plug-ins/common/file-gbr.c
+++ b/plug-ins/common/file-gbr.c
@@ -77,8 +77,8 @@ static GimpProcedure * gbr_create_procedure (GimpPlugIn *plug_in,
static GimpValueArray * gbr_save (GimpProcedure *procedure,
GimpRunMode run_mode,
- gint32 image_id,
- gint32 drawable_id,
+ GimpImage *image,
+ GimpDrawable *drawable,
GFile *file,
const GimpValueArray *args,
gpointer run_data);
@@ -177,8 +177,8 @@ gbr_create_procedure (GimpPlugIn *plug_in,
static GimpValueArray *
gbr_save (GimpProcedure *procedure,
GimpRunMode run_mode,
- gint32 image_id,
- gint32 drawable_id,
+ GimpImage *image,
+ GimpDrawable *drawable,
GFile *file,
const GimpValueArray *args,
gpointer run_data)
@@ -186,12 +186,12 @@ gbr_save (GimpProcedure *procedure,
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpExportReturn export = GIMP_EXPORT_CANCEL;
GimpParasite *parasite;
- gint32 orig_image_id;
+ GimpImage *orig_image;
GError *error = NULL;
INIT_I18N ();
- orig_image_id = image_id;
+ orig_image = image;
switch (run_mode)
{
@@ -199,7 +199,7 @@ gbr_save (GimpProcedure *procedure,
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY, FALSE);
- export = gimp_export_image (&image_id, &drawable_id, "GBR",
+ export = gimp_export_image (&image, &drawable, "GBR",
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
@@ -213,7 +213,7 @@ gbr_save (GimpProcedure *procedure,
/* Possibly retrieve data */
gimp_get_data (SAVE_PROC, &info);
- parasite = gimp_image_get_parasite (orig_image_id,
+ parasite = gimp_image_get_parasite (orig_image,
"gimp-brush-name");
if (parasite)
{
@@ -272,8 +272,8 @@ gbr_save (GimpProcedure *procedure,
gimp_pdb_run_procedure (gimp_get_pdb (),
"file-gbr-save-internal",
GIMP_TYPE_RUN_MODE, GIMP_RUN_NONINTERACTIVE,
- GIMP_TYPE_IMAGE_ID, image_id,
- GIMP_TYPE_DRAWABLE_ID, drawable_id,
+ GIMP_TYPE_IMAGE_ID, gimp_image_get_id (image),
+ GIMP_TYPE_DRAWABLE_ID, gimp_item_get_id (GIMP_ITEM (drawable)),
G_TYPE_STRING, uri,
G_TYPE_STRING, uri,
G_TYPE_INT, info.spacing,
@@ -308,17 +308,17 @@ gbr_save (GimpProcedure *procedure,
GIMP_PARASITE_PERSISTENT,
strlen (info.description) + 1,
info.description);
- gimp_image_attach_parasite (orig_image_id, parasite);
+ gimp_image_attach_parasite (orig_image, parasite);
gimp_parasite_free (parasite);
}
else
{
- gimp_image_detach_parasite (orig_image_id, "gimp-brush-name");
+ gimp_image_detach_parasite (orig_image, "gimp-brush-name");
}
out:
if (export == GIMP_EXPORT_EXPORT)
- gimp_image_delete (image_id);
+ gimp_image_delete (image);
return gimp_procedure_new_return_values (procedure, status, error);
}
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index d85762d47e..73797f84d7 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -22,7 +22,7 @@
'file-compressor' => { gio => 1, libdep => 'Z:BZIP2:LZMA', cflags => 'LZMA_CFLAGS', old_api => 1 },
'file-desktop-link' => { gio => 1, old_api => 1 },
'file-dicom' => { ui => 1, gegl => 1, cflags => '-fno-strict-aliasing', old_api => 1 },
- 'file-gbr' => { ui => 1, gegl => 1, old_api => 1 },
+ 'file-gbr' => { ui => 1, gegl => 1 },
'file-gegl' => { ui => 1, gegl => 1, old_api => 1 },
'file-gif-load' => { gegl => 1, old_api => 1 },
'file-gif-save' => { ui => 1, gegl => 1, old_api => 1 },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]