[gimp] libgimp: remove more legacy API that isn't used any longer by any plug-in



commit d2add325bb48bd7ab6ab6988eb42439e6ba15375
Author: Michael Natterer <mitch gimp org>
Date:   Tue Aug 13 11:20:52 2019 +0200

    libgimp: remove more legacy API that isn't used any longer by any plug-in

 libgimp/gimp.def     |   7 --
 libgimp/gimplegacy.c | 239 +--------------------------------------------------
 libgimp/gimplegacy.h |  30 -------
 3 files changed, 3 insertions(+), 273 deletions(-)
---
diff --git a/libgimp/gimp.def b/libgimp/gimp.def
index 758614547b..50c5fd0141 100644
--- a/libgimp/gimp.def
+++ b/libgimp/gimp.def
@@ -173,7 +173,6 @@ EXPORTS
        gimp_debug_timer_end
        gimp_debug_timer_start
        gimp_default_display
-       gimp_destroy_paramdefs
        gimp_destroy_params
        gimp_detach_parasite
        gimp_display_delete
@@ -255,9 +254,7 @@ EXPORTS
        gimp_export_exif
        gimp_export_iptc
        gimp_export_xmp
-       gimp_extension_ack
        gimp_extension_enable
-       gimp_extension_process
        gimp_file_load
        gimp_file_load_layer
        gimp_file_load_layers
@@ -660,11 +657,8 @@ EXPORTS
        gimp_plug_in_set_help_domain
        gimp_plug_in_set_pdb_error_handler
        gimp_plug_in_set_translation_domain
-       gimp_plugin_domain_register
        gimp_plugin_get_pdb_error_handler
-       gimp_plugin_help_register
        gimp_plugin_icon_register
-       gimp_plugin_menu_branch_register
        gimp_plugin_menu_register
        gimp_plugin_set_pdb_error_handler
        gimp_procedure_add_argument
@@ -724,7 +718,6 @@ EXPORTS
        gimp_register_save_handler
        gimp_register_thumbnail_loader
        gimp_run_procedure
-       gimp_run_procedure2
        gimp_run_procedure_array
        gimp_save_procedure_get_type
        gimp_save_procedure_new
diff --git a/libgimp/gimplegacy.c b/libgimp/gimplegacy.c
index dc68d8a4a6..ef582c8c24 100644
--- a/libgimp/gimplegacy.c
+++ b/libgimp/gimplegacy.c
@@ -377,30 +377,6 @@ gimp_uninstall_temp_proc (const gchar *name)
     }
 }
 
-/**
- * gimp_extension_ack:
- *
- * Notify the main GIMP application that the extension has been properly
- * initialized and is ready to run.
- *
- * This function <emphasis>must</emphasis> be called from every
- * procedure that was registered as #GIMP_EXTENSION.
- *
- * Subsequently, extensions can process temporary procedure run
- * requests using either gimp_extension_enable() or
- * gimp_extension_process().
- *
- * See also: gimp_install_procedure(), gimp_install_temp_proc()
- **/
-void
-gimp_extension_ack (void)
-{
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
-  if (! gp_extension_ack_write (_gimp_writechannel, NULL))
-    gimp_quit ();
-}
-
 /**
  * gimp_extension_enable:
  *
@@ -443,77 +419,6 @@ gimp_extension_enable (void)
     }
 }
 
-/**
- * gimp_extension_process:
- * @timeout: The timeout (in ms) to use for the select() call.
- *
- * Processes one message sent by GIMP and returns.
- *
- * Call this function in an endless loop after calling
- * gimp_extension_ack() to process requests for running temporary
- * procedures.
- *
- * See gimp_extension_enable() for an asynchronous way of doing the
- * same if running an endless loop is not an option.
- *
- * See also: gimp_install_procedure(), gimp_install_temp_proc()
- **/
-void
-gimp_extension_process (guint timeout)
-{
-#ifndef G_OS_WIN32
-  gint select_val;
-
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
-  do
-    {
-      fd_set readfds;
-      struct timeval  tv;
-      struct timeval *tvp;
-
-      if (timeout)
-        {
-          tv.tv_sec  = timeout / 1000;
-          tv.tv_usec = (timeout % 1000) * 1000;
-          tvp = &tv;
-        }
-      else
-        tvp = NULL;
-
-      FD_ZERO (&readfds);
-      FD_SET (g_io_channel_unix_get_fd (_gimp_readchannel), &readfds);
-
-      if ((select_val = select (FD_SETSIZE, &readfds, NULL, NULL, tvp)) > 0)
-        {
-          gimp_single_message ();
-        }
-      else if (select_val == -1 && errno != EINTR)
-        {
-          perror ("gimp_extension_process");
-          gimp_quit ();
-        }
-    }
-  while (select_val == -1 && errno == EINTR);
-#else
-  /* Zero means infinite wait for us, but g_poll and
-   * g_io_channel_win32_poll use -1 to indicate
-   * infinite wait.
-   */
-  GPollFD pollfd;
-
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
-  if (timeout == 0)
-    timeout = -1;
-
-  g_io_channel_win32_make_pollfd (_gimp_readchannel, G_IO_IN, &pollfd);
-
-  if (g_io_channel_win32_poll (&pollfd, 1, timeout) == 1)
-    gimp_single_message ();
-#endif
-}
-
 void
 _gimp_legacy_read_expect_msg (GimpWireMessage *msg,
                               gint             type)
