[gimp] libgimp: gimplegacy not introspected anymore.



commit b6e6f0b71bdd3ae147f536a1c6331378e5e39b67
Author: Jehan <jehan girinstud io>
Date:   Fri Aug 2 23:59:24 2019 +0200

    libgimp: gimplegacy not introspected anymore.
    
    Also remove several functions which never made it to a GIMP release.
    They were really meant as temporary anyway from the start, waiting for
    the new API to be usable.
    And GimpParam is not boxed anymore. This is made useless by the fact it
    is not an introspected type now.

 libgimp/Makefile.am  |   2 +
 libgimp/Makefile.gi  |   9 +-
 libgimp/gimplegacy.c | 234 ---------------------------------------------------
 libgimp/gimplegacy.h |  27 ------
 4 files changed, 3 insertions(+), 269 deletions(-)
---
diff --git a/libgimp/Makefile.am b/libgimp/Makefile.am
index 7dad0bfc4c..9e6bd9407d 100644
--- a/libgimp/Makefile.am
+++ b/libgimp/Makefile.am
@@ -111,6 +111,8 @@ libgimp_private_sources = \
        gimpgpcompat.h          \
        gimpgpparams.c          \
        gimpgpparams.h          \
+       gimplegacy.c            \
+       gimplegacy.h            \
        gimpplugin-private.c    \
        gimpplugin-private.h    \
        gimp-private.h          \
diff --git a/libgimp/Makefile.gi b/libgimp/Makefile.gi
index defc13c341..f4db5b974a 100644
--- a/libgimp/Makefile.gi
+++ b/libgimp/Makefile.gi
@@ -149,14 +149,7 @@ libgimp_introspectable = \
        $(top_srcdir)/libgimp/gimpprogress.c            \
        $(top_srcdir)/libgimp/gimpprogress.h            \
        $(top_srcdir)/libgimp/gimpselection.c           \
-       $(top_srcdir)/libgimp/gimpselection.h           \
-       \
-       $(top_srcdir)/libgimp/gimplegacy.c              \
-       $(top_srcdir)/libgimp/gimplegacy.h
-
-# Let's keep gimplegacy as introspectable until we figure out how to use
-# the new GimpPlugIn API in bindings. TODO: remove later and put back
-# into libgimp_private_sources.
+       $(top_srcdir)/libgimp/gimpselection.h
 
 libgimpui_introspectable =                             \
        $(top_srcdir)/libgimp/gimpui.c                  \
diff --git a/libgimp/gimplegacy.c b/libgimp/gimplegacy.c
index e8ad583ff0..cae03c5c14 100644
--- a/libgimp/gimplegacy.c
+++ b/libgimp/gimplegacy.c
@@ -45,9 +45,6 @@
  **/
 
 
