[gimp] libgimp: add gimp_get_pdb_status() to return the status of last...



commit 2e18c80c589cec9b86933c048410cdc543d9762e
Author: Jehan <jehan girinstud io>
Date:   Fri Jan 19 14:15:47 2018 +0100

    libgimp: add gimp_get_pdb_status() to return the status of last...
    
    ... procedure call.
    This is needed for plug-ins which depends on other plug-in's procedures.
    If for instance, the second-level plug-in is interrupted interactively,
    we don't want to process this as an error but as a cancellation.
    Therefore we need to know the returned value of the plug-in. Currently
    only way was to use gimp_get_pdb_error() but that was returning a
    human-readable error, not a computer-processable error.

 libgimp/gimp.c   |   15 +++++++++++++++
 libgimp/gimp.def |    1 +
 libgimp/gimp.h   |    4 ++++
 3 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libgimp/gimp.c b/libgimp/gimp.c
index 98a2b53..26cf5da 100644
--- a/libgimp/gimp.c
+++ b/libgimp/gimp.c
@@ -1226,6 +1226,21 @@ gimp_get_pdb_error (void)
 }
 
 /**
+ * gimp_get_pdb_status:
+ *
+ * Retrieves the status from the last procedure call.
+ *
+ * Return value: the #GimpPDBStatusType.
+ *
+ * Since: 2.10
+ **/
+GimpPDBStatusType
+gimp_get_pdb_status (void)
+{
+  return pdb_error_status;
+}
+
+/**
  * gimp_tile_width:
  *
  * Returns the tile width GIMP is using.
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index c18a690..f5bf0b9 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -343,6 +343,7 @@ EXPORTS
        gimp_get_parasite_list
        gimp_get_path_by_tattoo
        gimp_get_pdb_error
+       gimp_get_pdb_status
        gimp_get_progname
        gimp_get_theme_dir
        gimp_getpid
diff --git a/libgimp/gimp.h b/libgimp/gimp.h
index 087c5d7..ba30338 100644
--- a/libgimp/gimp.h
+++ b/libgimp/gimp.h
@@ -317,6 +317,10 @@ void           gimp_destroy_paramdefs   (GimpParamDef    *paramdefs,
  */
 const gchar  * gimp_get_pdb_error       (void);
 
+/* Retrieve the return status for the last procedure call.
+ */
+GimpPDBStatusType gimp_get_pdb_status   (void);
+
 /* Return various constants given by the GIMP core at plug-in config time.
  */
 guint          gimp_tile_width          (void) G_GNUC_CONST;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]