[gimp/wip/Jehan/classy-GIMP: 58/64] plug-ins: port mail to GimpImage/GimpDrawable.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/Jehan/classy-GIMP: 58/64] plug-ins: port mail to GimpImage/GimpDrawable.
- Date: Sun, 18 Aug 2019 20:01:10 +0000 (UTC)
commit 1cfb20ce8df093d718e3ea52365f69a16e635ff4
Author: Jehan <jehan girinstud io>
Date: Sat Aug 17 00:16:11 2019 +0200
plug-ins: port mail to GimpImage/GimpDrawable.
plug-ins/common/Makefile.am | 2 --
plug-ins/common/mail.c | 32 ++++++++++++++++----------------
plug-ins/common/plugin-defs.pl | 2 +-
3 files changed, 17 insertions(+), 19 deletions(-)
---
diff --git a/plug-ins/common/Makefile.am b/plug-ins/common/Makefile.am
index 2fbf13f0e1..1edfd28c72 100644
--- a/plug-ins/common/Makefile.am
+++ b/plug-ins/common/Makefile.am
@@ -1371,8 +1371,6 @@ jigsaw_LDADD = \
$(INTLLIBS) \
$(jigsaw_RC)
-mail_CPPFLAGS = $(AM_CPPFLAGS) -DGIMP_DEPRECATED_REPLACE_NEW_API
-
mail_SOURCES = \
mail.c
diff --git a/plug-ins/common/mail.c b/plug-ins/common/mail.c
index 065a0030d2..bd0a2467a2 100644
--- a/plug-ins/common/mail.c
+++ b/plug-ins/common/mail.c
@@ -87,14 +87,14 @@ static GimpProcedure * mail_create_procedure (GimpPlugIn *plug_in,
static GimpValueArray * mail_run (GimpProcedure *procedure,
GimpRunMode run_mode,
- gint32 image_id,
- gint32 drawable_id,
+ GimpImage *image,
+ GimpDrawable *drawable,
const GimpValueArray *args,
gpointer run_data);
static GimpPDBStatusType send_image (const gchar *filename,
- gint32 image_ID,
- gint32 drawable_ID,
+ GimpImage *image,
+ GimpDrawable *drawable,
gint32 run_mode);
static gboolean send_dialog (void);
@@ -255,8 +255,8 @@ mail_create_procedure (GimpPlugIn *plug_in,
static GimpValueArray *
mail_run (GimpProcedure *procedure,
GimpRunMode run_mode,
- gint32 image_id,
- gint32 drawable_id,
+ GimpImage *image,
+ GimpDrawable *drawable,
const GimpValueArray *args,
gpointer run_data)
{
@@ -269,7 +269,7 @@ mail_run (GimpProcedure *procedure,
case GIMP_RUN_INTERACTIVE:
gimp_get_data (PLUG_IN_PROC, &mail_info);
{
- gchar *filename = gimp_image_get_filename (image_id);
+ gchar *filename = gimp_image_get_filename (image);
if (filename)
{
@@ -313,8 +313,8 @@ mail_run (GimpProcedure *procedure,
}
status = send_image (mail_info.filename,
- image_id,
- drawable_id,
+ image,
+ drawable,
run_mode);
if (status == GIMP_PDB_SUCCESS)
@@ -329,10 +329,10 @@ mail_run (GimpProcedure *procedure,
}
static GimpPDBStatusType
-send_image (const gchar *filename,
- gint32 image_ID,
- gint32 drawable_ID,
- gint32 run_mode)
+send_image (const gchar *filename,
+ GimpImage *image,
+ GimpDrawable *drawable,
+ gint32 run_mode)
{
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gchar *ext;
@@ -359,8 +359,8 @@ send_image (const gchar *filename,
tmpname = gimp_temp_name (ext + 1);
if (! (gimp_file_save (run_mode,
- image_ID,
- drawable_ID,
+ image,
+ drawable,
tmpname,
tmpname) && valid_file (tmpname)))
{
@@ -379,7 +379,7 @@ send_image (const gchar *filename,
* So I use a known directory that we control under $GIMP_DIRECTORY/tmp/,
* and clean it out each time the plugin runs. This means that *if* you
* are in the above case (your email client requires the file to stay
- * alive), * you cannot run twice the plugin at the same time.
+ * alive), you cannot run twice the plugin at the same time.
*/
tmp_dir = gimp_directory_file ("tmp", PLUG_IN_PROC, NULL);
diff --git a/plug-ins/common/plugin-defs.pl b/plug-ins/common/plugin-defs.pl
index f76dcdbaf0..3d071c7cb0 100644
--- a/plug-ins/common/plugin-defs.pl
+++ b/plug-ins/common/plugin-defs.pl
@@ -57,7 +57,7 @@
'guillotine' => { old_api => 1 },
'hot' => { ui => 1, gegl => 1, old_api => 1 },
'jigsaw' => { ui => 1, gegl => 1 },
- 'mail' => { ui => 1, optional => 1, old_api => 1 },
+ 'mail' => { ui => 1, optional => 1 },
'nl-filter' => { ui => 1, gegl => 1 },
'plugin-browser' => { ui => 1, old_api => 1 },
'procedure-browser' => { ui => 1, old_api => 1 },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]