From 166714985c276c488fe1cd68d8896cafb0237949 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 11 Jul 2001 12:39:49 +0000 Subject: [PATCH] app/Makefile.am app/gimpunit.c removed... 2001-07-11 Michael Natterer * app/Makefile.am * app/gimpunit.c * app/unitrc.h: removed... * app/core/Makefile.am * app/core/gimpunit.[ch]: ...re-added here. * app/core/gimp.[ch]: added the image and drawable hash tables, next_image_ID, next_guide_ID and next_drawable_ID, added a GimpCoreConfig pointer which is now initalized dynamically. * app/core/gimpcoreconfig.[ch]: don't provide a global core_config variable any more (need to access gimp->config now). * app/gdisplay.[ch] * app/core/gimpdrawable.[ch] * app/core/gimpimage.[ch]: removed all global variables from gimpimage.c and gimpdrawable.c, pass a Gimp* to all *_get_by_ID() functions. * tools/pdbgen/app.pl: pass Gimp* to all _get_by_ID() functions. * app/app_procs.c * app/file-open.c * app/file-save.c * app/gimprc.c * app/libgimp_glue.c * app/module_db.c * app/plug_in.c * app/undo.c * app/user_install.c * app/core/core-types.h * app/core/gimpcontext.c * app/core/gimpimage-crop.c * app/core/gimpimage-new.c * app/core/gimpparasite.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/info-window.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c * app/widgets/gimpdnd.c * app/pdb/channel_cmds.c * app/pdb/color_cmds.c * app/pdb/convert_cmds.c * app/pdb/display_cmds.c * app/pdb/drawable_cmds.c * app/pdb/edit_cmds.c * app/pdb/fileops_cmds.c * app/pdb/floating_sel_cmds.c * app/pdb/guides_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/parasite_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/tools_cmds.c * app/pdb/undo_cmds.c * app/pdb/unit_cmds.c * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/unit.pdb: changed accordingly. --- ChangeLog | 70 ++++++ app/Makefile.am | 2 - app/actions/plug-in-commands.c | 23 +- app/app_procs.c | 4 +- app/core/Makefile.am | 2 + app/core/core-types.h | 2 + app/core/gimp-parasites.c | 7 +- app/core/gimp.c | 79 ++++--- app/core/gimp.h | 12 +- app/core/gimpcontext.c | 10 +- app/core/gimpcoreconfig.c | 54 +++-- app/core/gimpcoreconfig.h | 4 +- app/core/gimpdrawable.c | 38 +-- app/core/gimpdrawable.h | 3 +- app/core/gimpimage-crop.c | 10 +- app/core/gimpimage-guides.c | 67 +++--- app/core/gimpimage-guides.h | 8 +- app/core/gimpimage-merge.c | 67 +++--- app/core/gimpimage-merge.h | 8 +- app/core/gimpimage-new.c | 14 +- app/core/gimpimage-projection.c | 67 +++--- app/core/gimpimage-projection.h | 8 +- app/core/gimpimage-resize.c | 67 +++--- app/core/gimpimage-resize.h | 8 +- app/core/gimpimage-scale.c | 67 +++--- app/core/gimpimage-scale.h | 8 +- app/core/gimpimage-undo-push.c | 11 +- app/core/gimpimage.c | 67 +++--- app/core/gimpimage.h | 8 +- app/core/gimpparasite.c | 7 +- app/core/gimpprojection-construct.c | 67 +++--- app/core/gimpprojection-construct.h | 8 +- app/core/gimpprojection.c | 3 +- app/core/gimpprojection.h | 3 +- app/core/gimpunit.c | 38 ++- app/core/gimpunit.h | 3 + app/dialogs/file-open-dialog.c | 4 +- app/dialogs/image-new-dialog.c | 37 +-- app/dialogs/info-window.c | 2 +- app/dialogs/module-dialog.c | 8 +- app/dialogs/preferences-dialog.c | 196 ++++++++-------- app/dialogs/resize-dialog.c | 5 +- app/dialogs/user-install-dialog.c | 3 +- app/display/gimpdisplay.c | 3 +- app/display/gimpdisplay.h | 3 +- app/file-open.c | 2 +- app/file-save.c | 3 +- app/file/file-open.c | 2 +- app/file/file-save.c | 3 +- app/gdisplay.c | 3 +- app/gdisplay.h | 3 +- app/gimprc.c | 49 ++-- app/gimpunit.c | 334 --------------------------- app/gui/file-new-dialog.c | 37 +-- app/gui/file-open-dialog.c | 4 +- app/gui/info-window.c | 2 +- app/gui/module-browser.c | 8 +- app/gui/plug-in-commands.c | 23 +- app/gui/plug-in-menus.c | 23 +- app/gui/preferences-dialog.c | 196 ++++++++-------- app/gui/resize-dialog.c | 5 +- app/gui/user-install-dialog.c | 3 +- app/libgimp_glue.c | 2 +- app/menus/plug-in-menus.c | 23 +- app/module_db.c | 8 +- app/pdb/channel_cmds.c | 34 +-- app/pdb/color_cmds.c | 24 +- app/pdb/convert_cmds.c | 6 +- app/pdb/display_cmds.c | 4 +- app/pdb/drawable_cmds.c | 48 ++-- app/pdb/edit_cmds.c | 12 +- app/pdb/fileops_cmds.c | 2 +- app/pdb/floating_sel_cmds.c | 14 +- app/pdb/guides_cmds.c | 12 +- app/pdb/image_cmds.c | 151 ++++++------ app/pdb/layer_cmds.c | 62 ++--- app/pdb/parasite_cmds.c | 16 +- app/pdb/paths_cmds.c | 26 +-- app/pdb/selection_cmds.c | 36 +-- app/pdb/text_tool_cmds.c | 4 +- app/pdb/tools_cmds.c | 62 ++--- app/pdb/undo_cmds.c | 4 +- app/pdb/unit_cmds.c | 4 +- app/plug-in/gimpplugin-message.c | 23 +- app/plug-in/gimpplugin-progress.c | 23 +- app/plug-in/gimpplugin.c | 23 +- app/plug-in/gimppluginmanager-call.c | 23 +- app/plug-in/gimppluginmanager-run.c | 23 +- app/plug-in/gimppluginmanager.c | 23 +- app/plug-in/gimppluginshm.c | 23 +- app/plug-in/plug-in-def.c | 23 +- app/plug-in/plug-in-message.c | 23 +- app/plug-in/plug-in-params.c | 23 +- app/plug-in/plug-in-progress.c | 23 +- app/plug-in/plug-in-run.c | 23 +- app/plug-in/plug-in-shm.c | 23 +- app/plug-in/plug-in.c | 23 +- app/plug-in/plug-ins.c | 23 +- app/plug_in.c | 23 +- app/undo.c | 11 +- app/unitrc.h | 63 ----- app/user_install.c | 3 +- app/widgets/gimpdnd.c | 4 +- app/xcf/xcf-load.c | 5 +- app/xcf/xcf-save.c | 2 +- app/xcf/xcf.c | 2 +- tools/pdbgen/app.pl | 2 +- tools/pdbgen/pdb/image.pdb | 4 +- tools/pdbgen/pdb/unit.pdb | 2 +- 109 files changed, 1367 insertions(+), 1538 deletions(-) delete mode 100644 app/gimpunit.c delete mode 100644 app/unitrc.h diff --git a/ChangeLog b/ChangeLog index b5d13c801e..737545a74f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,73 @@ +2001-07-11 Michael Natterer + + * app/Makefile.am + * app/gimpunit.c + * app/unitrc.h: removed... + + * app/core/Makefile.am + * app/core/gimpunit.[ch]: ...re-added here. + + * app/core/gimp.[ch]: added the image and drawable hash tables, + next_image_ID, next_guide_ID and next_drawable_ID, added a + GimpCoreConfig pointer which is now initalized dynamically. + + * app/core/gimpcoreconfig.[ch]: don't provide a global core_config + variable any more (need to access gimp->config now). + + * app/gdisplay.[ch] + * app/core/gimpdrawable.[ch] + * app/core/gimpimage.[ch]: removed all global variables from + gimpimage.c and gimpdrawable.c, pass a Gimp* to all *_get_by_ID() + functions. + + * tools/pdbgen/app.pl: pass Gimp* to all _get_by_ID() functions. + + * app/app_procs.c + * app/file-open.c + * app/file-save.c + * app/gimprc.c + * app/libgimp_glue.c + * app/module_db.c + * app/plug_in.c + * app/undo.c + * app/user_install.c + * app/core/core-types.h + * app/core/gimpcontext.c + * app/core/gimpimage-crop.c + * app/core/gimpimage-new.c + * app/core/gimpparasite.c + * app/gui/file-new-dialog.c + * app/gui/file-open-dialog.c + * app/gui/info-window.c + * app/gui/preferences-dialog.c + * app/gui/resize-dialog.c + * app/xcf/xcf-load.c + * app/xcf/xcf-save.c + * app/xcf/xcf.c + * app/widgets/gimpdnd.c + + * app/pdb/channel_cmds.c + * app/pdb/color_cmds.c + * app/pdb/convert_cmds.c + * app/pdb/display_cmds.c + * app/pdb/drawable_cmds.c + * app/pdb/edit_cmds.c + * app/pdb/fileops_cmds.c + * app/pdb/floating_sel_cmds.c + * app/pdb/guides_cmds.c + * app/pdb/image_cmds.c + * app/pdb/layer_cmds.c + * app/pdb/parasite_cmds.c + * app/pdb/paths_cmds.c + * app/pdb/selection_cmds.c + * app/pdb/text_tool_cmds.c + * app/pdb/tools_cmds.c + * app/pdb/undo_cmds.c + * app/pdb/unit_cmds.c + + * tools/pdbgen/pdb/image.pdb + * tools/pdbgen/pdb/unit.pdb: changed accordingly. + 2001-07-10 Sven Neumann Bugfixes from the stable branch: diff --git a/app/Makefile.am b/app/Makefile.am index d82909dc97..5b852292ad 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -81,8 +81,6 @@ gimp_SOURCES = @STRIP_BEGIN@ \ ## floating_sel.c \ floating_sel.h \ - gimpunit.c \ - unitrc.h \ ## ## config stuff ## diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index 00c051bfa3..db969a9dbe 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/app_procs.c b/app/app_procs.c index 71de4bf5b3..8414bfaffd 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -40,6 +40,7 @@ #include "core/gimp.h" #include "core/gimpdatafactory.h" +#include "core/gimpunit.h" #include "pdb/internal_procs.h" @@ -62,7 +63,6 @@ #include "module_db.h" #include "plug_in.h" #include "undo.h" -#include "unitrc.h" #include "user_install.h" #ifdef DISPLAY_FILTERS @@ -108,7 +108,7 @@ app_init (gint gimp_argc, */ gimp_dir = gimp_directory (); - if (stat (gimp_dir, &stat_buf) != 0) + if (stat (gimp_dir, &stat_buf) != 0) { /* not properly installed */ diff --git a/app/core/Makefile.am b/app/core/Makefile.am index 84aac98620..ddcefb00ca 100644 --- a/app/core/Makefile.am +++ b/app/core/Makefile.am @@ -93,6 +93,8 @@ libappcore_a_SOURCES = @STRIP_BEGIN@ \ gimpscanconvert.h \ gimptoolinfo.c \ gimptoolinfo.h \ + gimpunit.c \ + gimpunit.h \ gimpundo.c \ gimpundo.h \ gimpundostack.c \ diff --git a/app/core/core-types.h b/app/core/core-types.h index 823dc0598c..49b0a7c60d 100644 --- a/app/core/core-types.h +++ b/app/core/core-types.h @@ -130,6 +130,8 @@ typedef struct _GimpUndoStack GimpUndoStack; /* non-object types */ +typedef struct _GimpCoreConfig GimpCoreConfig; + typedef struct _GimpGuide GimpGuide; typedef struct _GimpImageNewValues GimpImageNewValues; diff --git a/app/core/gimp-parasites.c b/app/core/gimp-parasites.c index f981c539d6..e34d61fbfa 100644 --- a/app/core/gimp-parasites.c +++ b/app/core/gimp-parasites.c @@ -35,9 +35,11 @@ #include "gimprc.h" -void +void gimp_parasites_init (Gimp *gimp) { + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (gimp->parasites == NULL); gimp->parasites = gimp_parasite_list_new (); @@ -49,6 +51,9 @@ gimp_parasites_init (Gimp *gimp) void gimp_parasites_exit (Gimp *gimp) { + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); + if (gimp->parasites) { gtk_object_unref (GTK_OBJECT (gimp->parasites)); diff --git a/app/core/gimp.c b/app/core/gimp.c index 7b3e347f04..e77e12803c 100644 --- a/app/core/gimp.c +++ b/app/core/gimp.c @@ -44,9 +44,9 @@ #include "gimppattern.h" #include "gimpparasite.h" #include "gimptoolinfo.h" +#include "gimpunit.h" #include "app_procs.h" -#include "unitrc.h" #include "libgimp/gimpintl.h" @@ -103,6 +103,8 @@ gimp_class_init (GimpClass *klass) static void gimp_init (Gimp *gimp) { + gimp_core_config_init (gimp); + gimp->create_display_func = NULL; gimp->gui_set_busy_func = NULL; gimp->gui_unset_busy_func = NULL; @@ -110,31 +112,37 @@ gimp_init (Gimp *gimp) gimp->busy = FALSE; gimp->busy_idle_id = 0; - gimp->user_units = NULL; - gimp->n_user_units = 0; + gimp_units_init (gimp); - gimp->images = gimp_list_new (GIMP_TYPE_IMAGE, - GIMP_CONTAINER_POLICY_WEAK); + gimp_parasites_init (gimp); + + gimp->images = gimp_list_new (GIMP_TYPE_IMAGE, + GIMP_CONTAINER_POLICY_WEAK); gtk_object_ref (GTK_OBJECT (gimp->images)); gtk_object_sink (GTK_OBJECT (gimp->images)); - gimp->global_buffer = NULL; - gimp->named_buffers = gimp_list_new (GIMP_TYPE_BUFFER, - GIMP_CONTAINER_POLICY_STRONG); + gimp->next_image_ID = 1; + gimp->next_guide_ID = 1; + gimp->image_table = g_hash_table_new (g_direct_hash, NULL); + + gimp->next_drawable_ID = 1; + gimp->drawable_table = g_hash_table_new (g_direct_hash, NULL); + + gimp->global_buffer = NULL; + gimp->named_buffers = gimp_list_new (GIMP_TYPE_BUFFER, + GIMP_CONTAINER_POLICY_STRONG); gtk_object_ref (GTK_OBJECT (gimp->named_buffers)); gtk_object_sink (GTK_OBJECT (gimp->named_buffers)); - gimp->parasites = NULL; - - gimp->brush_factory = NULL; - gimp->pattern_factory = NULL; - gimp->gradient_factory = NULL; - gimp->palette_factory = NULL; + gimp->brush_factory = NULL; + gimp->pattern_factory = NULL; + gimp->gradient_factory = NULL; + gimp->palette_factory = NULL; procedural_db_init (gimp); - gimp->tool_info_list = gimp_list_new (GIMP_TYPE_TOOL_INFO, - GIMP_CONTAINER_POLICY_STRONG); + gimp->tool_info_list = gimp_list_new (GIMP_TYPE_TOOL_INFO, + GIMP_CONTAINER_POLICY_STRONG); gtk_object_ref (GTK_OBJECT (gimp->tool_info_list)); gtk_object_sink (GTK_OBJECT (gimp->tool_info_list)); @@ -205,8 +213,6 @@ gimp_destroy (GtkObject *object) gimp->palette_factory = NULL; } - gimp_parasites_exit (gimp); - if (gimp->named_buffers) { gtk_object_unref (GTK_OBJECT (gimp->named_buffers)); @@ -219,20 +225,27 @@ gimp_destroy (GtkObject *object) gimp->global_buffer = NULL; } + if (gimp->drawable_table) + { + g_hash_table_destroy (gimp->drawable_table); + gimp->drawable_table = NULL; + } + + if (gimp->image_table) + { + g_hash_table_destroy (gimp->image_table); + gimp->image_table = NULL; + } + if (gimp->images) { gtk_object_unref (GTK_OBJECT (gimp->images)); gimp->images = NULL; } - if (gimp->user_units) - { - g_list_foreach (gimp->user_units, (GFunc) g_free, NULL); - g_list_free (gimp->user_units); + gimp_parasites_exit (gimp); - gimp->user_units = NULL; - gimp->n_user_units = 0; - } + gimp_units_exit (gimp); if (GTK_OBJECT_CLASS (parent_class)->destroy) GTK_OBJECT_CLASS (parent_class)->destroy (object); @@ -289,11 +302,9 @@ gimp_initialize (Gimp *gimp) g_return_if_fail (gimp != NULL); g_return_if_fail (GIMP_IS_GIMP (gimp)); - gimp_parasites_init (gimp); - gimp->brush_factory = gimp_data_factory_new (GIMP_TYPE_BRUSH, - (const gchar **) &core_config->brush_path, + (const gchar **) &gimp->config->brush_path, brush_loader_entries, n_brush_loader_entries, gimp_brush_new, @@ -303,7 +314,7 @@ gimp_initialize (Gimp *gimp) gimp->pattern_factory = gimp_data_factory_new (GIMP_TYPE_PATTERN, - (const gchar **) &core_config->pattern_path, + (const gchar **) &gimp->config->pattern_path, pattern_loader_entries, n_pattern_loader_entries, gimp_pattern_new, @@ -313,7 +324,7 @@ gimp_initialize (Gimp *gimp) gimp->gradient_factory = gimp_data_factory_new (GIMP_TYPE_GRADIENT, - (const gchar **) &core_config->gradient_path, + (const gchar **) &gimp->config->gradient_path, gradient_loader_entries, n_gradient_loader_entries, gimp_gradient_new, @@ -323,7 +334,7 @@ gimp_initialize (Gimp *gimp) gimp->palette_factory = gimp_data_factory_new (GIMP_TYPE_PALETTE, - (const gchar **) &core_config->palette_path, + (const gchar **) &gimp->config->palette_path, palette_loader_entries, n_palette_loader_entries, gimp_palette_new, @@ -463,14 +474,14 @@ gimp_create_image (Gimp *gimp, gimp_container_add (gimp->images, GIMP_OBJECT (gimage)); - if (attach_comment && core_config->default_comment) + if (attach_comment && gimp->config->default_comment) { GimpParasite *parasite; parasite = gimp_parasite_new ("gimp-comment", GIMP_PARASITE_PERSISTENT, - strlen (core_config->default_comment) + 1, - core_config->default_comment); + strlen (gimp->config->default_comment) + 1, + gimp->config->default_comment); gimp_image_parasite_attach (gimage, parasite); gimp_parasite_free (parasite); } diff --git a/app/core/gimp.h b/app/core/gimp.h index 6f2173d51c..60dbe3ef28 100644 --- a/app/core/gimp.h +++ b/app/core/gimp.h @@ -42,6 +42,8 @@ struct _Gimp { GimpObject parent_instance; + GimpCoreConfig *config; + GimpCreateDisplayFunc create_display_func; GimpSetBusyFunc gui_set_busy_func; GimpUnsetBusyFunc gui_unset_busy_func; @@ -52,13 +54,19 @@ struct _Gimp GList *user_units; gint n_user_units; + GimpParasiteList *parasites; + GimpContainer *images; + gint next_image_ID; + guint32 next_guide_ID; + GHashTable *image_table; + + gint next_drawable_ID; + GHashTable *drawable_table; TileManager *global_buffer; GimpContainer *named_buffers; - GimpParasiteList *parasites; - GimpDataFactory *brush_factory; GimpDataFactory *pattern_factory; GimpDataFactory *gradient_factory; diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index a7e741e96f..a8023fbfb5 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -1716,7 +1716,7 @@ gimp_context_brush_list_thaw (GimpContainer *container, GimpBrush *brush; if (! context->brush_name) - context->brush_name = g_strdup (core_config->default_brush); + context->brush_name = g_strdup (context->gimp->config->default_brush); if ((brush = (GimpBrush *) gimp_container_get_child_by_name (container, @@ -1880,7 +1880,7 @@ gimp_context_pattern_list_thaw (GimpContainer *container, GimpPattern *pattern; if (! context->pattern_name) - context->pattern_name = g_strdup (core_config->default_pattern); + context->pattern_name = g_strdup (context->gimp->config->default_pattern); if ((pattern = (GimpPattern *) gimp_container_get_child_by_name (container, @@ -2042,7 +2042,7 @@ gimp_context_gradient_list_thaw (GimpContainer *container, GimpGradient *gradient; if (! context->gradient_name) - context->gradient_name = g_strdup (core_config->default_gradient); + context->gradient_name = g_strdup (context->gimp->config->default_gradient); if ((gradient = (GimpGradient *) gimp_container_get_child_by_name (container, @@ -2189,7 +2189,7 @@ gimp_context_palette_list_thaw (GimpContainer *container, GimpPalette *palette; if (! context->palette_name) - context->palette_name = g_strdup (core_config->default_palette); + context->palette_name = g_strdup (context->gimp->config->default_palette); if ((palette = (GimpPalette *) gimp_container_get_child_by_name (container, @@ -2340,7 +2340,7 @@ gimp_context_buffer_list_thaw (GimpContainer *container, GimpBuffer *buffer; if (! context->buffer_name) - context->buffer_name = g_strdup (core_config->default_buffer); + context->buffer_name = g_strdup (context->gimp->config->default_buffer); if ((buffer = (GimpBuffer *) gimp_container_get_child_by_name (container, diff --git a/app/core/gimpcoreconfig.c b/app/core/gimpcoreconfig.c index eaafc41ae9..b0e7fd043b 100644 --- a/app/core/gimpcoreconfig.c +++ b/app/core/gimpcoreconfig.c @@ -22,38 +22,42 @@ #include "core-types.h" +#include "gimp.h" #include "gimpcoreconfig.h" -static GimpCoreConfig static_core_config = +void +gimp_core_config_init (Gimp *gimp) { - /* plug_in_path */ NULL, - /* module_path */ NULL, + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); - /* brush_path */ NULL, - /* pattern_path */ NULL, - /* palette_path */ NULL, - /* gradient_path */ NULL, + gimp->config = g_new0 (GimpCoreConfig, 1); - /* default_brush */ NULL, - /* default_pattern */ NULL, - /* default_palette */ NULL, - /* default_gradient */ NULL, + gimp->config->plug_in_path = NULL; + gimp->config->module_path = NULL; - /* default_comment */ NULL, - /* default_type */ RGB, - /* default_width */ 256, - /* default_height */ 256, - /* default_units */ GIMP_UNIT_INCH, - /* default_xresolution */ 72.0, - /* default_yresolution */ 72.0, - /* default_resolution_units */ GIMP_UNIT_INCH, + gimp->config->brush_path = NULL; + gimp->config->pattern_path = NULL; + gimp->config->palette_path = NULL; + gimp->config->gradient_path = NULL; - /* levels_of_undo */ 5, - /* pluginrc_path */ NULL, - /* module_db_load_inhibit */ NULL, - /* thumbnail_mode */ 1 -}; + gimp->config->default_brush = NULL; + gimp->config->default_pattern = NULL; + gimp->config->default_palette = NULL; + gimp->config->default_gradient = NULL; + gimp->config->default_comment = NULL; + gimp->config->default_type = RGB; + gimp->config->default_width = 256; + gimp->config->default_height = 256; + gimp->config->default_units = GIMP_UNIT_INCH; + gimp->config->default_xresolution = 72.0; + gimp->config->default_yresolution = 72.0; + gimp->config->default_resolution_units = GIMP_UNIT_INCH; -GimpCoreConfig *core_config = &static_core_config; + gimp->config->levels_of_undo = 5; + gimp->config->pluginrc_path = NULL; + gimp->config->module_db_load_inhibit = NULL; + gimp->config->thumbnail_mode = 1; +} diff --git a/app/core/gimpcoreconfig.h b/app/core/gimpcoreconfig.h index c50060a9a7..cc66a7cea1 100644 --- a/app/core/gimpcoreconfig.h +++ b/app/core/gimpcoreconfig.h @@ -20,8 +20,6 @@ #define __GIMP_CORE_CONFIG_H__ -typedef struct _GimpCoreConfig GimpCoreConfig; - struct _GimpCoreConfig { gchar *plug_in_path; @@ -53,7 +51,7 @@ struct _GimpCoreConfig }; -extern GimpCoreConfig *core_config; +void gimp_core_config_init (Gimp *gimp); #endif /* __GIMP_CORE_CONFIG_H__ */ diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 2d92adad7f..7ad33a4190 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -36,6 +36,7 @@ #include "paint-funcs/paint-funcs.h" +#include "gimp.h" #include "gimpchannel.h" #include "gimpcontext.h" #include "gimpdrawable.h" @@ -61,6 +62,8 @@ enum }; +/* local function prototypes */ + static void gimp_drawable_class_init (GimpDrawableClass *klass); static void gimp_drawable_init (GimpDrawable *drawable); static void gimp_drawable_destroy (GtkObject *object); @@ -74,9 +77,6 @@ static guint gimp_drawable_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_drawable_ID = 1; -static GHashTable *gimp_drawable_table = NULL; - GtkType gimp_drawable_get_type (void) @@ -158,7 +158,7 @@ gimp_drawable_init (GimpDrawable *drawable) drawable->offset_x = 0; drawable->offset_y = 0; drawable->bytes = 0; - drawable->ID = global_drawable_ID++; + drawable->ID = 0; drawable->tattoo = 0; drawable->gimage = NULL; drawable->type = -1; @@ -168,13 +168,6 @@ gimp_drawable_init (GimpDrawable *drawable) drawable->parasites = gimp_parasite_list_new (); drawable->preview_cache = NULL; drawable->preview_valid = FALSE; - - if (gimp_drawable_table == NULL) - gimp_drawable_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_drawable_table, - GINT_TO_POINTER (drawable->ID), - (gpointer) drawable); } static void @@ -186,7 +179,8 @@ gimp_drawable_destroy (GtkObject *object) drawable = GIMP_DRAWABLE (object); - g_hash_table_remove (gimp_drawable_table, GINT_TO_POINTER (drawable->ID)); + g_hash_table_remove (drawable->gimage->gimp->drawable_table, + GINT_TO_POINTER (drawable->ID)); if (drawable->tiles) tile_manager_destroy (drawable->tiles); @@ -329,6 +323,13 @@ gimp_drawable_configure (GimpDrawable *drawable, gboolean alpha; g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + + drawable->ID = gimage->gimp->next_drawable_ID++; + + g_hash_table_insert (gimage->gimp->drawable_table, + GINT_TO_POINTER (drawable->ID), + (gpointer) drawable); if (!name) name = _("unnamed"); @@ -367,8 +368,7 @@ gimp_drawable_configure (GimpDrawable *drawable, drawable->visible = TRUE; - if (gimage) - gimp_drawable_set_gimage (drawable, gimage); + gimp_drawable_set_gimage (drawable, gimage); gimp_object_set_name (GIMP_OBJECT (drawable), name); @@ -387,12 +387,16 @@ gimp_drawable_get_ID (GimpDrawable *drawable) } GimpDrawable * -gimp_drawable_get_by_ID (gint drawable_id) +gimp_drawable_get_by_ID (Gimp *gimp, + gint drawable_id) { - if (gimp_drawable_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->drawable_table == NULL) return NULL; - return (GimpDrawable *) g_hash_table_lookup (gimp_drawable_table, + return (GimpDrawable *) g_hash_table_lookup (gimp->drawable_table, GINT_TO_POINTER (drawable_id)); } diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 47ce0cd229..89404dbf24 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -76,7 +76,8 @@ void gimp_drawable_configure (GimpDrawable *drawable, const gchar *name); gint gimp_drawable_get_ID (GimpDrawable *drawable); -GimpDrawable * gimp_drawable_get_by_ID (gint id); +GimpDrawable * gimp_drawable_get_by_ID (Gimp *gimp, + gint id); GimpImage * gimp_drawable_gimage (const GimpDrawable *drawable); void gimp_drawable_set_gimage (GimpDrawable *drawable, diff --git a/app/core/gimpimage-crop.c b/app/core/gimpimage-crop.c index b3ac5535c3..b302f551b6 100644 --- a/app/core/gimpimage-crop.c +++ b/app/core/gimpimage-crop.c @@ -26,6 +26,7 @@ #include "base/pixel-region.h" +#include "gimp.h" #include "gimpchannel.h" #include "gimpdrawable.h" #include "gimpimage.h" @@ -34,7 +35,6 @@ #include "gimplayer.h" #include "gimplist.h" -#include "app_procs.h" #include "floating_sel.h" #include "undo.h" @@ -110,7 +110,7 @@ gimp_image_crop (GimpImage *gimage, /* Make sure new width and height are non-zero */ if (width && height) { - gimp_set_busy (); + gimp_set_busy (gimage->gimp); if (active_layer_only) { @@ -224,7 +224,7 @@ gimp_image_crop (GimpImage *gimage, gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); - gimp_unset_busy (); + gimp_unset_busy (gimage->gimp); } } @@ -260,7 +260,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage, g_return_val_if_fail (shrunk_x2 != NULL, FALSE); g_return_val_if_fail (shrunk_y2 != NULL, FALSE); - gimp_set_busy (); + gimp_set_busy (gimage->gimp); /* You should always keep in mind that crop->tx2 and crop->ty2 are the NOT the coordinates of the bottomright corner of the area to be cropped. They point @@ -372,7 +372,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage, FINISH: g_free (buffer); - gimp_unset_busy (); + gimp_unset_busy (gimage->gimp); return retval; } diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 0dc3639d18..c66d7c5dcc 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -107,6 +107,11 @@ static void gimp_image_initialize_projection (GimpImage *gimage, static void gimp_image_get_active_channels (GimpImage *gimage, GimpDrawable *drawable, gint *active); +static void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); /* projection functions */ static void project_intensity (GimpImage *gimage, @@ -136,7 +141,7 @@ static void project_channel (GimpImage *gimage, /* * Global variables */ -gint valid_combinations[][MAX_CHANNELS + 1] = +static gint valid_combinations[][MAX_CHANNELS + 1] = { /* RGB GIMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, @@ -176,15 +181,11 @@ enum LAST_SIGNAL }; + static guint gimp_image_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_image_ID = 1; -static GHashTable *gimp_image_table = NULL; - -static guint32 next_guide_id = 1; - GtkType gimp_image_get_type (void) @@ -386,15 +387,15 @@ gimp_image_class_init (GimpImageClass *klass) static void gimp_image_init (GimpImage *gimage) { - gimage->ID = global_image_ID++; + gimage->ID = 0; gimage->save_proc = NULL; gimage->width = 0; gimage->height = 0; - gimage->xresolution = core_config->default_xresolution; - gimage->yresolution = core_config->default_yresolution; - gimage->unit = core_config->default_units; + gimage->xresolution = 1.0; + gimage->yresolution = 1.0; + gimage->unit = GIMP_UNIT_INCH; gimage->base_type = RGB; gimage->cmap = NULL; @@ -450,13 +451,6 @@ gimp_image_init (GimpImage *gimage) gimage->comp_preview = NULL; gimage->comp_preview_valid = FALSE; - - if (gimp_image_table == NULL) - gimp_image_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_image_table, - GINT_TO_POINTER (gimage->ID), - (gpointer) gimage); } static void @@ -466,7 +460,8 @@ gimp_image_destroy (GtkObject *object) gimage = GIMP_IMAGE (object); - g_hash_table_remove (gimp_image_table, GINT_TO_POINTER (gimage->ID)); + g_hash_table_remove (gimage->gimp->image_table, + GINT_TO_POINTER (gimage->ID)); gimp_image_free_projection (gimage); gimp_image_free_shadow (gimage); @@ -617,10 +612,20 @@ gimp_image_new (Gimp *gimp, gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE)); - gimage->gimp = gimp; - gimage->width = width; - gimage->height = height; - gimage->base_type = base_type; + gimage->gimp = gimp; + gimage->ID = gimp->next_image_ID++; + + g_hash_table_insert (gimp->image_table, + GINT_TO_POINTER (gimage->ID), + (gpointer) gimage); + + gimage->width = width; + gimage->height = height; + gimage->base_type = base_type; + + gimage->xresolution = gimp->config->default_xresolution; + gimage->yresolution = gimp->config->default_yresolution; + gimage->unit = gimp->config->default_units; switch (base_type) { @@ -662,12 +667,16 @@ gimp_image_get_ID (GimpImage *gimage) } GimpImage * -gimp_image_get_by_ID (gint image_id) +gimp_image_get_by_ID (Gimp *gimp, + gint image_id) { - if (gimp_image_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->image_table == NULL) return NULL; - return (GimpImage *) g_hash_table_lookup (gimp_image_table, + return (GimpImage *) g_hash_table_lookup (gimp->image_table, GINT_TO_POINTER (image_id)); } @@ -1446,7 +1455,7 @@ gimp_image_add_hguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_HORIZONTAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1465,7 +1474,7 @@ gimp_image_add_vguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_VERTICAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1493,7 +1502,7 @@ gimp_image_remove_guide (GimpImage *gimage, void gimp_image_delete_guide (GimpImage *gimage, - GimpGuide *guide) + GimpGuide *guide) { guide->position = -1; @@ -2125,7 +2134,7 @@ gimp_image_get_active_channels (GimpImage *gimage, } } -void +static void gimp_image_construct (GimpImage *gimage, gint x, gint y, diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index 3c6c5fa3cf..d2ffb3a2b0 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -175,7 +175,8 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); gint gimp_image_get_ID (GimpImage *gimage); -GimpImage * gimp_image_get_by_ID (gint id); +GimpImage * gimp_image_get_by_ID (Gimp *gimp, + gint id); void gimp_image_set_filename (GimpImage *gimage, const gchar *filename); @@ -372,11 +373,6 @@ gboolean gimp_image_add_channel (GimpImage *gimage, gint position); void gimp_image_remove_channel (GimpImage *gimage, GimpChannel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 0dc3639d18..c66d7c5dcc 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -107,6 +107,11 @@ static void gimp_image_initialize_projection (GimpImage *gimage, static void gimp_image_get_active_channels (GimpImage *gimage, GimpDrawable *drawable, gint *active); +static void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); /* projection functions */ static void project_intensity (GimpImage *gimage, @@ -136,7 +141,7 @@ static void project_channel (GimpImage *gimage, /* * Global variables */ -gint valid_combinations[][MAX_CHANNELS + 1] = +static gint valid_combinations[][MAX_CHANNELS + 1] = { /* RGB GIMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, @@ -176,15 +181,11 @@ enum LAST_SIGNAL }; + static guint gimp_image_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_image_ID = 1; -static GHashTable *gimp_image_table = NULL; - -static guint32 next_guide_id = 1; - GtkType gimp_image_get_type (void) @@ -386,15 +387,15 @@ gimp_image_class_init (GimpImageClass *klass) static void gimp_image_init (GimpImage *gimage) { - gimage->ID = global_image_ID++; + gimage->ID = 0; gimage->save_proc = NULL; gimage->width = 0; gimage->height = 0; - gimage->xresolution = core_config->default_xresolution; - gimage->yresolution = core_config->default_yresolution; - gimage->unit = core_config->default_units; + gimage->xresolution = 1.0; + gimage->yresolution = 1.0; + gimage->unit = GIMP_UNIT_INCH; gimage->base_type = RGB; gimage->cmap = NULL; @@ -450,13 +451,6 @@ gimp_image_init (GimpImage *gimage) gimage->comp_preview = NULL; gimage->comp_preview_valid = FALSE; - - if (gimp_image_table == NULL) - gimp_image_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_image_table, - GINT_TO_POINTER (gimage->ID), - (gpointer) gimage); } static void @@ -466,7 +460,8 @@ gimp_image_destroy (GtkObject *object) gimage = GIMP_IMAGE (object); - g_hash_table_remove (gimp_image_table, GINT_TO_POINTER (gimage->ID)); + g_hash_table_remove (gimage->gimp->image_table, + GINT_TO_POINTER (gimage->ID)); gimp_image_free_projection (gimage); gimp_image_free_shadow (gimage); @@ -617,10 +612,20 @@ gimp_image_new (Gimp *gimp, gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE)); - gimage->gimp = gimp; - gimage->width = width; - gimage->height = height; - gimage->base_type = base_type; + gimage->gimp = gimp; + gimage->ID = gimp->next_image_ID++; + + g_hash_table_insert (gimp->image_table, + GINT_TO_POINTER (gimage->ID), + (gpointer) gimage); + + gimage->width = width; + gimage->height = height; + gimage->base_type = base_type; + + gimage->xresolution = gimp->config->default_xresolution; + gimage->yresolution = gimp->config->default_yresolution; + gimage->unit = gimp->config->default_units; switch (base_type) { @@ -662,12 +667,16 @@ gimp_image_get_ID (GimpImage *gimage) } GimpImage * -gimp_image_get_by_ID (gint image_id) +gimp_image_get_by_ID (Gimp *gimp, + gint image_id) { - if (gimp_image_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->image_table == NULL) return NULL; - return (GimpImage *) g_hash_table_lookup (gimp_image_table, + return (GimpImage *) g_hash_table_lookup (gimp->image_table, GINT_TO_POINTER (image_id)); } @@ -1446,7 +1455,7 @@ gimp_image_add_hguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_HORIZONTAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1465,7 +1474,7 @@ gimp_image_add_vguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_VERTICAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1493,7 +1502,7 @@ gimp_image_remove_guide (GimpImage *gimage, void gimp_image_delete_guide (GimpImage *gimage, - GimpGuide *guide) + GimpGuide *guide) { guide->position = -1; @@ -2125,7 +2134,7 @@ gimp_image_get_active_channels (GimpImage *gimage, } } -void +static void gimp_image_construct (GimpImage *gimage, gint x, gint y, diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index 3c6c5fa3cf..d2ffb3a2b0 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -175,7 +175,8 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); gint gimp_image_get_ID (GimpImage *gimage); -GimpImage * gimp_image_get_by_ID (gint id); +GimpImage * gimp_image_get_by_ID (Gimp *gimp, + gint id); void gimp_image_set_filename (GimpImage *gimage, const gchar *filename); @@ -372,11 +373,6 @@ gboolean gimp_image_add_channel (GimpImage *gimage, gint position); void gimp_image_remove_channel (GimpImage *gimage, GimpChannel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-new.c b/app/core/gimpimage-new.c index 712697617c..f322586bba 100644 --- a/app/core/gimpimage-new.c +++ b/app/core/gimpimage-new.c @@ -88,13 +88,13 @@ gimp_image_new_init (Gimp *gimp) /* Set the last values used to default values. */ - gimp->image_new_last_values.width = core_config->default_width; - gimp->image_new_last_values.height = core_config->default_height; - gimp->image_new_last_values.unit = core_config->default_units; - gimp->image_new_last_values.xresolution = core_config->default_xresolution; - gimp->image_new_last_values.yresolution = core_config->default_yresolution; - gimp->image_new_last_values.res_unit = core_config->default_resolution_units; - gimp->image_new_last_values.type = core_config->default_type; + gimp->image_new_last_values.width = gimp->config->default_width; + gimp->image_new_last_values.height = gimp->config->default_height; + gimp->image_new_last_values.unit = gimp->config->default_units; + gimp->image_new_last_values.xresolution = gimp->config->default_xresolution; + gimp->image_new_last_values.yresolution = gimp->config->default_yresolution; + gimp->image_new_last_values.res_unit = gimp->config->default_resolution_units; + gimp->image_new_last_values.type = gimp->config->default_type; gimp->image_new_last_values.fill_type = BACKGROUND_FILL; gimp->have_current_cut_buffer = FALSE; diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 0dc3639d18..c66d7c5dcc 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -107,6 +107,11 @@ static void gimp_image_initialize_projection (GimpImage *gimage, static void gimp_image_get_active_channels (GimpImage *gimage, GimpDrawable *drawable, gint *active); +static void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); /* projection functions */ static void project_intensity (GimpImage *gimage, @@ -136,7 +141,7 @@ static void project_channel (GimpImage *gimage, /* * Global variables */ -gint valid_combinations[][MAX_CHANNELS + 1] = +static gint valid_combinations[][MAX_CHANNELS + 1] = { /* RGB GIMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, @@ -176,15 +181,11 @@ enum LAST_SIGNAL }; + static guint gimp_image_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_image_ID = 1; -static GHashTable *gimp_image_table = NULL; - -static guint32 next_guide_id = 1; - GtkType gimp_image_get_type (void) @@ -386,15 +387,15 @@ gimp_image_class_init (GimpImageClass *klass) static void gimp_image_init (GimpImage *gimage) { - gimage->ID = global_image_ID++; + gimage->ID = 0; gimage->save_proc = NULL; gimage->width = 0; gimage->height = 0; - gimage->xresolution = core_config->default_xresolution; - gimage->yresolution = core_config->default_yresolution; - gimage->unit = core_config->default_units; + gimage->xresolution = 1.0; + gimage->yresolution = 1.0; + gimage->unit = GIMP_UNIT_INCH; gimage->base_type = RGB; gimage->cmap = NULL; @@ -450,13 +451,6 @@ gimp_image_init (GimpImage *gimage) gimage->comp_preview = NULL; gimage->comp_preview_valid = FALSE; - - if (gimp_image_table == NULL) - gimp_image_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_image_table, - GINT_TO_POINTER (gimage->ID), - (gpointer) gimage); } static void @@ -466,7 +460,8 @@ gimp_image_destroy (GtkObject *object) gimage = GIMP_IMAGE (object); - g_hash_table_remove (gimp_image_table, GINT_TO_POINTER (gimage->ID)); + g_hash_table_remove (gimage->gimp->image_table, + GINT_TO_POINTER (gimage->ID)); gimp_image_free_projection (gimage); gimp_image_free_shadow (gimage); @@ -617,10 +612,20 @@ gimp_image_new (Gimp *gimp, gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE)); - gimage->gimp = gimp; - gimage->width = width; - gimage->height = height; - gimage->base_type = base_type; + gimage->gimp = gimp; + gimage->ID = gimp->next_image_ID++; + + g_hash_table_insert (gimp->image_table, + GINT_TO_POINTER (gimage->ID), + (gpointer) gimage); + + gimage->width = width; + gimage->height = height; + gimage->base_type = base_type; + + gimage->xresolution = gimp->config->default_xresolution; + gimage->yresolution = gimp->config->default_yresolution; + gimage->unit = gimp->config->default_units; switch (base_type) { @@ -662,12 +667,16 @@ gimp_image_get_ID (GimpImage *gimage) } GimpImage * -gimp_image_get_by_ID (gint image_id) +gimp_image_get_by_ID (Gimp *gimp, + gint image_id) { - if (gimp_image_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->image_table == NULL) return NULL; - return (GimpImage *) g_hash_table_lookup (gimp_image_table, + return (GimpImage *) g_hash_table_lookup (gimp->image_table, GINT_TO_POINTER (image_id)); } @@ -1446,7 +1455,7 @@ gimp_image_add_hguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_HORIZONTAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1465,7 +1474,7 @@ gimp_image_add_vguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_VERTICAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1493,7 +1502,7 @@ gimp_image_remove_guide (GimpImage *gimage, void gimp_image_delete_guide (GimpImage *gimage, - GimpGuide *guide) + GimpGuide *guide) { guide->position = -1; @@ -2125,7 +2134,7 @@ gimp_image_get_active_channels (GimpImage *gimage, } } -void +static void gimp_image_construct (GimpImage *gimage, gint x, gint y, diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index 3c6c5fa3cf..d2ffb3a2b0 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -175,7 +175,8 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); gint gimp_image_get_ID (GimpImage *gimage); -GimpImage * gimp_image_get_by_ID (gint id); +GimpImage * gimp_image_get_by_ID (Gimp *gimp, + gint id); void gimp_image_set_filename (GimpImage *gimage, const gchar *filename); @@ -372,11 +373,6 @@ gboolean gimp_image_add_channel (GimpImage *gimage, gint position); void gimp_image_remove_channel (GimpImage *gimage, GimpChannel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 0dc3639d18..c66d7c5dcc 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -107,6 +107,11 @@ static void gimp_image_initialize_projection (GimpImage *gimage, static void gimp_image_get_active_channels (GimpImage *gimage, GimpDrawable *drawable, gint *active); +static void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); /* projection functions */ static void project_intensity (GimpImage *gimage, @@ -136,7 +141,7 @@ static void project_channel (GimpImage *gimage, /* * Global variables */ -gint valid_combinations[][MAX_CHANNELS + 1] = +static gint valid_combinations[][MAX_CHANNELS + 1] = { /* RGB GIMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, @@ -176,15 +181,11 @@ enum LAST_SIGNAL }; + static guint gimp_image_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_image_ID = 1; -static GHashTable *gimp_image_table = NULL; - -static guint32 next_guide_id = 1; - GtkType gimp_image_get_type (void) @@ -386,15 +387,15 @@ gimp_image_class_init (GimpImageClass *klass) static void gimp_image_init (GimpImage *gimage) { - gimage->ID = global_image_ID++; + gimage->ID = 0; gimage->save_proc = NULL; gimage->width = 0; gimage->height = 0; - gimage->xresolution = core_config->default_xresolution; - gimage->yresolution = core_config->default_yresolution; - gimage->unit = core_config->default_units; + gimage->xresolution = 1.0; + gimage->yresolution = 1.0; + gimage->unit = GIMP_UNIT_INCH; gimage->base_type = RGB; gimage->cmap = NULL; @@ -450,13 +451,6 @@ gimp_image_init (GimpImage *gimage) gimage->comp_preview = NULL; gimage->comp_preview_valid = FALSE; - - if (gimp_image_table == NULL) - gimp_image_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_image_table, - GINT_TO_POINTER (gimage->ID), - (gpointer) gimage); } static void @@ -466,7 +460,8 @@ gimp_image_destroy (GtkObject *object) gimage = GIMP_IMAGE (object); - g_hash_table_remove (gimp_image_table, GINT_TO_POINTER (gimage->ID)); + g_hash_table_remove (gimage->gimp->image_table, + GINT_TO_POINTER (gimage->ID)); gimp_image_free_projection (gimage); gimp_image_free_shadow (gimage); @@ -617,10 +612,20 @@ gimp_image_new (Gimp *gimp, gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE)); - gimage->gimp = gimp; - gimage->width = width; - gimage->height = height; - gimage->base_type = base_type; + gimage->gimp = gimp; + gimage->ID = gimp->next_image_ID++; + + g_hash_table_insert (gimp->image_table, + GINT_TO_POINTER (gimage->ID), + (gpointer) gimage); + + gimage->width = width; + gimage->height = height; + gimage->base_type = base_type; + + gimage->xresolution = gimp->config->default_xresolution; + gimage->yresolution = gimp->config->default_yresolution; + gimage->unit = gimp->config->default_units; switch (base_type) { @@ -662,12 +667,16 @@ gimp_image_get_ID (GimpImage *gimage) } GimpImage * -gimp_image_get_by_ID (gint image_id) +gimp_image_get_by_ID (Gimp *gimp, + gint image_id) { - if (gimp_image_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->image_table == NULL) return NULL; - return (GimpImage *) g_hash_table_lookup (gimp_image_table, + return (GimpImage *) g_hash_table_lookup (gimp->image_table, GINT_TO_POINTER (image_id)); } @@ -1446,7 +1455,7 @@ gimp_image_add_hguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_HORIZONTAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1465,7 +1474,7 @@ gimp_image_add_vguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_VERTICAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1493,7 +1502,7 @@ gimp_image_remove_guide (GimpImage *gimage, void gimp_image_delete_guide (GimpImage *gimage, - GimpGuide *guide) + GimpGuide *guide) { guide->position = -1; @@ -2125,7 +2134,7 @@ gimp_image_get_active_channels (GimpImage *gimage, } } -void +static void gimp_image_construct (GimpImage *gimage, gint x, gint y, diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index 3c6c5fa3cf..d2ffb3a2b0 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -175,7 +175,8 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); gint gimp_image_get_ID (GimpImage *gimage); -GimpImage * gimp_image_get_by_ID (gint id); +GimpImage * gimp_image_get_by_ID (Gimp *gimp, + gint id); void gimp_image_set_filename (GimpImage *gimage, const gchar *filename); @@ -372,11 +373,6 @@ gboolean gimp_image_add_channel (GimpImage *gimage, gint position); void gimp_image_remove_channel (GimpImage *gimage, GimpChannel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 0dc3639d18..c66d7c5dcc 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -107,6 +107,11 @@ static void gimp_image_initialize_projection (GimpImage *gimage, static void gimp_image_get_active_channels (GimpImage *gimage, GimpDrawable *drawable, gint *active); +static void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); /* projection functions */ static void project_intensity (GimpImage *gimage, @@ -136,7 +141,7 @@ static void project_channel (GimpImage *gimage, /* * Global variables */ -gint valid_combinations[][MAX_CHANNELS + 1] = +static gint valid_combinations[][MAX_CHANNELS + 1] = { /* RGB GIMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, @@ -176,15 +181,11 @@ enum LAST_SIGNAL }; + static guint gimp_image_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_image_ID = 1; -static GHashTable *gimp_image_table = NULL; - -static guint32 next_guide_id = 1; - GtkType gimp_image_get_type (void) @@ -386,15 +387,15 @@ gimp_image_class_init (GimpImageClass *klass) static void gimp_image_init (GimpImage *gimage) { - gimage->ID = global_image_ID++; + gimage->ID = 0; gimage->save_proc = NULL; gimage->width = 0; gimage->height = 0; - gimage->xresolution = core_config->default_xresolution; - gimage->yresolution = core_config->default_yresolution; - gimage->unit = core_config->default_units; + gimage->xresolution = 1.0; + gimage->yresolution = 1.0; + gimage->unit = GIMP_UNIT_INCH; gimage->base_type = RGB; gimage->cmap = NULL; @@ -450,13 +451,6 @@ gimp_image_init (GimpImage *gimage) gimage->comp_preview = NULL; gimage->comp_preview_valid = FALSE; - - if (gimp_image_table == NULL) - gimp_image_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_image_table, - GINT_TO_POINTER (gimage->ID), - (gpointer) gimage); } static void @@ -466,7 +460,8 @@ gimp_image_destroy (GtkObject *object) gimage = GIMP_IMAGE (object); - g_hash_table_remove (gimp_image_table, GINT_TO_POINTER (gimage->ID)); + g_hash_table_remove (gimage->gimp->image_table, + GINT_TO_POINTER (gimage->ID)); gimp_image_free_projection (gimage); gimp_image_free_shadow (gimage); @@ -617,10 +612,20 @@ gimp_image_new (Gimp *gimp, gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE)); - gimage->gimp = gimp; - gimage->width = width; - gimage->height = height; - gimage->base_type = base_type; + gimage->gimp = gimp; + gimage->ID = gimp->next_image_ID++; + + g_hash_table_insert (gimp->image_table, + GINT_TO_POINTER (gimage->ID), + (gpointer) gimage); + + gimage->width = width; + gimage->height = height; + gimage->base_type = base_type; + + gimage->xresolution = gimp->config->default_xresolution; + gimage->yresolution = gimp->config->default_yresolution; + gimage->unit = gimp->config->default_units; switch (base_type) { @@ -662,12 +667,16 @@ gimp_image_get_ID (GimpImage *gimage) } GimpImage * -gimp_image_get_by_ID (gint image_id) +gimp_image_get_by_ID (Gimp *gimp, + gint image_id) { - if (gimp_image_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->image_table == NULL) return NULL; - return (GimpImage *) g_hash_table_lookup (gimp_image_table, + return (GimpImage *) g_hash_table_lookup (gimp->image_table, GINT_TO_POINTER (image_id)); } @@ -1446,7 +1455,7 @@ gimp_image_add_hguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_HORIZONTAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1465,7 +1474,7 @@ gimp_image_add_vguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_VERTICAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1493,7 +1502,7 @@ gimp_image_remove_guide (GimpImage *gimage, void gimp_image_delete_guide (GimpImage *gimage, - GimpGuide *guide) + GimpGuide *guide) { guide->position = -1; @@ -2125,7 +2134,7 @@ gimp_image_get_active_channels (GimpImage *gimage, } } -void +static void gimp_image_construct (GimpImage *gimage, gint x, gint y, diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index 3c6c5fa3cf..d2ffb3a2b0 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -175,7 +175,8 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); gint gimp_image_get_ID (GimpImage *gimage); -GimpImage * gimp_image_get_by_ID (gint id); +GimpImage * gimp_image_get_by_ID (Gimp *gimp, + gint id); void gimp_image_set_filename (GimpImage *gimage, const gchar *filename); @@ -372,11 +373,6 @@ gboolean gimp_image_add_channel (GimpImage *gimage, gint position); void gimp_image_remove_channel (GimpImage *gimage, GimpChannel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index d4c28bdc0e..6701b883d5 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -34,6 +34,7 @@ #include "paint-funcs/paint-funcs.h" +#include "core/gimp.h" #include "core/gimpchannel.h" #include "core/gimpcontainer.h" #include "core/gimpcoreconfig.h" @@ -313,13 +314,13 @@ static gboolean undo_free_up_space (GimpImage *gimage) { /* If there are 0 levels of undo return FALSE. */ - if (core_config->levels_of_undo == 0) + if (gimage->gimp->config->levels_of_undo == 0) return FALSE; /* Delete the item on the bottom of the stack if we have the maximum * levels of undo already */ - while (gimage->undo_levels >= core_config->levels_of_undo) + while (gimage->undo_levels >= gimage->gimp->config->levels_of_undo) gimage->undo_stack = remove_stack_bottom (gimage); return TRUE; @@ -1180,7 +1181,7 @@ undo_pop_layer_displace (GimpImage *gimage, LayerDisplaceUndo *ldu; ldu = (LayerDisplaceUndo *) info_ptr; - layer = (GimpLayer *) gimp_drawable_get_by_ID (ldu->info[0]); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimage->gimp, ldu->info[0]); if (layer) { old_offsets[0] = GIMP_DRAWABLE (layer)->offset_x; @@ -2103,7 +2104,7 @@ undo_pop_fs_rigor (GimpImage *gimage, layer_ID = *((gint32 *) layer_ptr); - if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (layer_ID)) == NULL) + if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (gimage->gimp, layer_ID)) == NULL) return FALSE; if (! gimp_layer_is_floating_sel (floating_layer)) @@ -2184,7 +2185,7 @@ undo_pop_fs_relax (GimpImage *gimage, layer_ID = *((gint32 *) layer_ptr); - if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (layer_ID)) == NULL) + if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (gimage->gimp, layer_ID)) == NULL) return FALSE; if (! gimp_layer_is_floating_sel (floating_layer)) diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 0dc3639d18..c66d7c5dcc 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -107,6 +107,11 @@ static void gimp_image_initialize_projection (GimpImage *gimage, static void gimp_image_get_active_channels (GimpImage *gimage, GimpDrawable *drawable, gint *active); +static void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); /* projection functions */ static void project_intensity (GimpImage *gimage, @@ -136,7 +141,7 @@ static void project_channel (GimpImage *gimage, /* * Global variables */ -gint valid_combinations[][MAX_CHANNELS + 1] = +static gint valid_combinations[][MAX_CHANNELS + 1] = { /* RGB GIMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, @@ -176,15 +181,11 @@ enum LAST_SIGNAL }; + static guint gimp_image_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_image_ID = 1; -static GHashTable *gimp_image_table = NULL; - -static guint32 next_guide_id = 1; - GtkType gimp_image_get_type (void) @@ -386,15 +387,15 @@ gimp_image_class_init (GimpImageClass *klass) static void gimp_image_init (GimpImage *gimage) { - gimage->ID = global_image_ID++; + gimage->ID = 0; gimage->save_proc = NULL; gimage->width = 0; gimage->height = 0; - gimage->xresolution = core_config->default_xresolution; - gimage->yresolution = core_config->default_yresolution; - gimage->unit = core_config->default_units; + gimage->xresolution = 1.0; + gimage->yresolution = 1.0; + gimage->unit = GIMP_UNIT_INCH; gimage->base_type = RGB; gimage->cmap = NULL; @@ -450,13 +451,6 @@ gimp_image_init (GimpImage *gimage) gimage->comp_preview = NULL; gimage->comp_preview_valid = FALSE; - - if (gimp_image_table == NULL) - gimp_image_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_image_table, - GINT_TO_POINTER (gimage->ID), - (gpointer) gimage); } static void @@ -466,7 +460,8 @@ gimp_image_destroy (GtkObject *object) gimage = GIMP_IMAGE (object); - g_hash_table_remove (gimp_image_table, GINT_TO_POINTER (gimage->ID)); + g_hash_table_remove (gimage->gimp->image_table, + GINT_TO_POINTER (gimage->ID)); gimp_image_free_projection (gimage); gimp_image_free_shadow (gimage); @@ -617,10 +612,20 @@ gimp_image_new (Gimp *gimp, gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE)); - gimage->gimp = gimp; - gimage->width = width; - gimage->height = height; - gimage->base_type = base_type; + gimage->gimp = gimp; + gimage->ID = gimp->next_image_ID++; + + g_hash_table_insert (gimp->image_table, + GINT_TO_POINTER (gimage->ID), + (gpointer) gimage); + + gimage->width = width; + gimage->height = height; + gimage->base_type = base_type; + + gimage->xresolution = gimp->config->default_xresolution; + gimage->yresolution = gimp->config->default_yresolution; + gimage->unit = gimp->config->default_units; switch (base_type) { @@ -662,12 +667,16 @@ gimp_image_get_ID (GimpImage *gimage) } GimpImage * -gimp_image_get_by_ID (gint image_id) +gimp_image_get_by_ID (Gimp *gimp, + gint image_id) { - if (gimp_image_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->image_table == NULL) return NULL; - return (GimpImage *) g_hash_table_lookup (gimp_image_table, + return (GimpImage *) g_hash_table_lookup (gimp->image_table, GINT_TO_POINTER (image_id)); } @@ -1446,7 +1455,7 @@ gimp_image_add_hguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_HORIZONTAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1465,7 +1474,7 @@ gimp_image_add_vguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_VERTICAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1493,7 +1502,7 @@ gimp_image_remove_guide (GimpImage *gimage, void gimp_image_delete_guide (GimpImage *gimage, - GimpGuide *guide) + GimpGuide *guide) { guide->position = -1; @@ -2125,7 +2134,7 @@ gimp_image_get_active_channels (GimpImage *gimage, } } -void +static void gimp_image_construct (GimpImage *gimage, gint x, gint y, diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 3c6c5fa3cf..d2ffb3a2b0 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -175,7 +175,8 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); gint gimp_image_get_ID (GimpImage *gimage); -GimpImage * gimp_image_get_by_ID (gint id); +GimpImage * gimp_image_get_by_ID (Gimp *gimp, + gint id); void gimp_image_set_filename (GimpImage *gimage, const gchar *filename); @@ -372,11 +373,6 @@ gboolean gimp_image_add_channel (GimpImage *gimage, gint position); void gimp_image_remove_channel (GimpImage *gimage, GimpChannel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpparasite.c b/app/core/gimpparasite.c index f981c539d6..e34d61fbfa 100644 --- a/app/core/gimpparasite.c +++ b/app/core/gimpparasite.c @@ -35,9 +35,11 @@ #include "gimprc.h" -void +void gimp_parasites_init (Gimp *gimp) { + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); g_return_if_fail (gimp->parasites == NULL); gimp->parasites = gimp_parasite_list_new (); @@ -49,6 +51,9 @@ gimp_parasites_init (Gimp *gimp) void gimp_parasites_exit (Gimp *gimp) { + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); + if (gimp->parasites) { gtk_object_unref (GTK_OBJECT (gimp->parasites)); diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 0dc3639d18..c66d7c5dcc 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -107,6 +107,11 @@ static void gimp_image_initialize_projection (GimpImage *gimage, static void gimp_image_get_active_channels (GimpImage *gimage, GimpDrawable *drawable, gint *active); +static void gimp_image_construct (GimpImage *gimage, + gint x, + gint y, + gint w, + gint h); /* projection functions */ static void project_intensity (GimpImage *gimage, @@ -136,7 +141,7 @@ static void project_channel (GimpImage *gimage, /* * Global variables */ -gint valid_combinations[][MAX_CHANNELS + 1] = +static gint valid_combinations[][MAX_CHANNELS + 1] = { /* RGB GIMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, @@ -176,15 +181,11 @@ enum LAST_SIGNAL }; + static guint gimp_image_signals[LAST_SIGNAL] = { 0 }; static GimpViewableClass *parent_class = NULL; -static gint global_image_ID = 1; -static GHashTable *gimp_image_table = NULL; - -static guint32 next_guide_id = 1; - GtkType gimp_image_get_type (void) @@ -386,15 +387,15 @@ gimp_image_class_init (GimpImageClass *klass) static void gimp_image_init (GimpImage *gimage) { - gimage->ID = global_image_ID++; + gimage->ID = 0; gimage->save_proc = NULL; gimage->width = 0; gimage->height = 0; - gimage->xresolution = core_config->default_xresolution; - gimage->yresolution = core_config->default_yresolution; - gimage->unit = core_config->default_units; + gimage->xresolution = 1.0; + gimage->yresolution = 1.0; + gimage->unit = GIMP_UNIT_INCH; gimage->base_type = RGB; gimage->cmap = NULL; @@ -450,13 +451,6 @@ gimp_image_init (GimpImage *gimage) gimage->comp_preview = NULL; gimage->comp_preview_valid = FALSE; - - if (gimp_image_table == NULL) - gimp_image_table = g_hash_table_new (g_direct_hash, NULL); - - g_hash_table_insert (gimp_image_table, - GINT_TO_POINTER (gimage->ID), - (gpointer) gimage); } static void @@ -466,7 +460,8 @@ gimp_image_destroy (GtkObject *object) gimage = GIMP_IMAGE (object); - g_hash_table_remove (gimp_image_table, GINT_TO_POINTER (gimage->ID)); + g_hash_table_remove (gimage->gimp->image_table, + GINT_TO_POINTER (gimage->ID)); gimp_image_free_projection (gimage); gimp_image_free_shadow (gimage); @@ -617,10 +612,20 @@ gimp_image_new (Gimp *gimp, gimage = GIMP_IMAGE (gtk_type_new (GIMP_TYPE_IMAGE)); - gimage->gimp = gimp; - gimage->width = width; - gimage->height = height; - gimage->base_type = base_type; + gimage->gimp = gimp; + gimage->ID = gimp->next_image_ID++; + + g_hash_table_insert (gimp->image_table, + GINT_TO_POINTER (gimage->ID), + (gpointer) gimage); + + gimage->width = width; + gimage->height = height; + gimage->base_type = base_type; + + gimage->xresolution = gimp->config->default_xresolution; + gimage->yresolution = gimp->config->default_yresolution; + gimage->unit = gimp->config->default_units; switch (base_type) { @@ -662,12 +667,16 @@ gimp_image_get_ID (GimpImage *gimage) } GimpImage * -gimp_image_get_by_ID (gint image_id) +gimp_image_get_by_ID (Gimp *gimp, + gint image_id) { - if (gimp_image_table == NULL) + g_return_val_if_fail (gimp != NULL, NULL); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->image_table == NULL) return NULL; - return (GimpImage *) g_hash_table_lookup (gimp_image_table, + return (GimpImage *) g_hash_table_lookup (gimp->image_table, GINT_TO_POINTER (image_id)); } @@ -1446,7 +1455,7 @@ gimp_image_add_hguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_HORIZONTAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1465,7 +1474,7 @@ gimp_image_add_vguide (GimpImage *gimage) guide->ref_count = 0; guide->position = -1; - guide->guide_ID = next_guide_id++; + guide->guide_ID = gimage->gimp->next_guide_ID++; guide->orientation = ORIENTATION_VERTICAL; gimage->guides = g_list_prepend (gimage->guides, guide); @@ -1493,7 +1502,7 @@ gimp_image_remove_guide (GimpImage *gimage, void gimp_image_delete_guide (GimpImage *gimage, - GimpGuide *guide) + GimpGuide *guide) { guide->position = -1; @@ -2125,7 +2134,7 @@ gimp_image_get_active_channels (GimpImage *gimage, } } -void +static void gimp_image_construct (GimpImage *gimage, gint x, gint y, diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index 3c6c5fa3cf..d2ffb3a2b0 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -175,7 +175,8 @@ GimpImage * gimp_image_new (Gimp *gimp, GimpImageBaseType base_type); gint gimp_image_get_ID (GimpImage *gimage); -GimpImage * gimp_image_get_by_ID (gint id); +GimpImage * gimp_image_get_by_ID (Gimp *gimp, + gint id); void gimp_image_set_filename (GimpImage *gimage, const gchar *filename); @@ -372,11 +373,6 @@ gboolean gimp_image_add_channel (GimpImage *gimage, gint position); void gimp_image_remove_channel (GimpImage *gimage, GimpChannel *channel); -void gimp_image_construct (GimpImage *gimage, - gint x, - gint y, - gint w, - gint h); void gimp_image_invalidate_without_render (GimpImage *gimage, diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index ae5b877f18..596ffa96cc 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -2242,7 +2242,8 @@ gdisplay_active (void) } GDisplay * -gdisplay_get_by_ID (gint ID) +gdisplay_get_by_ID (Gimp *gimp, + gint ID) { GDisplay *gdisp; GSList *list; diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index 325db481cb..a0fdc43a79 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -282,7 +282,8 @@ void gdisplay_update_title (GDisplay *gdisp); void gdisplay_flush_displays_only (GDisplay *gdisp); /* no rerender! */ GDisplay * gdisplay_active (void); -GDisplay * gdisplay_get_by_ID (gint ID); +GDisplay * gdisplay_get_by_ID (Gimp *gimp, + gint ID); /* function declarations */ diff --git a/app/core/gimpunit.c b/app/core/gimpunit.c index 272c02ec00..6e3a225198 100644 --- a/app/core/gimpunit.c +++ b/app/core/gimpunit.c @@ -28,12 +28,12 @@ #include "libgimpbase/gimpbase.h" -#include "core/core-types.h" +#include "core-types.h" -#include "core/gimp.h" +#include "gimp.h" +#include "gimpunit.h" #include "gimprc.h" -#include "unitrc.h" #include "libgimp/gimpintl.h" @@ -275,11 +275,40 @@ _gimp_unit_get_plural (Gimp *gimp, /* unitrc functions **********/ +void +gimp_units_init (Gimp *gimp) +{ + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); + + gimp->user_units = NULL; + gimp->n_user_units = 0; +} + +void +gimp_units_exit (Gimp *gimp) +{ + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); + + if (gimp->user_units) + { + g_list_foreach (gimp->user_units, (GFunc) g_free, NULL); + g_list_free (gimp->user_units); + + gimp->user_units = NULL; + gimp->n_user_units = 0; + } +} + void gimp_unitrc_load (Gimp *gimp) { gchar *filename; + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); + filename = gimp_personal_rc_file ("unitrc"); gimprc_parse_file (filename); g_free (filename); @@ -292,6 +321,9 @@ gimp_unitrc_save (Gimp *gimp) gchar *filename; FILE *fp; + g_return_if_fail (gimp != NULL); + g_return_if_fail (GIMP_IS_GIMP (gimp)); + filename = gimp_personal_rc_file ("unitrc"); fp = fopen (filename, "w"); diff --git a/app/core/gimpunit.h b/app/core/gimpunit.h index dea895acb4..163bb22fa0 100644 --- a/app/core/gimpunit.h +++ b/app/core/gimpunit.h @@ -20,6 +20,9 @@ #define __APP_GIMP_UNIT_H__ +void gimp_units_init (Gimp *gimp); +void gimp_units_exit (Gimp *gimp); + void gimp_unitrc_load (Gimp *gimp); void gimp_unitrc_save (Gimp *gimp); diff --git a/app/dialogs/file-open-dialog.c b/app/dialogs/file-open-dialog.c index 426f459489..a57618508f 100644 --- a/app/dialogs/file-open-dialog.c +++ b/app/dialogs/file-open-dialog.c @@ -535,7 +535,7 @@ set_preview (const gchar *fullfname, } else { - switch (core_config->thumbnail_mode) + switch (the_gimp->config->thumbnail_mode) { case 0: gtk_label_set_text (GTK_LABEL(open_options_label), @@ -661,7 +661,7 @@ file_open_genbutton_callback (GtkWidget *widget, RGBbuf = make_RGBbuf_from_tempbuf (tempbuf, &RGBbuf_w, &RGBbuf_h); - if (core_config->thumbnail_mode) + if (the_gimp->config->thumbnail_mode) { file_save_thumbnail (gimage_to_be_thumbed, full_filename, tempbuf); diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index aa44e55bd6..672b81680e 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -26,6 +26,7 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpimage-new.h" @@ -121,30 +122,30 @@ file_new_reset_callback (GtkWidget *widget, gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (info->couple_resolutions), - ABS (core_config->default_xresolution - - core_config->default_yresolution) < GIMP_MIN_RESOLUTION); + ABS (the_gimp->config->default_xresolution - + the_gimp->config->default_yresolution) < GIMP_MIN_RESOLUTION); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 0, core_config->default_xresolution); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 1, core_config->default_yresolution); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), 0, + the_gimp->config->default_xresolution); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), 1, + the_gimp->config->default_yresolution); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->resolution_se), - core_config->default_resolution_units); + the_gimp->config->default_resolution_units); gtk_signal_handler_unblock_by_data (GTK_OBJECT (info->resolution_se), info); - gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), - 0, core_config->default_xresolution, TRUE); - gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), - 1, core_config->default_yresolution, TRUE); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 0, core_config->default_width); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 1, core_config->default_height); + gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 0, + the_gimp->config->default_xresolution, TRUE); + gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 1, + the_gimp->config->default_yresolution, TRUE); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), 0, + the_gimp->config->default_width); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), 1, + the_gimp->config->default_height); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->size_se), - core_config->default_units); + the_gimp->config->default_units); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[core_config->default_type]), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[the_gimp->config->default_type]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->fill_type_w[BACKGROUND_FILL]), TRUE); @@ -536,7 +537,7 @@ file_new_dialog_create (GimpImage *gimage) gtk_widget_set_usize (spinbutton, 75, 0); info->resolution_se = - gimp_size_entry_new (1, core_config->default_resolution_units, + gimp_size_entry_new (1, the_gimp->config->default_resolution_units, _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); diff --git a/app/dialogs/info-window.c b/app/dialogs/info-window.c index 201b5b2bd6..1ecbf26249 100644 --- a/app/dialogs/info-window.c +++ b/app/dialogs/info-window.c @@ -31,6 +31,7 @@ #include "core/gimpcontainer.h" #include "core/gimpcontext.h" #include "core/gimpimage.h" +#include "core/gimpunit.h" #include "widgets/gimppreview.h" @@ -45,7 +46,6 @@ #include "app_procs.h" #include "colormaps.h" #include "gdisplay.h" -#include "unitrc.h" #include "libgimp/gimpintl.h" diff --git a/app/dialogs/module-dialog.c b/app/dialogs/module-dialog.c index 1239a3fd0d..c6d73b0821 100644 --- a/app/dialogs/module-dialog.c +++ b/app/dialogs/module-dialog.c @@ -38,10 +38,12 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimplist.h" +#include "app_procs.h" #include "appenv.h" #include "module_db.h" #include "gimprc.h" @@ -218,7 +220,7 @@ module_db_init (void) modules = gimp_list_new (MODULE_INFO_TYPE, GIMP_CONTAINER_POLICY_WEAK); if (g_module_supported ()) - gimp_datafiles_read_directories (core_config->module_path, 0 /* no flags */, + gimp_datafiles_read_directories (the_gimp->config->module_path, 0 /* no flags */, module_initialize, NULL); #ifdef DUMP_DB gimp_container_foreach (modules, print_module_info, NULL); @@ -616,7 +618,7 @@ module_initialize (const gchar *filename, mod->refs = 0; mod->load_inhibit = module_inhibited (mod->fullpath, - core_config->module_db_load_inhibit); + the_gimp->config->module_db_load_inhibit); if (!mod->load_inhibit) { if (be_verbose) @@ -1138,7 +1140,7 @@ browser_refresh_callback (GtkWidget *widget, kill_list = NULL; /* walk filesystem and add new things we find */ - gimp_datafiles_read_directories (core_config->module_path, 0 /* no flags */, + gimp_datafiles_read_directories (the_gimp->config->module_path, 0 /* no flags */, module_initialize, NULL); } diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index c6adadee47..123bca6a4c 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -271,10 +271,10 @@ static PrefsState prefs_check_settings (void) { /* First, check for invalid values... */ - if (core_config->levels_of_undo < 0) + if (the_gimp->config->levels_of_undo < 0) { g_message (_("Error: Levels of undo must be zero or greater.")); - core_config->levels_of_undo = old_levels_of_undo; + the_gimp->config->levels_of_undo = old_levels_of_undo; return PREFS_CORRUPT; } if (gimprc.marching_speed < 50) @@ -283,38 +283,38 @@ prefs_check_settings (void) gimprc.marching_speed = old_marching_speed; return PREFS_CORRUPT; } - if (core_config->default_width < 1) + if (the_gimp->config->default_width < 1) { g_message (_("Error: Default width must be one or greater.")); - core_config->default_width = old_default_width; + the_gimp->config->default_width = old_default_width; return PREFS_CORRUPT; } - if (core_config->default_height < 1) + if (the_gimp->config->default_height < 1) { g_message (_("Error: Default height must be one or greater.")); - core_config->default_height = old_default_height; + the_gimp->config->default_height = old_default_height; return PREFS_CORRUPT; } - if (core_config->default_units < GIMP_UNIT_INCH || - core_config->default_units >= gimp_unit_get_number_of_units ()) + if (the_gimp->config->default_units < GIMP_UNIT_INCH || + the_gimp->config->default_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default unit must be within unit range.")); - core_config->default_units = old_default_units; + the_gimp->config->default_units = old_default_units; return PREFS_CORRUPT; } - if (core_config->default_xresolution < GIMP_MIN_RESOLUTION || - core_config->default_yresolution < GIMP_MIN_RESOLUTION) + if (the_gimp->config->default_xresolution < GIMP_MIN_RESOLUTION || + the_gimp->config->default_yresolution < GIMP_MIN_RESOLUTION) { g_message (_("Error: Default resolution must not be zero.")); - core_config->default_xresolution = old_default_xresolution; - core_config->default_yresolution = old_default_yresolution; + the_gimp->config->default_xresolution = old_default_xresolution; + the_gimp->config->default_yresolution = old_default_yresolution; return PREFS_CORRUPT; } - if (core_config->default_resolution_units < GIMP_UNIT_INCH || - core_config->default_resolution_units >= gimp_unit_get_number_of_units ()) + if (the_gimp->config->default_resolution_units < GIMP_UNIT_INCH || + the_gimp->config->default_resolution_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default resolution unit must be within unit range.")); - core_config->default_resolution_units = old_default_resolution_units; + the_gimp->config->default_resolution_units = old_default_resolution_units; return PREFS_CORRUPT; } if (gimprc.monitor_xres < GIMP_MIN_RESOLUTION || @@ -531,14 +531,14 @@ prefs_save_callback (GtkWidget *widget, save_temp_path = base_config->temp_path; save_swap_path = base_config->swap_path; - save_plug_in_path = core_config->plug_in_path; - save_module_path = core_config->module_path; - save_brush_path = core_config->brush_path; - save_pattern_path = core_config->pattern_path; - save_palette_path = core_config->palette_path; - save_gradient_path = core_config->gradient_path; + save_plug_in_path = the_gimp->config->plug_in_path; + save_module_path = the_gimp->config->module_path; + save_brush_path = the_gimp->config->brush_path; + save_pattern_path = the_gimp->config->pattern_path; + save_palette_path = the_gimp->config->palette_path; + save_gradient_path = the_gimp->config->gradient_path; - if (core_config->levels_of_undo != old_levels_of_undo) + if (the_gimp->config->levels_of_undo != old_levels_of_undo) { update = g_list_append (update, "undo-levels"); } @@ -599,32 +599,32 @@ prefs_save_callback (GtkWidget *widget, { update = g_list_append (update, "always-restore-session"); } - if (core_config->default_width != old_default_width || - core_config->default_height != old_default_height) + if (the_gimp->config->default_width != old_default_width || + the_gimp->config->default_height != old_default_height) { update = g_list_append (update, "default-image-size"); } - if (core_config->default_units != old_default_units) + if (the_gimp->config->default_units != old_default_units) { update = g_list_append (update, "default-units"); } - if (ABS (core_config->default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) + if (ABS (the_gimp->config->default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-xresolution"); } - if (ABS (core_config->default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) + if (ABS (the_gimp->config->default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-yresolution"); } - if (core_config->default_resolution_units != old_default_resolution_units) + if (the_gimp->config->default_resolution_units != old_default_resolution_units) { update = g_list_append (update, "default-resolution-units"); } - if (core_config->default_type != old_default_type) + if (the_gimp->config->default_type != old_default_type) { update = g_list_append (update, "default-image-type"); } - if (prefs_strcmp (core_config->default_comment, old_default_comment)) + if (prefs_strcmp (the_gimp->config->default_comment, old_default_comment)) { update = g_list_append (update, "default-comment"); } @@ -683,7 +683,7 @@ prefs_save_callback (GtkWidget *widget, { update = g_list_append (update, "max-new-image-size"); } - if (core_config->thumbnail_mode != old_thumbnail_mode) + if (the_gimp->config->thumbnail_mode != old_thumbnail_mode) { update = g_list_append (update, "thumbnail-mode"); } @@ -776,32 +776,32 @@ prefs_save_callback (GtkWidget *widget, } if (prefs_strcmp (old_plug_in_path, edit_plug_in_path)) { - core_config->plug_in_path = edit_plug_in_path; + the_gimp->config->plug_in_path = edit_plug_in_path; update = g_list_append (update, "plug-in-path"); } if (prefs_strcmp (old_module_path, edit_module_path)) { - core_config->module_path = edit_module_path; + the_gimp->config->module_path = edit_module_path; update = g_list_append (update, "module-path"); } if (prefs_strcmp (old_brush_path, edit_brush_path)) { - core_config->brush_path = edit_brush_path; + the_gimp->config->brush_path = edit_brush_path; update = g_list_append (update, "brush-path"); } if (prefs_strcmp (old_pattern_path, edit_pattern_path)) { - core_config->pattern_path = edit_pattern_path; + the_gimp->config->pattern_path = edit_pattern_path; update = g_list_append (update, "pattern-path"); } if (prefs_strcmp (old_palette_path, edit_palette_path)) { - core_config->palette_path = edit_palette_path; + the_gimp->config->palette_path = edit_palette_path; update = g_list_append (update, "palette-path"); } if (prefs_strcmp (old_gradient_path, edit_gradient_path)) { - core_config->gradient_path = edit_gradient_path; + the_gimp->config->gradient_path = edit_gradient_path; update = g_list_append (update, "gradient-path"); } @@ -833,12 +833,12 @@ prefs_save_callback (GtkWidget *widget, base_config->temp_path = save_temp_path; base_config->swap_path = save_swap_path; - core_config->plug_in_path = save_plug_in_path; - core_config->module_path = save_module_path; - core_config->brush_path = save_brush_path; - core_config->pattern_path = save_pattern_path; - core_config->palette_path = save_palette_path; - core_config->gradient_path = save_gradient_path; + the_gimp->config->plug_in_path = save_plug_in_path; + the_gimp->config->module_path = save_module_path; + the_gimp->config->brush_path = save_brush_path; + the_gimp->config->pattern_path = save_pattern_path; + the_gimp->config->palette_path = save_palette_path; + the_gimp->config->gradient_path = save_gradient_path; /* no need to restore values which are only changed on "OK" and "Save" */ @@ -857,15 +857,15 @@ prefs_cancel_callback (GtkWidget *widget, base_config->interpolation_type = old_interpolation_type; base_config->num_processors = old_num_processors; - core_config->default_type = old_default_type; - core_config->default_width = old_default_width; - core_config->default_height = old_default_height; - core_config->default_units = old_default_units; - core_config->default_xresolution = old_default_xresolution; - core_config->default_yresolution = old_default_yresolution; - core_config->default_resolution_units = old_default_resolution_units; - core_config->levels_of_undo = old_levels_of_undo; - core_config->thumbnail_mode = old_thumbnail_mode; + the_gimp->config->default_type = old_default_type; + the_gimp->config->default_width = old_default_width; + the_gimp->config->default_height = old_default_height; + the_gimp->config->default_units = old_default_units; + the_gimp->config->default_xresolution = old_default_xresolution; + the_gimp->config->default_yresolution = old_default_yresolution; + the_gimp->config->default_resolution_units = old_default_resolution_units; + the_gimp->config->levels_of_undo = old_levels_of_undo; + the_gimp->config->thumbnail_mode = old_thumbnail_mode; gimprc.marching_speed = old_marching_speed; gimprc.allow_resize_windows = old_allow_resize_windows; @@ -917,7 +917,7 @@ prefs_cancel_callback (GtkWidget *widget, } prefs_strset (&gimprc.image_title_format, old_image_title_format); - prefs_strset (&core_config->default_comment, old_default_comment); + prefs_strset (&the_gimp->config->default_comment, old_default_comment); tool_manager_set_global_paint_options (the_gimp, old_global_paint_options); @@ -981,8 +981,8 @@ prefs_toggle_callback (GtkWidget *widget, /* radio buttons */ else if (data == &base_config->interpolation_type || - data == &core_config->default_type || - data == &core_config->thumbnail_mode || + data == &the_gimp->config->default_type || + data == &the_gimp->config->thumbnail_mode || data == &gimprc.trust_dirty_flag || data == &gimprc.help_browser || data == &gimprc.cursor_mode) @@ -1110,11 +1110,11 @@ static void prefs_default_size_callback (GtkWidget *widget, gpointer data) { - core_config->default_width = + the_gimp->config->default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0)); - core_config->default_height = + the_gimp->config->default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1)); - core_config->default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); + the_gimp->config->default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } static void @@ -1159,15 +1159,15 @@ prefs_default_resolution_callback (GtkWidget *widget, gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 1, yres, FALSE); - core_config->default_width = + the_gimp->config->default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0)); - core_config->default_height = + the_gimp->config->default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1)); - core_config->default_xresolution = xres; - core_config->default_yresolution = yres; + the_gimp->config->default_xresolution = xres; + the_gimp->config->default_yresolution = yres; - core_config->default_resolution_units = + the_gimp->config->default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } @@ -1411,12 +1411,12 @@ preferences_dialog_create (void) edit_temp_path = prefs_strdup (base_config->temp_path); edit_swap_path = prefs_strdup (base_config->swap_path); - edit_plug_in_path = prefs_strdup (core_config->plug_in_path); - edit_module_path = prefs_strdup (core_config->module_path); - edit_brush_path = prefs_strdup (core_config->brush_path); - edit_pattern_path = prefs_strdup (core_config->pattern_path); - edit_palette_path = prefs_strdup (core_config->palette_path); - edit_gradient_path = prefs_strdup (core_config->gradient_path); + edit_plug_in_path = prefs_strdup (the_gimp->config->plug_in_path); + edit_module_path = prefs_strdup (the_gimp->config->module_path); + edit_brush_path = prefs_strdup (the_gimp->config->brush_path); + edit_pattern_path = prefs_strdup (the_gimp->config->pattern_path); + edit_palette_path = prefs_strdup (the_gimp->config->palette_path); + edit_gradient_path = prefs_strdup (the_gimp->config->gradient_path); } /* assign edit variables for values which get changed on "OK" and "Save" @@ -1428,15 +1428,15 @@ preferences_dialog_create (void) old_interpolation_type = base_config->interpolation_type; old_num_processors = base_config->num_processors; - old_default_type = core_config->default_type; - old_default_width = core_config->default_width; - old_default_height = core_config->default_height; - old_default_units = core_config->default_units; - old_default_xresolution = core_config->default_xresolution; - old_default_yresolution = core_config->default_yresolution; - old_default_resolution_units = core_config->default_resolution_units; - old_levels_of_undo = core_config->levels_of_undo; - old_thumbnail_mode = core_config->thumbnail_mode; + old_default_type = the_gimp->config->default_type; + old_default_width = the_gimp->config->default_width; + old_default_height = the_gimp->config->default_height; + old_default_units = the_gimp->config->default_units; + old_default_xresolution = the_gimp->config->default_xresolution; + old_default_yresolution = the_gimp->config->default_yresolution; + old_default_resolution_units = the_gimp->config->default_resolution_units; + old_levels_of_undo = the_gimp->config->levels_of_undo; + old_thumbnail_mode = the_gimp->config->thumbnail_mode; old_perfectmouse = gimprc.perfectmouse; old_transparency_type = gimprc.transparency_type; @@ -1467,7 +1467,7 @@ preferences_dialog_create (void) old_default_threshold = gimprc.default_threshold; prefs_strset (&old_image_title_format, gimprc.image_title_format); - prefs_strset (&old_default_comment, core_config->default_comment); + prefs_strset (&old_default_comment, the_gimp->config->default_comment); /* values which will need a restart */ old_stingy_memory_use = edit_stingy_memory_use; @@ -1567,7 +1567,7 @@ preferences_dialog_create (void) gtk_widget_show (hbox); sizeentry = - gimp_size_entry_new (2, core_config->default_units, "%p", + gimp_size_entry_new (2, the_gimp->config->default_units, "%p", FALSE, FALSE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_SIZE); @@ -1579,9 +1579,9 @@ preferences_dialog_create (void) _("Pixels"), 1, 4, 0.0); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0, - core_config->default_xresolution, FALSE); + the_gimp->config->default_xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 1, - core_config->default_yresolution, FALSE); + the_gimp->config->default_yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); @@ -1589,9 +1589,9 @@ preferences_dialog_create (void) (GIMP_SIZE_ENTRY (sizeentry), 1, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, - core_config->default_width); + the_gimp->config->default_width); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, - core_config->default_height); + the_gimp->config->default_height); gtk_signal_connect (GTK_OBJECT (sizeentry), "unit_changed", GTK_SIGNAL_FUNC (prefs_default_size_callback), @@ -1617,14 +1617,14 @@ preferences_dialog_create (void) pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL); - sizeentry2 = gimp_size_entry_new (2, core_config->default_resolution_units, + sizeentry2 = gimp_size_entry_new (2, the_gimp->config->default_resolution_units, pixels_per_unit, FALSE, FALSE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM); - if (ABS (core_config->default_xresolution - - core_config->default_yresolution) < GIMP_MIN_RESOLUTION) + if (ABS (the_gimp->config->default_xresolution - + the_gimp->config->default_yresolution) < GIMP_MIN_RESOLUTION) gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE); gtk_table_attach_defaults (GTK_TABLE (sizeentry2), button, 1, 3, 3, 4); gtk_widget_show (button); @@ -1644,9 +1644,9 @@ preferences_dialog_create (void) (GIMP_SIZE_ENTRY (sizeentry2), 1, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), 0, - core_config->default_xresolution); + the_gimp->config->default_xresolution); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), 1, - core_config->default_yresolution); + the_gimp->config->default_yresolution); gtk_signal_connect (GTK_OBJECT (sizeentry2), "unit_changed", (GtkSignalFunc) prefs_default_resolution_callback, @@ -1674,8 +1674,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &core_config->default_type, - (gpointer) core_config->default_type, + &the_gimp->config->default_type, + (gpointer) the_gimp->config->default_type, _("RGB"), (gpointer) RGB, NULL, _("Grayscale"), (gpointer) GRAY, NULL, @@ -1721,10 +1721,10 @@ preferences_dialog_create (void) text = gtk_text_new (NULL, NULL); gtk_text_set_editable (GTK_TEXT (text), TRUE); gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, - core_config->default_comment, -1); + the_gimp->config->default_comment, -1); gtk_signal_connect (GTK_OBJECT (text), "changed", GTK_SIGNAL_FUNC (prefs_text_callback), - &core_config->default_comment); + &the_gimp->config->default_comment); gtk_container_add (GTK_CONTAINER (hbox), text); gtk_widget_show (text); @@ -2238,11 +2238,11 @@ preferences_dialog_create (void) gtk_widget_show (table); /* Levels of Undo */ - spinbutton = gimp_spin_button_new (&adjustment, core_config->levels_of_undo, + spinbutton = gimp_spin_button_new (&adjustment, the_gimp->config->levels_of_undo, 0.0, 255.0, 1.0, 5.0, 0.0, 1.0, 0.0); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", GTK_SIGNAL_FUNC (gimp_int_adjustment_update), - &core_config->levels_of_undo); + &the_gimp->config->levels_of_undo); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Levels of Undo:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2317,8 +2317,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &core_config->thumbnail_mode, - (gpointer) core_config->thumbnail_mode, + &the_gimp->config->thumbnail_mode, + (gpointer) the_gimp->config->thumbnail_mode, _("Always"), (gpointer) 1, NULL, _("Never"), (gpointer) 0, NULL, diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index 4feb074774..e3975d89ef 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -26,12 +26,15 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpimage.h" #include "core/gimplayer.h" #include "resize-dialog.h" +#include "app_procs.h" + #include "libgimp/gimpintl.h" @@ -592,7 +595,7 @@ resize_widget_new (ResizeType type, gtk_widget_set_usize (spinbutton, 75, 0); private->resolution_se = - gimp_size_entry_new (1, core_config->default_resolution_units, + gimp_size_entry_new (1, the_gimp->config->default_resolution_units, _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); diff --git a/app/dialogs/user-install-dialog.c b/app/dialogs/user-install-dialog.c index c5605f9624..522db344ad 100644 --- a/app/dialogs/user-install-dialog.c +++ b/app/dialogs/user-install-dialog.c @@ -38,12 +38,13 @@ #include "base/base-config.h" +#include "core/gimpunit.h" + #include "gui/resolution-calibrate-dialog.h" #include "appenv.h" #include "gdisplay_ops.h" #include "gimprc.h" -#include "unitrc.h" #include "user_install.h" #include "libgimp/gimpintl.h" diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index ae5b877f18..596ffa96cc 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -2242,7 +2242,8 @@ gdisplay_active (void) } GDisplay * -gdisplay_get_by_ID (gint ID) +gdisplay_get_by_ID (Gimp *gimp, + gint ID) { GDisplay *gdisp; GSList *list; diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index 325db481cb..a0fdc43a79 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -282,7 +282,8 @@ void gdisplay_update_title (GDisplay *gdisp); void gdisplay_flush_displays_only (GDisplay *gdisp); /* no rerender! */ GDisplay * gdisplay_active (void); -GDisplay * gdisplay_get_by_ID (gint ID); +GDisplay * gdisplay_get_by_ID (Gimp *gimp, + gint ID); /* function declarations */ diff --git a/app/file-open.c b/app/file-open.c index acadcf8fde..29f672a7e9 100644 --- a/app/file-open.c +++ b/app/file-open.c @@ -166,7 +166,7 @@ file_open_image (Gimp *gimp, if (*status == GIMP_PDB_SUCCESS && gimage_id != -1) { - return gimp_image_get_by_ID (gimage_id); + return gimp_image_get_by_ID (gimp, gimage_id); } return NULL; diff --git a/app/file-save.c b/app/file-save.c index ab17a0642a..1615cd5de1 100644 --- a/app/file-save.c +++ b/app/file-save.c @@ -59,6 +59,7 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdrawable.h" #include "core/gimpimage.h" @@ -181,7 +182,7 @@ file_save (GimpImage *gimage, /* gimage_set_save_proc(gimage, file_proc); */ /* Write a thumbnail for the saved image, where appropriate */ - switch (core_config->thumbnail_mode) + switch (gimage->gimp->config->thumbnail_mode) { case 0: break; diff --git a/app/file/file-open.c b/app/file/file-open.c index acadcf8fde..29f672a7e9 100644 --- a/app/file/file-open.c +++ b/app/file/file-open.c @@ -166,7 +166,7 @@ file_open_image (Gimp *gimp, if (*status == GIMP_PDB_SUCCESS && gimage_id != -1) { - return gimp_image_get_by_ID (gimage_id); + return gimp_image_get_by_ID (gimp, gimage_id); } return NULL; diff --git a/app/file/file-save.c b/app/file/file-save.c index ab17a0642a..1615cd5de1 100644 --- a/app/file/file-save.c +++ b/app/file/file-save.c @@ -59,6 +59,7 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdrawable.h" #include "core/gimpimage.h" @@ -181,7 +182,7 @@ file_save (GimpImage *gimage, /* gimage_set_save_proc(gimage, file_proc); */ /* Write a thumbnail for the saved image, where appropriate */ - switch (core_config->thumbnail_mode) + switch (gimage->gimp->config->thumbnail_mode) { case 0: break; diff --git a/app/gdisplay.c b/app/gdisplay.c index ae5b877f18..596ffa96cc 100644 --- a/app/gdisplay.c +++ b/app/gdisplay.c @@ -2242,7 +2242,8 @@ gdisplay_active (void) } GDisplay * -gdisplay_get_by_ID (gint ID) +gdisplay_get_by_ID (Gimp *gimp, + gint ID) { GDisplay *gdisp; GSList *list; diff --git a/app/gdisplay.h b/app/gdisplay.h index 325db481cb..a0fdc43a79 100644 --- a/app/gdisplay.h +++ b/app/gdisplay.h @@ -282,7 +282,8 @@ void gdisplay_update_title (GDisplay *gdisp); void gdisplay_flush_displays_only (GDisplay *gdisp); /* no rerender! */ GDisplay * gdisplay_active (void); -GDisplay * gdisplay_get_by_ID (gint ID); +GDisplay * gdisplay_get_by_ID (Gimp *gimp, + gint ID); /* function declarations */ diff --git a/app/gimprc.c b/app/gimprc.c index 619fbd6ba6..24da312ec4 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -43,6 +43,7 @@ #include "base/base-config.c" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpparasite.h" #include "core/gimptoolinfo.h" @@ -439,28 +440,28 @@ gimprc_init (Gimp *gimp) base_funcs[4].val1p = &base_config->interpolation_type; base_funcs[4].val1p = &base_config->num_processors; - core_funcs[0].val1p = &core_config->plug_in_path; - core_funcs[1].val1p = &core_config->module_path; - core_funcs[2].val1p = &core_config->brush_path; - core_funcs[3].val1p = &core_config->pattern_path; - core_funcs[4].val1p = &core_config->palette_path; - core_funcs[5].val1p = &core_config->gradient_path; - core_funcs[6].val1p = &core_config->default_brush; - core_funcs[7].val1p = &core_config->default_pattern; - core_funcs[8].val1p = &core_config->default_palette; - core_funcs[9].val1p = &core_config->default_gradient; - core_funcs[10].val1p = &core_config->default_comment; - core_funcs[11].val1p = &core_config->default_type; - core_funcs[12].val1p = &core_config->default_width; - core_funcs[12].val2p = &core_config->default_height; - core_funcs[13].val1p = &core_config->default_units; - core_funcs[14].val1p = &core_config->default_xresolution; - core_funcs[15].val1p = &core_config->default_xresolution; - core_funcs[16].val1p = &core_config->default_resolution_units; - core_funcs[17].val1p = &core_config->levels_of_undo; - core_funcs[18].val1p = &core_config->pluginrc_path; - core_funcs[19].val1p = &core_config->module_db_load_inhibit; - core_funcs[20].val1p = &core_config->thumbnail_mode; + core_funcs[0].val1p = &gimp->config->plug_in_path; + core_funcs[1].val1p = &gimp->config->module_path; + core_funcs[2].val1p = &gimp->config->brush_path; + core_funcs[3].val1p = &gimp->config->pattern_path; + core_funcs[4].val1p = &gimp->config->palette_path; + core_funcs[5].val1p = &gimp->config->gradient_path; + core_funcs[6].val1p = &gimp->config->default_brush; + core_funcs[7].val1p = &gimp->config->default_pattern; + core_funcs[8].val1p = &gimp->config->default_palette; + core_funcs[9].val1p = &gimp->config->default_gradient; + core_funcs[10].val1p = &gimp->config->default_comment; + core_funcs[11].val1p = &gimp->config->default_type; + core_funcs[12].val1p = &gimp->config->default_width; + core_funcs[12].val2p = &gimp->config->default_height; + core_funcs[13].val1p = &gimp->config->default_units; + core_funcs[14].val1p = &gimp->config->default_xresolution; + core_funcs[15].val1p = &gimp->config->default_xresolution; + core_funcs[16].val1p = &gimp->config->default_resolution_units; + core_funcs[17].val1p = &gimp->config->levels_of_undo; + core_funcs[18].val1p = &gimp->config->pluginrc_path; + core_funcs[19].val1p = &gimp->config->module_db_load_inhibit; + core_funcs[20].val1p = &gimp->config->thumbnail_mode; parse_func_hash = g_hash_table_new (g_str_hash, g_str_equal); @@ -535,8 +536,8 @@ gimprc_parse (Gimp *gimp) if (! gimprc.image_title_format) gimprc.image_title_format = g_strdup (DEFAULT_IMAGE_TITLE_FORMAT); - if (! core_config->default_comment) - core_config->default_comment = g_strdup (DEFAULT_COMMENT); + if (! gimp->config->default_comment) + gimp->config->default_comment = g_strdup (DEFAULT_COMMENT); } gboolean diff --git a/app/gimpunit.c b/app/gimpunit.c deleted file mode 100644 index 272c02ec00..0000000000 --- a/app/gimpunit.c +++ /dev/null @@ -1,334 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995-1999 Spencer Kimball and Peter Mattis - * - * gimpunit.c - * Copyright (C) 1999-2000 Michael Natterer - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include "config.h" - -#include -#include - -#include - -#include "libgimpbase/gimpbase.h" - -#include "core/core-types.h" - -#include "core/gimp.h" - -#include "gimprc.h" -#include "unitrc.h" - -#include "libgimp/gimpintl.h" - - -/* internal structures */ - -typedef struct -{ - gboolean delete_on_exit; - gdouble factor; - gint digits; - gchar *identifier; - gchar *symbol; - gchar *abbreviation; - gchar *singular; - gchar *plural; -} GimpUnitDef; - -/* these are the built-in units - */ -static GimpUnitDef gimp_unit_defs[GIMP_UNIT_END] = -{ - /* pseudo unit */ - { FALSE, 0.0, 0, "pixels", "px", "px", N_("pixel"), N_("pixels") }, - - /* standard units */ - { FALSE, 1.0, 2, "inches", "''", "in", N_("inch"), N_("inches") }, - { FALSE, 25.4, 1, "millimeters", "mm", "mm", N_("millimeter"), N_("millimeters") }, - - /* professional units */ - { FALSE, 72.0, 0, "points", "pt", "pt", N_("point"), N_("points") }, - { FALSE, 6.0, 1, "picas", "pc", "pc", N_("pica"), N_("picas") }, -}; - -/* not a unit at all but kept here to have the strings in one place - */ -static GimpUnitDef gimp_unit_percent = -{ - FALSE, 0.0, 0, "percent", "%", "%", N_("percent"), N_("percent") -}; - - -/* private functions */ - -static GimpUnitDef * -_gimp_unit_get_user_unit (Gimp *gimp, - GimpUnit unit) -{ - return g_list_nth_data (gimp->user_units, unit - GIMP_UNIT_END); -} - - -/* public functions */ - -gint -_gimp_unit_get_number_of_units (Gimp *gimp) -{ - return GIMP_UNIT_END + gimp->n_user_units; -} - -gint -_gimp_unit_get_number_of_built_in_units (Gimp *gimp) -{ - return GIMP_UNIT_END; -} - -GimpUnit -_gimp_unit_new (Gimp *gimp, - gchar *identifier, - gdouble factor, - gint digits, - gchar *symbol, - gchar *abbreviation, - gchar *singular, - gchar *plural) -{ - GimpUnitDef *user_unit; - - user_unit = g_new0 (GimpUnitDef, 1); - - user_unit->delete_on_exit = TRUE; - user_unit->factor = factor; - user_unit->digits = digits; - user_unit->identifier = g_strdup (identifier); - user_unit->symbol = g_strdup (symbol); - user_unit->abbreviation = g_strdup (abbreviation); - user_unit->singular = g_strdup (singular); - user_unit->plural = g_strdup (plural); - - gimp->user_units = g_list_append (gimp->user_units, user_unit); - gimp->n_user_units++; - - return GIMP_UNIT_END + gimp->n_user_units - 1; -} - -gboolean -_gimp_unit_get_deletion_flag (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)), FALSE); - - if (unit < GIMP_UNIT_END) - return FALSE; - - return _gimp_unit_get_user_unit (gimp, unit)->delete_on_exit; -} - -void -_gimp_unit_set_deletion_flag (Gimp *gimp, - GimpUnit unit, - gboolean deletion_flag) -{ - g_return_if_fail ((unit >= GIMP_UNIT_END) && - (unit < (GIMP_UNIT_END + gimp->n_user_units))); - - _gimp_unit_get_user_unit (gimp, unit)->delete_on_exit = - deletion_flag ? TRUE : FALSE; -} - -gdouble -_gimp_unit_get_factor (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)), - gimp_unit_defs[GIMP_UNIT_INCH].factor); - - if (unit < GIMP_UNIT_END) - return gimp_unit_defs[unit].factor; - - return _gimp_unit_get_user_unit (gimp, unit)->factor; -} - -gint -_gimp_unit_get_digits (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)), - gimp_unit_defs[GIMP_UNIT_INCH].digits); - - if (unit < GIMP_UNIT_END) - return gimp_unit_defs[unit].digits; - - return _gimp_unit_get_user_unit (gimp, unit)->digits; -} - -gchar * -_gimp_unit_get_identifier (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gimp_unit_defs[GIMP_UNIT_INCH].identifier); - - if (unit < GIMP_UNIT_END) - return gimp_unit_defs[unit].identifier; - - if (unit == GIMP_UNIT_PERCENT) - return gimp_unit_percent.identifier; - - return _gimp_unit_get_user_unit (gimp, unit)->identifier; -} - -gchar * -_gimp_unit_get_symbol (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gimp_unit_defs[GIMP_UNIT_INCH].symbol); - - if (unit < GIMP_UNIT_END) - return gimp_unit_defs[unit].symbol; - - if (unit == GIMP_UNIT_PERCENT) - return gimp_unit_percent.symbol; - - return _gimp_unit_get_user_unit (gimp, unit)->symbol; -} - -gchar * -_gimp_unit_get_abbreviation (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gimp_unit_defs[GIMP_UNIT_INCH].abbreviation); - - if (unit < GIMP_UNIT_END) - return gimp_unit_defs[unit].abbreviation; - - if (unit == GIMP_UNIT_PERCENT) - return gimp_unit_percent.abbreviation; - - return _gimp_unit_get_user_unit (gimp, unit)->abbreviation; -} - -gchar * -_gimp_unit_get_singular (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gettext (gimp_unit_defs[GIMP_UNIT_INCH].singular)); - - if (unit < GIMP_UNIT_END) - return gettext (gimp_unit_defs[unit].singular); - - if (unit == GIMP_UNIT_PERCENT) - return gettext (gimp_unit_percent.singular); - - return gettext (_gimp_unit_get_user_unit (gimp, unit)->singular); -} - -gchar * -_gimp_unit_get_plural (Gimp *gimp, - GimpUnit unit) -{ - g_return_val_if_fail ((unit >= GIMP_UNIT_PIXEL) && - (unit < (GIMP_UNIT_END + gimp->n_user_units)) || - (unit == GIMP_UNIT_PERCENT), - gettext (gimp_unit_defs[GIMP_UNIT_INCH].plural)); - - if (unit < GIMP_UNIT_END) - return gettext (gimp_unit_defs[unit].plural); - - if (unit == GIMP_UNIT_PERCENT) - return gettext (gimp_unit_percent.plural); - - return gettext (_gimp_unit_get_user_unit (gimp, unit)->plural); -} - - -/* unitrc functions **********/ - -void -gimp_unitrc_load (Gimp *gimp) -{ - gchar *filename; - - filename = gimp_personal_rc_file ("unitrc"); - gimprc_parse_file (filename); - g_free (filename); -} - -void -gimp_unitrc_save (Gimp *gimp) -{ - gint i; - gchar *filename; - FILE *fp; - - filename = gimp_personal_rc_file ("unitrc"); - - fp = fopen (filename, "w"); - g_free (filename); - if (!fp) - return; - - fprintf (fp, - "# GIMP unitrc\n" - "# This file contains your user unit database. You can\n" - "# modify this list with the unit editor. You are not\n" - "# supposed to edit it manually, but of course you can do.\n" - "# This file will be entirely rewritten every time you\n" - "# quit the gimp.\n\n"); - - /* save user defined units */ - for (i = gimp_unit_get_number_of_built_in_units (); - i < gimp_unit_get_number_of_units (); - i++) - if (gimp_unit_get_deletion_flag (i) == FALSE) - { - fprintf (fp, - "(unit-info \"%s\"\n" - " (factor %f)\n" - " (digits %d)\n" - " (symbol \"%s\")\n" - " (abbreviation \"%s\")\n" - " (singular \"%s\")\n" - " (plural \"%s\"))\n\n", - gimp_unit_get_identifier (i), - gimp_unit_get_factor (i), - gimp_unit_get_digits (i), - gimp_unit_get_symbol (i), - gimp_unit_get_abbreviation (i), - gimp_unit_get_singular (i), - gimp_unit_get_plural (i)); - } - - fclose (fp); -} diff --git a/app/gui/file-new-dialog.c b/app/gui/file-new-dialog.c index aa44e55bd6..672b81680e 100644 --- a/app/gui/file-new-dialog.c +++ b/app/gui/file-new-dialog.c @@ -26,6 +26,7 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpimage-new.h" @@ -121,30 +122,30 @@ file_new_reset_callback (GtkWidget *widget, gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (info->couple_resolutions), - ABS (core_config->default_xresolution - - core_config->default_yresolution) < GIMP_MIN_RESOLUTION); + ABS (the_gimp->config->default_xresolution - + the_gimp->config->default_yresolution) < GIMP_MIN_RESOLUTION); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 0, core_config->default_xresolution); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 1, core_config->default_yresolution); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), 0, + the_gimp->config->default_xresolution); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), 1, + the_gimp->config->default_yresolution); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->resolution_se), - core_config->default_resolution_units); + the_gimp->config->default_resolution_units); gtk_signal_handler_unblock_by_data (GTK_OBJECT (info->resolution_se), info); - gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), - 0, core_config->default_xresolution, TRUE); - gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), - 1, core_config->default_yresolution, TRUE); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 0, core_config->default_width); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 1, core_config->default_height); + gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 0, + the_gimp->config->default_xresolution, TRUE); + gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), 1, + the_gimp->config->default_yresolution, TRUE); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), 0, + the_gimp->config->default_width); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), 1, + the_gimp->config->default_height); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->size_se), - core_config->default_units); + the_gimp->config->default_units); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[core_config->default_type]), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[the_gimp->config->default_type]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->fill_type_w[BACKGROUND_FILL]), TRUE); @@ -536,7 +537,7 @@ file_new_dialog_create (GimpImage *gimage) gtk_widget_set_usize (spinbutton, 75, 0); info->resolution_se = - gimp_size_entry_new (1, core_config->default_resolution_units, + gimp_size_entry_new (1, the_gimp->config->default_resolution_units, _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); diff --git a/app/gui/file-open-dialog.c b/app/gui/file-open-dialog.c index 426f459489..a57618508f 100644 --- a/app/gui/file-open-dialog.c +++ b/app/gui/file-open-dialog.c @@ -535,7 +535,7 @@ set_preview (const gchar *fullfname, } else { - switch (core_config->thumbnail_mode) + switch (the_gimp->config->thumbnail_mode) { case 0: gtk_label_set_text (GTK_LABEL(open_options_label), @@ -661,7 +661,7 @@ file_open_genbutton_callback (GtkWidget *widget, RGBbuf = make_RGBbuf_from_tempbuf (tempbuf, &RGBbuf_w, &RGBbuf_h); - if (core_config->thumbnail_mode) + if (the_gimp->config->thumbnail_mode) { file_save_thumbnail (gimage_to_be_thumbed, full_filename, tempbuf); diff --git a/app/gui/info-window.c b/app/gui/info-window.c index 201b5b2bd6..1ecbf26249 100644 --- a/app/gui/info-window.c +++ b/app/gui/info-window.c @@ -31,6 +31,7 @@ #include "core/gimpcontainer.h" #include "core/gimpcontext.h" #include "core/gimpimage.h" +#include "core/gimpunit.h" #include "widgets/gimppreview.h" @@ -45,7 +46,6 @@ #include "app_procs.h" #include "colormaps.h" #include "gdisplay.h" -#include "unitrc.h" #include "libgimp/gimpintl.h" diff --git a/app/gui/module-browser.c b/app/gui/module-browser.c index 1239a3fd0d..c6d73b0821 100644 --- a/app/gui/module-browser.c +++ b/app/gui/module-browser.c @@ -38,10 +38,12 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimplist.h" +#include "app_procs.h" #include "appenv.h" #include "module_db.h" #include "gimprc.h" @@ -218,7 +220,7 @@ module_db_init (void) modules = gimp_list_new (MODULE_INFO_TYPE, GIMP_CONTAINER_POLICY_WEAK); if (g_module_supported ()) - gimp_datafiles_read_directories (core_config->module_path, 0 /* no flags */, + gimp_datafiles_read_directories (the_gimp->config->module_path, 0 /* no flags */, module_initialize, NULL); #ifdef DUMP_DB gimp_container_foreach (modules, print_module_info, NULL); @@ -616,7 +618,7 @@ module_initialize (const gchar *filename, mod->refs = 0; mod->load_inhibit = module_inhibited (mod->fullpath, - core_config->module_db_load_inhibit); + the_gimp->config->module_db_load_inhibit); if (!mod->load_inhibit) { if (be_verbose) @@ -1138,7 +1140,7 @@ browser_refresh_callback (GtkWidget *widget, kill_list = NULL; /* walk filesystem and add new things we find */ - gimp_datafiles_read_directories (core_config->module_path, 0 /* no flags */, + gimp_datafiles_read_directories (the_gimp->config->module_path, 0 /* no flags */, module_initialize, NULL); } diff --git a/app/gui/plug-in-commands.c b/app/gui/plug-in-commands.c index 00c051bfa3..db969a9dbe 100644 --- a/app/gui/plug-in-commands.c +++ b/app/gui/plug-in-commands.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/gui/plug-in-menus.c b/app/gui/plug-in-menus.c index 00c051bfa3..db969a9dbe 100644 --- a/app/gui/plug-in-menus.c +++ b/app/gui/plug-in-menus.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index c6adadee47..123bca6a4c 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -271,10 +271,10 @@ static PrefsState prefs_check_settings (void) { /* First, check for invalid values... */ - if (core_config->levels_of_undo < 0) + if (the_gimp->config->levels_of_undo < 0) { g_message (_("Error: Levels of undo must be zero or greater.")); - core_config->levels_of_undo = old_levels_of_undo; + the_gimp->config->levels_of_undo = old_levels_of_undo; return PREFS_CORRUPT; } if (gimprc.marching_speed < 50) @@ -283,38 +283,38 @@ prefs_check_settings (void) gimprc.marching_speed = old_marching_speed; return PREFS_CORRUPT; } - if (core_config->default_width < 1) + if (the_gimp->config->default_width < 1) { g_message (_("Error: Default width must be one or greater.")); - core_config->default_width = old_default_width; + the_gimp->config->default_width = old_default_width; return PREFS_CORRUPT; } - if (core_config->default_height < 1) + if (the_gimp->config->default_height < 1) { g_message (_("Error: Default height must be one or greater.")); - core_config->default_height = old_default_height; + the_gimp->config->default_height = old_default_height; return PREFS_CORRUPT; } - if (core_config->default_units < GIMP_UNIT_INCH || - core_config->default_units >= gimp_unit_get_number_of_units ()) + if (the_gimp->config->default_units < GIMP_UNIT_INCH || + the_gimp->config->default_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default unit must be within unit range.")); - core_config->default_units = old_default_units; + the_gimp->config->default_units = old_default_units; return PREFS_CORRUPT; } - if (core_config->default_xresolution < GIMP_MIN_RESOLUTION || - core_config->default_yresolution < GIMP_MIN_RESOLUTION) + if (the_gimp->config->default_xresolution < GIMP_MIN_RESOLUTION || + the_gimp->config->default_yresolution < GIMP_MIN_RESOLUTION) { g_message (_("Error: Default resolution must not be zero.")); - core_config->default_xresolution = old_default_xresolution; - core_config->default_yresolution = old_default_yresolution; + the_gimp->config->default_xresolution = old_default_xresolution; + the_gimp->config->default_yresolution = old_default_yresolution; return PREFS_CORRUPT; } - if (core_config->default_resolution_units < GIMP_UNIT_INCH || - core_config->default_resolution_units >= gimp_unit_get_number_of_units ()) + if (the_gimp->config->default_resolution_units < GIMP_UNIT_INCH || + the_gimp->config->default_resolution_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default resolution unit must be within unit range.")); - core_config->default_resolution_units = old_default_resolution_units; + the_gimp->config->default_resolution_units = old_default_resolution_units; return PREFS_CORRUPT; } if (gimprc.monitor_xres < GIMP_MIN_RESOLUTION || @@ -531,14 +531,14 @@ prefs_save_callback (GtkWidget *widget, save_temp_path = base_config->temp_path; save_swap_path = base_config->swap_path; - save_plug_in_path = core_config->plug_in_path; - save_module_path = core_config->module_path; - save_brush_path = core_config->brush_path; - save_pattern_path = core_config->pattern_path; - save_palette_path = core_config->palette_path; - save_gradient_path = core_config->gradient_path; + save_plug_in_path = the_gimp->config->plug_in_path; + save_module_path = the_gimp->config->module_path; + save_brush_path = the_gimp->config->brush_path; + save_pattern_path = the_gimp->config->pattern_path; + save_palette_path = the_gimp->config->palette_path; + save_gradient_path = the_gimp->config->gradient_path; - if (core_config->levels_of_undo != old_levels_of_undo) + if (the_gimp->config->levels_of_undo != old_levels_of_undo) { update = g_list_append (update, "undo-levels"); } @@ -599,32 +599,32 @@ prefs_save_callback (GtkWidget *widget, { update = g_list_append (update, "always-restore-session"); } - if (core_config->default_width != old_default_width || - core_config->default_height != old_default_height) + if (the_gimp->config->default_width != old_default_width || + the_gimp->config->default_height != old_default_height) { update = g_list_append (update, "default-image-size"); } - if (core_config->default_units != old_default_units) + if (the_gimp->config->default_units != old_default_units) { update = g_list_append (update, "default-units"); } - if (ABS (core_config->default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) + if (ABS (the_gimp->config->default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-xresolution"); } - if (ABS (core_config->default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) + if (ABS (the_gimp->config->default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-yresolution"); } - if (core_config->default_resolution_units != old_default_resolution_units) + if (the_gimp->config->default_resolution_units != old_default_resolution_units) { update = g_list_append (update, "default-resolution-units"); } - if (core_config->default_type != old_default_type) + if (the_gimp->config->default_type != old_default_type) { update = g_list_append (update, "default-image-type"); } - if (prefs_strcmp (core_config->default_comment, old_default_comment)) + if (prefs_strcmp (the_gimp->config->default_comment, old_default_comment)) { update = g_list_append (update, "default-comment"); } @@ -683,7 +683,7 @@ prefs_save_callback (GtkWidget *widget, { update = g_list_append (update, "max-new-image-size"); } - if (core_config->thumbnail_mode != old_thumbnail_mode) + if (the_gimp->config->thumbnail_mode != old_thumbnail_mode) { update = g_list_append (update, "thumbnail-mode"); } @@ -776,32 +776,32 @@ prefs_save_callback (GtkWidget *widget, } if (prefs_strcmp (old_plug_in_path, edit_plug_in_path)) { - core_config->plug_in_path = edit_plug_in_path; + the_gimp->config->plug_in_path = edit_plug_in_path; update = g_list_append (update, "plug-in-path"); } if (prefs_strcmp (old_module_path, edit_module_path)) { - core_config->module_path = edit_module_path; + the_gimp->config->module_path = edit_module_path; update = g_list_append (update, "module-path"); } if (prefs_strcmp (old_brush_path, edit_brush_path)) { - core_config->brush_path = edit_brush_path; + the_gimp->config->brush_path = edit_brush_path; update = g_list_append (update, "brush-path"); } if (prefs_strcmp (old_pattern_path, edit_pattern_path)) { - core_config->pattern_path = edit_pattern_path; + the_gimp->config->pattern_path = edit_pattern_path; update = g_list_append (update, "pattern-path"); } if (prefs_strcmp (old_palette_path, edit_palette_path)) { - core_config->palette_path = edit_palette_path; + the_gimp->config->palette_path = edit_palette_path; update = g_list_append (update, "palette-path"); } if (prefs_strcmp (old_gradient_path, edit_gradient_path)) { - core_config->gradient_path = edit_gradient_path; + the_gimp->config->gradient_path = edit_gradient_path; update = g_list_append (update, "gradient-path"); } @@ -833,12 +833,12 @@ prefs_save_callback (GtkWidget *widget, base_config->temp_path = save_temp_path; base_config->swap_path = save_swap_path; - core_config->plug_in_path = save_plug_in_path; - core_config->module_path = save_module_path; - core_config->brush_path = save_brush_path; - core_config->pattern_path = save_pattern_path; - core_config->palette_path = save_palette_path; - core_config->gradient_path = save_gradient_path; + the_gimp->config->plug_in_path = save_plug_in_path; + the_gimp->config->module_path = save_module_path; + the_gimp->config->brush_path = save_brush_path; + the_gimp->config->pattern_path = save_pattern_path; + the_gimp->config->palette_path = save_palette_path; + the_gimp->config->gradient_path = save_gradient_path; /* no need to restore values which are only changed on "OK" and "Save" */ @@ -857,15 +857,15 @@ prefs_cancel_callback (GtkWidget *widget, base_config->interpolation_type = old_interpolation_type; base_config->num_processors = old_num_processors; - core_config->default_type = old_default_type; - core_config->default_width = old_default_width; - core_config->default_height = old_default_height; - core_config->default_units = old_default_units; - core_config->default_xresolution = old_default_xresolution; - core_config->default_yresolution = old_default_yresolution; - core_config->default_resolution_units = old_default_resolution_units; - core_config->levels_of_undo = old_levels_of_undo; - core_config->thumbnail_mode = old_thumbnail_mode; + the_gimp->config->default_type = old_default_type; + the_gimp->config->default_width = old_default_width; + the_gimp->config->default_height = old_default_height; + the_gimp->config->default_units = old_default_units; + the_gimp->config->default_xresolution = old_default_xresolution; + the_gimp->config->default_yresolution = old_default_yresolution; + the_gimp->config->default_resolution_units = old_default_resolution_units; + the_gimp->config->levels_of_undo = old_levels_of_undo; + the_gimp->config->thumbnail_mode = old_thumbnail_mode; gimprc.marching_speed = old_marching_speed; gimprc.allow_resize_windows = old_allow_resize_windows; @@ -917,7 +917,7 @@ prefs_cancel_callback (GtkWidget *widget, } prefs_strset (&gimprc.image_title_format, old_image_title_format); - prefs_strset (&core_config->default_comment, old_default_comment); + prefs_strset (&the_gimp->config->default_comment, old_default_comment); tool_manager_set_global_paint_options (the_gimp, old_global_paint_options); @@ -981,8 +981,8 @@ prefs_toggle_callback (GtkWidget *widget, /* radio buttons */ else if (data == &base_config->interpolation_type || - data == &core_config->default_type || - data == &core_config->thumbnail_mode || + data == &the_gimp->config->default_type || + data == &the_gimp->config->thumbnail_mode || data == &gimprc.trust_dirty_flag || data == &gimprc.help_browser || data == &gimprc.cursor_mode) @@ -1110,11 +1110,11 @@ static void prefs_default_size_callback (GtkWidget *widget, gpointer data) { - core_config->default_width = + the_gimp->config->default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0)); - core_config->default_height = + the_gimp->config->default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1)); - core_config->default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); + the_gimp->config->default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } static void @@ -1159,15 +1159,15 @@ prefs_default_resolution_callback (GtkWidget *widget, gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 1, yres, FALSE); - core_config->default_width = + the_gimp->config->default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0)); - core_config->default_height = + the_gimp->config->default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1)); - core_config->default_xresolution = xres; - core_config->default_yresolution = yres; + the_gimp->config->default_xresolution = xres; + the_gimp->config->default_yresolution = yres; - core_config->default_resolution_units = + the_gimp->config->default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } @@ -1411,12 +1411,12 @@ preferences_dialog_create (void) edit_temp_path = prefs_strdup (base_config->temp_path); edit_swap_path = prefs_strdup (base_config->swap_path); - edit_plug_in_path = prefs_strdup (core_config->plug_in_path); - edit_module_path = prefs_strdup (core_config->module_path); - edit_brush_path = prefs_strdup (core_config->brush_path); - edit_pattern_path = prefs_strdup (core_config->pattern_path); - edit_palette_path = prefs_strdup (core_config->palette_path); - edit_gradient_path = prefs_strdup (core_config->gradient_path); + edit_plug_in_path = prefs_strdup (the_gimp->config->plug_in_path); + edit_module_path = prefs_strdup (the_gimp->config->module_path); + edit_brush_path = prefs_strdup (the_gimp->config->brush_path); + edit_pattern_path = prefs_strdup (the_gimp->config->pattern_path); + edit_palette_path = prefs_strdup (the_gimp->config->palette_path); + edit_gradient_path = prefs_strdup (the_gimp->config->gradient_path); } /* assign edit variables for values which get changed on "OK" and "Save" @@ -1428,15 +1428,15 @@ preferences_dialog_create (void) old_interpolation_type = base_config->interpolation_type; old_num_processors = base_config->num_processors; - old_default_type = core_config->default_type; - old_default_width = core_config->default_width; - old_default_height = core_config->default_height; - old_default_units = core_config->default_units; - old_default_xresolution = core_config->default_xresolution; - old_default_yresolution = core_config->default_yresolution; - old_default_resolution_units = core_config->default_resolution_units; - old_levels_of_undo = core_config->levels_of_undo; - old_thumbnail_mode = core_config->thumbnail_mode; + old_default_type = the_gimp->config->default_type; + old_default_width = the_gimp->config->default_width; + old_default_height = the_gimp->config->default_height; + old_default_units = the_gimp->config->default_units; + old_default_xresolution = the_gimp->config->default_xresolution; + old_default_yresolution = the_gimp->config->default_yresolution; + old_default_resolution_units = the_gimp->config->default_resolution_units; + old_levels_of_undo = the_gimp->config->levels_of_undo; + old_thumbnail_mode = the_gimp->config->thumbnail_mode; old_perfectmouse = gimprc.perfectmouse; old_transparency_type = gimprc.transparency_type; @@ -1467,7 +1467,7 @@ preferences_dialog_create (void) old_default_threshold = gimprc.default_threshold; prefs_strset (&old_image_title_format, gimprc.image_title_format); - prefs_strset (&old_default_comment, core_config->default_comment); + prefs_strset (&old_default_comment, the_gimp->config->default_comment); /* values which will need a restart */ old_stingy_memory_use = edit_stingy_memory_use; @@ -1567,7 +1567,7 @@ preferences_dialog_create (void) gtk_widget_show (hbox); sizeentry = - gimp_size_entry_new (2, core_config->default_units, "%p", + gimp_size_entry_new (2, the_gimp->config->default_units, "%p", FALSE, FALSE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_SIZE); @@ -1579,9 +1579,9 @@ preferences_dialog_create (void) _("Pixels"), 1, 4, 0.0); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 0, - core_config->default_xresolution, FALSE); + the_gimp->config->default_xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), 1, - core_config->default_yresolution, FALSE); + the_gimp->config->default_yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); @@ -1589,9 +1589,9 @@ preferences_dialog_create (void) (GIMP_SIZE_ENTRY (sizeentry), 1, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, - core_config->default_width); + the_gimp->config->default_width); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, - core_config->default_height); + the_gimp->config->default_height); gtk_signal_connect (GTK_OBJECT (sizeentry), "unit_changed", GTK_SIGNAL_FUNC (prefs_default_size_callback), @@ -1617,14 +1617,14 @@ preferences_dialog_create (void) pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL); - sizeentry2 = gimp_size_entry_new (2, core_config->default_resolution_units, + sizeentry2 = gimp_size_entry_new (2, the_gimp->config->default_resolution_units, pixels_per_unit, FALSE, FALSE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM); - if (ABS (core_config->default_xresolution - - core_config->default_yresolution) < GIMP_MIN_RESOLUTION) + if (ABS (the_gimp->config->default_xresolution - + the_gimp->config->default_yresolution) < GIMP_MIN_RESOLUTION) gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE); gtk_table_attach_defaults (GTK_TABLE (sizeentry2), button, 1, 3, 3, 4); gtk_widget_show (button); @@ -1644,9 +1644,9 @@ preferences_dialog_create (void) (GIMP_SIZE_ENTRY (sizeentry2), 1, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), 0, - core_config->default_xresolution); + the_gimp->config->default_xresolution); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), 1, - core_config->default_yresolution); + the_gimp->config->default_yresolution); gtk_signal_connect (GTK_OBJECT (sizeentry2), "unit_changed", (GtkSignalFunc) prefs_default_resolution_callback, @@ -1674,8 +1674,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &core_config->default_type, - (gpointer) core_config->default_type, + &the_gimp->config->default_type, + (gpointer) the_gimp->config->default_type, _("RGB"), (gpointer) RGB, NULL, _("Grayscale"), (gpointer) GRAY, NULL, @@ -1721,10 +1721,10 @@ preferences_dialog_create (void) text = gtk_text_new (NULL, NULL); gtk_text_set_editable (GTK_TEXT (text), TRUE); gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, - core_config->default_comment, -1); + the_gimp->config->default_comment, -1); gtk_signal_connect (GTK_OBJECT (text), "changed", GTK_SIGNAL_FUNC (prefs_text_callback), - &core_config->default_comment); + &the_gimp->config->default_comment); gtk_container_add (GTK_CONTAINER (hbox), text); gtk_widget_show (text); @@ -2238,11 +2238,11 @@ preferences_dialog_create (void) gtk_widget_show (table); /* Levels of Undo */ - spinbutton = gimp_spin_button_new (&adjustment, core_config->levels_of_undo, + spinbutton = gimp_spin_button_new (&adjustment, the_gimp->config->levels_of_undo, 0.0, 255.0, 1.0, 5.0, 0.0, 1.0, 0.0); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", GTK_SIGNAL_FUNC (gimp_int_adjustment_update), - &core_config->levels_of_undo); + &the_gimp->config->levels_of_undo); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Levels of Undo:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2317,8 +2317,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &core_config->thumbnail_mode, - (gpointer) core_config->thumbnail_mode, + &the_gimp->config->thumbnail_mode, + (gpointer) the_gimp->config->thumbnail_mode, _("Always"), (gpointer) 1, NULL, _("Never"), (gpointer) 0, NULL, diff --git a/app/gui/resize-dialog.c b/app/gui/resize-dialog.c index 4feb074774..e3975d89ef 100644 --- a/app/gui/resize-dialog.c +++ b/app/gui/resize-dialog.c @@ -26,12 +26,15 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpimage.h" #include "core/gimplayer.h" #include "resize-dialog.h" +#include "app_procs.h" + #include "libgimp/gimpintl.h" @@ -592,7 +595,7 @@ resize_widget_new (ResizeType type, gtk_widget_set_usize (spinbutton, 75, 0); private->resolution_se = - gimp_size_entry_new (1, core_config->default_resolution_units, + gimp_size_entry_new (1, the_gimp->config->default_resolution_units, _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); diff --git a/app/gui/user-install-dialog.c b/app/gui/user-install-dialog.c index c5605f9624..522db344ad 100644 --- a/app/gui/user-install-dialog.c +++ b/app/gui/user-install-dialog.c @@ -38,12 +38,13 @@ #include "base/base-config.h" +#include "core/gimpunit.h" + #include "gui/resolution-calibrate-dialog.h" #include "appenv.h" #include "gdisplay_ops.h" #include "gimprc.h" -#include "unitrc.h" #include "user_install.h" #include "libgimp/gimpintl.h" diff --git a/app/libgimp_glue.c b/app/libgimp_glue.c index 454abf9aa4..c2394d768e 100644 --- a/app/libgimp_glue.c +++ b/app/libgimp_glue.c @@ -26,9 +26,9 @@ #include "core/gimp.h" #include "core/gimpcontext.h" +#include "core/gimpunit.h" #include "app_procs.h" -#include "unitrc.h" #include "libgimp_glue.h" diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index 00c051bfa3..db969a9dbe 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/module_db.c b/app/module_db.c index 1239a3fd0d..c6d73b0821 100644 --- a/app/module_db.c +++ b/app/module_db.c @@ -38,10 +38,12 @@ #include "core/core-types.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimplist.h" +#include "app_procs.h" #include "appenv.h" #include "module_db.h" #include "gimprc.h" @@ -218,7 +220,7 @@ module_db_init (void) modules = gimp_list_new (MODULE_INFO_TYPE, GIMP_CONTAINER_POLICY_WEAK); if (g_module_supported ()) - gimp_datafiles_read_directories (core_config->module_path, 0 /* no flags */, + gimp_datafiles_read_directories (the_gimp->config->module_path, 0 /* no flags */, module_initialize, NULL); #ifdef DUMP_DB gimp_container_foreach (modules, print_module_info, NULL); @@ -616,7 +618,7 @@ module_initialize (const gchar *filename, mod->refs = 0; mod->load_inhibit = module_inhibited (mod->fullpath, - core_config->module_db_load_inhibit); + the_gimp->config->module_db_load_inhibit); if (!mod->load_inhibit) { if (be_verbose) @@ -1138,7 +1140,7 @@ browser_refresh_callback (GtkWidget *widget, kill_list = NULL; /* walk filesystem and add new things we find */ - gimp_datafiles_read_directories (core_config->module_path, 0 /* no flags */, + gimp_datafiles_read_directories (the_gimp->config->module_path, 0 /* no flags */, module_initialize, NULL); } diff --git a/app/pdb/channel_cmds.c b/app/pdb/channel_cmds.c index 5d8770c775..73f14cdf62 100644 --- a/app/pdb/channel_cmds.c +++ b/app/pdb/channel_cmds.c @@ -87,7 +87,7 @@ channel_new_invoker (Gimp *gimp, GimpRGB color; GimpChannel *channel = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -194,7 +194,7 @@ channel_copy_invoker (Gimp *gimp, GimpChannel *channel; GimpChannel *copy = NULL; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -250,7 +250,7 @@ channel_delete_invoker (Gimp *gimp, gboolean success = TRUE; GimpChannel *channel; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -296,11 +296,11 @@ channel_combine_masks_invoker (Gimp *gimp, gint32 offx; gint32 offy; - channel1 = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel1 = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel1 == NULL) success = FALSE; - channel2 = (GimpChannel *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + channel2 = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (channel2 == NULL) success = FALSE; @@ -373,7 +373,7 @@ channel_get_name_invoker (Gimp *gimp, Argument *return_args; GimpChannel *channel; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -427,7 +427,7 @@ channel_set_name_invoker (Gimp *gimp, GimpChannel *channel; gchar *name; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -479,7 +479,7 @@ channel_get_visible_invoker (Gimp *gimp, Argument *return_args; GimpChannel *channel; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -533,7 +533,7 @@ channel_set_visible_invoker (Gimp *gimp, GimpChannel *channel; gboolean visible; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -583,7 +583,7 @@ channel_get_show_masked_invoker (Gimp *gimp, Argument *return_args; GimpChannel *channel; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -637,7 +637,7 @@ channel_set_show_masked_invoker (Gimp *gimp, GimpChannel *channel; gboolean show_masked; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -687,7 +687,7 @@ channel_get_opacity_invoker (Gimp *gimp, Argument *return_args; GimpChannel *channel; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -741,7 +741,7 @@ channel_set_opacity_invoker (Gimp *gimp, GimpChannel *channel; gdouble opacity; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -794,7 +794,7 @@ channel_get_color_invoker (Gimp *gimp, GimpChannel *channel; GimpRGB color; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -853,7 +853,7 @@ channel_set_color_invoker (Gimp *gimp, GimpChannel *channel; GimpRGB color; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -908,7 +908,7 @@ channel_get_tattoo_invoker (Gimp *gimp, Argument *return_args; GimpChannel *channel; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -962,7 +962,7 @@ channel_set_tattoo_invoker (Gimp *gimp, GimpChannel *channel; gint32 tattoo; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; diff --git a/app/pdb/color_cmds.c b/app/pdb/color_cmds.c index 3a0b98a538..0e6ae8ba24 100644 --- a/app/pdb/color_cmds.c +++ b/app/pdb/color_cmds.c @@ -90,7 +90,7 @@ brightness_contrast_invoker (Gimp *gimp, PixelRegion srcPR, destPR; int x1, y1, x2, y2; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -191,7 +191,7 @@ levels_invoker (Gimp *gimp, int low_output[5]; int high_output[5]; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -335,7 +335,7 @@ posterize_invoker (Gimp *gimp, PixelRegion srcPR, destPR; int x1, y1, x2, y2; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -410,7 +410,7 @@ desaturate_invoker (Gimp *gimp, gboolean success = TRUE; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -458,7 +458,7 @@ equalize_invoker (Gimp *gimp, GimpDrawable *drawable; gboolean mask_only; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -512,7 +512,7 @@ invert_invoker (Gimp *gimp, gboolean success = TRUE; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -566,7 +566,7 @@ curves_spline_invoker (Gimp *gimp, int i, j; PixelRegion srcPR, destPR; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -688,7 +688,7 @@ curves_explicit_invoker (Gimp *gimp, int i, j; PixelRegion srcPR, destPR; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -800,7 +800,7 @@ color_balance_invoker (Gimp *gimp, PixelRegion srcPR, destPR; int x1, y1, x2, y2; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -929,7 +929,7 @@ histogram_invoker (Gimp *gimp, gboolean no_mask; GimpChannel *mask; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1094,7 +1094,7 @@ hue_saturation_invoker (Gimp *gimp, PixelRegion srcPR, destPR; int x1, y1, x2, y2; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1211,7 +1211,7 @@ threshold_invoker (Gimp *gimp, int x1, y1, x2, y2; PixelRegion srcPR, destPR; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; diff --git a/app/pdb/convert_cmds.c b/app/pdb/convert_cmds.c index 832811703b..68000b7936 100644 --- a/app/pdb/convert_cmds.c +++ b/app/pdb/convert_cmds.c @@ -54,7 +54,7 @@ convert_rgb_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -97,7 +97,7 @@ convert_grayscale_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -146,7 +146,7 @@ convert_indexed_invoker (Gimp *gimp, gboolean remove_unused; gchar *palette_name; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; diff --git a/app/pdb/display_cmds.c b/app/pdb/display_cmds.c index de28847617..fc8038cdb4 100644 --- a/app/pdb/display_cmds.c +++ b/app/pdb/display_cmds.c @@ -53,7 +53,7 @@ display_new_invoker (Gimp *gimp, GDisplay *gdisp = NULL; guint scale = 0x101; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -114,7 +114,7 @@ display_delete_invoker (Gimp *gimp, gboolean success = TRUE; GDisplay *gdisp; - gdisp = gdisplay_get_by_ID (args[0].value.pdb_int); + gdisp = gdisplay_get_by_ID (gimp, args[0].value.pdb_int); if (gdisp == NULL) success = FALSE; diff --git a/app/pdb/drawable_cmds.c b/app/pdb/drawable_cmds.c index 9b5c90e8d8..d6d9d33fe6 100644 --- a/app/pdb/drawable_cmds.c +++ b/app/pdb/drawable_cmds.c @@ -102,7 +102,7 @@ drawable_merge_shadow_invoker (Gimp *gimp, GimpDrawable *drawable; gboolean undo; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -152,7 +152,7 @@ drawable_fill_invoker (Gimp *gimp, GimpDrawable *drawable; gint32 fill_type; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -207,7 +207,7 @@ drawable_update_invoker (Gimp *gimp, gint32 width; gint32 height; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -283,7 +283,7 @@ drawable_mask_bounds_invoker (Gimp *gimp, gint32 x2; gint32 y2; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -367,7 +367,7 @@ drawable_image_invoker (Gimp *gimp, GimpDrawable *drawable; GimpImage *gimage = NULL; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -424,7 +424,7 @@ drawable_type_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -478,7 +478,7 @@ drawable_has_alpha_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -532,7 +532,7 @@ drawable_type_with_alpha_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -586,7 +586,7 @@ drawable_is_rgb_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -640,7 +640,7 @@ drawable_is_gray_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -694,7 +694,7 @@ drawable_is_indexed_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -748,7 +748,7 @@ drawable_bytes_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -802,7 +802,7 @@ drawable_width_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -856,7 +856,7 @@ drawable_height_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -912,7 +912,7 @@ drawable_offsets_invoker (Gimp *gimp, gint32 offset_x; gint32 offset_y; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -977,7 +977,7 @@ drawable_is_layer_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1031,7 +1031,7 @@ drawable_is_layer_mask_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1085,7 +1085,7 @@ drawable_is_channel_invoker (Gimp *gimp, Argument *return_args; GimpDrawable *drawable; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1146,7 +1146,7 @@ drawable_get_pixel_invoker (Gimp *gimp, gint b; Tile *tile; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1255,7 +1255,7 @@ drawable_set_pixel_invoker (Gimp *gimp, gint b; Tile *tile; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1349,11 +1349,11 @@ drawable_set_image_invoker (Gimp *gimp, GimpDrawable *drawable; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; - gimage = gimp_image_get_by_ID (args[1].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[1].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1408,7 +1408,7 @@ drawable_thumbnail_invoker (Gimp *gimp, gint32 num_pixels = 0; guint8 *thumbnail_data = NULL; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1537,7 +1537,7 @@ drawable_offset_invoker (Gimp *gimp, gint32 offset_x; gint32 offset_y; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; diff --git a/app/pdb/edit_cmds.c b/app/pdb/edit_cmds.c index 802ec615e2..6a4689a90a 100644 --- a/app/pdb/edit_cmds.c +++ b/app/pdb/edit_cmds.c @@ -61,7 +61,7 @@ edit_cut_invoker (Gimp *gimp, GimpDrawable *drawable; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -107,7 +107,7 @@ edit_copy_invoker (Gimp *gimp, GimpDrawable *drawable; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -156,7 +156,7 @@ edit_paste_invoker (Gimp *gimp, GimpLayer *layer = NULL; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -224,7 +224,7 @@ edit_clear_invoker (Gimp *gimp, GimpDrawable *drawable; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -271,7 +271,7 @@ edit_fill_invoker (Gimp *gimp, gint32 fill_type; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -326,7 +326,7 @@ edit_stroke_invoker (Gimp *gimp, GimpDrawable *drawable; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; diff --git a/app/pdb/fileops_cmds.c b/app/pdb/fileops_cmds.c index a8e7f7cdba..1ade1f9ec9 100644 --- a/app/pdb/fileops_cmds.c +++ b/app/pdb/fileops_cmds.c @@ -330,7 +330,7 @@ file_save_thumbnail_invoker (Gimp *gimp, gchar *filename; TempBuf *thumb; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; diff --git a/app/pdb/floating_sel_cmds.c b/app/pdb/floating_sel_cmds.c index cd57968d84..4e78994767 100644 --- a/app/pdb/floating_sel_cmds.c +++ b/app/pdb/floating_sel_cmds.c @@ -57,7 +57,7 @@ floating_sel_remove_invoker (Gimp *gimp, gboolean success = TRUE; GimpLayer *floating_sel; - floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (floating_sel == NULL) success = FALSE; @@ -104,7 +104,7 @@ floating_sel_anchor_invoker (Gimp *gimp, gboolean success = TRUE; GimpLayer *floating_sel; - floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (floating_sel == NULL) success = FALSE; @@ -151,7 +151,7 @@ floating_sel_to_layer_invoker (Gimp *gimp, gboolean success = TRUE; GimpLayer *floating_sel; - floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (floating_sel == NULL) success = FALSE; @@ -199,11 +199,11 @@ floating_sel_attach_invoker (Gimp *gimp, GimpLayer *layer; GimpDrawable *drawable; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; - drawable = gimp_drawable_get_by_ID (args[1].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -251,7 +251,7 @@ floating_sel_rigor_invoker (Gimp *gimp, GimpLayer *floating_sel; gboolean undo; - floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (floating_sel == NULL) success = FALSE; @@ -306,7 +306,7 @@ floating_sel_relax_invoker (Gimp *gimp, GimpLayer *floating_sel; gboolean undo; - floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + floating_sel = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (floating_sel == NULL) success = FALSE; diff --git a/app/pdb/guides_cmds.c b/app/pdb/guides_cmds.c index 17aa65c22f..a516a9cce1 100644 --- a/app/pdb/guides_cmds.c +++ b/app/pdb/guides_cmds.c @@ -61,7 +61,7 @@ image_add_hguide_invoker (Gimp *gimp, gint32 guide_ID = 0; GimpGuide *guide; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -140,7 +140,7 @@ image_add_vguide_invoker (Gimp *gimp, gint32 guide_ID = 0; GimpGuide *guide; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -217,7 +217,7 @@ image_delete_guide_invoker (Gimp *gimp, gint32 guide; GList *guides; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -293,7 +293,7 @@ image_find_next_guide_invoker (Gimp *gimp, gint32 next_guide = 0; GList *guides; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -404,7 +404,7 @@ image_get_guide_orientation_invoker (Gimp *gimp, gint32 orientation = 0; GList *guides; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -488,7 +488,7 @@ image_get_guide_position_invoker (Gimp *gimp, gint32 position = 0; GList *guides; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; diff --git a/app/pdb/image_cmds.c b/app/pdb/image_cmds.c index 00ef7aef34..2cad3cf3f1 100644 --- a/app/pdb/image_cmds.c +++ b/app/pdb/image_cmds.c @@ -42,6 +42,7 @@ #include "core/gimplayer.h" #include "core/gimplayermask.h" #include "core/gimplist.h" +#include "core/gimpunit.h" #include "gdisplay.h" #include "libgimp/gimpintl.h" @@ -333,7 +334,7 @@ image_resize_invoker (Gimp *gimp, gint32 offx; gint32 offy; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -412,7 +413,7 @@ image_scale_invoker (Gimp *gimp, gint32 new_width; gint32 new_height; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -479,7 +480,7 @@ image_crop_invoker (Gimp *gimp, gint32 offx; gint32 offy; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -565,7 +566,7 @@ image_delete_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -607,7 +608,7 @@ image_free_shadow_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -654,7 +655,7 @@ image_get_layers_invoker (Gimp *gimp, GList *list = NULL; int i; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -733,7 +734,7 @@ image_get_channels_invoker (Gimp *gimp, GList *list = NULL; int i; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -807,7 +808,7 @@ image_unset_active_channel_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -853,7 +854,7 @@ image_pick_correlate_layer_invoker (Gimp *gimp, gint32 y; GimpLayer *layer = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -924,11 +925,11 @@ image_raise_layer_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *layer; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -976,11 +977,11 @@ image_lower_layer_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *layer; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1028,11 +1029,11 @@ image_raise_layer_to_top_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *layer; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1080,11 +1081,11 @@ image_lower_layer_to_bottom_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *layer; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1134,7 +1135,7 @@ image_merge_visible_layers_invoker (Gimp *gimp, gint32 merge_type; GimpLayer *layer = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1206,11 +1207,11 @@ image_merge_down_invoker (Gimp *gimp, gint32 merge_type; GimpLayer *layer = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - merge_layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + merge_layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (merge_layer == NULL) success = FALSE; @@ -1285,7 +1286,7 @@ image_flatten_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *layer = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1343,11 +1344,11 @@ image_add_layer_invoker (Gimp *gimp, GimpLayer *layer; gint32 position; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1409,11 +1410,11 @@ image_remove_layer_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *layer; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1462,15 +1463,15 @@ image_add_layer_mask_invoker (Gimp *gimp, GimpLayer *layer; GimpLayerMask *mask; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; - mask = (GimpLayerMask *) gimp_drawable_get_by_ID (args[2].value.pdb_int); + mask = (GimpLayerMask *) gimp_drawable_get_by_ID (gimp, args[2].value.pdb_int); if (mask == NULL) success = FALSE; @@ -1524,11 +1525,11 @@ image_remove_layer_mask_invoker (Gimp *gimp, GimpLayer *layer; gint32 mode; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1585,11 +1586,11 @@ image_raise_channel_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *channel; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (channel == NULL) success = FALSE; @@ -1637,11 +1638,11 @@ image_lower_channel_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *layer; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1690,11 +1691,11 @@ image_add_channel_invoker (Gimp *gimp, GimpChannel *channel; gint32 position; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (channel == NULL) success = FALSE; @@ -1749,11 +1750,11 @@ image_remove_channel_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *channel; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (channel == NULL) success = FALSE; @@ -1802,7 +1803,7 @@ image_active_drawable_invoker (Gimp *gimp, GimpImage *gimage; GimpDrawable *drawable = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1860,7 +1861,7 @@ image_base_type_invoker (Gimp *gimp, GimpImage *gimage; gint32 base_type = 0; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1919,7 +1920,7 @@ image_get_cmap_invoker (Gimp *gimp, gint32 num_bytes = 0; guint8 *cmap = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1989,7 +1990,7 @@ image_set_cmap_invoker (Gimp *gimp, gint32 num_bytes; guint8 *cmap; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2060,7 +2061,7 @@ image_undo_is_enabled_invoker (Gimp *gimp, GimpImage *gimage; gboolean enabled = FALSE; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2117,7 +2118,7 @@ image_undo_enable_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2174,7 +2175,7 @@ image_undo_disable_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2231,7 +2232,7 @@ image_undo_freeze_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2288,7 +2289,7 @@ image_undo_thaw_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2344,7 +2345,7 @@ image_clean_all_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2388,7 +2389,7 @@ image_floating_selection_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *floating_sel = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2447,7 +2448,7 @@ image_floating_sel_attached_to_invoker (Gimp *gimp, GimpDrawable *drawable = NULL; GimpLayer *floating_sel; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2518,7 +2519,7 @@ image_thumbnail_invoker (Gimp *gimp, gint32 num_bytes = 0; guint8 *thumbnail_data = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2645,7 +2646,7 @@ image_set_tattoo_state_invoker (Gimp *gimp, GimpImage *gimage; gint32 tattoo; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2698,7 +2699,7 @@ image_get_tattoo_state_invoker (Gimp *gimp, GimpImage *gimage; gint32 tattoo = 0; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2758,7 +2759,7 @@ image_duplicate_invoker (Gimp *gimp, GimpImage *gimage; GimpImage *new_gimage = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2815,7 +2816,7 @@ image_width_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2869,7 +2870,7 @@ image_height_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2924,7 +2925,7 @@ image_get_active_layer_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *active_layer = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2981,11 +2982,11 @@ image_set_active_layer_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *active_layer; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - active_layer = (GimpLayer *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + active_layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (active_layer == NULL) success = FALSE; @@ -3034,7 +3035,7 @@ image_get_active_channel_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *active_channel = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3091,11 +3092,11 @@ image_set_active_channel_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *active_channel; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - active_channel = (GimpChannel *) gimp_drawable_get_by_ID (args[1].value.pdb_int); + active_channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (active_channel == NULL) success = FALSE; @@ -3144,7 +3145,7 @@ image_get_selection_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *selection = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3202,7 +3203,7 @@ image_get_component_active_invoker (Gimp *gimp, GimpImage *gimage; gint32 component; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3276,7 +3277,7 @@ image_set_component_active_invoker (Gimp *gimp, gint32 component; gboolean active; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3346,7 +3347,7 @@ image_get_component_visible_invoker (Gimp *gimp, GimpImage *gimage; gint32 component; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3420,7 +3421,7 @@ image_set_component_visible_invoker (Gimp *gimp, gint32 component; gboolean visible; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3489,7 +3490,7 @@ image_get_filename_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3543,7 +3544,7 @@ image_set_filename_invoker (Gimp *gimp, GimpImage *gimage; gchar *filename; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3595,7 +3596,7 @@ image_get_resolution_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3658,7 +3659,7 @@ image_set_resolution_invoker (Gimp *gimp, gdouble xresolution; gdouble yresolution; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3730,7 +3731,7 @@ image_get_unit_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3784,7 +3785,7 @@ image_set_unit_invoker (Gimp *gimp, GimpImage *gimage; GimpUnit unit; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3838,7 +3839,7 @@ image_get_layer_by_tattoo_invoker (Gimp *gimp, gint32 tattoo; GimpLayer *layer = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -3909,7 +3910,7 @@ image_get_channel_by_tattoo_invoker (Gimp *gimp, gint32 tattoo; GimpChannel *channel = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; diff --git a/app/pdb/layer_cmds.c b/app/pdb/layer_cmds.c index 6f472a5156..61a127ac59 100644 --- a/app/pdb/layer_cmds.c +++ b/app/pdb/layer_cmds.c @@ -123,7 +123,7 @@ layer_new_invoker (Gimp *gimp, GimpLayer *layer = NULL; int opacity; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -240,7 +240,7 @@ layer_copy_invoker (Gimp *gimp, gboolean add_alpha; GimpLayer *copy = NULL; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -306,7 +306,7 @@ layer_create_mask_invoker (Gimp *gimp, gint32 mask_type; GimpLayerMask *mask = NULL; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -376,7 +376,7 @@ layer_scale_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *floating_layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -468,7 +468,7 @@ layer_resize_invoker (Gimp *gimp, GimpImage *gimage; GimpLayer *floating_layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -561,7 +561,7 @@ layer_delete_invoker (Gimp *gimp, gboolean success = TRUE; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -609,7 +609,7 @@ layer_translate_invoker (Gimp *gimp, GimpLayer *tmp_layer; GList *layer_list; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -692,7 +692,7 @@ layer_add_alpha_invoker (Gimp *gimp, gboolean success = TRUE; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -740,7 +740,7 @@ layer_set_offsets_invoker (Gimp *gimp, GimpLayer *tmp_layer; GList *layer_list; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -826,7 +826,7 @@ layer_mask_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -880,7 +880,7 @@ layer_is_floating_sel_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -934,7 +934,7 @@ layer_get_name_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -988,7 +988,7 @@ layer_set_name_invoker (Gimp *gimp, GimpLayer *layer; gchar *name; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1040,7 +1040,7 @@ layer_get_visible_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1094,7 +1094,7 @@ layer_set_visible_invoker (Gimp *gimp, GimpLayer *layer; gboolean visible; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1144,7 +1144,7 @@ layer_get_preserve_trans_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1198,7 +1198,7 @@ layer_set_preserve_trans_invoker (Gimp *gimp, GimpLayer *layer; gboolean preserve_trans; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1248,7 +1248,7 @@ layer_get_apply_mask_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1302,7 +1302,7 @@ layer_set_apply_mask_invoker (Gimp *gimp, GimpLayer *layer; gboolean apply_mask; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1352,7 +1352,7 @@ layer_get_show_mask_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1406,7 +1406,7 @@ layer_set_show_mask_invoker (Gimp *gimp, GimpLayer *layer; gboolean show_mask; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1456,7 +1456,7 @@ layer_get_edit_mask_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1510,7 +1510,7 @@ layer_set_edit_mask_invoker (Gimp *gimp, GimpLayer *layer; gboolean edit_mask; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1560,7 +1560,7 @@ layer_get_opacity_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1614,7 +1614,7 @@ layer_set_opacity_invoker (Gimp *gimp, GimpLayer *layer; gdouble opacity; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1666,7 +1666,7 @@ layer_get_mode_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1720,7 +1720,7 @@ layer_set_mode_invoker (Gimp *gimp, GimpLayer *layer; gint32 mode; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1772,7 +1772,7 @@ layer_get_linked_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1826,7 +1826,7 @@ layer_set_linked_invoker (Gimp *gimp, GimpLayer *layer; gboolean linked; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1876,7 +1876,7 @@ layer_get_tattoo_invoker (Gimp *gimp, Argument *return_args; GimpLayer *layer; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -1930,7 +1930,7 @@ layer_set_tattoo_invoker (Gimp *gimp, GimpLayer *layer; gint32 tattoo; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; diff --git a/app/pdb/parasite_cmds.c b/app/pdb/parasite_cmds.c index 98bc9c7488..d9daef8305 100644 --- a/app/pdb/parasite_cmds.c +++ b/app/pdb/parasite_cmds.c @@ -267,7 +267,7 @@ drawable_parasite_find_invoker (Gimp *gimp, gchar *name; GimpParasite *parasite = NULL; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -336,7 +336,7 @@ drawable_parasite_attach_invoker (Gimp *gimp, GimpDrawable *drawable; GimpParasite *parasite; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -388,7 +388,7 @@ drawable_parasite_detach_invoker (Gimp *gimp, GimpDrawable *drawable; gchar *name; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -442,7 +442,7 @@ drawable_parasite_list_invoker (Gimp *gimp, gint32 num_parasites; gchar **parasites = NULL; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -509,7 +509,7 @@ image_parasite_find_invoker (Gimp *gimp, gchar *name; GimpParasite *parasite = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -578,7 +578,7 @@ image_parasite_attach_invoker (Gimp *gimp, GimpImage *gimage; GimpParasite *parasite; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -630,7 +630,7 @@ image_parasite_detach_invoker (Gimp *gimp, GimpImage *gimage; gchar *name; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -684,7 +684,7 @@ image_parasite_list_invoker (Gimp *gimp, gint32 num_parasites; gchar **parasites = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; diff --git a/app/pdb/paths_cmds.c b/app/pdb/paths_cmds.c index 49c68f7782..22ebe953ff 100644 --- a/app/pdb/paths_cmds.c +++ b/app/pdb/paths_cmds.c @@ -77,7 +77,7 @@ path_list_invoker (Gimp *gimp, gchar **path_list = NULL; PathList *plist; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -165,7 +165,7 @@ path_get_points_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -301,7 +301,7 @@ path_get_current_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -366,7 +366,7 @@ path_set_current_invoker (Gimp *gimp, GimpImage *gimage; gchar *pname; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -422,7 +422,7 @@ path_set_points_invoker (Gimp *gimp, gdouble *pnts; gboolean pclosed = FALSE; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -507,7 +507,7 @@ path_stroke_current_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -571,7 +571,7 @@ path_get_point_at_dist_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -666,7 +666,7 @@ path_get_tattoo_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -761,7 +761,7 @@ get_path_by_tattoo_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -836,7 +836,7 @@ path_delete_invoker (Gimp *gimp, GimpImage *gimage; gchar *pname; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -892,7 +892,7 @@ path_get_locked_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -987,7 +987,7 @@ path_set_locked_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1075,7 +1075,7 @@ path_set_tattoo_invoker (Gimp *gimp, PathList *plist; Path *pptr = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; diff --git a/app/pdb/selection_cmds.c b/app/pdb/selection_cmds.c index 08f0d47c05..17b76a55a5 100644 --- a/app/pdb/selection_cmds.c +++ b/app/pdb/selection_cmds.c @@ -90,7 +90,7 @@ selection_bounds_invoker (Gimp *gimp, gint32 x2; gint32 y2; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -175,7 +175,7 @@ selection_value_invoker (Gimp *gimp, gint32 x; gint32 y; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -243,7 +243,7 @@ selection_is_empty_invoker (Gimp *gimp, Argument *return_args; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -298,7 +298,7 @@ selection_translate_invoker (Gimp *gimp, gint32 offx; gint32 offy; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -359,7 +359,7 @@ selection_float_invoker (Gimp *gimp, GimpLayer *layer = NULL; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -433,7 +433,7 @@ selection_clear_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -475,7 +475,7 @@ selection_invert_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -517,7 +517,7 @@ selection_sharpen_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -559,7 +559,7 @@ selection_all_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -601,7 +601,7 @@ selection_none_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -644,7 +644,7 @@ selection_feather_invoker (Gimp *gimp, GimpImage *gimage; gdouble radius; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -696,7 +696,7 @@ selection_border_invoker (Gimp *gimp, GimpImage *gimage; gint32 radius; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -748,7 +748,7 @@ selection_grow_invoker (Gimp *gimp, GimpImage *gimage; gint32 steps; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -800,7 +800,7 @@ selection_shrink_invoker (Gimp *gimp, GimpImage *gimage; gint32 radius; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -852,7 +852,7 @@ selection_layer_alpha_invoker (Gimp *gimp, GimpLayer *layer; GimpImage *gimage; - layer = (GimpLayer *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (layer == NULL) success = FALSE; @@ -898,7 +898,7 @@ selection_load_invoker (Gimp *gimp, GimpChannel *channel; GimpImage *gimage; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; @@ -950,7 +950,7 @@ selection_save_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *channel = NULL; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1009,7 +1009,7 @@ selection_combine_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *new_channel; - channel = (GimpChannel *) gimp_drawable_get_by_ID (args[0].value.pdb_int); + channel = (GimpChannel *) gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (channel == NULL) success = FALSE; diff --git a/app/pdb/text_tool_cmds.c b/app/pdb/text_tool_cmds.c index b66cff8217..7c60b20a71 100644 --- a/app/pdb/text_tool_cmds.c +++ b/app/pdb/text_tool_cmds.c @@ -198,11 +198,11 @@ text_fontname_invoker (Gimp *gimp, GimpLayer *text_layer = NULL; gchar *real_fontname; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - drawable = gimp_drawable_get_by_ID (args[1].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); x = args[2].value.pdb_float; diff --git a/app/pdb/tools_cmds.c b/app/pdb/tools_cmds.c index d16da5f784..0ebd664173 100644 --- a/app/pdb/tools_cmds.c +++ b/app/pdb/tools_cmds.c @@ -135,7 +135,7 @@ airbrush_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -206,7 +206,7 @@ airbrush_default_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -280,7 +280,7 @@ blend_invoker (Gimp *gimp, gdouble y2; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -442,7 +442,7 @@ bucket_fill_invoker (Gimp *gimp, gdouble y; GimpImage *gimage; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -554,7 +554,7 @@ by_color_select_invoker (Gimp *gimp, GimpImage *gimage; guchar fixme[3]; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -662,11 +662,11 @@ clone_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; - src_drawable = gimp_drawable_get_by_ID (args[1].value.pdb_int); + src_drawable = gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); if (src_drawable == NULL) success = FALSE; @@ -757,7 +757,7 @@ clone_default_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -826,11 +826,11 @@ color_picker_invoker (Gimp *gimp, gboolean save_color; GimpRGB color; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; - drawable = gimp_drawable_get_by_ID (args[1].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[1].value.pdb_int); x = args[2].value.pdb_float; @@ -954,7 +954,7 @@ convolve_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1034,7 +1034,7 @@ convolve_default_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1099,7 +1099,7 @@ dodgeburn_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1188,7 +1188,7 @@ dodgeburn_default_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1256,7 +1256,7 @@ ellipse_select_invoker (Gimp *gimp, gboolean feather; gdouble feather_radius; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1365,7 +1365,7 @@ eraser_invoker (Gimp *gimp, gint32 hardness; gint32 method; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1445,7 +1445,7 @@ eraser_default_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1510,7 +1510,7 @@ flip_invoker (Gimp *gimp, TileManager *float_tiles, *new_tiles; gboolean new_layer; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1616,7 +1616,7 @@ free_select_invoker (Gimp *gimp, gboolean feather; gdouble feather_radius; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -1717,7 +1717,7 @@ fuzzy_select_invoker (Gimp *gimp, GimpImage *gimage; GimpChannel *new, *old_fuzzy_mask; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1837,7 +1837,7 @@ paintbrush_invoker (Gimp *gimp, gint32 method; gdouble gradient_length; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1927,7 +1927,7 @@ paintbrush_default_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -1989,7 +1989,7 @@ pencil_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -2059,7 +2059,7 @@ perspective_invoker (Gimp *gimp, gdouble trans_info[8]; GimpMatrix3 m, matrix; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -2231,7 +2231,7 @@ rect_select_invoker (Gimp *gimp, gboolean feather; gdouble feather_radius; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -2338,7 +2338,7 @@ rotate_invoker (Gimp *gimp, gdouble cx, cy; GimpMatrix3 matrix; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -2450,7 +2450,7 @@ scale_invoker (Gimp *gimp, gdouble trans_info[4]; GimpMatrix3 matrix; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -2596,7 +2596,7 @@ shear_invoker (Gimp *gimp, gint offset_x, offset_y; GimpMatrix3 matrix; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -2719,7 +2719,7 @@ smudge_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -2790,7 +2790,7 @@ smudge_default_invoker (Gimp *gimp, gint32 num_strokes; gdouble *strokes; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; @@ -2863,7 +2863,7 @@ transform_2d_invoker (Gimp *gimp, gboolean new_layer; GimpMatrix3 matrix; - drawable = gimp_drawable_get_by_ID (args[0].value.pdb_int); + drawable = gimp_drawable_get_by_ID (gimp, args[0].value.pdb_int); if (drawable == NULL) success = FALSE; diff --git a/app/pdb/undo_cmds.c b/app/pdb/undo_cmds.c index cab08fbc0f..d235a3deb5 100644 --- a/app/pdb/undo_cmds.c +++ b/app/pdb/undo_cmds.c @@ -48,7 +48,7 @@ undo_push_group_start_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; @@ -90,7 +90,7 @@ undo_push_group_end_invoker (Gimp *gimp, gboolean success = TRUE; GimpImage *gimage; - gimage = gimp_image_get_by_ID (args[0].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int); if (gimage == NULL) success = FALSE; diff --git a/app/pdb/unit_cmds.c b/app/pdb/unit_cmds.c index a9f5a8fc5b..c7a6fc148e 100644 --- a/app/pdb/unit_cmds.c +++ b/app/pdb/unit_cmds.c @@ -28,9 +28,9 @@ #include "core/core-types.h" #include "procedural_db.h" -#include "unitrc.h" +#include "core/gimpunit.h" -#include "libgimpbase/gimpunit.h" +#include "libgimpbase/gimpbase.h" static ProcRecord unit_get_number_of_units_proc; static ProcRecord unit_get_number_of_built_in_units_proc; diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-in-def.c b/app/plug-in/plug-in-def.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-in-def.c +++ b/app/plug-in/plug-in-def.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/plug_in.c b/app/plug_in.c index 00c051bfa3..db969a9dbe 100644 --- a/app/plug_in.c +++ b/app/plug_in.c @@ -89,6 +89,7 @@ #include "base/tile.h" #include "base/tile-manager.h" +#include "core/gimp.h" #include "core/gimpcoreconfig.h" #include "core/gimpdatafiles.h" #include "core/gimpdrawable.h" @@ -323,19 +324,19 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (core_config->plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (the_gimp->config->plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (core_config->pluginrc_path) + if (the_gimp->config->pluginrc_path) { - if (g_path_is_absolute (core_config->pluginrc_path)) - filename = g_strdup (core_config->pluginrc_path); + if (g_path_is_absolute (the_gimp->config->pluginrc_path)) + filename = g_strdup (the_gimp->config->pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", gimp_directory (), - core_config->pluginrc_path); + the_gimp->config->pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -855,7 +856,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (core_config->plug_in_path, name); + path = plug_in_search_in_path (the_gimp->config->plug_in_path, name); if (! path) { @@ -1605,9 +1606,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) tile_info = msg.data; if (tile_info->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_info->drawable_ID)); if (!tm) { @@ -1642,9 +1643,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req) else { if (tile_req->shadow) - tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); else - tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID)); + tm = gimp_drawable_data (gimp_drawable_get_by_ID (the_gimp, tile_req->drawable_ID)); if (!tm) { @@ -3517,7 +3518,7 @@ plug_in_progress_init (PlugIn *plug_in, message = plug_in->args[0]; if (gdisp_ID > 0) - gdisp = gdisplay_get_by_ID (gdisp_ID); + gdisp = gdisplay_get_by_ID (the_gimp, gdisp_ID); if (plug_in->progress) plug_in->progress = progress_restart (plug_in->progress, message, diff --git a/app/undo.c b/app/undo.c index d4c28bdc0e..6701b883d5 100644 --- a/app/undo.c +++ b/app/undo.c @@ -34,6 +34,7 @@ #include "paint-funcs/paint-funcs.h" +#include "core/gimp.h" #include "core/gimpchannel.h" #include "core/gimpcontainer.h" #include "core/gimpcoreconfig.h" @@ -313,13 +314,13 @@ static gboolean undo_free_up_space (GimpImage *gimage) { /* If there are 0 levels of undo return FALSE. */ - if (core_config->levels_of_undo == 0) + if (gimage->gimp->config->levels_of_undo == 0) return FALSE; /* Delete the item on the bottom of the stack if we have the maximum * levels of undo already */ - while (gimage->undo_levels >= core_config->levels_of_undo) + while (gimage->undo_levels >= gimage->gimp->config->levels_of_undo) gimage->undo_stack = remove_stack_bottom (gimage); return TRUE; @@ -1180,7 +1181,7 @@ undo_pop_layer_displace (GimpImage *gimage, LayerDisplaceUndo *ldu; ldu = (LayerDisplaceUndo *) info_ptr; - layer = (GimpLayer *) gimp_drawable_get_by_ID (ldu->info[0]); + layer = (GimpLayer *) gimp_drawable_get_by_ID (gimage->gimp, ldu->info[0]); if (layer) { old_offsets[0] = GIMP_DRAWABLE (layer)->offset_x; @@ -2103,7 +2104,7 @@ undo_pop_fs_rigor (GimpImage *gimage, layer_ID = *((gint32 *) layer_ptr); - if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (layer_ID)) == NULL) + if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (gimage->gimp, layer_ID)) == NULL) return FALSE; if (! gimp_layer_is_floating_sel (floating_layer)) @@ -2184,7 +2185,7 @@ undo_pop_fs_relax (GimpImage *gimage, layer_ID = *((gint32 *) layer_ptr); - if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (layer_ID)) == NULL) + if ((floating_layer = (GimpLayer *) gimp_drawable_get_by_ID (gimage->gimp, layer_ID)) == NULL) return FALSE; if (! gimp_layer_is_floating_sel (floating_layer)) diff --git a/app/unitrc.h b/app/unitrc.h deleted file mode 100644 index dea895acb4..0000000000 --- a/app/unitrc.h +++ /dev/null @@ -1,63 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __APP_GIMP_UNIT_H__ -#define __APP_GIMP_UNIT_H__ - - -void gimp_unitrc_load (Gimp *gimp); -void gimp_unitrc_save (Gimp *gimp); - -gint _gimp_unit_get_number_of_units (Gimp *gimp); -gint _gimp_unit_get_number_of_built_in_units (Gimp *gimp); - -GimpUnit _gimp_unit_new (Gimp *gimp, - gchar *identifier, - gdouble factor, - gint digits, - gchar *symbol, - gchar *abbreviation, - gchar *singular, - gchar *plural); - -gboolean _gimp_unit_get_deletion_flag (Gimp *gimp, - GimpUnit unit); -void _gimp_unit_set_deletion_flag (Gimp *gimp, - GimpUnit unit, - gboolean deletion_flag); - -gdouble _gimp_unit_get_factor (Gimp *gimp, - GimpUnit unit); - -gint _gimp_unit_get_digits (Gimp *gimp, - GimpUnit unit); - -gchar * _gimp_unit_get_identifier (Gimp *gimp, - GimpUnit unit); - -gchar * _gimp_unit_get_symbol (Gimp *gimp, - GimpUnit unit); -gchar * _gimp_unit_get_abbreviation (Gimp *gimp, - GimpUnit unit); -gchar * _gimp_unit_get_singular (Gimp *gimp, - GimpUnit unit); -gchar * _gimp_unit_get_plural (Gimp *gimp, - GimpUnit unit); - - -#endif /* __APP_GIMP_UNIT_H__ */ diff --git a/app/user_install.c b/app/user_install.c index c5605f9624..522db344ad 100644 --- a/app/user_install.c +++ b/app/user_install.c @@ -38,12 +38,13 @@ #include "base/base-config.h" +#include "core/gimpunit.h" + #include "gui/resolution-calibrate-dialog.h" #include "appenv.h" #include "gdisplay_ops.h" #include "gimprc.h" -#include "unitrc.h" #include "user_install.h" #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimpdnd.c b/app/widgets/gimpdnd.c index 707e64486b..2f1c06bfcf 100644 --- a/app/widgets/gimpdnd.c +++ b/app/widgets/gimpdnd.c @@ -1141,7 +1141,7 @@ gimp_dnd_set_image_data (GtkWidget *widget, if (! ID) return; - gimage = gimp_image_get_by_ID (ID); + gimage = gimp_image_get_by_ID (the_gimp, ID); if (gimage) (* (GimpDndDropViewableFunc) set_image_func) (widget, @@ -1203,7 +1203,7 @@ gimp_dnd_set_drawable_data (GtkWidget *widget, if (! ID) return; - drawable = gimp_drawable_get_by_ID (ID); + drawable = gimp_drawable_get_by_ID (the_gimp, ID); if (drawable) (* (GimpDndDropViewableFunc) set_drawable_func) (widget, diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index dcb3d23609..cb1d183ab6 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -41,6 +41,7 @@ #include "core/gimplayer.h" #include "core/gimplayermask.h" #include "core/gimpparasitelist.h" +#include "core/gimpunit.h" #include "xcf-private.h" #include "xcf-load.h" @@ -474,8 +475,8 @@ xcf_load_image_props (XcfInfo *info, yres < GIMP_MIN_RESOLUTION || yres > GIMP_MAX_RESOLUTION) { g_message ("Warning, resolution out of range in XCF file"); - xres = core_config->default_xresolution; - yres = core_config->default_yresolution; + xres = gimage->gimp->config->default_xresolution; + yres = gimage->gimp->config->default_yresolution; } gimage->xresolution = xres; gimage->yresolution = yres; diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c index 8e8039e191..b10e52b582 100644 --- a/app/xcf/xcf-save.c +++ b/app/xcf/xcf-save.c @@ -40,6 +40,7 @@ #include "core/gimplayermask.h" #include "core/gimplist.h" #include "core/gimpparasitelist.h" +#include "core/gimpunit.h" #include "xcf-private.h" #include "xcf-read.h" @@ -49,7 +50,6 @@ #include "floating_sel.h" #include "path.h" #include "pathP.h" -#include "unitrc.h" static void xcf_save_image_props (XcfInfo *info, diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index b403093e60..ab0dc44fed 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -282,7 +282,7 @@ xcf_save_invoker (Gimp *gimp, success = FALSE; - gimage = gimp_image_get_by_ID (args[1].value.pdb_int); + gimage = gimp_image_get_by_ID (gimp, args[1].value.pdb_int); filename = args[3].value.pdb_pointer; info.fp = fopen (filename, "wb"); diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl index b02cf417ba..6f0fd8fb64 100644 --- a/tools/pdbgen/app.pl +++ b/tools/pdbgen/app.pl @@ -248,7 +248,7 @@ sub marshal_inargs { my $id_func = $arg->{id_func}; $id_func = $_->{id_func} if exists $_->{id_func}; - $result .= " $var = $id_func ($value);\n"; + $result .= " $var = $id_func (gimp, $value);\n"; $result .= &make_arg_test($_, sub { ${$_[0]} =~ s/==/!=/ }, "$var == NULL"); } diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb index 40685fe082..2cd10ebbf1 100644 --- a/tools/pdbgen/pdb/image.pdb +++ b/tools/pdbgen/pdb/image.pdb @@ -139,8 +139,6 @@ sub image_get_prop_proc { $outargs[0]->{init} = 1; delete @{$outargs[0]}{qw(alias no_declare)}; - $invoke{headers} = [ qw("gimpimage.h") ]; - $invoke{code} = "{\n color = g_new (guchar, 3);\n"; foreach (map { "${_}_PIX" } qw(RED GREEN BLUE)) { $invoke{code} .= " $prop\[$_] = image->col[$_];\n"; @@ -1498,7 +1496,7 @@ CODE @headers = qw( "core/gimp.h" "core/gimpcontainer.h" - "core/gimplist.h" "base/temp-buf.h" + "core/gimplist.h" "core/gimpunit.h" "base/temp-buf.h" "libgimpmath/gimpmath.h" "libgimpbase/gimpbase.h" "libgimp/gimpintl.h"); diff --git a/tools/pdbgen/pdb/unit.pdb b/tools/pdbgen/pdb/unit.pdb index 3a078d0684..c72969498d 100644 --- a/tools/pdbgen/pdb/unit.pdb +++ b/tools/pdbgen/pdb/unit.pdb @@ -214,7 +214,7 @@ HELP &unit_prop_proc('plural', 'string', 'plural form'); } -@headers = qw("libgimpbase/gimpunit.h" "unitrc.h"); +@headers = qw("libgimpbase/gimpbase.h" "core/gimpunit.h"); @procs = qw(unit_get_number_of_units unit_get_number_of_built_in_units unit_new unit_get_deletion_flag unit_set_deletion_flag