Commit c288b28a authored by Ell's avatar Ell

libgimpbase, libgimp, app: pass misc. GEGL config to plug-ins

Pass the GEGL tile-cache size, swap path, and thread-count to plug-
ins as part of their config, and have libgimp set the plug-in's
GeglConfig accordingly upon initialization.
parent 77c24ca1
...@@ -222,6 +222,9 @@ gimp_plug_in_manager_call_run (GimpPlugInManager *manager, ...@@ -222,6 +222,9 @@ gimp_plug_in_manager_call_run (GimpPlugInManager *manager,
config.icon_theme_dir = icon_theme_dir ? config.icon_theme_dir = icon_theme_dir ?
g_file_get_path (icon_theme_dir) : g_file_get_path (icon_theme_dir) :
NULL; NULL;
config.tile_cache_size = gegl_config->tile_cache_size;
config.swap_path = gegl_config->swap_path;
config.num_processors = gegl_config->num_processors;
proc_run.name = GIMP_PROCEDURE (procedure)->original_name; proc_run.name = GIMP_PROCEDURE (procedure)->original_name;
proc_run.nparams = gimp_value_array_length (args); proc_run.nparams = gimp_value_array_length (args);
......
...@@ -2164,6 +2164,9 @@ gimp_config (GPConfig *config) ...@@ -2164,6 +2164,9 @@ gimp_config (GPConfig *config)
gimp_cpu_accel_set_use (config->use_cpu_accel); gimp_cpu_accel_set_use (config->use_cpu_accel);
g_object_set (gegl_config (), g_object_set (gegl_config (),
"tile-cache-size", config->tile_cache_size,
"swap", config->swap_path,
"threads", (gint) config->num_processors,
"use-opencl", config->use_opencl, "use-opencl", config->use_opencl,
"application-license", "GPL3", "application-license", "GPL3",
NULL); NULL);
......
...@@ -539,6 +539,16 @@ _gp_config_read (GIOChannel *channel, ...@@ -539,6 +539,16 @@ _gp_config_read (GIOChannel *channel,
if (! _gimp_wire_read_string (channel, if (! _gimp_wire_read_string (channel,
&config->icon_theme_dir, 1, user_data)) &config->icon_theme_dir, 1, user_data))
goto cleanup; goto cleanup;
if (! _gimp_wire_read_int64 (channel,
&config->tile_cache_size, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_string (channel,
&config->swap_path, 1, user_data))
goto cleanup;
if (! _gimp_wire_read_int32 (channel,
(guint32 *) &config->num_processors, 1,
user_data))
goto cleanup;
msg->data = config; msg->data = config;
return; return;
...@@ -548,6 +558,7 @@ _gp_config_read (GIOChannel *channel, ...@@ -548,6 +558,7 @@ _gp_config_read (GIOChannel *channel,
g_free (config->wm_class); g_free (config->wm_class);
g_free (config->display_name); g_free (config->display_name);
g_free (config->icon_theme_dir); g_free (config->icon_theme_dir);
g_free (config->swap_path);
g_slice_free (GPConfig, config); g_slice_free (GPConfig, config);
} }
...@@ -628,6 +639,16 @@ _gp_config_write (GIOChannel *channel, ...@@ -628,6 +639,16 @@ _gp_config_write (GIOChannel *channel,
if (! _gimp_wire_write_string (channel, if (! _gimp_wire_write_string (channel,
&config->icon_theme_dir, 1, user_data)) &config->icon_theme_dir, 1, user_data))
return; return;
if (! _gimp_wire_write_int64 (channel,
&config->tile_cache_size, 1, user_data))
return;
if (! _gimp_wire_write_string (channel,
&config->swap_path, 1, user_data))
return;
if (! _gimp_wire_write_int32 (channel,
(const guint32 *) &config->num_processors, 1,
user_data))
return;
} }
static void static void
...@@ -641,6 +662,7 @@ _gp_config_destroy (GimpWireMessage *msg) ...@@ -641,6 +662,7 @@ _gp_config_destroy (GimpWireMessage *msg)
g_free (config->wm_class); g_free (config->wm_class);
g_free (config->display_name); g_free (config->display_name);
g_free (config->icon_theme_dir); g_free (config->icon_theme_dir);
g_free (config->swap_path);
g_slice_free (GPConfig, config); g_slice_free (GPConfig, config);
} }
} }
......
...@@ -26,7 +26,7 @@ G_BEGIN_DECLS ...@@ -26,7 +26,7 @@ G_BEGIN_DECLS
/* Increment every time the protocol changes /* Increment every time the protocol changes
*/ */
#define GIMP_PROTOCOL_VERSION 0x0102 #define GIMP_PROTOCOL_VERSION 0x0103
enum enum
...@@ -80,6 +80,9 @@ struct _GPConfig ...@@ -80,6 +80,9 @@ struct _GPConfig
gint32 monitor_number; gint32 monitor_number;
guint32 timestamp; guint32 timestamp;
gchar *icon_theme_dir; gchar *icon_theme_dir;
guint64 tile_cache_size;
gchar *swap_path;
gint32 num_processors;
}; };
struct _GPTileReq struct _GPTileReq
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment