[gimp] Revert "pdb: Added a procedure to check how many processors GIMP is configured to use."



commit d303d8c7c1168f8d988b83e0377e5a1b9ebe0adc
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jul 9 02:30:10 2010 +0200

    Revert "pdb: Added a procedure to check how many processors GIMP is configured to use."
    
    This reverts commit b22880c32f599eb082c52d06a43d40a6615976ee.
    Adding this procedure was a misunderstanding on IRC.

 app/pdb/gimprc-cmds.c       |   51 -------------------------------------------
 app/pdb/internal-procs.c    |    2 +-
 libgimp/gimpgimprc_pdb.c    |   34 ----------------------------
 libgimp/gimpgimprc_pdb.h    |    1 -
 tools/pdbgen/pdb/gimprc.pdb |   40 +--------------------------------
 5 files changed, 2 insertions(+), 126 deletions(-)
---
diff --git a/app/pdb/gimprc-cmds.c b/app/pdb/gimprc-cmds.c
index cc905a5..acb6800 100644
--- a/app/pdb/gimprc-cmds.c
+++ b/app/pdb/gimprc-cmds.c
@@ -29,7 +29,6 @@
 
 #include "pdb-types.h"
 
-#include "base/pixel-processor.h"
 #include "config/gimprc.h"
 #include "core/gimp-utils.h"
 #include "core/gimp.h"
@@ -227,33 +226,6 @@ get_module_load_inhibit_invoker (GimpProcedure      *procedure,
   return return_vals;
 }
 
-static GValueArray *
-get_number_of_processors_invoker (GimpProcedure      *procedure,
-                                  Gimp               *gimp,
-                                  GimpContext        *context,
-                                  GimpProgress       *progress,
-                                  const GValueArray  *args,
-                                  GError            **error)
-{
-  GValueArray *return_vals;
-  gint32 num_proc = 0;
-
-  gchar  *str;
-
-  str = gimp_rc_query (GIMP_RC (gimp->config), "num-processors");
-  num_proc = (gint32) g_ascii_strtoll (str, NULL, 0);
-
-  /* Although this is probably not necessary, still be safe */
-  num_proc = CLAMP (num_proc, 1, GIMP_MAX_NUM_THREADS);
-
-  g_free (str);
-
-  return_vals = gimp_procedure_get_return_values (procedure, TRUE, NULL);
-  g_value_set_int (&return_vals->values[1], num_proc);
-
-  return return_vals;
-}
-
 void
 register_gimprc_procs (GimpPDB *pdb)
 {
@@ -470,27 +442,4 @@ register_gimprc_procs (GimpPDB *pdb)
                                                            GIMP_PARAM_READWRITE));
   gimp_pdb_register_procedure (pdb, procedure);
   g_object_unref (procedure);
-
-  /*
-   * gimp-get-number-of-processors
-   */
-  procedure = gimp_procedure_new (get_number_of_processors_invoker);
-  gimp_object_set_static_name (GIMP_OBJECT (procedure),
-                               "gimp-get-number-of-processors");
-  gimp_procedure_set_static_strings (procedure,
-                                     "gimp-get-number-of-processors",
-                                     "Get the number of processors which GIMP was configured to use.",
-                                     "Returns the number of processors which GIMP was configured to use. This value is taken from the Preferences and there's no guarantee for the value to be reasonable. This function is mainly intended for plugin writers who want to write multithreaded plugins and need to know how many threads to create.",
-                                     "Barak Itkin <lightningismyname gmail com>",
-                                     "Barak Itkin",
-                                     "2010",
-                                     NULL);
-  gimp_procedure_add_return_value (procedure,
-                                   gimp_param_spec_int32 ("num-proc",
-                                                          "num proc",
-                                                          "The number of processors",
-                                                          1, GIMP_MAX_NUM_THREADS, 1,
-                                                          GIMP_PARAM_READWRITE));
-  gimp_pdb_register_procedure (pdb, procedure);
-  g_object_unref (procedure);
 }
diff --git a/app/pdb/internal-procs.c b/app/pdb/internal-procs.c
index c8a6aae..cbe9a72 100644
--- a/app/pdb/internal-procs.c
+++ b/app/pdb/internal-procs.c
@@ -28,7 +28,7 @@
 #include "internal-procs.h"
 
 
-/* 603 procedures registered total */
+/* 602 procedures registered total */
 
 void
 internal_procs_init (GimpPDB *pdb)
diff --git a/libgimp/gimpgimprc_pdb.c b/libgimp/gimpgimprc_pdb.c
index 209c0cf..b67846d 100644
--- a/libgimp/gimpgimprc_pdb.c
+++ b/libgimp/gimpgimprc_pdb.c
@@ -294,37 +294,3 @@ gimp_get_module_load_inhibit (void)
 
   return load_inhibit;
 }
-
-/**
- * gimp_get_number_of_processors:
- *
- * Get the number of processors which GIMP was configured to use.
- *
- * Returns the number of processors which GIMP was configured to use.
- * This value is taken from the Preferences and there's no guarantee
- * for the value to be reasonable. This function is mainly intended for
- * plugin writers who want to write multithreaded plugins and need to
- * know how many threads to create.
- *
- * Returns: The number of processors.
- *
- * Since: GIMP 2.8
- */
-gint
-gimp_get_number_of_processors (void)
-{
-  GimpParam *return_vals;
-  gint nreturn_vals;
-  gint num_proc = 0;
-
-  return_vals = gimp_run_procedure ("gimp-get-number-of-processors",
-                                    &nreturn_vals,
-                                    GIMP_PDB_END);
-
-  if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
-    num_proc = return_vals[1].data.d_int32;
-
-  gimp_destroy_params (return_vals, nreturn_vals);
-
-  return num_proc;
-}
diff --git a/libgimp/gimpgimprc_pdb.h b/libgimp/gimpgimprc_pdb.h
index dd8928d..d4f2005 100644
--- a/libgimp/gimpgimprc_pdb.h
+++ b/libgimp/gimpgimprc_pdb.h
@@ -38,7 +38,6 @@ gboolean               gimp_get_monitor_resolution   (gdouble     *xres,
 gchar*                 gimp_get_theme_dir            (void);
 G_GNUC_INTERNAL gchar* _gimp_get_color_configuration (void);
 gchar*                 gimp_get_module_load_inhibit  (void);
-gint                   gimp_get_number_of_processors (void);
 
 
 G_END_DECLS
diff --git a/tools/pdbgen/pdb/gimprc.pdb b/tools/pdbgen/pdb/gimprc.pdb
index ab5a20f..b8863f6 100644
--- a/tools/pdbgen/pdb/gimprc.pdb
+++ b/tools/pdbgen/pdb/gimprc.pdb
@@ -233,45 +233,8 @@ CODE
     );
 }
 
-sub get_number_of_processors {
-    $blurb = 'Get the number of processors which GIMP was configured to use.';
-    $help = <<'HELP';
-Returns the number of processors which GIMP was configured to use. This value
-is taken from the Preferences and there's no guarantee for the value to be
-reasonable. This function is mainly intended for plugin writers who want to
-write multithreaded plugins and need to know how many threads to create.
-HELP
-
-    	$author = 'Barak Itkin <lightningismyname gmail com>';
-	$copyright = 'Barak Itkin';
-	$date = '2010';
-	$since = '2.8';
-
-    @outargs = (
-	{  name => 'num_proc', type => '1 <= int32 <= GIMP_MAX_NUM_THREADS',
-	   desc => 'The number of processors' }
-    );
-
-    %invoke = (
-	code => <<'CODE'
-{
-  gchar  *str;
-
-  str = gimp_rc_query (GIMP_RC (gimp->config), "num-processors");
-  num_proc = (gint32) g_ascii_strtoll (str, NULL, 0);
-
-  /* Although this is probably not necessary, still be safe */
-  num_proc = CLAMP (num_proc, 1, GIMP_MAX_NUM_THREADS);
-
-  g_free (str);
-}
-CODE
-    );
-}
-
 
 @headers = qw(<string.h>
-              "base/pixel-processor.h"
               "config/gimprc.h"
               "core/gimp.h");
 
@@ -282,8 +245,7 @@ CODE
             get_monitor_resolution
 	    get_theme_dir
             get_color_configuration
-            get_module_load_inhibit
-            get_number_of_processors);
+            get_module_load_inhibit);
 
 %exports = (app => [ procs], lib => [ procs]);
 



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