-static gpointer   gimp_param_copy (gpointer boxed);
-static void       gimp_param_free (gpointer boxed);
-
 static void       gimp_single_message          (void);
 static gboolean   gimp_extension_read          (GIOChannel      *channel,
                                                 GIOCondition     condition,
@@ -63,152 +60,6 @@ static void       gimp_proc_run_internal       (GPProcRun       *proc_run,
 static GHashTable *gimp_temp_proc_ht = NULL;
 
 
-/**
- * gimp_plug_in_info_set_callbacks:
- * @info: the PLUG_IN_INFO structure
- * @init_proc:  (closure) (scope async) (nullable): the init procedure
- * @quit_proc:  (closure) (scope async) (nullable): the quit procedure
- * @query_proc: (closure) (scope async) (nullable): the query procedure
- * @run_proc:   (closure) (scope async) (nullable): the run procedure
- *
- * The procedure that must be called with the PLUG_IN_INFO structure to
- * set the initialization, query, run and quit callbacks.
- *
- * Since: 3.0
- **/
-void
-gimp_plug_in_info_set_callbacks (GimpPlugInInfo *info,
-                                 GimpInitProc    init_proc,
-                                 GimpQuitProc    quit_proc,
-                                 GimpQueryProc   query_proc,
-                                 GimpRunProc     run_proc)
-{
-  info->init_proc  = init_proc;
-  info->quit_proc  = quit_proc;
-  info->query_proc = query_proc;
-  info->run_proc   = run_proc;
-}
-
-/**
- * gimp_param_from_int32:
- * @value: the #gint32 value to set.
- *
- * The procedure creates a new #GimpParam for a int32 value.
- *
- * Returns: (transfer full): A newly allocated #GimpParam.
- *
- * Since: 3.0
- **/
-GimpParam *
-gimp_param_from_int32 (gint32 value)
-{
-  GimpParam * param = g_new0 (GimpParam, 1);
-
-  param->type = GIMP_PDB_INT32;
-  param->data.d_int32 = value;
-
-  return param;
-}
-
-/**
- * gimp_param_get_int32:
- * @param: the #GimpParam.
- *
- * Unwrap the integer value contained in @param. Running this function
- * if @param is not an int32 #GimpParam is a programming error.
- *
- * Returns: the #gint32 value contained in @param.
- *
- * Since: 3.0
- **/
-gint32
-gimp_param_get_int32 (GimpParam *param)
-{
-  g_return_val_if_fail (param->type == GIMP_PDB_INT32, 0);
-
-  return param->data.d_int32;
-}
-
-/**
- * gimp_param_from_status:
- * @value: the #GimpPDBStatusType value to set.
- *
- * The procedure creates a new #GimpParam for a status value.
- *
- * Returns: (transfer full): A newly allocated #GimpParam.
- *
- * Since: 3.0
- **/
-GimpParam *
-gimp_param_from_status (GimpPDBStatusType value)
-{
-  GimpParam * param = g_new0 (GimpParam, 1);
-
-  param->type = GIMP_PDB_STATUS;
-  param->data.d_status = value;
-
-  return param;
-}
-
-/**
- * gimp_param_get_status:
- * @param: the #GimpParam.
- *
- * Unwrap the status value contained in @param. Running this function
- * if @param is not a status #GimpParam is a programming error.
- *
- * Returns: the #GimpPDBStatusType value contained in @param.
- *
- * Since: 3.0
- **/
-GimpPDBStatusType
-gimp_param_get_status (GimpParam *param)
-{
-  g_return_val_if_fail (param->type == GIMP_PDB_STATUS, 0);
-
-  return param->data.d_status;
-}
-
-/**
- * gimp_param_from_string:
- * @value: the string value to set.
- *
- * The procedure creates a new #GimpParam for a string value.
- *
- * Returns: (transfer full): A newly allocated #GimpParam.
- *
- * Since: 3.0
- **/
-GimpParam *
-gimp_param_from_string (gchar *value)
-{
-  GimpParam * param = g_new0 (GimpParam, 1);
-
-  param->type = GIMP_PDB_STRING;
-  param->data.d_string = g_strdup (value);
-
-  return param;
-}
-
-/**
- * gimp_param_get_string:
- * @param: the #GimpParam.
- *
- * Unwrap the string value contained in @param. Running this function
- * if @param is not a string #GimpParam is a programming error.
- *
- * Returns: the string value contained in @param.
- *
- * Since: 3.0
- **/
-gchar *
-gimp_param_get_string (GimpParam *param)
-{
-  g_return_val_if_fail (param->type == GIMP_PDB_STRING, NULL);
-
-  return param->data.d_string;
-}
-
 /**
  * gimp_install_procedure:
  * @name:                                      the procedure's name.
@@ -1003,91 +854,6 @@ _gimp_loop (GimpRunProc run_proc)
     }
 }
 
-/* Define boxed type functions. */
-
-static gpointer
-gimp_param_copy (gpointer boxed)
-{
-  GimpParam *param = boxed;
-  GimpParam *new_param;
-
-  new_param = g_slice_new (GimpParam);
-  new_param->type = param->type;
-  switch (param->type)
-    {
-    case GIMP_PDB_STRING:
-      new_param->data.d_string = g_strdup (param->data.d_string);
-      break;
-    case GIMP_PDB_INT32ARRAY:
-    case GIMP_PDB_INT16ARRAY:
-    case GIMP_PDB_INT8ARRAY:
-    case GIMP_PDB_FLOATARRAY:
-    case GIMP_PDB_COLORARRAY:
-    case GIMP_PDB_STRINGARRAY:
-      /* XXX: we can't copy these because we don't know the size, and
-       * we are bounded by the GBoxed copy function signature.
-       * Anyway this is only temporary until we replace GimpParam in the
-       * new API.
-       */
-      g_return_val_if_reached (new_param);
-      break;
-    default:
-      new_param->data = param->data;
-      break;
-    }
-
-  return new_param;
-}
-
-static void
-gimp_param_free (gpointer boxed)
-{
-  GimpParam *param = boxed;
-
-  switch (param->type)
-    {
-    case GIMP_PDB_STRING:
-      g_free (param->data.d_string);
-      break;
-    case GIMP_PDB_INT32ARRAY:
-      g_free (param->data.d_int32array);
-      break;
-    case GIMP_PDB_INT16ARRAY:
-      g_free (param->data.d_int16array);
-      break;
-    case GIMP_PDB_INT8ARRAY:
-      g_free (param->data.d_int8array);
-      break;
-    case GIMP_PDB_FLOATARRAY:
-      g_free (param->data.d_floatarray);
-      break;
-    case GIMP_PDB_COLORARRAY:
-      g_free (param->data.d_colorarray);
-      break;
-    case GIMP_PDB_STRINGARRAY:
-      /* XXX: we also want to free each element string. Unfortunately
-       * this type is not zero-terminated or anything of the sort to
-       * determine the number of elements.
-       * It uses the previous parameter, but we cannot have such value
-       * in a GBoxed's free function.
-       * Since this is all most likely temporary code until we update
-       * the plug-in API, let's just leak for now.
-       */
-      g_free (param->data.d_stringarray);
-      break;
-    default:
-      /* Pass-through. */
-      break;
-    }
-
-  g_slice_free (GimpParam, boxed);
-}
-
-G_DEFINE_BOXED_TYPE (GimpParam, gimp_param,
-                     gimp_param_copy,
-                     gimp_param_free)
-
-
 /*  old gimp_plugin cruft  */
 
 /**
diff --git a/libgimp/gimplegacy.h b/libgimp/gimplegacy.h
index ad735ad4e8..76f61f0305 100644
--- a/libgimp/gimplegacy.h
+++ b/libgimp/gimplegacy.h
@@ -131,18 +131,6 @@ struct _GimpParam
   GimpParamData  data;
 };
 
-/**
- * GIMP_TYPE_PARAM:
- *
- * Boxed type representing parameters and returned values, as passed
- * through the plug-in legacy API.
- *
- * Since: 3.0
- */
-#define GIMP_TYPE_PARAM (gimp_param_get_type ())
-
-GType gimp_param_get_type (void) G_GNUC_CONST;
-
 /**
  * MAIN:
  *
@@ -204,21 +192,6 @@ GType gimp_param_get_type (void) G_GNUC_CONST;
 #endif
 
 
-void                gimp_plug_in_info_set_callbacks    (GimpPlugInInfo    *info,
-                                                        GimpInitProc       init_proc,
-                                                        GimpQuitProc       quit_proc,
-                                                        GimpQueryProc      query_proc,
-                                                        GimpRunProc        run_proc);
-
-GimpParam         * gimp_param_from_int32              (gint32             value);
-gint32              gimp_param_get_int32               (GimpParam         *param);
-
-GimpParam         * gimp_param_from_status             (GimpPDBStatusType  value);
-GimpPDBStatusType   gimp_param_get_status              (GimpParam         *param);
-
-GimpParam         * gimp_param_from_string             (gchar             *value);
-gchar             * gimp_param_get_string              (GimpParam         *param);
-
 /* The main procedure that must be called with the PLUG_IN_INFO
  * structure and the 'argc' and 'argv' that are passed to "main".
  */


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