@@ -565,6 +470,8 @@ gimp_run_procedure (const gchar *name,
                     gint        *n_return_vals,
                     ...)
 {
+  GimpValueArray *arguments;
+  GimpValueArray *return_values;
   GimpPDBArgType  param_type;
   GimpParam      *return_vals;
   GimpParam      *params   = NULL;
@@ -739,53 +646,12 @@ gimp_run_procedure (const gchar *name,
 
   va_end (args);
 
-  return_vals = gimp_run_procedure2 (name, n_return_vals, n_params, params);
-
-  g_free (params);
-
-  return return_vals;
-}
-
-/**
- * gimp_run_procedure2: (rename-to gimp_run_procedure)
- * @name:          the name of the procedure to run
- * @n_return_vals: return location for the number of return values
- * @n_params:      the number of parameters the procedure takes.
- * @params:        the procedure's parameters array.
- *
- * This function calls a GIMP procedure and returns its return values.
- * To get more information about the available procedures and the
- * parameters they expect, please have a look at the Procedure Browser
- * as found in the Xtns menu in GIMP's toolbox.
- *
- * As soon as you don't need the return values any longer, you should
- * free them using gimp_destroy_params().
- *
- * Returns: the procedure's return values unless there was an error,
- * in which case the zero-th return value will be the error status, and
- * if there are two values returned, the other return value will be a
- * string detailing the error.
- **/
-GimpParam *
-gimp_run_procedure2 (const gchar     *name,
-                     gint            *n_return_vals,
-                     gint             n_params,
-                     const GimpParam *params)
-{
-  GimpValueArray *arguments;
-  GimpValueArray *return_values;
-  GimpParam      *return_vals;
-
-  g_return_val_if_fail (name != NULL, NULL);
-  g_return_val_if_fail (n_return_vals != NULL, NULL);
-
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
   arguments = _gimp_params_to_value_array (params, n_params, FALSE);
 
   return_values = gimp_run_procedure_array (name, arguments);
 
   gimp_value_array_unref (arguments);
+  g_free (params);
 
   *n_return_vals = gimp_value_array_length (return_values);
   return_vals    = _gimp_value_array_to_params (return_values, TRUE);
@@ -921,29 +787,6 @@ gimp_destroy_params (GimpParam *params,
   g_free (params);
 }
 
-/**
- * gimp_destroy_paramdefs:
- * @paramdefs: the #GimpParamDef array to destroy
- * @n_params:  the number of elements in the array
- *
- * Destroys a #GimpParamDef array as returned by
- * gimp_procedural_db_proc_info().
- **/
-void
-gimp_destroy_paramdefs (GimpParamDef *paramdefs,
-                        gint          n_params)
-{
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
-  while (n_params--)
-    {
-      g_free (paramdefs[n_params].name);
-      g_free (paramdefs[n_params].description);
-    }
-
-  g_free (paramdefs);
-}
-
 /**
  * gimp_get_pdb_error:
  *
@@ -1080,82 +923,6 @@ _gimp_legacy_quit (void)
 
 /*  cruft from other places  */
 
-/**
- * gimp_plugin_domain_register:
- * @domain_name: The name of the textdomain (must be unique).
- * @domain_path: The absolute path to the compiled message catalog (may be NULL).
- *
- * Registers a textdomain for localisation.
- *
- * This procedure adds a textdomain to the list of domains Gimp
- * searches for strings when translating its menu entries. There is no
- * need to call this function for plug-ins that have their strings
- * included in the 'gimp-std-plugins' domain as that is used by
- * default. If the compiled message catalog is not in the standard
- * location, you may specify an absolute path to another location. This
- * procedure can only be called in the query function of a plug-in and
- * it has to be called before any procedure is installed.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_plugin_domain_register (const gchar *domain_name,
-                             const gchar *domain_path)
-{
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
-  return _gimp_plugin_domain_register (domain_name, domain_path);
-}
-
-/**
- * gimp_plugin_help_register:
- * @domain_name: The XML namespace of the plug-in's help pages.
- * @domain_uri: The root URI of the plug-in's help pages.
- *
- * Register a help path for a plug-in.
- *
- * This procedure registers user documentation for the calling plug-in
- * with the GIMP help system. The domain_uri parameter points to the
- * root directory where the plug-in help is installed. For each
- * supported language there should be a file called 'gimp-help.xml'
- * that maps the help IDs to the actual help files.
- *
- * Returns: TRUE on success.
- **/
-gboolean
-gimp_plugin_help_register (const gchar *domain_name,
-                           const gchar *domain_uri)
-{
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
-  return _gimp_plugin_help_register (domain_name, domain_uri);
-}
-
-/**
- * gimp_plugin_menu_branch_register:
- * @menu_path: The sub-menu's menu path.
- * @menu_name: The name of the sub-menu.
- *
- * Register a sub-menu.
- *
- * This procedure installs a sub-menu which does not belong to any
- * procedure. The menu-name should be the untranslated menu label. GIMP
- * will look up the translation in the textdomain registered for the
- * plug-in.
- *
- * Returns: TRUE on success.
- *
- * Since: 2.4
- **/
-gboolean
-gimp_plugin_menu_branch_register (const gchar *menu_path,
-                                  const gchar *menu_name)
-{
-  ASSERT_NO_PLUG_IN_EXISTS (G_STRFUNC);
-
-  return _gimp_plugin_menu_branch_register (menu_path, menu_name);
-}
-
 /**
  * gimp_plugin_set_pdb_error_handler:
  * @handler: Who is responsible for handling procedure call errors.
diff --git a/libgimp/gimplegacy.h b/libgimp/gimplegacy.h
index 92b0e5685f..546d24e4f5 100644
--- a/libgimp/gimplegacy.h
+++ b/libgimp/gimplegacy.h
@@ -274,18 +274,10 @@ void           gimp_install_temp_proc   (const gchar        *name,
  */
 void           gimp_uninstall_temp_proc (const gchar        *name);
 
-/* Notify the main GIMP application that the extension is ready to run
- */
-void           gimp_extension_ack       (void);
-
 /* Enable asynchronous processing of temp_procs
  */
 void           gimp_extension_enable    (void);
 
-/* Process one temp_proc and return
- */
-void           gimp_extension_process   (guint            timeout);
-
 /* Run a procedure in the procedure database. The parameters are
  *  specified via the variable length argument list. The return
  *  values are returned in the 'GimpParam*' array.
@@ -294,15 +286,6 @@ GimpParam    * gimp_run_procedure       (const gchar     *name,
                                          gint            *n_return_vals,
                                          ...);
 
-/* Run a procedure in the procedure database. The parameters are
- *  specified as an array of GimpParam.  The return
- *  values are returned in the 'GimpParam*' array.
- */
-GimpParam    * gimp_run_procedure2      (const gchar     *name,
-                                         gint            *n_return_vals,
-                                         gint             n_params,
-                                         const GimpParam *params);
-
 /* Run a procedure in the procedure database. The parameters are
  *  specified as a GimpValueArray, so are the return values.
  */
@@ -316,13 +299,6 @@ GimpValueArray * gimp_run_procedure_array (const gchar          *name,
 void           gimp_destroy_params      (GimpParam       *params,
                                          gint             n_params);
 
-/* Destroy the an array of GimpParamDef's. This is useful for
- *  destroying the return values returned by a call to
- *  'gimp_procedural_db_proc_info'.
- */
-void           gimp_destroy_paramdefs   (GimpParamDef    *paramdefs,
-                                         gint             n_params);
-
 /* Retrieve the error message and return status for the last procedure
  * call.
  */
@@ -332,12 +308,6 @@ GimpPDBStatusType   gimp_get_pdb_status (void);
 /* gimp_plugin API that should now be done by using GimpPlugIn
  */
 
-gboolean   gimp_plugin_domain_register       (const gchar         *domain_name,
-                                              const gchar         *domain_path);
-gboolean   gimp_plugin_help_register         (const gchar         *domain_name,
-                                              const gchar         *domain_uri);
-gboolean   gimp_plugin_menu_branch_register  (const gchar         *menu_path,
-                                              const gchar         *menu_name);
 gboolean   gimp_plugin_set_pdb_error_handler (GimpPDBErrorHandler  handler);
 GimpPDBErrorHandler
            gimp_plugin_get_pdb_error_handler (void);


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