From 8a4d5f08b1a3468b63a7742addae1c20bdc53832 Mon Sep 17 00:00:00 2001 From: Dave Neary Date: Sun, 3 Jun 2001 20:40:50 +0000 Subject: [PATCH] Made all the global options members of one struct, gimprc. 2001-06-03 Dave Neary * app/gimprc.[ch]: Made all the global options members of one struct, gimprc. * lots of .c files in app, app/core, app/tools, app/widgets & app/gui: Changed accordingly. --- ChangeLog | 59 ++ app/actions/help-commands.c | 4 +- app/actions/plug-in-commands.c | 20 +- app/app_procs.c | 10 +- app/colormaps.c | 10 +- app/context_manager.c | 16 +- app/core/gimpcontext.c | 8 +- app/core/gimpimage-guides.c | 6 +- app/core/gimpimage-merge.c | 6 +- app/core/gimpimage-projection.c | 6 +- app/core/gimpimage-resize.c | 6 +- app/core/gimpimage-scale.c | 6 +- app/core/gimpimage-undo-push.c | 4 +- app/core/gimpimage.c | 6 +- app/core/gimpprojection-construct.c | 6 +- app/core/gimpprojection.c | 8 +- app/core/gimpprojection.h | 4 +- app/core/gimpundo.c | 3 +- app/devices.c | 2 +- app/dialogs/file-open-dialog.c | 4 +- app/dialogs/file-save-dialog.c | 2 +- app/dialogs/image-new-dialog.c | 26 +- app/dialogs/module-dialog.c | 7 +- app/dialogs/preferences-dialog.c | 641 ++++++++++---------- app/dialogs/resize-dialog.c | 3 +- app/dialogs/tips-dialog.c | 32 +- app/dialogs/user-install-dialog.c | 32 +- app/disp_callbacks.c | 5 +- app/display/gimpdisplay-callbacks.c | 5 +- app/display/gimpdisplay-ops.c | 2 +- app/display/gimpdisplay-scale.c | 2 +- app/display/gimpdisplay-selection.c | 2 +- app/display/gimpdisplay.c | 8 +- app/display/gimpdisplay.h | 4 +- app/display/gimpdisplayshell-callbacks.c | 5 +- app/display/gimpdisplayshell-draw.c | 4 +- app/display/gimpdisplayshell-layer-select.c | 7 +- app/display/gimpdisplayshell-scale.c | 2 +- app/display/gimpdisplayshell-selection.c | 2 +- app/display/gimpdisplayshell.c | 4 +- app/display/gimpnavigationeditor.c | 16 +- app/display/gimpnavigationview.c | 16 +- app/file-save.c | 2 +- app/file/file-save.c | 2 +- app/gdisplay.c | 8 +- app/gdisplay.h | 4 +- app/gdisplay_ops.c | 2 +- app/gimphelp.c | 10 +- app/gimprc.c | 410 ++++++++----- app/gimprc.h | 128 ++-- app/gui/brush-select.c | 2 +- app/gui/commands.c | 4 +- app/gui/device-status-dialog.c | 2 +- app/gui/file-new-dialog.c | 26 +- app/gui/file-open-dialog.c | 4 +- app/gui/file-save-dialog.c | 2 +- app/gui/gui.c | 10 +- app/gui/help-commands.c | 4 +- app/gui/input-dialog.c | 2 +- app/gui/layer-select.c | 7 +- app/gui/menus.c | 16 +- app/gui/module-browser.c | 7 +- app/gui/paths-dialog.c | 12 +- app/gui/plug-in-commands.c | 20 +- app/gui/plug-in-menus.c | 20 +- app/gui/preferences-dialog.c | 641 ++++++++++---------- app/gui/resize-dialog.c | 3 +- app/gui/session.c | 2 +- app/gui/tips-dialog.c | 32 +- app/gui/toolbox.c | 2 +- app/gui/user-install-dialog.c | 32 +- app/image_new.c | 20 +- app/interface.c | 4 +- app/menus/menus.c | 16 +- app/menus/plug-in-menus.c | 20 +- app/module_db.c | 7 +- app/nav_window.c | 16 +- app/paint/gimpink.c | 2 +- app/paint/gimppaintcore.c | 2 +- app/pdb/gimprc_cmds.c | 4 +- app/plug-in/gimpplugin-message.c | 20 +- app/plug-in/gimpplugin-progress.c | 20 +- app/plug-in/gimpplugin.c | 20 +- app/plug-in/gimppluginmanager-call.c | 20 +- app/plug-in/gimppluginmanager-run.c | 20 +- app/plug-in/gimppluginmanager.c | 20 +- app/plug-in/gimppluginshm.c | 20 +- app/plug-in/plug-in-def.c | 20 +- app/plug-in/plug-in-message.c | 20 +- app/plug-in/plug-in-params.c | 20 +- app/plug-in/plug-in-progress.c | 20 +- app/plug-in/plug-in-run.c | 20 +- app/plug-in/plug-in-shm.c | 20 +- app/plug-in/plug-in.c | 20 +- app/plug-in/plug-ins.c | 20 +- app/plug_in.c | 20 +- app/resize.c | 3 +- app/scale.c | 2 +- app/selection.c | 2 +- app/tools/gimpbrushtool.c | 2 +- app/tools/gimpbucketfilltool.c | 6 +- app/tools/gimpbycolorselecttool.c | 4 +- app/tools/gimpinktool.c | 2 +- app/tools/gimpmagnifytool.c | 8 +- app/tools/gimppaintoptions-gui.c | 8 +- app/tools/gimppainttool.c | 2 +- app/tools/gimpselectionoptions.c | 6 +- app/tools/paint_options.c | 8 +- app/tools/selection_options.c | 6 +- app/undo.c | 4 +- app/undo_history.c | 2 +- app/user_install.c | 32 +- app/widgets/gimpdeviceinfo.c | 2 +- app/widgets/gimpdevices.c | 2 +- app/widgets/gimpdrawablelistview.c | 2 +- app/widgets/gimpdrawabletreeview.c | 2 +- app/widgets/gimphelp.c | 10 +- app/widgets/gimpitemfactory.c | 16 +- app/widgets/gimpitemlistview.c | 2 +- app/widgets/gimpitemtreeview.c | 2 +- app/widgets/gimptoolbox.c | 2 +- app/xcf.c | 4 +- app/xcf/xcf.c | 4 +- tools/pdbgen/pdb/gimprc.pdb | 4 +- 124 files changed, 1587 insertions(+), 1410 deletions(-) diff --git a/ChangeLog b/ChangeLog index fff482ef60..2bfc7825f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,62 @@ +2001-06-03 Dave Neary + + * app/gimprc.[ch]: Made all the global options members of one + struct, gimprc. + + * app/app_procs.c + * app/colormaps.c + * app/context_manager.c + * app/devices.c + * app/disp_callbacks.c + * app/file-save.c + * app/gdisplay.c + * app/gdisplay.h + * app/gdisplay_ops.c + * app/gimphelp.c + * app/image_new.c + * app/interface.c + * app/module_db.c + * app/nav_window.c + * app/plug_in.c + * app/resize.c + * app/scale.c + * app/selection.c + * app/undo.c + * app/undo_history.c + * app/user_install.c + * app/xcf.c + + * app/core/gimpcontext.c + * app/core/gimpimage.c + * app/core/gimpundo.c + + * app/gui/brush-select.c + * app/gui/commands.c + * app/gui/file-new-dialog.c + * app/gui/file-open-dialog.c + * app/gui/file-save-dialog.c + * app/gui/gui.c + * app/gui/layer-select.c + * app/gui/menus.c + * app/gui/paths-dialog.c + * app/gui/preferences-dialog.c + * app/gui/session.c + * app/gui/tips-dialog.c + * app/gui/toolbox.c + + * app/tools/gimpbucketfilltool.c + * app/tools/gimpbycolorselecttool.c + * app/tools/gimpinktool.c + * app/tools/gimpmagnifytool.c + * app/tools/gimppainttool.c + * app/tools/paint_options.c + * app/tools/selection_options.c + + * app/widgets/gimpdrawablelistview.c + + * tools/pdbgen/pdb/gimprc.pdb + * app/pdb/gimprc_cmds.c: Changed accordingly. + 2001-06-01 Dave Neary * app/tools/gimpbycolorselecttool.c: added a call to diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c index fa48e04209..5bea4e7ceb 100644 --- a/app/actions/help-commands.c +++ b/app/actions/help-commands.c @@ -586,7 +586,7 @@ view_info_window_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - if (! info_window_follows_mouse) + if (! gimprc.info_window_follows_mouse) { if (! gdisp->window_info_dialog) gdisp->window_info_dialog = info_window_create ((void *) gdisp); @@ -607,7 +607,7 @@ view_nav_window_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - if (nav_window_per_display) + if (gimprc.nav_window_per_display) { if (! gdisp->window_nav_dialog) gdisp->window_nav_dialog = nav_window_create ((void *) gdisp); diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/app_procs.c b/app/app_procs.c index 530a2e7ede..4cc1fdcf7a 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -174,15 +174,15 @@ app_init (void) #endif /* DISPLAY_FILTERS */ RESET_BAR(); - if (always_restore_session) + if (gimprc.always_restore_session) restore_session = TRUE; /* make sure the monitor resolution is valid */ - if (monitor_xres < GIMP_MIN_RESOLUTION || - monitor_yres < GIMP_MIN_RESOLUTION) + if (gimprc.monitor_xres < GIMP_MIN_RESOLUTION || + gimprc.monitor_yres < GIMP_MIN_RESOLUTION) { - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); - using_xserver_resolution = TRUE; + gdisplay_xserver_resolution (&gimprc.monitor_xres, &gimprc.monitor_yres); + gimprc.using_xserver_resolution = TRUE; } /* Now we are ready to draw the splash-screen-image to the start-up window */ diff --git a/app/colormaps.c b/app/colormaps.c index bea98c4e89..368aa200ee 100644 --- a/app/colormaps.c +++ b/app/colormaps.c @@ -41,7 +41,7 @@ gulong marching_ants_pixels[8]; static void set_app_colors (void) { - cycled_marching_ants = FALSE; + gimprc.cycled_marching_ants = FALSE; g_black_pixel = get_color (0, 0, 0); g_gray_pixel = get_color (127, 127, 127); @@ -64,12 +64,12 @@ void get_standard_colormaps (void) { if (gtk_check_version (1, 2, 8)) - min_colors = CLAMP (min_colors, 27, 216); + gimprc.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - min_colors = CLAMP (min_colors, 27, 256); + gimprc.min_colors = CLAMP (gimprc.min_colors, 27, 256); - gdk_rgb_set_min_colors (min_colors); - gdk_rgb_set_install (install_cmap); + gdk_rgb_set_min_colors (gimprc.min_colors); + gdk_rgb_set_install (gimprc.install_cmap); g_visual = gdk_rgb_get_visual (); g_cmap = gdk_rgb_get_cmap (); diff --git a/app/context_manager.c b/app/context_manager.c index 00bbb1bf17..c7b65d58e8 100644 --- a/app/context_manager.c +++ b/app/context_manager.c @@ -126,7 +126,7 @@ context_manager_tool_changed (GimpContext *user_context, return; } - if (! global_paint_options) + if (! gimprc.global_paint_options) { if (active_tool && (tool_context = tool_manager_get_info_by_tool (active_tool)->context)) @@ -193,7 +193,7 @@ context_manager_init (void) /* Create the global data factories */ global_brush_factory = gimp_data_factory_new (GIMP_TYPE_BRUSH, - (const gchar **) &brush_path, + (const gchar **) &gimprc.brush_path, brush_loader_entries, n_brush_loader_entries, gimp_brush_new, @@ -201,7 +201,7 @@ context_manager_init (void) global_pattern_factory = gimp_data_factory_new (GIMP_TYPE_PATTERN, - (const gchar **) &pattern_path, + (const gchar **) &gimprc.pattern_path, pattern_loader_entries, n_pattern_loader_entries, gimp_pattern_new, @@ -209,7 +209,7 @@ context_manager_init (void) global_gradient_factory = gimp_data_factory_new (GIMP_TYPE_GRADIENT, - (const gchar **) &gradient_path, + (const gchar **) &gimprc.gradient_path, gradient_loader_entries, n_gradient_loader_entries, gimp_gradient_new, @@ -217,7 +217,7 @@ context_manager_init (void) global_palette_factory = gimp_data_factory_new (GIMP_TYPE_PALETTE, - (const gchar **) &palette_path, + (const gchar **) &gimprc.palette_path, palette_loader_entries, n_palette_loader_entries, gimp_palette_new, @@ -262,12 +262,12 @@ context_manager_init (void) /* register internal tools */ tools_init (); - if (! global_paint_options && active_tool && + if (! gimprc.global_paint_options && active_tool && (tool_context = tool_manager_get_info_by_tool (active_tool)->context)) { gimp_context_set_parent (tool_context, user_context); } - else if (global_paint_options) + else if (gimprc.global_paint_options) { gimp_context_set_parent (global_tool_context, user_context); } @@ -301,7 +301,7 @@ context_manager_set_global_paint_options (gboolean global) GimpToolInfo *tool_info; GimpContext *context; - if (global == global_paint_options) + if (global == gimprc.global_paint_options) return; paint_options_set_global (global); diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index 67381c8870..00b2b5d7f5 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -1774,7 +1774,7 @@ gimp_context_brush_list_thaw (GimpContainer *container, GimpBrush *brush; if (! context->brush_name) - context->brush_name = g_strdup (default_brush); + context->brush_name = g_strdup (gimprc.default_brush); if ((brush = (GimpBrush *) gimp_container_get_child_by_name (container, @@ -1941,7 +1941,7 @@ gimp_context_pattern_list_thaw (GimpContainer *container, GimpPattern *pattern; if (! context->pattern_name) - context->pattern_name = g_strdup (default_pattern); + context->pattern_name = g_strdup (gimprc.default_pattern); if ((pattern = (GimpPattern *) gimp_container_get_child_by_name (container, @@ -2106,7 +2106,7 @@ gimp_context_gradient_list_thaw (GimpContainer *container, GimpGradient *gradient; if (! context->gradient_name) - context->gradient_name = g_strdup (default_gradient); + context->gradient_name = g_strdup (gimprc.default_gradient); if ((gradient = (GimpGradient *) gimp_container_get_child_by_name (container, @@ -2256,7 +2256,7 @@ gimp_context_palette_list_thaw (GimpContainer *container, GimpPalette *palette; if (! context->palette_name) - context->palette_name = g_strdup (default_palette); + context->palette_name = g_strdup (gimprc.default_palette); if ((palette = (GimpPalette *) gimp_container_get_child_by_name (container, diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 349f1ec20c..954ca6b2c8 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -401,9 +401,9 @@ gimp_image_init (GimpImage *gimage) gimage->width = 0; gimage->height = 0; - gimage->xresolution = default_xresolution; - gimage->yresolution = default_yresolution; - gimage->unit = default_units; + gimage->xresolution = gimprc.default_xresolution; + gimage->yresolution = gimprc.default_yresolution; + gimage->unit = gimprc.default_units; gimage->base_type = RGB; gimage->cmap = NULL; diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 349f1ec20c..954ca6b2c8 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -401,9 +401,9 @@ gimp_image_init (GimpImage *gimage) gimage->width = 0; gimage->height = 0; - gimage->xresolution = default_xresolution; - gimage->yresolution = default_yresolution; - gimage->unit = default_units; + gimage->xresolution = gimprc.default_xresolution; + gimage->yresolution = gimprc.default_yresolution; + gimage->unit = gimprc.default_units; gimage->base_type = RGB; gimage->cmap = NULL; diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 349f1ec20c..954ca6b2c8 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -401,9 +401,9 @@ gimp_image_init (GimpImage *gimage) gimage->width = 0; gimage->height = 0; - gimage->xresolution = default_xresolution; - gimage->yresolution = default_yresolution; - gimage->unit = default_units; + gimage->xresolution = gimprc.default_xresolution; + gimage->yresolution = gimprc.default_yresolution; + gimage->unit = gimprc.default_units; gimage->base_type = RGB; gimage->cmap = NULL; diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 349f1ec20c..954ca6b2c8 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -401,9 +401,9 @@ gimp_image_init (GimpImage *gimage) gimage->width = 0; gimage->height = 0; - gimage->xresolution = default_xresolution; - gimage->yresolution = default_yresolution; - gimage->unit = default_units; + gimage->xresolution = gimprc.default_xresolution; + gimage->yresolution = gimprc.default_yresolution; + gimage->unit = gimprc.default_units; gimage->base_type = RGB; gimage->cmap = NULL; diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 349f1ec20c..954ca6b2c8 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -401,9 +401,9 @@ gimp_image_init (GimpImage *gimage) gimage->width = 0; gimage->height = 0; - gimage->xresolution = default_xresolution; - gimage->yresolution = default_yresolution; - gimage->unit = default_units; + gimage->xresolution = gimprc.default_xresolution; + gimage->yresolution = gimprc.default_yresolution; + gimage->unit = gimprc.default_units; gimage->base_type = RGB; gimage->cmap = NULL; diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index 3489eb0457..3d097acb8c 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -313,13 +313,13 @@ static gboolean undo_free_up_space (GimpImage *gimage) { /* If there are 0 levels of undo return FALSE. */ - if (levels_of_undo == 0) + if (gimprc.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 >= levels_of_undo) + while (gimage->undo_levels >= gimprc.levels_of_undo) gimage->undo_stack = remove_stack_bottom (gimage); return TRUE; diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 349f1ec20c..954ca6b2c8 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -401,9 +401,9 @@ gimp_image_init (GimpImage *gimage) gimage->width = 0; gimage->height = 0; - gimage->xresolution = default_xresolution; - gimage->yresolution = default_yresolution; - gimage->unit = default_units; + gimage->xresolution = gimprc.default_xresolution; + gimage->yresolution = gimprc.default_yresolution; + gimage->unit = gimprc.default_units; gimage->base_type = RGB; gimage->cmap = NULL; diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 349f1ec20c..954ca6b2c8 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -401,9 +401,9 @@ gimp_image_init (GimpImage *gimage) gimage->width = 0; gimage->height = 0; - gimage->xresolution = default_xresolution; - gimage->yresolution = default_yresolution; - gimage->unit = default_units; + gimage->xresolution = gimprc.default_xresolution; + gimage->yresolution = gimprc.default_yresolution; + gimage->unit = gimprc.default_units; gimage->base_type = RGB; gimage->cmap = NULL; diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index afe977c8f9..0e27c75ebf 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -148,7 +148,7 @@ gdisplay_new (GimpImage *gimage, gdisp->offset_x = 0; gdisp->offset_y = 0; gdisp->scale = scale; - gdisp->dot_for_dot = default_dot_for_dot; + gdisp->dot_for_dot = gimprc.default_dot_for_dot; gdisp->gimage = gimage; gdisp->window_info_dialog = NULL; gdisp->window_nav_dialog = NULL; @@ -280,7 +280,7 @@ gdisplay_format_title (GDisplay *gdisp, } i = 0; - format = image_title_format; + format = gimprc.image_title_format; while (i < title_len && *format) { @@ -1378,7 +1378,7 @@ gdisplay_set_dot_for_dot (GDisplay *gdisp, gdisp->dot_for_dot = dot_for_dot; gdisplay_resize_cursor_label (gdisp); - resize_display (gdisp, allow_resize_windows, TRUE); + resize_display (gdisp, gimprc.allow_resize_windows, TRUE); } } @@ -1838,7 +1838,7 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp, { if (cursor_type != GIMP_BAD_CURSOR) { - switch (cursor_mode) + switch (gimprc.cursor_mode) { case CURSOR_MODE_TOOL_ICON: break; diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index 5ce2245784..96c73425b1 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -41,8 +41,8 @@ typedef enum #define SCALEDEST(g) (g->scale >> 8) /* finding the effective screen resolution (double) */ -#define SCREEN_XRES(g) (g->dot_for_dot? g->gimage->xresolution : monitor_xres) -#define SCREEN_YRES(g) (g->dot_for_dot? g->gimage->yresolution : monitor_yres) +#define SCREEN_XRES(g) (g->dot_for_dot? g->gimage->xresolution : gimprc.monitor_xres) +#define SCREEN_YRES(g) (g->dot_for_dot? g->gimage->yresolution : gimprc.monitor_yres) /* calculate scale factors (double) */ #define SCALEFACTOR_X(g) ((SCALEDEST(g) * SCREEN_XRES(g)) / \ diff --git a/app/core/gimpundo.c b/app/core/gimpundo.c index b40db1487e..a63f6e6fb8 100644 --- a/app/core/gimpundo.c +++ b/app/core/gimpundo.c @@ -201,7 +201,8 @@ gimp_undo_real_push (GimpUndo *undo, GimpImage *gimage) { undo->preview = gimp_viewable_get_preview (GIMP_VIEWABLE (gimage), - preview_size, preview_size); + gimprc.preview_size, + gimprc.preview_size); } static void diff --git a/app/devices.c b/app/devices.c index 4ac7b4ee8a..bddf2d5774 100644 --- a/app/devices.c +++ b/app/devices.c @@ -973,7 +973,7 @@ void device_status_free (void) { /* Save device status on exit */ - if (save_device_status) + if (gimprc.save_device_status) devices_write_rc (); if (deviceD) diff --git a/app/dialogs/file-open-dialog.c b/app/dialogs/file-open-dialog.c index ea8b2f0589..7fb4d0cfeb 100644 --- a/app/dialogs/file-open-dialog.c +++ b/app/dialogs/file-open-dialog.c @@ -598,7 +598,7 @@ set_preview (const gchar *fullfname, } else { - switch (thumbnail_mode) + switch (gimprc.thumbnail_mode) { case 0: gtk_label_set_text (GTK_LABEL(open_options_label), @@ -723,7 +723,7 @@ file_open_genbutton_callback (GtkWidget *widget, RGBbuf = make_RGBbuf_from_tempbuf (tempbuf, &RGBbuf_w, &RGBbuf_h); - if (thumbnail_mode) + if (gimprc.thumbnail_mode) { file_save_thumbnail (gimage_to_be_thumbed, full_filename, tempbuf); diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c index bd548db069..189f433cd1 100644 --- a/app/dialogs/file-save-dialog.c +++ b/app/dialogs/file-save-dialog.c @@ -135,7 +135,7 @@ file_save_callback (GtkWidget *widget, return; /* Only save if the gimage has been modified */ - if (!trust_dirty_flag || gdisplay->gimage->dirty != 0) + if (!gimprc.trust_dirty_flag || gdisplay->gimage->dirty != 0) { gchar *filename; diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index 2fda7dcbb1..5858a10887 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -91,7 +91,7 @@ file_new_ok_callback (GtkWidget *widget, values->res_unit = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (info->resolution_se)); - if (info->size > max_new_image_size) + if (info->size > gimprc.max_new_image_size) { file_new_confirm_dialog (info); } @@ -116,29 +116,29 @@ file_new_reset_callback (GtkWidget *widget, gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (info->couple_resolutions), - ABS (default_xresolution - default_yresolution) < GIMP_MIN_RESOLUTION); + ABS (gimprc.default_xresolution - gimprc.default_yresolution) < GIMP_MIN_RESOLUTION); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 0, default_xresolution); + 0, gimprc.default_xresolution); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 1, default_yresolution); + 1, gimprc.default_yresolution); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->resolution_se), - default_resolution_units); + gimprc.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, default_xresolution, TRUE); + 0, gimprc.default_xresolution, TRUE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), - 1, default_yresolution, TRUE); + 1, gimprc.default_yresolution, TRUE); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 0, default_width); + 0, gimprc.default_width); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 1, default_height); + 1, gimprc.default_height); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->size_se), - default_units); + gimprc.default_units); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[default_type]), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[gimprc.default_type]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->fill_type_w[BACKGROUND_FILL]), TRUE); @@ -192,7 +192,7 @@ file_new_confirm_dialog (NewImageInfo *info) gtk_widget_set_sensitive (info->dlg, FALSE); size = image_new_get_size_string (info->size); - max_size = image_new_get_size_string (max_new_image_size); + max_size = image_new_get_size_string (gimprc.max_new_image_size); /* xgettext:no-c-format */ @@ -551,7 +551,7 @@ ui_new_image_window_create (const GimpImageNewValues *values_orig) gtk_widget_set_usize (spinbutton, 75, 0); info->resolution_se = - gimp_size_entry_new (1, default_resolution_units, _("pixels/%a"), + gimp_size_entry_new (1, gimprc.default_resolution_units, _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); gtk_table_set_col_spacing (GTK_TABLE (info->resolution_se), 1, 2); diff --git a/app/dialogs/module-dialog.c b/app/dialogs/module-dialog.c index 0e87298d4d..7d707d1665 100644 --- a/app/dialogs/module-dialog.c +++ b/app/dialogs/module-dialog.c @@ -217,7 +217,7 @@ module_db_init (void) modules = gimp_list_new (MODULE_INFO_TYPE, GIMP_CONTAINER_POLICY_WEAK); if (g_module_supported ()) - gimp_datafiles_read_directories (module_path, 0 /* no flags */, + gimp_datafiles_read_directories (gimprc.module_path, 0 /* no flags */, module_initialize, NULL); #ifdef DUMP_DB gimp_container_foreach (modules, print_module_info, NULL); @@ -614,7 +614,8 @@ module_initialize (const gchar *filename, */ mod->refs = 0; - mod->load_inhibit = module_inhibited (mod->fullpath, module_db_load_inhibit); + mod->load_inhibit = module_inhibited (mod->fullpath, + gimprc.module_db_load_inhibit); if (!mod->load_inhibit) { if (be_verbose) @@ -1136,7 +1137,7 @@ browser_refresh_callback (GtkWidget *widget, kill_list = NULL; /* walk filesystem and add new things we find */ - gimp_datafiles_read_directories (module_path, 0 /* no flags */, + gimp_datafiles_read_directories (gimprc.module_path, 0 /* no flags */, module_initialize, NULL); } diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 70a3293ec1..cab21f6756 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -267,64 +267,64 @@ static PrefsState prefs_check_settings (void) { /* First, check for invalid values... */ - if (levels_of_undo < 0) + if (gimprc.levels_of_undo < 0) { g_message (_("Error: Levels of undo must be zero or greater.")); - levels_of_undo = old_levels_of_undo; + gimprc.levels_of_undo = old_levels_of_undo; return PREFS_CORRUPT; } - if (marching_speed < 50) + if (gimprc.marching_speed < 50) { g_message (_("Error: Marching speed must be 50 or greater.")); - marching_speed = old_marching_speed; + gimprc.marching_speed = old_marching_speed; return PREFS_CORRUPT; } - if (default_width < 1) + if (gimprc.default_width < 1) { g_message (_("Error: Default width must be one or greater.")); - default_width = old_default_width; + gimprc.default_width = old_default_width; return PREFS_CORRUPT; } - if (default_height < 1) + if (gimprc.default_height < 1) { g_message (_("Error: Default height must be one or greater.")); - default_height = old_default_height; + gimprc.default_height = old_default_height; return PREFS_CORRUPT; } - if (default_units < GIMP_UNIT_INCH || - default_units >= gimp_unit_get_number_of_units ()) + if (gimprc.default_units < GIMP_UNIT_INCH || + gimprc.default_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default unit must be within unit range.")); - default_units = old_default_units; + gimprc.default_units = old_default_units; return PREFS_CORRUPT; } - if (default_xresolution < GIMP_MIN_RESOLUTION || - default_yresolution < GIMP_MIN_RESOLUTION) + if (gimprc.default_xresolution < GIMP_MIN_RESOLUTION || + gimprc.default_yresolution < GIMP_MIN_RESOLUTION) { g_message (_("Error: Default resolution must not be zero.")); - default_xresolution = old_default_xresolution; - default_yresolution = old_default_yresolution; + gimprc.default_xresolution = old_default_xresolution; + gimprc.default_yresolution = old_default_yresolution; return PREFS_CORRUPT; } - if (default_resolution_units < GIMP_UNIT_INCH || - default_resolution_units >= gimp_unit_get_number_of_units ()) + if (gimprc.default_resolution_units < GIMP_UNIT_INCH || + gimprc.default_resolution_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default resolution unit must be within unit range.")); - default_resolution_units = old_default_resolution_units; + gimprc.default_resolution_units = old_default_resolution_units; return PREFS_CORRUPT; } - if (monitor_xres < GIMP_MIN_RESOLUTION || - monitor_yres < GIMP_MIN_RESOLUTION) + if (gimprc.monitor_xres < GIMP_MIN_RESOLUTION || + gimprc.monitor_yres < GIMP_MIN_RESOLUTION) { g_message (_("Error: Monitor resolution must not be zero.")); - monitor_xres = old_monitor_xres; - monitor_yres = old_monitor_yres; + gimprc.monitor_xres = old_monitor_xres; + gimprc.monitor_yres = old_monitor_yres; return PREFS_CORRUPT; } - if (image_title_format == NULL) + if (gimprc.image_title_format == NULL) { g_message (_("Error: Image title format must not be NULL.")); - image_title_format = old_image_title_format; + gimprc.image_title_format = old_image_title_format; return PREFS_CORRUPT; } @@ -435,7 +435,7 @@ prefs_ok_callback (GtkWidget *widget, break; case PREFS_OK: - if (show_tool_tips) + if (gimprc.show_tool_tips) gimp_help_enable_tooltips (); else gimp_help_disable_tooltips (); @@ -498,7 +498,7 @@ prefs_save_callback (GtkWidget *widget, /* don't break */ case PREFS_OK: - if (show_tool_tips) + if (gimprc.show_tool_tips) gimp_help_enable_tooltips (); else gimp_help_disable_tooltips (); @@ -516,57 +516,57 @@ prefs_save_callback (GtkWidget *widget, /* Save variables so that we can restore them later */ save_stingy_memory_use = base_config->stingy_memory_use; - save_min_colors = min_colors; - save_install_cmap = install_cmap; - save_cycled_marching_ants = cycled_marching_ants; - save_last_opened_size = last_opened_size; - save_show_indicators = show_indicators; - save_nav_window_per_display = nav_window_per_display; - save_info_window_follows_mouse = info_window_follows_mouse; + save_min_colors = gimprc.min_colors; + save_install_cmap = gimprc.install_cmap; + save_cycled_marching_ants = gimprc.cycled_marching_ants; + save_last_opened_size = gimprc.last_opened_size; + save_show_indicators = gimprc.show_indicators; + save_nav_window_per_display = gimprc.nav_window_per_display; + save_info_window_follows_mouse = gimprc.info_window_follows_mouse; save_temp_path = base_config->temp_path; save_swap_path = base_config->swap_path; - save_brush_path = brush_path; - save_pattern_path = pattern_path; - save_palette_path = palette_path; - save_gradient_path = gradient_path; - save_plug_in_path = plug_in_path; - save_module_path = module_path; + save_brush_path = gimprc.brush_path; + save_pattern_path = gimprc.pattern_path; + save_palette_path = gimprc.palette_path; + save_gradient_path = gimprc.gradient_path; + save_plug_in_path = gimprc.plug_in_path; + save_module_path = gimprc.module_path; - if (levels_of_undo != old_levels_of_undo) + if (gimprc.levels_of_undo != old_levels_of_undo) { update = g_list_append (update, "undo-levels"); } - if (marching_speed != old_marching_speed) + if (gimprc.marching_speed != old_marching_speed) { update = g_list_append (update, "marching-ants-speed"); } - if (allow_resize_windows != old_allow_resize_windows) + if (gimprc.allow_resize_windows != old_allow_resize_windows) { update = g_list_append (update, "allow-resize-windows"); remove = g_list_append (remove, "dont-allow-resize-windows"); } - if (auto_save != old_auto_save) + if (gimprc.auto_save != old_auto_save) { update = g_list_append (update, "auto-save"); remove = g_list_append (remove, "dont-auto-save"); } - if (no_cursor_updating != old_no_cursor_updating) + if (gimprc.no_cursor_updating != old_no_cursor_updating) { update = g_list_append (update, "cursor-updating"); remove = g_list_append (remove, "no-cursor-updating"); } - if (show_tool_tips != old_show_tool_tips) + if (gimprc.show_tool_tips != old_show_tool_tips) { update = g_list_append (update, "show-tool-tips"); remove = g_list_append (remove, "dont-show-tool-tips"); } - if (show_rulers != old_show_rulers) + if (gimprc.show_rulers != old_show_rulers) { update = g_list_append (update, "show-rulers"); remove = g_list_append (remove, "dont-show-rulers"); } - if (show_statusbar != old_show_statusbar) + if (gimprc.show_statusbar != old_show_statusbar) { update = g_list_append (update, "show-statusbar"); remove = g_list_append (remove, "dont-show-statusbar"); @@ -575,132 +575,132 @@ prefs_save_callback (GtkWidget *widget, { update = g_list_append (update, "interpolation-type"); } - if (confirm_on_close != old_confirm_on_close) + if (gimprc.confirm_on_close != old_confirm_on_close) { update = g_list_append (update, "confirm-on-close"); remove = g_list_append (remove, "dont-confirm-on-close"); } - if (save_session_info != old_save_session_info) + if (gimprc.save_session_info != old_save_session_info) { update = g_list_append (update, "save-session-info"); remove = g_list_append (remove, "dont-save-session-info"); } - if (save_device_status!= old_save_device_status) + if (gimprc.save_device_status!= old_save_device_status) { update = g_list_append (update, "save-device-status"); remove = g_list_append (remove, "dont-save-device-status"); } - if (always_restore_session != old_always_restore_session) + if (gimprc.always_restore_session != old_always_restore_session) { update = g_list_append (update, "always-restore-session"); } - if (default_width != old_default_width || - default_height != old_default_height) + if (gimprc.default_width != old_default_width || + gimprc.default_height != old_default_height) { update = g_list_append (update, "default-image-size"); } - if (default_units != old_default_units) + if (gimprc.default_units != old_default_units) { update = g_list_append (update, "default-units"); } - if (ABS (default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) + if (ABS (gimprc.default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-xresolution"); } - if (ABS (default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) + if (ABS (gimprc.default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-yresolution"); } - if (default_resolution_units != old_default_resolution_units) + if (gimprc.default_resolution_units != old_default_resolution_units) { update = g_list_append (update, "default-resolution-units"); } - if (default_type != old_default_type) + if (gimprc.default_type != old_default_type) { update = g_list_append (update, "default-image-type"); } - if (prefs_strcmp (default_comment, old_default_comment)) + if (prefs_strcmp (gimprc.default_comment, old_default_comment)) { update = g_list_append (update, "default-comment"); } - if (default_dot_for_dot != old_default_dot_for_dot) + if (gimprc.default_dot_for_dot != old_default_dot_for_dot) { update = g_list_append (update, "default-dot-for-dot"); remove = g_list_append (remove, "dont-default-dot-for-dot"); } - if (preview_size != old_preview_size) + if (gimprc.preview_size != old_preview_size) { update = g_list_append (update, "preview-size"); } - if (nav_preview_size != old_nav_preview_size) + if (gimprc.nav_preview_size != old_nav_preview_size) { update = g_list_append (update, "nav-preview-size"); } - if (perfectmouse != old_perfectmouse) + if (gimprc.perfectmouse != old_perfectmouse) { update = g_list_append (update, "perfect-mouse"); } - if (transparency_type != old_transparency_type) + if (gimprc.transparency_type != old_transparency_type) { update = g_list_append (update, "transparency-type"); } - if (transparency_size != old_transparency_size) + if (gimprc.transparency_size != old_transparency_size) { update = g_list_append (update, "transparency-size"); } - if (using_xserver_resolution != old_using_xserver_resolution || - ABS(monitor_xres - old_monitor_xres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != old_using_xserver_resolution || + ABS(gimprc.monitor_xres - old_monitor_xres) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "monitor-xresolution"); } - if (using_xserver_resolution != old_using_xserver_resolution || - ABS(monitor_yres - old_monitor_yres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != old_using_xserver_resolution || + ABS(gimprc.monitor_yres - old_monitor_yres) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "monitor-yresolution"); } - if (using_xserver_resolution) + if (gimprc.using_xserver_resolution) { /* special value of 0 for either x or y res in the gimprc file * means use the xserver's current resolution */ - monitor_xres = 0.0; - monitor_yres = 0.0; + gimprc.monitor_xres = 0.0; + gimprc.monitor_yres = 0.0; } - if (prefs_strcmp (image_title_format, old_image_title_format)) + if (prefs_strcmp (gimprc.image_title_format, old_image_title_format)) { update = g_list_append (update, "image-title-format"); } - if (global_paint_options != old_global_paint_options) + if (gimprc.global_paint_options != old_global_paint_options) { update = g_list_append (update, "global-paint-options"); remove = g_list_append (remove, "no-global-paint-options"); } - if (max_new_image_size != old_max_new_image_size) + if (gimprc.max_new_image_size != old_max_new_image_size) { update = g_list_append (update, "max-new-image-size"); } - if (thumbnail_mode != old_thumbnail_mode) + if (gimprc.thumbnail_mode != old_thumbnail_mode) { update = g_list_append (update, "thumbnail-mode"); } - if (trust_dirty_flag != old_trust_dirty_flag) + if (gimprc.trust_dirty_flag != old_trust_dirty_flag) { update = g_list_append (update, "trust-dirty-flag"); remove = g_list_append (remove, "dont-trust-dirty-flag"); } - if (use_help != old_use_help) + if (gimprc.use_help != old_use_help) { update = g_list_append (update, "use-help"); remove = g_list_append (remove, "dont-use-help"); } - if (help_browser != old_help_browser) + if (gimprc.help_browser != old_help_browser) { update = g_list_append (update, "help-browser"); } - if (cursor_mode != old_cursor_mode) + if (gimprc.cursor_mode != old_cursor_mode) { update = g_list_append (update, "cursor-mode"); } - if (default_threshold != old_default_threshold) + if (gimprc.default_threshold != old_default_threshold) { update = g_list_append (update, "default-threshold"); } @@ -717,45 +717,45 @@ prefs_save_callback (GtkWidget *widget, } if (edit_min_colors != old_min_colors) { - min_colors = edit_min_colors; + gimprc.min_colors = edit_min_colors; update = g_list_append (update, "min-colors"); } if (edit_install_cmap != old_install_cmap) { - install_cmap = edit_install_cmap; + gimprc.install_cmap = edit_install_cmap; update = g_list_append (update, "install-colormap"); } if (edit_cycled_marching_ants != old_cycled_marching_ants) { - cycled_marching_ants = edit_cycled_marching_ants; + gimprc.cycled_marching_ants = edit_cycled_marching_ants; update = g_list_append (update, "colormap-cycling"); } if (edit_last_opened_size != old_last_opened_size) { - last_opened_size = edit_last_opened_size; + gimprc.last_opened_size = edit_last_opened_size; update = g_list_append (update, "last-opened-size"); } if (edit_show_indicators != old_show_indicators) { - show_indicators = edit_show_indicators; + gimprc.show_indicators = edit_show_indicators; update = g_list_append (update, "show-indicators"); remove = g_list_append (remove, "dont-show-indicators"); } if (edit_nav_window_per_display != old_nav_window_per_display) { - nav_window_per_display = edit_nav_window_per_display; + gimprc.nav_window_per_display = edit_nav_window_per_display; update = g_list_append (update, "nav-window-per-display"); remove = g_list_append (remove, "nav-window-follows-auto"); } if (edit_info_window_follows_mouse != old_info_window_follows_mouse) { - info_window_follows_mouse = edit_info_window_follows_mouse; + gimprc.info_window_follows_mouse = edit_info_window_follows_mouse; update = g_list_append (update, "info-window-follows-mouse"); remove = g_list_append (remove, "info-window-per-display"); } if (edit_disable_tearoff_menus != old_disable_tearoff_menus) { - disable_tearoff_menus = edit_disable_tearoff_menus; + gimprc.disable_tearoff_menus = edit_disable_tearoff_menus; update = g_list_append (update, "disable-tearoff-menus"); } @@ -771,32 +771,32 @@ prefs_save_callback (GtkWidget *widget, } if (prefs_strcmp (old_brush_path, edit_brush_path)) { - brush_path = edit_brush_path; + gimprc.brush_path = edit_brush_path; update = g_list_append (update, "brush-path"); } if (prefs_strcmp (old_pattern_path, edit_pattern_path)) { - pattern_path = edit_pattern_path; + gimprc.pattern_path = edit_pattern_path; update = g_list_append (update, "pattern-path"); } if (prefs_strcmp (old_palette_path, edit_palette_path)) { - palette_path = edit_palette_path; + gimprc.palette_path = edit_palette_path; update = g_list_append (update, "palette-path"); } if (prefs_strcmp (old_gradient_path, edit_gradient_path)) { - gradient_path = edit_gradient_path; + gimprc.gradient_path = edit_gradient_path; update = g_list_append (update, "gradient-path"); } if (prefs_strcmp (old_plug_in_path, edit_plug_in_path)) { - plug_in_path = edit_plug_in_path; + gimprc.plug_in_path = edit_plug_in_path; update = g_list_append (update, "plug-in-path"); } if (prefs_strcmp (old_module_path, edit_module_path)) { - module_path = edit_module_path; + gimprc.module_path = edit_module_path; update = g_list_append (update, "module-path"); } @@ -811,27 +811,28 @@ prefs_save_callback (GtkWidget *widget, save_gimprc (&update, &remove); - if (using_xserver_resolution) - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); + if (gimprc.using_xserver_resolution) + gdisplay_xserver_resolution (&(gimprc.monitor_xres), + &(gimprc.monitor_yres)); /* restore variables which must not change */ base_config->stingy_memory_use = save_stingy_memory_use; - min_colors = save_min_colors; - install_cmap = save_install_cmap; - cycled_marching_ants = save_cycled_marching_ants; - last_opened_size = save_last_opened_size; - show_indicators = save_show_indicators; - nav_window_per_display = save_nav_window_per_display; - info_window_follows_mouse = save_info_window_follows_mouse; + gimprc.min_colors = save_min_colors; + gimprc.install_cmap = save_install_cmap; + gimprc.cycled_marching_ants = save_cycled_marching_ants; + gimprc.last_opened_size = save_last_opened_size; + gimprc.show_indicators = save_show_indicators; + gimprc.nav_window_per_display = save_nav_window_per_display; + gimprc.info_window_follows_mouse = save_info_window_follows_mouse; base_config->temp_path = save_temp_path; base_config->swap_path = save_swap_path; - brush_path = save_brush_path; - pattern_path = save_pattern_path; - palette_path = save_palette_path; - gradient_path = save_gradient_path; - plug_in_path = save_plug_in_path; - module_path = save_module_path; + gimprc.brush_path = save_brush_path; + gimprc.pattern_path = save_pattern_path; + gimprc.palette_path = save_palette_path; + gimprc.gradient_path = save_gradient_path; + gimprc.plug_in_path = save_plug_in_path; + gimprc.module_path = save_module_path; /* no need to restore values which are only changed on "OK" and "Save" */ @@ -850,55 +851,55 @@ prefs_cancel_callback (GtkWidget *widget, base_config->interpolation_type = old_interpolation_type; base_config->num_processors = old_num_processors; - levels_of_undo = old_levels_of_undo; - marching_speed = old_marching_speed; - allow_resize_windows = old_allow_resize_windows; - auto_save = old_auto_save; - no_cursor_updating = old_no_cursor_updating; - perfectmouse = old_perfectmouse; - show_tool_tips = old_show_tool_tips; - show_rulers = old_show_rulers; - show_statusbar = old_show_statusbar; - confirm_on_close = old_confirm_on_close; - save_session_info = old_save_session_info; - save_device_status = old_save_device_status; - default_width = old_default_width; - default_height = old_default_height; - default_units = old_default_units; - default_xresolution = old_default_xresolution; - default_yresolution = old_default_yresolution; - default_resolution_units = old_default_resolution_units; - default_type = old_default_type; - default_dot_for_dot = old_default_dot_for_dot; - monitor_xres = old_monitor_xres; - monitor_yres = old_monitor_yres; - using_xserver_resolution = old_using_xserver_resolution; - max_new_image_size = old_max_new_image_size; - thumbnail_mode = old_thumbnail_mode; - trust_dirty_flag = old_trust_dirty_flag; - use_help = old_use_help; - help_browser = old_help_browser; - cursor_mode = old_cursor_mode; - default_threshold = old_default_threshold; + gimprc.levels_of_undo = old_levels_of_undo; + gimprc.marching_speed = old_marching_speed; + gimprc.allow_resize_windows = old_allow_resize_windows; + gimprc.auto_save = old_auto_save; + gimprc.no_cursor_updating = old_no_cursor_updating; + gimprc.perfectmouse = old_perfectmouse; + gimprc.show_tool_tips = old_show_tool_tips; + gimprc.show_rulers = old_show_rulers; + gimprc.show_statusbar = old_show_statusbar; + gimprc.confirm_on_close = old_confirm_on_close; + gimprc.save_session_info = old_save_session_info; + gimprc.save_device_status = old_save_device_status; + gimprc.default_width = old_default_width; + gimprc.default_height = old_default_height; + gimprc.default_units = old_default_units; + gimprc.default_xresolution = old_default_xresolution; + gimprc.default_yresolution = old_default_yresolution; + gimprc.default_resolution_units = old_default_resolution_units; + gimprc.default_type = old_default_type; + gimprc.default_dot_for_dot = old_default_dot_for_dot; + gimprc.monitor_xres = old_monitor_xres; + gimprc.monitor_yres = old_monitor_yres; + gimprc.using_xserver_resolution = old_using_xserver_resolution; + gimprc.max_new_image_size = old_max_new_image_size; + gimprc.thumbnail_mode = old_thumbnail_mode; + gimprc.trust_dirty_flag = old_trust_dirty_flag; + gimprc.use_help = old_use_help; + gimprc.help_browser = old_help_browser; + gimprc.cursor_mode = old_cursor_mode; + gimprc.default_threshold = old_default_threshold; /* restore variables which need some magic */ - if (preview_size != old_preview_size) + if (gimprc.preview_size != old_preview_size) { /* lc_dialog_rebuild (old_preview_size); FIXME: update preview size */ layer_select_update_preview_size (); } - if (nav_preview_size != old_nav_preview_size) + if (gimprc.nav_preview_size != old_nav_preview_size) { - nav_preview_size = old_nav_preview_size; + gimprc.nav_preview_size = old_nav_preview_size; gdisplays_nav_preview_resized (); } - if ((transparency_type != old_transparency_type) || - (transparency_size != old_transparency_size)) + if ((gimprc.transparency_type != old_transparency_type) || + (gimprc.transparency_size != old_transparency_size)) { - transparency_type = old_transparency_type; - transparency_size = old_transparency_size; + gimprc.transparency_type = old_transparency_type; + gimprc.transparency_size = old_transparency_size; - render_setup (transparency_type, transparency_size); + render_setup (gimprc.transparency_type, gimprc.transparency_size); gimp_container_foreach (image_context, (GFunc) gimp_image_invalidate_layer_previews, NULL); @@ -909,8 +910,8 @@ prefs_cancel_callback (GtkWidget *widget, gdisplays_flush (); } - prefs_strset (&image_title_format, old_image_title_format); - prefs_strset (&default_comment, old_default_comment); + prefs_strset (&(gimprc.image_title_format), old_image_title_format); + prefs_strset (&(gimprc.default_comment), old_default_comment); context_manager_set_global_paint_options (old_global_paint_options); @@ -946,19 +947,19 @@ prefs_toggle_callback (GtkWidget *widget, val = (gint *) data; /* toggle buttos */ - if (data == &allow_resize_windows || - data == &auto_save || - data == &no_cursor_updating || - data == &perfectmouse || - data == &show_tool_tips || - data == &show_rulers || - data == &show_statusbar || - data == &confirm_on_close || - data == &save_session_info || - data == &save_device_status || - data == &always_restore_session || - data == &default_dot_for_dot || - data == &use_help || + if (data == &(gimprc.allow_resize_windows) || + data == &(gimprc.auto_save) || + data == &(gimprc.no_cursor_updating) || + data == &(gimprc.perfectmouse) || + data == &(gimprc.show_tool_tips) || + data == &(gimprc.show_rulers) || + data == &(gimprc.show_statusbar) || + data == &(gimprc.confirm_on_close) || + data == &(gimprc.save_session_info) || + data == &(gimprc.save_device_status) || + data == &(gimprc.always_restore_session) || + data == &(gimprc.default_dot_for_dot) || + data == &(gimprc.use_help) || data == &edit_stingy_memory_use || data == &edit_install_cmap || @@ -972,23 +973,23 @@ prefs_toggle_callback (GtkWidget *widget, } /* radio buttons */ - else if (data == &thumbnail_mode || + else if (data == &(gimprc.thumbnail_mode) || data == &base_config->interpolation_type || - data == &trust_dirty_flag || - data == &help_browser || - data == &cursor_mode || - data == &default_type) + data == &(gimprc.trust_dirty_flag) || + data == &(gimprc.help_browser) || + data == &(gimprc.cursor_mode) || + data == &(gimprc.default_type)) { *val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget)); } /* values which need some magic */ - else if ((data == &transparency_type) || - (data == &transparency_size)) + else if ((data == &(gimprc.transparency_type)) || + (data == &(gimprc.transparency_size))) { *val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget)); - render_setup (transparency_type, transparency_size); + render_setup (gimprc.transparency_type, gimprc.transparency_size); gimp_container_foreach (image_context, (GFunc) gimp_image_invalidate_layer_previews, NULL); @@ -998,7 +999,7 @@ prefs_toggle_callback (GtkWidget *widget, gdisplays_expose_full (); gdisplays_flush (); } - else if (data == &global_paint_options) + else if (data == &(gimprc.global_paint_options)) { context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active); @@ -1029,7 +1030,7 @@ static void prefs_nav_preview_size_callback (GtkWidget *widget, gpointer data) { - nav_preview_size = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));; + gimprc.nav_preview_size = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));; gdisplays_nav_preview_resized (); } @@ -1105,11 +1106,11 @@ static void prefs_default_size_callback (GtkWidget *widget, gpointer data) { - default_width = + gimprc.default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0)); - default_height = + gimprc.default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1)); - default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); + gimprc.default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } static void @@ -1154,15 +1155,15 @@ prefs_default_resolution_callback (GtkWidget *widget, gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 1, yres, FALSE); - default_width = + gimprc.default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0)); - default_height = + gimprc.default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1)); - default_xresolution = xres; - default_yresolution = yres; + gimprc.default_xresolution = xres; + gimprc.default_yresolution = yres; - default_resolution_units = + gimprc.default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } @@ -1176,22 +1177,23 @@ prefs_res_source_callback (GtkWidget *widget, if (GTK_TOGGLE_BUTTON (widget)->active) { - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); - using_xserver_resolution = TRUE; + gdisplay_xserver_resolution (&(gimprc.monitor_xres), + &(gimprc.monitor_yres)); + gimprc.using_xserver_resolution = TRUE; } else { monitor_resolution_sizeentry = gtk_object_get_data (GTK_OBJECT (widget), "monitor_resolution_sizeentry"); - + if (monitor_resolution_sizeentry) { - monitor_xres = gimp_size_entry_get_refval + gimprc.monitor_xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 0); - monitor_yres = gimp_size_entry_get_refval + gimprc.monitor_yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 1); } - using_xserver_resolution = FALSE; + gimprc.using_xserver_resolution = FALSE; } } @@ -1229,8 +1231,8 @@ prefs_monitor_resolution_callback (GtkWidget *widget, yres = new_yres; } - monitor_xres = xres; - monitor_yres = yres; + gimprc.monitor_xres = xres; + gimprc.monitor_yres = yres; } static void @@ -1393,23 +1395,23 @@ preferences_dialog_create (void) * copy config vals to edit variables. */ edit_stingy_memory_use = base_config->stingy_memory_use; - edit_min_colors = min_colors; - edit_install_cmap = install_cmap; - edit_cycled_marching_ants = cycled_marching_ants; - edit_last_opened_size = last_opened_size; - edit_show_indicators = show_indicators; - edit_nav_window_per_display = nav_window_per_display; - edit_info_window_follows_mouse = info_window_follows_mouse; - edit_disable_tearoff_menus = disable_tearoff_menus; + edit_min_colors = gimprc.min_colors; + edit_install_cmap = gimprc.install_cmap; + edit_cycled_marching_ants = gimprc.cycled_marching_ants; + edit_last_opened_size = gimprc.last_opened_size; + edit_show_indicators = gimprc.show_indicators; + edit_nav_window_per_display = gimprc.nav_window_per_display; + edit_info_window_follows_mouse = gimprc.info_window_follows_mouse; + edit_disable_tearoff_menus = gimprc.disable_tearoff_menus; edit_temp_path = prefs_strdup (base_config->temp_path); edit_swap_path = prefs_strdup (base_config->swap_path); - edit_plug_in_path = prefs_strdup (plug_in_path); - edit_module_path = prefs_strdup (module_path); - edit_brush_path = prefs_strdup (brush_path); - edit_pattern_path = prefs_strdup (pattern_path); - edit_palette_path = prefs_strdup (palette_path); - edit_gradient_path = prefs_strdup (gradient_path); + edit_plug_in_path = prefs_strdup (gimprc.plug_in_path); + edit_module_path = prefs_strdup (gimprc.module_path); + edit_brush_path = prefs_strdup (gimprc.brush_path); + edit_pattern_path = prefs_strdup (gimprc.pattern_path); + edit_palette_path = prefs_strdup (gimprc.palette_path); + edit_gradient_path = prefs_strdup (gimprc.gradient_path); } /* assign edit variables for values which get changed on "OK" and "Save" @@ -1421,45 +1423,45 @@ preferences_dialog_create (void) old_interpolation_type = base_config->interpolation_type; old_num_processors = base_config->num_processors; - old_perfectmouse = perfectmouse; - old_transparency_type = transparency_type; - old_transparency_size = transparency_size; - old_levels_of_undo = levels_of_undo; - old_marching_speed = marching_speed; - old_allow_resize_windows = allow_resize_windows; - old_auto_save = auto_save; - old_preview_size = preview_size; - old_nav_preview_size = nav_preview_size; - old_no_cursor_updating = no_cursor_updating; - old_show_tool_tips = show_tool_tips; - old_show_rulers = show_rulers; - old_show_statusbar = show_statusbar; - old_confirm_on_close = confirm_on_close; - old_save_session_info = save_session_info; - old_save_device_status = save_device_status; - old_always_restore_session = always_restore_session; - old_default_width = default_width; - old_default_height = default_height; - old_default_units = default_units; - old_default_xresolution = default_xresolution; - old_default_yresolution = default_yresolution; - old_default_resolution_units = default_resolution_units; - old_default_type = default_type; - old_default_dot_for_dot = default_dot_for_dot; - old_monitor_xres = monitor_xres; - old_monitor_yres = monitor_yres; - old_using_xserver_resolution = using_xserver_resolution; - old_global_paint_options = global_paint_options; - old_max_new_image_size = max_new_image_size; - old_thumbnail_mode = thumbnail_mode; - old_trust_dirty_flag = trust_dirty_flag; - old_use_help = use_help; - old_help_browser = help_browser; - old_cursor_mode = cursor_mode; - old_default_threshold = default_threshold; + old_perfectmouse = gimprc.perfectmouse; + old_transparency_type = gimprc.transparency_type; + old_transparency_size = gimprc.transparency_size; + old_levels_of_undo = gimprc.levels_of_undo; + old_marching_speed = gimprc.marching_speed; + old_allow_resize_windows = gimprc.allow_resize_windows; + old_auto_save = gimprc.auto_save; + old_preview_size = gimprc.preview_size; + old_nav_preview_size = gimprc.nav_preview_size; + old_no_cursor_updating = gimprc.no_cursor_updating; + old_show_tool_tips = gimprc.show_tool_tips; + old_show_rulers = gimprc.show_rulers; + old_show_statusbar = gimprc.show_statusbar; + old_confirm_on_close = gimprc.confirm_on_close; + old_save_session_info = gimprc.save_session_info; + old_save_device_status = gimprc.save_device_status; + old_always_restore_session = gimprc.always_restore_session; + old_default_width = gimprc.default_width; + old_default_height = gimprc.default_height; + old_default_units = gimprc.default_units; + old_default_xresolution = gimprc.default_xresolution; + old_default_yresolution = gimprc.default_yresolution; + old_default_resolution_units = gimprc.default_resolution_units; + old_default_type = gimprc.default_type; + old_default_dot_for_dot = gimprc.default_dot_for_dot; + old_monitor_xres = gimprc.monitor_xres; + old_monitor_yres = gimprc.monitor_yres; + old_using_xserver_resolution = gimprc.using_xserver_resolution; + old_global_paint_options = gimprc.global_paint_options; + old_max_new_image_size = gimprc.max_new_image_size; + old_thumbnail_mode = gimprc.thumbnail_mode; + old_trust_dirty_flag = gimprc.trust_dirty_flag; + old_use_help = gimprc.use_help; + old_help_browser = gimprc.help_browser; + old_cursor_mode = gimprc.cursor_mode; + old_default_threshold = gimprc.default_threshold; - prefs_strset (&old_image_title_format, image_title_format); - prefs_strset (&old_default_comment, default_comment); + prefs_strset (&old_image_title_format, gimprc.image_title_format); + prefs_strset (&old_default_comment, gimprc.default_comment); /* values which will need a restart */ old_stingy_memory_use = edit_stingy_memory_use; @@ -1540,7 +1542,7 @@ preferences_dialog_create (void) GTK_CTREE (ctree), _("New File"), "dialogs/preferences/new_file.html", - NULL, + NULL, &top_insert, page_index); gtk_widget_show (vbox); @@ -1559,7 +1561,7 @@ preferences_dialog_create (void) gtk_widget_show (hbox); sizeentry = - gimp_size_entry_new (2, default_units, "%p", FALSE, FALSE, TRUE, 75, + gimp_size_entry_new (2, gimprc.default_units, "%p", FALSE, FALSE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_SIZE); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), @@ -1570,17 +1572,19 @@ preferences_dialog_create (void) _("Pixels"), 1, 4, 0.0); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), - 0, default_xresolution, FALSE); + 0, gimprc.default_xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), - 1, default_yresolution, FALSE); + 1, gimprc.default_yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 1, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, default_width); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, default_height); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, + gimprc.default_width); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, + gimprc.default_height); gtk_signal_connect (GTK_OBJECT (sizeentry), "unit_changed", GTK_SIGNAL_FUNC (prefs_default_size_callback), @@ -1607,12 +1611,12 @@ preferences_dialog_create (void) pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL); sizeentry2 = - gimp_size_entry_new (2, default_resolution_units, pixels_per_unit, + gimp_size_entry_new (2, gimprc.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 (default_xresolution - default_yresolution) < GIMP_MIN_RESOLUTION) + if (ABS (gimprc.default_xresolution - gimprc.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); @@ -1630,11 +1634,11 @@ preferences_dialog_create (void) (GIMP_SIZE_ENTRY (sizeentry2), 0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry2), 1, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); - + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), - 0, default_xresolution); + 0, gimprc.default_xresolution); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), - 1, default_yresolution); + 1, gimprc.default_yresolution); gtk_signal_connect (GTK_OBJECT (sizeentry2), "unit_changed", (GtkSignalFunc) prefs_default_resolution_callback, @@ -1662,7 +1666,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &default_type, (gpointer) default_type, + &(gimprc.default_type), (gpointer) + gimprc.default_type, _("RGB"), (gpointer) RGB, NULL, _("Grayscale"), (gpointer) GRAY, NULL, @@ -1673,13 +1678,13 @@ preferences_dialog_create (void) optionmenu, 1, TRUE); /* The maximum size of a new image */ - adjustment = gtk_adjustment_new (max_new_image_size, + adjustment = gtk_adjustment_new (gimprc.max_new_image_size, 0, (4069.0 * 1024 * 1024 - 1), 1.0, 1.0, 0.0); hbox = gimp_mem_size_entry_new (GTK_ADJUSTMENT (adjustment)); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", GTK_SIGNAL_FUNC (gimp_uint_adjustment_update), - &max_new_image_size); + &(gimprc.max_new_image_size)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Maximum Image Size:"), 1.0, 0.5, hbox, 1, TRUE); @@ -1707,10 +1712,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, default_comment, -1); + gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, gimprc.default_comment, -1); gtk_signal_connect (GTK_OBJECT (text), "changed", GTK_SIGNAL_FUNC (prefs_text_callback), - &default_comment); + &(gimprc.default_comment)); gtk_container_add (GTK_CONTAINER (hbox), text); gtk_widget_show (text); @@ -1743,7 +1748,7 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &transparency_type, (gpointer) transparency_type, + &(gimprc.transparency_type), (gpointer) gimprc.transparency_type, _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, @@ -1759,7 +1764,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &transparency_size, (gpointer) transparency_size, + &(gimprc.transparency_size), (gpointer) + gimprc.transparency_size, _("Small"), (gpointer) SMALL_CHECKS, NULL, _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, @@ -1849,7 +1855,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_preview_size_callback, - &preview_size, (gpointer) preview_size, + &(gimprc.preview_size), (gpointer) + gimprc.preview_size, _("None"), (gpointer) 0, NULL, _("Tiny"), (gpointer) 24, NULL, @@ -1865,7 +1872,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_nav_preview_size_callback, - &nav_preview_size, (gpointer) nav_preview_size, + &(gimprc.nav_preview_size), (gpointer) + gimprc.nav_preview_size, _("Small"), (gpointer) 48, NULL, _("Medium"), (gpointer) 80, NULL, @@ -1946,21 +1954,21 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Show Tool Tips")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - show_tool_tips); + gimprc.show_tool_tips); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &show_tool_tips); + &(gimprc.show_tool_tips)); gtk_widget_show (button); button = gtk_check_button_new_with_label (_("Context Sensitive Help with \"F1\"")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - use_help); + gimprc.use_help); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &use_help); + &(gimprc.use_help)); gtk_widget_show (button); vbox2 = prefs_frame_new (_("Help Browser"), GTK_BOX (vbox)); @@ -1973,7 +1981,7 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &help_browser, (gpointer) help_browser, + &(gimprc.help_browser), (gpointer) gimprc.help_browser, _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, @@ -1999,38 +2007,38 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Use \"Dot for Dot\" by default")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - default_dot_for_dot); + gimprc.default_dot_for_dot); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &default_dot_for_dot); + &(gimprc.default_dot_for_dot)); gtk_widget_show (button); button = gtk_check_button_new_with_label(_("Resize Window on Zoom")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - allow_resize_windows); + gimprc.allow_resize_windows); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &allow_resize_windows); + &(gimprc.allow_resize_windows)); gtk_widget_show (button); button = gtk_check_button_new_with_label(_("Show Rulers")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - show_rulers); + gimprc.show_rulers); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &show_rulers); + &(gimprc.show_rulers)); gtk_widget_show (button); button = gtk_check_button_new_with_label(_("Show Statusbar")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - show_statusbar); + gimprc.show_statusbar); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &show_statusbar); + &(gimprc.show_statusbar)); gtk_widget_show (button); table = gtk_table_new (2, 2, FALSE); @@ -2042,11 +2050,11 @@ preferences_dialog_create (void) spinbutton = gimp_spin_button_new (&adjustment, - marching_speed, 50.0, 32000.0, 10.0, 100.0, 1.0, + gimprc.marching_speed, 50.0, 32000.0, 10.0, 100.0, 1.0, 1.0, 0.0); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", GTK_SIGNAL_FUNC (gimp_int_adjustment_update), - &marching_speed); + &(gimprc.marching_speed)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Marching Ants Speed:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2058,7 +2066,7 @@ preferences_dialog_create (void) /* Set the currently used string as "Custom" */ comboitem = gtk_list_item_new_with_label (_("Custom")); gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem), - image_title_format); + gimprc.image_title_format); gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem); gtk_widget_show (comboitem); /* set some commonly used format strings */ @@ -2085,7 +2093,7 @@ preferences_dialog_create (void) gtk_signal_connect (GTK_OBJECT (GTK_COMBO (combo)->entry), "changed", GTK_SIGNAL_FUNC (prefs_string_callback), - &image_title_format); + &(gimprc.image_title_format)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Image Title Format:"), 1.0, 0.5, @@ -2097,20 +2105,20 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Perfect-but-Slow Pointer Tracking")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - perfectmouse); + gimprc.perfectmouse); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &perfectmouse); + &(gimprc.perfectmouse)); gtk_widget_show (button); button = gtk_check_button_new_with_label (_("Disable Cursor Updating")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - no_cursor_updating); + gimprc.no_cursor_updating); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &no_cursor_updating); + &(gimprc.no_cursor_updating)); gtk_widget_show (button); table = gtk_table_new (1, 2, FALSE); @@ -2121,7 +2129,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &cursor_mode, (gpointer) cursor_mode, + &(gimprc.cursor_mode), + (gpointer) gimprc.cursor_mode, _("Tool Icon"), (gpointer) CURSOR_MODE_TOOL_ICON, NULL, @@ -2153,11 +2162,11 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label(_("Use Global Paint Options")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - global_paint_options); + gimprc.global_paint_options); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &global_paint_options); + &(gimprc.global_paint_options)); gtk_widget_show (button); vbox2 = prefs_frame_new (_("Finding Contiguous Regions"), GTK_BOX (vbox)); @@ -2172,11 +2181,11 @@ preferences_dialog_create (void) /* Default threshold */ spinbutton = gimp_spin_button_new (&adjustment, - default_threshold, 0.0, 255.0, + gimprc.default_threshold, 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), - &default_threshold); + &(gimprc.default_threshold)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Default Threshold:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2222,10 +2231,10 @@ preferences_dialog_create (void) /* Levels of Undo */ spinbutton = gimp_spin_button_new (&adjustment, - levels_of_undo, 0.0, 255.0, 1.0, 5.0, 0.0, 1.0, 0.0); + gimprc.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), - &levels_of_undo); + &(gimprc.levels_of_undo)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Levels of Undo:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2300,7 +2309,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &thumbnail_mode, (gpointer) thumbnail_mode, + &(gimprc.thumbnail_mode), (gpointer) + gimprc.thumbnail_mode, _("Always"), (gpointer) 1, NULL, _("Never"), (gpointer) 0, NULL, @@ -2312,7 +2322,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &trust_dirty_flag, (gpointer) trust_dirty_flag, + &(gimprc.trust_dirty_flag), + (gpointer) gimprc.trust_dirty_flag, _("Only when Modified"), (gpointer) 1, NULL, _("Always"), (gpointer) 0, NULL, @@ -2339,11 +2350,11 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Save Window Positions on Exit")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - save_session_info); + gimprc.save_session_info); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &save_session_info); + &(gimprc.save_session_info)); gtk_widget_show (button); hbox = gtk_hbox_new (FALSE, 2); @@ -2361,22 +2372,22 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Always Try to Restore Session")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - always_restore_session); + gimprc.always_restore_session); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &always_restore_session); + &(gimprc.always_restore_session)); gtk_widget_show (button); vbox2 = prefs_frame_new (_("Devices"), GTK_BOX (vbox)); button = gtk_check_button_new_with_label (_("Save Device Status on Exit")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - save_device_status); + gimprc.save_device_status); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &save_device_status); + &(gimprc.save_device_status)); gtk_widget_show (button); /* Monitor */ @@ -2416,9 +2427,9 @@ preferences_dialog_create (void) pixels_per_unit = NULL; button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM); - if (ABS (monitor_xres - monitor_yres) < GIMP_MIN_RESOLUTION) + if (ABS (gimprc.monitor_xres - gimprc.monitor_yres) < GIMP_MIN_RESOLUTION) gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE); - gtk_object_set_data (GTK_OBJECT (sizeentry), "chain_button", button); + gtk_object_set_data (GTK_OBJECT (sizeentry), "chain_button", button); gtk_table_attach_defaults (GTK_TABLE (sizeentry), button, 1, 3, 3, 4); gtk_widget_show (button); @@ -2436,8 +2447,10 @@ preferences_dialog_create (void) GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, monitor_xres); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, monitor_yres); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, + gimprc.monitor_xres); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, + gimprc.monitor_yres); gtk_signal_connect (GTK_OBJECT (sizeentry), "value_changed", GTK_SIGNAL_FUNC (prefs_monitor_resolution_callback), @@ -2448,11 +2461,11 @@ preferences_dialog_create (void) gtk_container_add (GTK_CONTAINER (abox), sizeentry); gtk_widget_show (sizeentry); - gtk_widget_set_sensitive (sizeentry, !using_xserver_resolution); - + gtk_widget_set_sensitive (sizeentry, !gimprc.using_xserver_resolution); + hbox = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); - + calibrate_button = gtk_button_new_with_label (_("Calibrate")); gtk_misc_set_padding (GTK_MISC (GTK_BIN (calibrate_button)->child), 4, 0); gtk_signal_connect (GTK_OBJECT (calibrate_button), "clicked", @@ -2460,7 +2473,7 @@ preferences_dialog_create (void) sizeentry); gtk_box_pack_start (GTK_BOX (hbox), calibrate_button, FALSE, FALSE, 0); gtk_widget_show (calibrate_button); - gtk_widget_set_sensitive (calibrate_button, !using_xserver_resolution); + gtk_widget_set_sensitive (calibrate_button, !gimprc.using_xserver_resolution); group = NULL; button = gtk_radio_button_new_with_label (group, _("From windowing system")); @@ -2480,23 +2493,23 @@ preferences_dialog_create (void) gtk_widget_show (button); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0); gtk_widget_show (label); - + separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox2), separator, FALSE, FALSE, 0); gtk_widget_show (separator); - + button = gtk_radio_button_new_with_label (group, _("Manually:")); group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_widget_show (button); - + gtk_box_pack_start (GTK_BOX (vbox2), abox, FALSE, FALSE, 0); gtk_widget_show (abox); - + gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - - if (!using_xserver_resolution) + + if (!gimprc.using_xserver_resolution) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); /* Directories */ @@ -2510,7 +2523,7 @@ preferences_dialog_create (void) page_index); gtk_widget_show (vbox); page_index++; - + { static const struct { @@ -2524,13 +2537,13 @@ preferences_dialog_create (void) { N_("Swap Dir:"), N_("Select Swap Dir"), &edit_swap_path }, }; static gint ndirs = sizeof (dirs) / sizeof (dirs[0]); - + table = gtk_table_new (ndirs + 1, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); gtk_widget_show (table); - + for (i = 0; i < ndirs; i++) { fileselection = gimp_file_selection_new (gettext(dirs[i].fs_label), diff --git a/app/dialogs/resize-dialog.c b/app/dialogs/resize-dialog.c index 737ec55233..9cecabe728 100644 --- a/app/dialogs/resize-dialog.c +++ b/app/dialogs/resize-dialog.c @@ -598,7 +598,8 @@ resize_widget_new (ResizeType type, gtk_widget_set_usize (spinbutton, 75, 0); private->resolution_se = - gimp_size_entry_new (1, default_resolution_units, _("pixels/%a"), + gimp_size_entry_new (1, gimprc.default_resolution_units, + _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); gtk_table_set_col_spacing (GTK_TABLE (private->resolution_se), 1, 2); diff --git a/app/dialogs/tips-dialog.c b/app/dialogs/tips-dialog.c index d59212c726..b916e3ba66 100644 --- a/app/dialogs/tips-dialog.c +++ b/app/dialogs/tips-dialog.c @@ -83,8 +83,8 @@ tips_dialog_create (void) g_free (temp); } - if (last_tip >= tips_count || last_tip < 0) - last_tip = 0; + if (gimprc.last_tip >= tips_count || gimprc.last_tip < 0) + gimprc.last_tip = 0; if (tips_dialog) return tips_dialog; @@ -115,7 +115,7 @@ tips_dialog_create (void) gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); - tips_label = gtk_label_new (tips_text[last_tip]); + tips_label = gtk_label_new (tips_text[gimprc.last_tip]); gtk_label_set_justify (GTK_LABEL (tips_label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (tips_label), 0.5, 0.5); gtk_box_pack_start (GTK_BOX (hbox), tips_label, TRUE, TRUE, 3); @@ -140,14 +140,14 @@ tips_dialog_create (void) gtk_widget_show (hbox); button = gtk_check_button_new_with_label (_("Show tip next time GIMP starts")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), show_tips); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), gimprc.show_tips); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (tips_toggle_update), - &show_tips); + &gimprc.show_tips); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_show (button); - old_show_tips = show_tips; + old_show_tips = gimprc.show_tips; bbox = gtk_hbutton_box_new (); gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0); @@ -203,11 +203,11 @@ tips_dialog_destroy (GtkWidget *widget, /* the last-shown-tip is now saved in sessionrc */ - if (show_tips != old_show_tips) + if (gimprc.show_tips != old_show_tips) { update = g_list_append (update, "show-tips"); remove = g_list_append (remove, "dont-show-tips"); - old_show_tips = show_tips; + old_show_tips = gimprc.show_tips; save_gimprc (&update, &remove); } g_list_free (update); @@ -218,24 +218,24 @@ static void tips_show_previous (GtkWidget *widget, gpointer data) { - last_tip--; + gimprc.last_tip--; - if (last_tip < 0) - last_tip = tips_count - 1; + if (gimprc.last_tip < 0) + gimprc.last_tip = tips_count - 1; - gtk_label_set_text (GTK_LABEL (tips_label), tips_text[last_tip]); + gtk_label_set_text (GTK_LABEL (tips_label), tips_text[gimprc.last_tip]); } static void tips_show_next (GtkWidget *widget, gpointer data) { - last_tip++; + gimprc.last_tip++; - if (last_tip >= tips_count) - last_tip = 0; + if (gimprc.last_tip >= tips_count) + gimprc.last_tip = 0; - gtk_label_set_text (GTK_LABEL (tips_label), tips_text[last_tip]); + gtk_label_set_text (GTK_LABEL (tips_label), tips_text[gimprc.last_tip]); } static void diff --git a/app/dialogs/user-install-dialog.c b/app/dialogs/user-install-dialog.c index 007f50e575..a38860ad37 100644 --- a/app/dialogs/user-install-dialog.c +++ b/app/dialogs/user-install-dialog.c @@ -1206,16 +1206,16 @@ user_install_resolution (void) gimp_coordinates_new (GIMP_UNIT_INCH, pixels_per_unit, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION, - abs (monitor_xres - monitor_yres) < GIMP_MIN_RESOLUTION, + abs (gimprc.monitor_xres - gimprc.monitor_yres) < GIMP_MIN_RESOLUTION, FALSE, _("Monitor Resolution X:"), - monitor_xres, + gimprc.monitor_xres, 1.0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, 0, 0, _("Y:"), - monitor_yres, + gimprc.monitor_yres, 1.0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, @@ -1268,7 +1268,7 @@ user_install_resolution (void) GTK_SIGNAL_FUNC (gimp_toggle_button_sensitive_update), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (xserver_toggle), - using_xserver_resolution); + gimprc.using_xserver_resolution); } static void @@ -1305,33 +1305,33 @@ user_install_resolution_done (void) base_config->swap_path = new_swap_path; update = g_list_append (update, "swap-path"); } - if (using_xserver_resolution != new_using_xserver_resolution || - ABS (monitor_xres - new_monitor_xres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != new_using_xserver_resolution || + ABS (gimprc.monitor_xres - new_monitor_xres) > GIMP_MIN_RESOLUTION) { - monitor_xres = new_monitor_xres; + gimprc.monitor_xres = new_monitor_xres; update = g_list_append (update, "monitor-xresolution"); } - if (using_xserver_resolution != new_using_xserver_resolution || - ABS (monitor_yres - new_monitor_yres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != new_using_xserver_resolution || + ABS (gimprc.monitor_yres - new_monitor_yres) > GIMP_MIN_RESOLUTION) { - monitor_yres = new_monitor_yres; + gimprc.monitor_yres = new_monitor_yres; update = g_list_append (update, "monitor-yresolution"); } - using_xserver_resolution = new_using_xserver_resolution; + gimprc.using_xserver_resolution = new_using_xserver_resolution; - if (using_xserver_resolution) + if (gimprc.using_xserver_resolution) { /* special value of 0 for either x or y res in the gimprc file * means use the xserver's current resolution */ - monitor_xres = 0.0; - monitor_yres = 0.0; + gimprc.monitor_xres = 0.0; + gimprc.monitor_yres = 0.0; } save_gimprc (&update, &remove); - if (using_xserver_resolution) - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); + if (gimprc.using_xserver_resolution) + gdisplay_xserver_resolution (&gimprc.monitor_xres, &gimprc.monitor_yres); g_list_free (update); g_list_free (remove); diff --git a/app/disp_callbacks.c b/app/disp_callbacks.c index 40aeb283dc..6c637bd3a9 100644 --- a/app/disp_callbacks.c +++ b/app/disp_callbacks.c @@ -195,7 +195,8 @@ gdisplay_canvas_events (GtkWidget *canvas, /* create the selection object */ gdisp->select = selection_create (gdisp->canvas->window, gdisp, gdisp->gimage->height, - gdisp->gimage->width, marching_speed); + gdisp->gimage->width, + gimprc.marching_speed); gdisp->disp_width = gdisp->canvas->allocation.width; gdisp->disp_height = gdisp->canvas->allocation.height; @@ -643,7 +644,7 @@ gdisplay_canvas_events (GtkWidget *canvas, /* /File/Preferences.../Interface/... */ /* Image Windows/Disable Cursor Updating is TOGGLED ON */ - if (no_cursor_updating == 0) + if (gimprc.no_cursor_updating == 0) { if (active_tool && !gimp_image_is_empty (gdisp->gimage) && !(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK))) diff --git a/app/display/gimpdisplay-callbacks.c b/app/display/gimpdisplay-callbacks.c index 40aeb283dc..6c637bd3a9 100644 --- a/app/display/gimpdisplay-callbacks.c +++ b/app/display/gimpdisplay-callbacks.c @@ -195,7 +195,8 @@ gdisplay_canvas_events (GtkWidget *canvas, /* create the selection object */ gdisp->select = selection_create (gdisp->canvas->window, gdisp, gdisp->gimage->height, - gdisp->gimage->width, marching_speed); + gdisp->gimage->width, + gimprc.marching_speed); gdisp->disp_width = gdisp->canvas->allocation.width; gdisp->disp_height = gdisp->canvas->allocation.height; @@ -643,7 +644,7 @@ gdisplay_canvas_events (GtkWidget *canvas, /* /File/Preferences.../Interface/... */ /* Image Windows/Disable Cursor Updating is TOGGLED ON */ - if (no_cursor_updating == 0) + if (gimprc.no_cursor_updating == 0) { if (active_tool && !gimp_image_is_empty (gdisp->gimage) && !(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK))) diff --git a/app/display/gimpdisplay-ops.c b/app/display/gimpdisplay-ops.c index 4b7aaf40b2..ce7f4a109d 100644 --- a/app/display/gimpdisplay-ops.c +++ b/app/display/gimpdisplay-ops.c @@ -127,7 +127,7 @@ gdisplay_close_window (GDisplay *gdisp, if (! kill_it && (gdisp->gimage->disp_count == 1) && gdisp->gimage->dirty && - confirm_on_close) + gimprc.confirm_on_close) { gdisplay_close_warning_dialog (g_basename (gimp_image_filename (gdisp->gimage)), gdisp); diff --git a/app/display/gimpdisplay-scale.c b/app/display/gimpdisplay-scale.c index 802996c144..ad21c5d64f 100644 --- a/app/display/gimpdisplay-scale.c +++ b/app/display/gimpdisplay-scale.c @@ -172,7 +172,7 @@ change_scale (GDisplay *gdisp, gdisp->offset_y = (int) (offset_y - (gdisp->disp_height / 2)); /* resize the image */ - resize_display (gdisp, allow_resize_windows, TRUE); + resize_display (gdisp, gimprc.allow_resize_windows, TRUE); } } diff --git a/app/display/gimpdisplay-selection.c b/app/display/gimpdisplay-selection.c index 22732ce038..5a0cd1ea01 100644 --- a/app/display/gimpdisplay-selection.c +++ b/app/display/gimpdisplay-selection.c @@ -520,7 +520,7 @@ selection_create (GdkWindow *win, new = g_new (Selection, 1); base_type = gimp_image_base_type (gdisp->gimage); - if (cycled_marching_ants) + if (gimprc.cycled_marching_ants) { new->cycle = TRUE; if (!cycled_ants_pixmap) diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index afe977c8f9..0e27c75ebf 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -148,7 +148,7 @@ gdisplay_new (GimpImage *gimage, gdisp->offset_x = 0; gdisp->offset_y = 0; gdisp->scale = scale; - gdisp->dot_for_dot = default_dot_for_dot; + gdisp->dot_for_dot = gimprc.default_dot_for_dot; gdisp->gimage = gimage; gdisp->window_info_dialog = NULL; gdisp->window_nav_dialog = NULL; @@ -280,7 +280,7 @@ gdisplay_format_title (GDisplay *gdisp, } i = 0; - format = image_title_format; + format = gimprc.image_title_format; while (i < title_len && *format) { @@ -1378,7 +1378,7 @@ gdisplay_set_dot_for_dot (GDisplay *gdisp, gdisp->dot_for_dot = dot_for_dot; gdisplay_resize_cursor_label (gdisp); - resize_display (gdisp, allow_resize_windows, TRUE); + resize_display (gdisp, gimprc.allow_resize_windows, TRUE); } } @@ -1838,7 +1838,7 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp, { if (cursor_type != GIMP_BAD_CURSOR) { - switch (cursor_mode) + switch (gimprc.cursor_mode) { case CURSOR_MODE_TOOL_ICON: break; diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index 5ce2245784..96c73425b1 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -41,8 +41,8 @@ typedef enum #define SCALEDEST(g) (g->scale >> 8) /* finding the effective screen resolution (double) */ -#define SCREEN_XRES(g) (g->dot_for_dot? g->gimage->xresolution : monitor_xres) -#define SCREEN_YRES(g) (g->dot_for_dot? g->gimage->yresolution : monitor_yres) +#define SCREEN_XRES(g) (g->dot_for_dot? g->gimage->xresolution : gimprc.monitor_xres) +#define SCREEN_YRES(g) (g->dot_for_dot? g->gimage->yresolution : gimprc.monitor_yres) /* calculate scale factors (double) */ #define SCALEFACTOR_X(g) ((SCALEDEST(g) * SCREEN_XRES(g)) / \ diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index 40aeb283dc..6c637bd3a9 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -195,7 +195,8 @@ gdisplay_canvas_events (GtkWidget *canvas, /* create the selection object */ gdisp->select = selection_create (gdisp->canvas->window, gdisp, gdisp->gimage->height, - gdisp->gimage->width, marching_speed); + gdisp->gimage->width, + gimprc.marching_speed); gdisp->disp_width = gdisp->canvas->allocation.width; gdisp->disp_height = gdisp->canvas->allocation.height; @@ -643,7 +644,7 @@ gdisplay_canvas_events (GtkWidget *canvas, /* /File/Preferences.../Interface/... */ /* Image Windows/Disable Cursor Updating is TOGGLED ON */ - if (no_cursor_updating == 0) + if (gimprc.no_cursor_updating == 0) { if (active_tool && !gimp_image_is_empty (gdisp->gimage) && !(state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK))) diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 5c425917b3..37edd17b93 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -526,7 +526,7 @@ create_display_shell (GDisplay *gdisp, /* show everything *******************************************************/ - if (show_rulers) + if (gimprc.show_rulers) { gtk_widget_show (gdisp->origin); gtk_widget_show (gdisp->hrule); @@ -545,7 +545,7 @@ create_display_shell (GDisplay *gdisp, gtk_widget_show (gdisp->statusbar); gtk_widget_show (gdisp->progressbar); gtk_widget_show (gdisp->cancelbutton); - if (show_statusbar) + if (gimprc.show_statusbar) { gtk_widget_show (gdisp->statusarea); } diff --git a/app/display/gimpdisplayshell-layer-select.c b/app/display/gimpdisplayshell-layer-select.c index 561a0f4296..a382824aa7 100644 --- a/app/display/gimpdisplayshell-layer-select.c +++ b/app/display/gimpdisplayshell-layer-select.c @@ -98,7 +98,8 @@ layer_select_init (GimpImage *gimage, layer_select = g_new0 (LayerSelect, 1); layer_select->preview = gimp_preview_new (GIMP_VIEWABLE (layer), - preview_size, 1, FALSE); + gimprc.preview_size, 1, + FALSE); layer_select->label = gtk_label_new (NULL); layer_select_set_gimage (layer_select, gimage); @@ -167,7 +168,7 @@ layer_select_update_preview_size (void) if (layer_select != NULL) { gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview), - preview_size, 1); + gimprc.preview_size, 1); } } @@ -265,7 +266,7 @@ layer_select_set_gimage (LayerSelect *layer_select, gimp_preview_set_viewable (GIMP_PREVIEW (layer_select->preview), GIMP_VIEWABLE (layer_select->current_layer)); gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview), - preview_size, 1); + gimprc.preview_size, 1); gtk_label_set_text (GTK_LABEL (layer_select->label), GIMP_OBJECT (layer_select->current_layer)->name); } diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c index 802996c144..ad21c5d64f 100644 --- a/app/display/gimpdisplayshell-scale.c +++ b/app/display/gimpdisplayshell-scale.c @@ -172,7 +172,7 @@ change_scale (GDisplay *gdisp, gdisp->offset_y = (int) (offset_y - (gdisp->disp_height / 2)); /* resize the image */ - resize_display (gdisp, allow_resize_windows, TRUE); + resize_display (gdisp, gimprc.allow_resize_windows, TRUE); } } diff --git a/app/display/gimpdisplayshell-selection.c b/app/display/gimpdisplayshell-selection.c index 22732ce038..5a0cd1ea01 100644 --- a/app/display/gimpdisplayshell-selection.c +++ b/app/display/gimpdisplayshell-selection.c @@ -520,7 +520,7 @@ selection_create (GdkWindow *win, new = g_new (Selection, 1); base_type = gimp_image_base_type (gdisp->gimage); - if (cycled_marching_ants) + if (gimprc.cycled_marching_ants) { new->cycle = TRUE; if (!cycled_ants_pixmap) diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 5c425917b3..37edd17b93 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -526,7 +526,7 @@ create_display_shell (GDisplay *gdisp, /* show everything *******************************************************/ - if (show_rulers) + if (gimprc.show_rulers) { gtk_widget_show (gdisp->origin); gtk_widget_show (gdisp->hrule); @@ -545,7 +545,7 @@ create_display_shell (GDisplay *gdisp, gtk_widget_show (gdisp->statusbar); gtk_widget_show (gdisp->progressbar); gtk_widget_show (gdisp->cancelbutton); - if (show_statusbar) + if (gimprc.show_statusbar) { gtk_widget_show (gdisp->statusarea); } diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c index d015cec050..cc409fb6f8 100644 --- a/app/display/gimpnavigationeditor.c +++ b/app/display/gimpnavigationeditor.c @@ -1261,11 +1261,11 @@ create_dummy_iwd (GDisplay *gdisp, iwd->ratio = 1.0; iwd->block_window_marker = FALSE; iwd->nav_preview_width = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_WIDTH : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_WIDTH : gimprc.nav_preview_size; iwd->nav_preview_height = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_HEIGHT : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_HEIGHT : gimprc.nav_preview_size; iwd->block_adj_sig = FALSE; iwd->frozen = FALSE; iwd->timer_id = 0; @@ -1726,11 +1726,11 @@ nav_window_preview_resized (InfoDialog *idialog) iwd->imageheight = 1; iwd->nav_preview_width = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_WIDTH : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_WIDTH : gimprc.nav_preview_size; iwd->nav_preview_height = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_HEIGHT : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_HEIGHT : gimprc.nav_preview_size; nav_window_update_window_marker (idialog); } diff --git a/app/display/gimpnavigationview.c b/app/display/gimpnavigationview.c index d015cec050..cc409fb6f8 100644 --- a/app/display/gimpnavigationview.c +++ b/app/display/gimpnavigationview.c @@ -1261,11 +1261,11 @@ create_dummy_iwd (GDisplay *gdisp, iwd->ratio = 1.0; iwd->block_window_marker = FALSE; iwd->nav_preview_width = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_WIDTH : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_WIDTH : gimprc.nav_preview_size; iwd->nav_preview_height = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_HEIGHT : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_HEIGHT : gimprc.nav_preview_size; iwd->block_adj_sig = FALSE; iwd->frozen = FALSE; iwd->timer_id = 0; @@ -1726,11 +1726,11 @@ nav_window_preview_resized (InfoDialog *idialog) iwd->imageheight = 1; iwd->nav_preview_width = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_WIDTH : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_WIDTH : gimprc.nav_preview_size; iwd->nav_preview_height = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_HEIGHT : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_HEIGHT : gimprc.nav_preview_size; nav_window_update_window_marker (idialog); } diff --git a/app/file-save.c b/app/file-save.c index d4dfec5421..dc643b8752 100644 --- a/app/file-save.c +++ b/app/file-save.c @@ -181,7 +181,7 @@ file_save (GimpImage *gimage, /* gimage_set_save_proc(gimage, file_proc); */ /* Write a thumbnail for the saved image, where appropriate */ - switch (thumbnail_mode) + switch (gimprc.thumbnail_mode) { case 0: break; diff --git a/app/file/file-save.c b/app/file/file-save.c index d4dfec5421..dc643b8752 100644 --- a/app/file/file-save.c +++ b/app/file/file-save.c @@ -181,7 +181,7 @@ file_save (GimpImage *gimage, /* gimage_set_save_proc(gimage, file_proc); */ /* Write a thumbnail for the saved image, where appropriate */ - switch (thumbnail_mode) + switch (gimprc.thumbnail_mode) { case 0: break; diff --git a/app/gdisplay.c b/app/gdisplay.c index afe977c8f9..0e27c75ebf 100644 --- a/app/gdisplay.c +++ b/app/gdisplay.c @@ -148,7 +148,7 @@ gdisplay_new (GimpImage *gimage, gdisp->offset_x = 0; gdisp->offset_y = 0; gdisp->scale = scale; - gdisp->dot_for_dot = default_dot_for_dot; + gdisp->dot_for_dot = gimprc.default_dot_for_dot; gdisp->gimage = gimage; gdisp->window_info_dialog = NULL; gdisp->window_nav_dialog = NULL; @@ -280,7 +280,7 @@ gdisplay_format_title (GDisplay *gdisp, } i = 0; - format = image_title_format; + format = gimprc.image_title_format; while (i < title_len && *format) { @@ -1378,7 +1378,7 @@ gdisplay_set_dot_for_dot (GDisplay *gdisp, gdisp->dot_for_dot = dot_for_dot; gdisplay_resize_cursor_label (gdisp); - resize_display (gdisp, allow_resize_windows, TRUE); + resize_display (gdisp, gimprc.allow_resize_windows, TRUE); } } @@ -1838,7 +1838,7 @@ gdisplay_real_install_tool_cursor (GDisplay *gdisp, { if (cursor_type != GIMP_BAD_CURSOR) { - switch (cursor_mode) + switch (gimprc.cursor_mode) { case CURSOR_MODE_TOOL_ICON: break; diff --git a/app/gdisplay.h b/app/gdisplay.h index 5ce2245784..96c73425b1 100644 --- a/app/gdisplay.h +++ b/app/gdisplay.h @@ -41,8 +41,8 @@ typedef enum #define SCALEDEST(g) (g->scale >> 8) /* finding the effective screen resolution (double) */ -#define SCREEN_XRES(g) (g->dot_for_dot? g->gimage->xresolution : monitor_xres) -#define SCREEN_YRES(g) (g->dot_for_dot? g->gimage->yresolution : monitor_yres) +#define SCREEN_XRES(g) (g->dot_for_dot? g->gimage->xresolution : gimprc.monitor_xres) +#define SCREEN_YRES(g) (g->dot_for_dot? g->gimage->yresolution : gimprc.monitor_yres) /* calculate scale factors (double) */ #define SCALEFACTOR_X(g) ((SCALEDEST(g) * SCREEN_XRES(g)) / \ diff --git a/app/gdisplay_ops.c b/app/gdisplay_ops.c index 4b7aaf40b2..ce7f4a109d 100644 --- a/app/gdisplay_ops.c +++ b/app/gdisplay_ops.c @@ -127,7 +127,7 @@ gdisplay_close_window (GDisplay *gdisp, if (! kill_it && (gdisp->gimage->disp_count == 1) && gdisp->gimage->dirty && - confirm_on_close) + gimprc.confirm_on_close) { gdisplay_close_warning_dialog (g_basename (gimp_image_filename (gdisp->gimage)), gdisp); diff --git a/app/gimphelp.c b/app/gimphelp.c index d99280bd2d..71bef9c431 100644 --- a/app/gimphelp.c +++ b/app/gimphelp.c @@ -78,7 +78,7 @@ void gimp_help (const gchar *help_path, const gchar *help_data) { - if (use_help) + if (gimprc.use_help) { GimpIdleHelp *idle_help; @@ -106,7 +106,7 @@ gimp_idle_help (gpointer data) idle_help = (GimpIdleHelp *) data; - if (idle_help->help_data == NULL && help_browser != HELP_BROWSER_GIMP) + if (idle_help->help_data == NULL && gimprc.help_browser != HELP_BROWSER_GIMP) idle_help->help_data = g_strdup ("introduction.html"); #ifdef DEBUG_HELP @@ -123,7 +123,7 @@ gimp_idle_help (gpointer data) g_print ("\n"); #endif /* DEBUG_HELP */ - switch (help_browser) + switch (gimprc.help_browser) { case HELP_BROWSER_GIMP: if (gimp_help_internal (idle_help->help_path, @@ -160,7 +160,7 @@ gimp_help_internal_not_found_callback (GtkWidget *widget, if (use_netscape) { - help_browser = HELP_BROWSER_NETSCAPE; + gimprc.help_browser = HELP_BROWSER_NETSCAPE; update = g_list_append (update, "help-browser"); save_gimprc (&update, &remove); @@ -201,7 +201,7 @@ gimp_help_internal (const gchar *help_path, gtk_widget_show (not_found); gtk_main (); - return (help_browser != HELP_BROWSER_NETSCAPE); + return (gimprc.help_browser != HELP_BROWSER_NETSCAPE); } args = g_new (Argument, 4); diff --git a/app/gimprc.c b/app/gimprc.c index a3fdb7da0c..cb2e4aab37 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -195,128 +195,181 @@ static gchar * open_backup_file (gchar *filename, /* global gimprc variables */ -gchar *plug_in_path = NULL; -gchar *brush_path = NULL; -gchar *default_brush = NULL; -gchar *pattern_path = NULL; -gchar *default_pattern = NULL; -gchar *palette_path = NULL; -gchar *default_palette = NULL; -gchar *gradient_path = NULL; -gchar *default_gradient = NULL; -gchar *pluginrc_path = NULL; -gchar *module_path = NULL; -gint marching_speed = 300; /* 300 ms */ -gdouble gamma_val = 1.0; -gint transparency_type = 1; /* Mid-Tone Checks */ -gboolean perfectmouse = FALSE; /* off (fast and sloppy) */ -gint transparency_size = 1; /* Medium sized */ -gint levels_of_undo = 5; -gint last_opened_size = 4; -gint min_colors = 144; /* 6*6*4 */ -gboolean install_cmap = FALSE; -gint cycled_marching_ants = 0; -gint default_threshold = 15; -gboolean allow_resize_windows = FALSE; -gboolean no_cursor_updating = FALSE; -gint preview_size = 32; -gint nav_preview_size = 112; -gboolean show_rulers = TRUE; -gboolean show_statusbar = TRUE; -GimpUnit default_units = GIMP_UNIT_INCH; -gboolean auto_save = TRUE; -gboolean confirm_on_close = TRUE; -gboolean save_session_info = TRUE; -gboolean save_device_status = FALSE; -gboolean always_restore_session = TRUE; -gint default_width = 256; -gint default_height = 256; -gint default_type = RGB; -gdouble default_xresolution = 72.0; -gdouble default_yresolution = 72.0; -GimpUnit default_resolution_units = GIMP_UNIT_INCH; -gchar *default_comment = NULL; -gboolean default_dot_for_dot = TRUE; -gboolean show_tips = TRUE; -gint last_tip = -1; -gboolean show_tool_tips = TRUE; -gdouble monitor_xres = 72.0; -gdouble monitor_yres = 72.0; -gboolean using_xserver_resolution = FALSE; -gchar *image_title_format = NULL; -gboolean global_paint_options = FALSE; -gchar *module_db_load_inhibit = NULL; -gboolean show_indicators = TRUE; -guint max_new_image_size = 33554432; /* 32 MB */ -gint thumbnail_mode = 1; -gboolean trust_dirty_flag = FALSE; -gboolean use_help = TRUE; -gboolean nav_window_per_display = FALSE; -gboolean info_window_follows_mouse = TRUE; -gint help_browser = HELP_BROWSER_GIMP; -gint cursor_mode = CURSOR_MODE_TOOL_ICON; -gboolean disable_tearoff_menus = FALSE; - +GimpRc gimprc = { + .plug_in_path = NULL, + .brush_path = NULL, + .default_brush = NULL, + .pattern_path = NULL, + .default_pattern = NULL, + .palette_path = NULL, + .default_palette = NULL, + .gradient_path = NULL, + .default_gradient = NULL, + .pluginrc_path = NULL, + .module_path = NULL, + .marching_speed = 300, /* 300 ms */ + .gamma_val = 1.0, + .transparency_type = 1, /* Mid-Tone Checks */ + .perfectmouse = FALSE, /* off (fast and sloppy) */ + .transparency_size = 1, /* Medium sized */ + .levels_of_undo = 5, + .last_opened_size = 4, + .min_colors = 144, /* 6*6*4 */ + .install_cmap = FALSE, + .cycled_marching_ants = 0, + .default_threshold = 15, + .allow_resize_windows = FALSE, + .no_cursor_updating = FALSE, + .preview_size = 32, + .nav_preview_size = 112, + .show_rulers = TRUE, + .show_statusbar = TRUE, + .default_units = GIMP_UNIT_INCH, + .auto_save = TRUE, + .confirm_on_close = TRUE, + .save_session_info = TRUE, + .save_device_status = FALSE, + .always_restore_session = TRUE, + .default_width = 256, + .default_height = 256, + .default_type = RGB, + .default_xresolution = 72.0, + .default_yresolution = 72.0, + .default_resolution_units = GIMP_UNIT_INCH, + .default_comment = NULL, + .default_dot_for_dot = TRUE, + .show_tips = TRUE, + .last_tip = -1, + .show_tool_tips = TRUE, + .monitor_xres = 72.0, + .monitor_yres = 72.0, + .using_xserver_resolution = FALSE, + .image_title_format = NULL, + .global_paint_options = FALSE, + .module_db_load_inhibit = NULL, + .show_indicators = TRUE, + .max_new_image_size = 33554432, /* 32 MB */ + .thumbnail_mode = 1, + .trust_dirty_flag = FALSE, + .use_help = TRUE, + .nav_window_per_display = FALSE, + .info_window_follows_mouse = TRUE, + .help_browser = HELP_BROWSER_GIMP, + .cursor_mode = CURSOR_MODE_TOOL_ICON, + .disable_tearoff_menus = FALSE +}; static GHashTable *parse_func_hash = NULL; static ParseFunc funcs[] = { - { "brush-path", TT_PATH, &brush_path, NULL }, - { "pattern-path", TT_PATH, &pattern_path, NULL }, - { "plug-in-path", TT_PATH, &plug_in_path, NULL }, - { "palette-path", TT_PATH, &palette_path, NULL }, - { "gradient-path", TT_PATH, &gradient_path, NULL }, - { "pluginrc-path", TT_PATH, &pluginrc_path, NULL }, - { "module-path", TT_PATH, &module_path, NULL }, - { "default-brush", TT_STRING, &default_brush, NULL }, - { "default-pattern", TT_STRING, &default_pattern, NULL }, - { "default-palette", TT_STRING, &default_palette, NULL }, - { "default-gradient", TT_STRING, &default_gradient, NULL }, - { "gamma-correction", TT_DOUBLE, &gamma_val, NULL }, - { "marching-ants-speed", TT_INT, &marching_speed, NULL }, - { "last-opened-size", TT_INT, &last_opened_size, NULL }, - { "undo-levels", TT_INT, &levels_of_undo, NULL }, - { "transparency-type", TT_INT, &transparency_type, NULL }, - { "perfect-mouse", TT_BOOLEAN, &perfectmouse, NULL }, - { "transparency-size", TT_INT, &transparency_size, NULL }, - { "min-colors", TT_INT, &min_colors, NULL }, - { "install-colormap", TT_BOOLEAN, &install_cmap, NULL }, - { "colormap-cycling", TT_BOOLEAN, &cycled_marching_ants, NULL }, - { "default-threshold", TT_INT, &default_threshold, NULL }, - { "allow-resize-windows", TT_BOOLEAN, &allow_resize_windows, NULL }, - { "dont-allow-resize-windows", TT_BOOLEAN, NULL, &allow_resize_windows }, - { "cursor-updating", TT_BOOLEAN, NULL, &no_cursor_updating }, - { "no-cursor-updating", TT_BOOLEAN, &no_cursor_updating, NULL }, + { "brush-path", TT_PATH, + &(gimprc.brush_path), NULL }, + { "pattern-path", TT_PATH, + &(gimprc.pattern_path), NULL }, + { "plug-in-path", TT_PATH, + &(gimprc.plug_in_path), NULL }, + { "palette-path", TT_PATH, + &(gimprc.palette_path), NULL }, + { "gradient-path", TT_PATH, + &(gimprc.gradient_path), NULL }, + { "pluginrc-path", TT_PATH, + &(gimprc.pluginrc_path), NULL }, + { "module-path", TT_PATH, + &(gimprc.module_path), NULL }, + { "default-brush", TT_STRING, + &(gimprc.default_brush), NULL }, + { "default-pattern", TT_STRING, + &(gimprc.default_pattern), NULL }, + { "default-palette", TT_STRING, + &(gimprc.default_palette), NULL }, + { "default-gradient", TT_STRING, + &(gimprc.default_gradient), NULL }, + { "gamma-correction", TT_DOUBLE, + &(gimprc.gamma_val), NULL }, + { "marching-ants-speed", TT_INT, + &(gimprc.marching_speed), NULL }, + { "last-opened-size", TT_INT, + &(gimprc.last_opened_size), NULL }, + { "undo-levels", TT_INT, + &(gimprc.levels_of_undo), NULL }, + { "transparency-type", TT_INT, + &(gimprc.transparency_type), NULL }, + { "perfect-mouse", TT_BOOLEAN, + &(gimprc.perfectmouse), NULL }, + { "transparency-size", TT_INT, + &(gimprc.transparency_size), NULL }, + { "min-colors", TT_INT, + &(gimprc.min_colors), NULL }, + { "install-colormap", TT_BOOLEAN, + &(gimprc.install_cmap), NULL }, + { "colormap-cycling", TT_BOOLEAN, + &(gimprc.cycled_marching_ants), NULL }, + { "default-threshold", TT_INT, + &(gimprc.default_threshold), NULL }, + { "allow-resize-windows", TT_BOOLEAN, + &(gimprc.allow_resize_windows), NULL }, + { "dont-allow-resize-windows", TT_BOOLEAN, NULL, + &(gimprc.allow_resize_windows) }, + { "cursor-updating", TT_BOOLEAN, NULL, + &(gimprc.no_cursor_updating) }, + { "no-cursor-updating", TT_BOOLEAN, + &(gimprc.no_cursor_updating), NULL }, { "preview-size", TT_XPREVSIZE, NULL, NULL }, { "nav-preview-size", TT_XNAVPREVSIZE, NULL, NULL }, - { "show-rulers", TT_BOOLEAN, &show_rulers, NULL }, - { "dont-show-rulers", TT_BOOLEAN, NULL, &show_rulers }, - { "show-statusbar", TT_BOOLEAN, &show_statusbar, NULL }, - { "dont-show-statusbar", TT_BOOLEAN, NULL, &show_statusbar }, - { "default-units", TT_XUNIT, &default_units, NULL }, - { "auto-save", TT_BOOLEAN, &auto_save, NULL }, - { "dont-auto-save", TT_BOOLEAN, NULL, &auto_save }, - { "confirm-on-close", TT_BOOLEAN, &confirm_on_close, NULL }, - { "dont-confirm-on-close", TT_BOOLEAN, NULL, &confirm_on_close }, - { "save-session-info", TT_BOOLEAN, &save_session_info, NULL }, - { "dont-save-session-info", TT_BOOLEAN, NULL, &save_session_info}, - { "save-device-status", TT_BOOLEAN, &save_device_status, NULL }, - { "dont-save-device-status", TT_BOOLEAN, NULL, &save_device_status}, - { "always-restore-session", TT_BOOLEAN, &always_restore_session, NULL }, - { "show-tips", TT_BOOLEAN, &show_tips, NULL }, - { "dont-show-tips", TT_BOOLEAN, NULL, &show_tips }, - { "last-tip-shown", TT_INT, &last_tip, NULL }, - { "show-tool-tips", TT_BOOLEAN, &show_tool_tips, NULL }, - { "dont-show-tool-tips", TT_BOOLEAN, NULL, &show_tool_tips }, - { "default-image-size", TT_POSITION, &default_width, &default_height }, - { "default-image-type", TT_IMAGETYPE, &default_type, NULL }, - { "default-xresolution", TT_DOUBLE, &default_xresolution, NULL }, - { "default-yresolution", TT_DOUBLE, &default_yresolution, NULL }, - { "default-resolution-units", TT_XUNIT, &default_resolution_units, NULL }, - { "default-comment", TT_XCOMMENT, &default_comment, NULL }, - { "default-dot-for-dot", TT_BOOLEAN, &default_dot_for_dot, NULL }, + { "show-rulers", TT_BOOLEAN, + &(gimprc.show_rulers), NULL }, + { "dont-show-rulers", TT_BOOLEAN, NULL, + &(gimprc.show_rulers) }, + { "show-statusbar", TT_BOOLEAN, + &(gimprc.show_statusbar), NULL }, + { "dont-show-statusbar", TT_BOOLEAN, NULL, + &(gimprc.show_statusbar) }, + { "default-units", TT_XUNIT, + &(gimprc.default_units), NULL }, + { "auto-save", TT_BOOLEAN, + &(gimprc.auto_save), NULL }, + { "dont-auto-save", TT_BOOLEAN, NULL, + &(gimprc.auto_save) }, + { "confirm-on-close", TT_BOOLEAN, + &(gimprc.confirm_on_close), NULL }, + { "dont-confirm-on-close", TT_BOOLEAN, NULL, + &(gimprc.confirm_on_close) }, + { "save-session-info", TT_BOOLEAN, + &(gimprc.save_session_info), NULL }, + { "dont-save-session-info", TT_BOOLEAN, NULL, + &(gimprc.save_session_info)}, + { "save-device-status", TT_BOOLEAN, + &(gimprc.save_device_status), NULL }, + { "dont-save-device-status", TT_BOOLEAN, NULL, + &(gimprc.save_device_status)}, + { "always-restore-session", TT_BOOLEAN, + &(gimprc.always_restore_session), NULL }, + { "show-tips", TT_BOOLEAN, + &(gimprc.show_tips), NULL }, + { "dont-show-tips", TT_BOOLEAN, NULL, + &(gimprc.show_tips) }, + { "last-tip-shown", TT_INT, + &(gimprc.last_tip), NULL }, + { "show-tool-tips", TT_BOOLEAN, + &(gimprc.show_tool_tips), NULL }, + { "dont-show-tool-tips", TT_BOOLEAN, NULL, + &(gimprc.show_tool_tips) }, + { "default-image-size", TT_POSITION, + &(gimprc.default_width), &(gimprc.default_height) }, + { "default-image-type", TT_IMAGETYPE, + &(gimprc.default_type), NULL }, + { "default-xresolution", TT_DOUBLE, + &(gimprc.default_xresolution), NULL }, + { "default-yresolution", TT_DOUBLE, + &(gimprc.default_yresolution), NULL }, + { "default-resolution-units", TT_XUNIT, + &(gimprc.default_resolution_units), NULL }, + { "default-comment", TT_XCOMMENT, + &(gimprc.default_comment), NULL }, + { "default-dot-for-dot", TT_BOOLEAN, + &(gimprc.default_dot_for_dot), NULL }, { "plug-in", TT_XPLUGIN, NULL, NULL }, { "plug-in-def", TT_XPLUGINDEF, NULL, NULL }, { "menu-path", TT_XMENUPATH, NULL, NULL }, @@ -324,28 +377,49 @@ static ParseFunc funcs[] = { "session-info", TT_XSESSIONINFO, NULL, NULL }, { "color-history", TT_XCOLORHISTORY, NULL, NULL }, { "unit-info", TT_XUNITINFO, NULL, NULL }, - { "monitor-xresolution", TT_DOUBLE, &monitor_xres, NULL }, - { "monitor-yresolution", TT_DOUBLE, &monitor_yres, NULL }, - { "image-title-format", TT_STRING, &image_title_format, NULL }, + { "monitor-xresolution", TT_DOUBLE, + &(gimprc.monitor_xres), NULL }, + { "monitor-yresolution", TT_DOUBLE, + &(gimprc.monitor_yres), NULL }, + { "image-title-format", TT_STRING, + &(gimprc.image_title_format), NULL }, { "parasite", TT_XPARASITE, NULL, NULL }, - { "global-paint-options", TT_BOOLEAN, &global_paint_options, NULL }, - { "show-indicators", TT_BOOLEAN, &show_indicators, NULL }, - { "dont-show-indicators", TT_BOOLEAN, NULL, &show_indicators }, - { "no-global-paint-options", TT_BOOLEAN, NULL, &global_paint_options }, - { "module-load-inhibit", TT_PATH, &module_db_load_inhibit, NULL }, - { "max-new-image-size", TT_MEMSIZE, &max_new_image_size, NULL }, - { "thumbnail-mode", TT_INT, &thumbnail_mode, NULL }, - { "trust-dirty-flag", TT_BOOLEAN, &trust_dirty_flag, NULL }, - { "dont-trust-dirty-flag", TT_BOOLEAN, NULL, &trust_dirty_flag }, - { "use-help", TT_BOOLEAN, &use_help, NULL }, - { "dont-use-help", TT_BOOLEAN, NULL, &use_help }, - { "nav-window-per-display", TT_BOOLEAN, &nav_window_per_display, NULL }, - { "nav-window-follows-auto", TT_BOOLEAN, NULL, &nav_window_per_display }, - { "info-window-follows-mouse", TT_BOOLEAN, &info_window_follows_mouse, NULL }, - { "info-window-per-display", TT_BOOLEAN, NULL, &info_window_follows_mouse }, - { "help-browser", TT_XHELPBROWSER, &help_browser, NULL }, - { "cursor-mode", TT_XCURSORMODE, &cursor_mode, NULL }, - { "disable-tearoff-menus", TT_BOOLEAN, &disable_tearoff_menus, NULL } + { "global-paint-options", TT_BOOLEAN, + &(gimprc.global_paint_options), NULL }, + { "show-indicators", TT_BOOLEAN, + &(gimprc.show_indicators), NULL }, + { "dont-show-indicators", TT_BOOLEAN, NULL, + &(gimprc.show_indicators) }, + { "no-global-paint-options", TT_BOOLEAN, NULL, + &(gimprc.global_paint_options) }, + { "module-load-inhibit", TT_PATH, + &(gimprc.module_db_load_inhibit), NULL }, + { "max-new-image-size", TT_MEMSIZE, + &(gimprc.max_new_image_size), NULL }, + { "thumbnail-mode", TT_INT, + &(gimprc.thumbnail_mode), NULL }, + { "trust-dirty-flag", TT_BOOLEAN, + &(gimprc.trust_dirty_flag), NULL }, + { "dont-trust-dirty-flag", TT_BOOLEAN, NULL, + &(gimprc.trust_dirty_flag) }, + { "use-help", TT_BOOLEAN, + &(gimprc.use_help), NULL }, + { "dont-use-help", TT_BOOLEAN, NULL, + &(gimprc.use_help) }, + { "nav-window-per-display", TT_BOOLEAN, + &(gimprc.nav_window_per_display), NULL }, + { "nav-window-follows-auto", TT_BOOLEAN, NULL, + &(gimprc.nav_window_per_display) }, + { "info-window-follows-mouse", TT_BOOLEAN, + &(gimprc.info_window_follows_mouse), NULL }, + { "info-window-per-display", TT_BOOLEAN, NULL, + &(gimprc.info_window_follows_mouse) }, + { "help-browser", TT_XHELPBROWSER, + &(gimprc.help_browser), NULL }, + { "cursor-mode", TT_XCURSORMODE, + &(gimprc.cursor_mode), NULL }, + { "disable-tearoff-menus", TT_BOOLEAN, + &(gimprc.disable_tearoff_menus), NULL } }; static gint n_funcs = (sizeof (funcs) / sizeof (funcs[0])); @@ -471,10 +545,10 @@ parse_gimprc (void) g_free (filename); g_free (libfilename); - if (!image_title_format) - image_title_format = g_strdup (DEFAULT_IMAGE_TITLE_FORMAT); - if (!default_comment) - default_comment = g_strdup (DEFAULT_COMMENT); + if (!gimprc.image_title_format) + gimprc.image_title_format = g_strdup (DEFAULT_IMAGE_TITLE_FORMAT); + if (!gimprc.default_comment) + gimprc.default_comment = g_strdup (DEFAULT_COMMENT); } gboolean @@ -1295,22 +1369,22 @@ parse_preview_size (gpointer val1p, if (token == TOKEN_SYMBOL) { if (strcmp (token_sym, "none") == 0) - preview_size = 0; + gimprc.preview_size = 0; else if (strcmp (token_sym, "tiny") == 0) - preview_size = 24; + gimprc.preview_size = 24; else if (strcmp (token_sym, "small") == 0) - preview_size = 32; + gimprc.preview_size = 32; else if (strcmp (token_sym, "medium") == 0) - preview_size = 48; + gimprc.preview_size = 48; else if (strcmp (token_sym, "large") == 0) - preview_size = 64; + gimprc.preview_size = 64; else if (strcmp (token_sym, "huge") == 0) - preview_size = 128; + gimprc.preview_size = 128; else - preview_size = 0; + gimprc.preview_size = 0; } else if (token == TOKEN_NUMBER) - preview_size = token_num; + gimprc.preview_size = token_num; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -1337,16 +1411,16 @@ parse_nav_preview_size (gpointer val1p, /* preview_size = 0; */ /* else */ if (strcmp (token_sym, "small") == 0) - nav_preview_size = 48; + gimprc.nav_preview_size = 48; else if (strcmp (token_sym, "medium") == 0) - nav_preview_size = 80; + gimprc.nav_preview_size = 80; else if (strcmp (token_sym, "large") == 0) - nav_preview_size = 112; + gimprc.nav_preview_size = 112; else - nav_preview_size = 112; + gimprc.nav_preview_size = 112; } else if (token == TOKEN_NUMBER) - nav_preview_size = token_num; + gimprc.nav_preview_size = token_num; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -2685,9 +2759,9 @@ parse_help_browser (gpointer val1p, token = get_next_token (); if (strcmp (token_sym, "gimp") == 0) - help_browser = HELP_BROWSER_GIMP; + gimprc.help_browser = HELP_BROWSER_GIMP; else if (strcmp (token_sym, "netscape") == 0) - help_browser = HELP_BROWSER_NETSCAPE; + gimprc.help_browser = HELP_BROWSER_NETSCAPE; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -2709,11 +2783,11 @@ parse_cursor_mode (gpointer val1p, token = get_next_token (); if (strcmp (token_sym, "tool-icon") == 0) - cursor_mode = CURSOR_MODE_TOOL_ICON; + gimprc.cursor_mode = CURSOR_MODE_TOOL_ICON; else if (strcmp (token_sym, "tool-crosshair") == 0) - cursor_mode = CURSOR_MODE_TOOL_CROSSHAIR; + gimprc.cursor_mode = CURSOR_MODE_TOOL_CROSSHAIR; else if (strcmp (token_sym, "crosshair") == 0) - cursor_mode = CURSOR_MODE_CROSSHAIR; + gimprc.cursor_mode = CURSOR_MODE_CROSSHAIR; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -2957,15 +3031,15 @@ static inline gchar * preview_size_to_str (gpointer val1p, gpointer val2p) { - if (preview_size >= 128) + if (gimprc.preview_size >= 128) return g_strdup ("huge"); - else if (preview_size >= 64) + else if (gimprc.preview_size >= 64) return g_strdup ("large"); - else if (preview_size >= 48) + else if (gimprc.preview_size >= 48) return g_strdup ("medium"); - else if (preview_size >= 32) + else if (gimprc.preview_size >= 32) return g_strdup ("small"); - else if (preview_size >= 24) + else if (gimprc.preview_size >= 24) return g_strdup ("tiny"); else return g_strdup ("none"); @@ -2975,11 +3049,11 @@ static inline gchar * nav_preview_size_to_str (gpointer val1p, gpointer val2p) { - if (nav_preview_size >= 112) + if (gimprc.nav_preview_size >= 112) return g_strdup ("large"); - else if (nav_preview_size >= 80) + else if (gimprc.nav_preview_size >= 80) return g_strdup ("medium"); - else if (nav_preview_size >= 48) + else if (gimprc.nav_preview_size >= 48) return g_strdup ("small"); else return g_strdup ("large"); @@ -2997,7 +3071,7 @@ static inline gchar * help_browser_to_str (gpointer val1p, gpointer val2p) { - if (help_browser == HELP_BROWSER_NETSCAPE) + if (gimprc.help_browser == HELP_BROWSER_NETSCAPE) return g_strdup ("netscape"); else return g_strdup ("gimp"); @@ -3007,9 +3081,9 @@ static inline gchar * cursor_mode_to_str (gpointer val1p, gpointer val2p) { - if (cursor_mode == CURSOR_MODE_TOOL_ICON) + if (gimprc.cursor_mode == CURSOR_MODE_TOOL_ICON) return g_strdup ("tool-icon"); - else if (cursor_mode == CURSOR_MODE_TOOL_CROSSHAIR) + else if (gimprc.cursor_mode == CURSOR_MODE_TOOL_CROSSHAIR) return g_strdup ("tool-crosshair"); else return g_strdup ("crosshair"); diff --git a/app/gimprc.h b/app/gimprc.h index 8f8dd321b2..c0438bedba 100644 --- a/app/gimprc.h +++ b/app/gimprc.h @@ -19,68 +19,74 @@ #ifndef __GIMPRC_H__ #define __GIMPRC_H__ +typedef struct _GimpRc GimpRc; -/* global gimprc variables */ -extern gchar *plug_in_path; -extern gchar *brush_path; -extern gchar *default_brush; -extern gchar *pattern_path; -extern gchar *default_pattern; -extern gchar *palette_path; -extern gchar *default_palette; -extern gchar *gradient_path; -extern gchar *default_gradient; -extern gchar *pluginrc_path; -extern gchar *module_path; -extern gint marching_speed; -extern gint last_opened_size; -extern gdouble gamma_val; -extern gint transparency_type; -extern gboolean perfectmouse; -extern gint transparency_size; -extern gint levels_of_undo; -extern gint min_colors; -extern gboolean install_cmap; -extern gboolean cycled_marching_ants; -extern gint default_threshold; -extern gboolean allow_resize_windows; -extern gboolean no_cursor_updating; -extern gint preview_size; -extern gint nav_preview_size; -extern gboolean show_rulers; -extern GimpUnit default_units; -extern gboolean show_statusbar; -extern gboolean auto_save; -extern gboolean confirm_on_close; -extern gint default_width, default_height; -extern gint default_type; -extern GimpUnit default_resolution_units; -extern gdouble default_xresolution; -extern gdouble default_yresolution; -extern gchar *default_comment; -extern gboolean default_dot_for_dot; -extern gboolean save_session_info; -extern gboolean save_device_status; -extern gboolean always_restore_session; -extern gboolean show_tips; -extern gint last_tip; -extern gboolean show_tool_tips; -extern gdouble monitor_xres; -extern gdouble monitor_yres; -extern gboolean using_xserver_resolution; -extern gchar *image_title_format; -extern gboolean global_paint_options; -extern gchar *module_db_load_inhibit; -extern gboolean show_indicators; -extern guint max_new_image_size; -extern gint thumbnail_mode; -extern gboolean trust_dirty_flag; -extern gboolean use_help; -extern gboolean nav_window_per_display; -extern gboolean info_window_follows_mouse; -extern gint help_browser; -extern gint cursor_mode; -extern gboolean disable_tearoff_menus; +/* global gimprc variables - need some comments on this stuff */ +struct _GimpRc +{ + gchar *plug_in_path; + gchar *brush_path; + gchar *default_brush; + gchar *pattern_path; + gchar *default_pattern; + gchar *palette_path; + gchar *default_palette; + gchar *gradient_path; + gchar *default_gradient; + gchar *pluginrc_path; + gchar *module_path; + gint marching_speed; + gint last_opened_size; + gdouble gamma_val; + gint transparency_type; + gboolean perfectmouse; + gint transparency_size; + gint levels_of_undo; + gint min_colors; + gboolean install_cmap; + gboolean cycled_marching_ants; + gint default_threshold; + gboolean allow_resize_windows; + gboolean no_cursor_updating; + gint preview_size; + gint nav_preview_size; + gboolean show_rulers; + GimpUnit default_units; + gboolean show_statusbar; + gboolean auto_save; + gboolean confirm_on_close; + gint default_width, default_height; + gint default_type; + GimpUnit default_resolution_units; + gdouble default_xresolution; + gdouble default_yresolution; + gchar *default_comment; + gboolean default_dot_for_dot; + gboolean save_session_info; + gboolean save_device_status; + gboolean always_restore_session; + gboolean show_tips; + gint last_tip; + gboolean show_tool_tips; + gdouble monitor_xres; + gdouble monitor_yres; + gboolean using_xserver_resolution; + gchar *image_title_format; + gboolean global_paint_options; + gchar *module_db_load_inhibit; + gboolean show_indicators; + guint max_new_image_size; + gint thumbnail_mode; + gboolean trust_dirty_flag; + gboolean use_help; + gboolean nav_window_per_display; + gboolean info_window_follows_mouse; + gint help_browser; + gint cursor_mode; + gboolean disable_tearoff_menus; +}; + +extern GimpRc gimprc; /* function prototypes */ gboolean gimprc_init (void); /* this has to be called before any file diff --git a/app/gui/brush-select.c b/app/gui/brush-select.c index 4b1e095149..27bf15bccc 100644 --- a/app/gui/brush-select.c +++ b/app/gui/brush-select.c @@ -284,7 +284,7 @@ brush_select_new (gchar *title, if (! title) { /* if we are in per-tool paint options mode, hide the paint options */ - brush_select_show_paint_options (bsp, global_paint_options); + brush_select_show_paint_options (bsp, gimprc.global_paint_options); } gtk_widget_show (bsp->shell); diff --git a/app/gui/commands.c b/app/gui/commands.c index fa48e04209..5bea4e7ceb 100644 --- a/app/gui/commands.c +++ b/app/gui/commands.c @@ -586,7 +586,7 @@ view_info_window_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - if (! info_window_follows_mouse) + if (! gimprc.info_window_follows_mouse) { if (! gdisp->window_info_dialog) gdisp->window_info_dialog = info_window_create ((void *) gdisp); @@ -607,7 +607,7 @@ view_nav_window_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - if (nav_window_per_display) + if (gimprc.nav_window_per_display) { if (! gdisp->window_nav_dialog) gdisp->window_nav_dialog = nav_window_create ((void *) gdisp); diff --git a/app/gui/device-status-dialog.c b/app/gui/device-status-dialog.c index 4ac7b4ee8a..bddf2d5774 100644 --- a/app/gui/device-status-dialog.c +++ b/app/gui/device-status-dialog.c @@ -973,7 +973,7 @@ void device_status_free (void) { /* Save device status on exit */ - if (save_device_status) + if (gimprc.save_device_status) devices_write_rc (); if (deviceD) diff --git a/app/gui/file-new-dialog.c b/app/gui/file-new-dialog.c index 2fda7dcbb1..5858a10887 100644 --- a/app/gui/file-new-dialog.c +++ b/app/gui/file-new-dialog.c @@ -91,7 +91,7 @@ file_new_ok_callback (GtkWidget *widget, values->res_unit = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (info->resolution_se)); - if (info->size > max_new_image_size) + if (info->size > gimprc.max_new_image_size) { file_new_confirm_dialog (info); } @@ -116,29 +116,29 @@ file_new_reset_callback (GtkWidget *widget, gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (info->couple_resolutions), - ABS (default_xresolution - default_yresolution) < GIMP_MIN_RESOLUTION); + ABS (gimprc.default_xresolution - gimprc.default_yresolution) < GIMP_MIN_RESOLUTION); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 0, default_xresolution); + 0, gimprc.default_xresolution); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->resolution_se), - 1, default_yresolution); + 1, gimprc.default_yresolution); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->resolution_se), - default_resolution_units); + gimprc.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, default_xresolution, TRUE); + 0, gimprc.default_xresolution, TRUE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (info->size_se), - 1, default_yresolution, TRUE); + 1, gimprc.default_yresolution, TRUE); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 0, default_width); + 0, gimprc.default_width); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (info->size_se), - 1, default_height); + 1, gimprc.default_height); gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (info->size_se), - default_units); + gimprc.default_units); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[default_type]), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->type_w[gimprc.default_type]), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->fill_type_w[BACKGROUND_FILL]), TRUE); @@ -192,7 +192,7 @@ file_new_confirm_dialog (NewImageInfo *info) gtk_widget_set_sensitive (info->dlg, FALSE); size = image_new_get_size_string (info->size); - max_size = image_new_get_size_string (max_new_image_size); + max_size = image_new_get_size_string (gimprc.max_new_image_size); /* xgettext:no-c-format */ @@ -551,7 +551,7 @@ ui_new_image_window_create (const GimpImageNewValues *values_orig) gtk_widget_set_usize (spinbutton, 75, 0); info->resolution_se = - gimp_size_entry_new (1, default_resolution_units, _("pixels/%a"), + gimp_size_entry_new (1, gimprc.default_resolution_units, _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); gtk_table_set_col_spacing (GTK_TABLE (info->resolution_se), 1, 2); diff --git a/app/gui/file-open-dialog.c b/app/gui/file-open-dialog.c index ea8b2f0589..7fb4d0cfeb 100644 --- a/app/gui/file-open-dialog.c +++ b/app/gui/file-open-dialog.c @@ -598,7 +598,7 @@ set_preview (const gchar *fullfname, } else { - switch (thumbnail_mode) + switch (gimprc.thumbnail_mode) { case 0: gtk_label_set_text (GTK_LABEL(open_options_label), @@ -723,7 +723,7 @@ file_open_genbutton_callback (GtkWidget *widget, RGBbuf = make_RGBbuf_from_tempbuf (tempbuf, &RGBbuf_w, &RGBbuf_h); - if (thumbnail_mode) + if (gimprc.thumbnail_mode) { file_save_thumbnail (gimage_to_be_thumbed, full_filename, tempbuf); diff --git a/app/gui/file-save-dialog.c b/app/gui/file-save-dialog.c index bd548db069..189f433cd1 100644 --- a/app/gui/file-save-dialog.c +++ b/app/gui/file-save-dialog.c @@ -135,7 +135,7 @@ file_save_callback (GtkWidget *widget, return; /* Only save if the gimage has been modified */ - if (!trust_dirty_flag || gdisplay->gimage->dirty != 0) + if (!gimprc.trust_dirty_flag || gdisplay->gimage->dirty != 0) { gchar *filename; diff --git a/app/gui/gui.c b/app/gui/gui.c index 9d3baf8998..07a6dbd2d2 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -76,7 +76,7 @@ gui_init (void) menus_reorder_plugins (); gximage_init (); - render_setup (transparency_type, transparency_size); + render_setup (gimprc.transparency_type, gimprc.transparency_size); dialogs_init (); @@ -86,7 +86,7 @@ gui_init (void) /* tooltips */ gimp_help_init (); - if (! show_tool_tips) + if (! gimprc.show_tool_tips) gimp_help_disable_tooltips (); gimp_dialog_factory_dialog_new (global_dialog_factory, "gimp:toolbox"); @@ -96,13 +96,13 @@ gui_init (void) */ { FILE *fp; - gchar **filenames = g_new0 (gchar *, last_opened_size); + gchar **filenames = g_new0 (gchar *, gimprc.last_opened_size); gint i; if ((fp = document_index_parse_init ())) { /* read the filenames... */ - for (i = 0; i < last_opened_size; i++) + for (i = 0; i < gimprc.last_opened_size; i++) if ((filenames[i] = document_index_parse_line (fp)) == NULL) break; @@ -132,7 +132,7 @@ gui_restore (void) void gui_post_init (void) { - if (show_tips) + if (gimprc.show_tips) { gimp_dialog_factory_dialog_new (global_dialog_factory, "gimp:tips-dialog"); } diff --git a/app/gui/help-commands.c b/app/gui/help-commands.c index fa48e04209..5bea4e7ceb 100644 --- a/app/gui/help-commands.c +++ b/app/gui/help-commands.c @@ -586,7 +586,7 @@ view_info_window_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - if (! info_window_follows_mouse) + if (! gimprc.info_window_follows_mouse) { if (! gdisp->window_info_dialog) gdisp->window_info_dialog = info_window_create ((void *) gdisp); @@ -607,7 +607,7 @@ view_nav_window_cmd_callback (GtkWidget *widget, GDisplay *gdisp; return_if_no_display (gdisp); - if (nav_window_per_display) + if (gimprc.nav_window_per_display) { if (! gdisp->window_nav_dialog) gdisp->window_nav_dialog = nav_window_create ((void *) gdisp); diff --git a/app/gui/input-dialog.c b/app/gui/input-dialog.c index 4ac7b4ee8a..bddf2d5774 100644 --- a/app/gui/input-dialog.c +++ b/app/gui/input-dialog.c @@ -973,7 +973,7 @@ void device_status_free (void) { /* Save device status on exit */ - if (save_device_status) + if (gimprc.save_device_status) devices_write_rc (); if (deviceD) diff --git a/app/gui/layer-select.c b/app/gui/layer-select.c index 561a0f4296..a382824aa7 100644 --- a/app/gui/layer-select.c +++ b/app/gui/layer-select.c @@ -98,7 +98,8 @@ layer_select_init (GimpImage *gimage, layer_select = g_new0 (LayerSelect, 1); layer_select->preview = gimp_preview_new (GIMP_VIEWABLE (layer), - preview_size, 1, FALSE); + gimprc.preview_size, 1, + FALSE); layer_select->label = gtk_label_new (NULL); layer_select_set_gimage (layer_select, gimage); @@ -167,7 +168,7 @@ layer_select_update_preview_size (void) if (layer_select != NULL) { gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview), - preview_size, 1); + gimprc.preview_size, 1); } } @@ -265,7 +266,7 @@ layer_select_set_gimage (LayerSelect *layer_select, gimp_preview_set_viewable (GIMP_PREVIEW (layer_select->preview), GIMP_VIEWABLE (layer_select->current_layer)); gimp_preview_set_size (GIMP_PREVIEW (layer_select->preview), - preview_size, 1); + gimprc.preview_size, 1); gtk_label_set_text (GTK_LABEL (layer_select->label), GIMP_OBJECT (layer_select->current_layer)->name); } diff --git a/app/gui/menus.c b/app/gui/menus.c index a9220e742d..05e5e29914 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -1552,7 +1552,7 @@ menus_last_opened_add (gchar *filename) num_entries = g_slist_length (last_opened_raw_filenames); - if (num_entries == last_opened_size) + if (num_entries == gimprc.last_opened_size) { list = g_slist_last (last_opened_raw_filenames); if (list) @@ -1586,12 +1586,12 @@ menus_init_mru (void) gchar *accelerators; gint i; - last_opened_entries = g_new (GimpItemFactoryEntry, last_opened_size); + last_opened_entries = g_new (GimpItemFactoryEntry, gimprc.last_opened_size); - paths = g_new (gchar, last_opened_size * MRU_MENU_ENTRY_SIZE); + paths = g_new (gchar, gimprc.last_opened_size * MRU_MENU_ENTRY_SIZE); accelerators = g_new (gchar, 9 * MRU_MENU_ACCEL_SIZE); - for (i = 0; i < last_opened_size; i++) + for (i = 0; i < gimprc.last_opened_size; i++) { gchar *path, *accelerator; @@ -1615,10 +1615,10 @@ menus_init_mru (void) g_snprintf (accelerator, MRU_MENU_ACCEL_SIZE, "%d", i + 1); } - menus_create_items (toolbox_factory, last_opened_size, + menus_create_items (toolbox_factory, gimprc.last_opened_size, last_opened_entries, NULL, 2, TRUE); - for (i=0; i < last_opened_size; i++) + for (i=0; i < gimprc.last_opened_size; i++) { menu_item = gtk_item_factory_get_widget (toolbox_factory, @@ -1763,12 +1763,12 @@ menus_create_item (GtkItemFactory *item_factory, if (! (strstr (entry->entry.path, "tearoff1"))) { - if (! disable_tearoff_menus && create_tearoff) + if (! gimprc.disable_tearoff_menus && create_tearoff) { menus_create_branches (item_factory, entry); } } - else if (disable_tearoff_menus || ! create_tearoff) + else if (gimprc.disable_tearoff_menus || ! create_tearoff) { return; } diff --git a/app/gui/module-browser.c b/app/gui/module-browser.c index 0e87298d4d..7d707d1665 100644 --- a/app/gui/module-browser.c +++ b/app/gui/module-browser.c @@ -217,7 +217,7 @@ module_db_init (void) modules = gimp_list_new (MODULE_INFO_TYPE, GIMP_CONTAINER_POLICY_WEAK); if (g_module_supported ()) - gimp_datafiles_read_directories (module_path, 0 /* no flags */, + gimp_datafiles_read_directories (gimprc.module_path, 0 /* no flags */, module_initialize, NULL); #ifdef DUMP_DB gimp_container_foreach (modules, print_module_info, NULL); @@ -614,7 +614,8 @@ module_initialize (const gchar *filename, */ mod->refs = 0; - mod->load_inhibit = module_inhibited (mod->fullpath, module_db_load_inhibit); + mod->load_inhibit = module_inhibited (mod->fullpath, + gimprc.module_db_load_inhibit); if (!mod->load_inhibit) { if (be_verbose) @@ -1136,7 +1137,7 @@ browser_refresh_callback (GtkWidget *widget, kill_list = NULL; /* walk filesystem and add new things we find */ - gimp_datafiles_read_directories (module_path, 0 /* no flags */, + gimp_datafiles_read_directories (gimprc.module_path, 0 /* no flags */, module_initialize, NULL); } diff --git a/app/gui/paths-dialog.c b/app/gui/paths-dialog.c index 59750314ff..f1077589dc 100644 --- a/app/gui/paths-dialog.c +++ b/app/gui/paths-dialog.c @@ -377,7 +377,7 @@ paths_dialog_realized (GtkWidget *widget) gchar dash_list[2]= {3,3}; /* Help out small displays */ - if (preview_size < 64) + if (gimprc.preview_size < 64) dash_list[1] = 1; paths_dialog->gc = gdk_gc_new (widget->window); @@ -559,7 +559,7 @@ paths_add_path (Path *bzp, paths_dialog_preview_extents (); - if (preview_size) + if (gimprc.preview_size) { /* Need to add this to the list */ pwidget->paths_pixmap = gdk_pixmap_new (paths_dialog->vbox->window, @@ -660,11 +660,11 @@ paths_dialog_preview_extents (void) /* Get the image width and height variables, based on the gimage */ if (gimage->width > gimage->height) - paths_dialog->ratio = (double) preview_size / (double) gimage->width; + paths_dialog->ratio = (double) gimprc.preview_size / (double) gimage->width; else - paths_dialog->ratio = (double) preview_size / (double) gimage->height; + paths_dialog->ratio = (double) gimprc.preview_size / (double) gimage->height; - if (preview_size) + if (gimprc.preview_size) { paths_dialog->image_width = (int) (paths_dialog->ratio * gimage->width); paths_dialog->image_height = (int) (paths_dialog->ratio * gimage->height); @@ -1651,7 +1651,7 @@ paths_update_preview (GimpBezierSelectTool *bezier_sel) if(paths_dialog && paths_dialog->current_path_list && (row = paths_dialog->current_path_list->last_selected_row) >= 0 && - preview_size) + gimprc.preview_size) { PathWidget *pwidget; diff --git a/app/gui/plug-in-commands.c b/app/gui/plug-in-commands.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/gui/plug-in-commands.c +++ b/app/gui/plug-in-commands.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/gui/plug-in-menus.c b/app/gui/plug-in-menus.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/gui/plug-in-menus.c +++ b/app/gui/plug-in-menus.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index 70a3293ec1..cab21f6756 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -267,64 +267,64 @@ static PrefsState prefs_check_settings (void) { /* First, check for invalid values... */ - if (levels_of_undo < 0) + if (gimprc.levels_of_undo < 0) { g_message (_("Error: Levels of undo must be zero or greater.")); - levels_of_undo = old_levels_of_undo; + gimprc.levels_of_undo = old_levels_of_undo; return PREFS_CORRUPT; } - if (marching_speed < 50) + if (gimprc.marching_speed < 50) { g_message (_("Error: Marching speed must be 50 or greater.")); - marching_speed = old_marching_speed; + gimprc.marching_speed = old_marching_speed; return PREFS_CORRUPT; } - if (default_width < 1) + if (gimprc.default_width < 1) { g_message (_("Error: Default width must be one or greater.")); - default_width = old_default_width; + gimprc.default_width = old_default_width; return PREFS_CORRUPT; } - if (default_height < 1) + if (gimprc.default_height < 1) { g_message (_("Error: Default height must be one or greater.")); - default_height = old_default_height; + gimprc.default_height = old_default_height; return PREFS_CORRUPT; } - if (default_units < GIMP_UNIT_INCH || - default_units >= gimp_unit_get_number_of_units ()) + if (gimprc.default_units < GIMP_UNIT_INCH || + gimprc.default_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default unit must be within unit range.")); - default_units = old_default_units; + gimprc.default_units = old_default_units; return PREFS_CORRUPT; } - if (default_xresolution < GIMP_MIN_RESOLUTION || - default_yresolution < GIMP_MIN_RESOLUTION) + if (gimprc.default_xresolution < GIMP_MIN_RESOLUTION || + gimprc.default_yresolution < GIMP_MIN_RESOLUTION) { g_message (_("Error: Default resolution must not be zero.")); - default_xresolution = old_default_xresolution; - default_yresolution = old_default_yresolution; + gimprc.default_xresolution = old_default_xresolution; + gimprc.default_yresolution = old_default_yresolution; return PREFS_CORRUPT; } - if (default_resolution_units < GIMP_UNIT_INCH || - default_resolution_units >= gimp_unit_get_number_of_units ()) + if (gimprc.default_resolution_units < GIMP_UNIT_INCH || + gimprc.default_resolution_units >= gimp_unit_get_number_of_units ()) { g_message (_("Error: Default resolution unit must be within unit range.")); - default_resolution_units = old_default_resolution_units; + gimprc.default_resolution_units = old_default_resolution_units; return PREFS_CORRUPT; } - if (monitor_xres < GIMP_MIN_RESOLUTION || - monitor_yres < GIMP_MIN_RESOLUTION) + if (gimprc.monitor_xres < GIMP_MIN_RESOLUTION || + gimprc.monitor_yres < GIMP_MIN_RESOLUTION) { g_message (_("Error: Monitor resolution must not be zero.")); - monitor_xres = old_monitor_xres; - monitor_yres = old_monitor_yres; + gimprc.monitor_xres = old_monitor_xres; + gimprc.monitor_yres = old_monitor_yres; return PREFS_CORRUPT; } - if (image_title_format == NULL) + if (gimprc.image_title_format == NULL) { g_message (_("Error: Image title format must not be NULL.")); - image_title_format = old_image_title_format; + gimprc.image_title_format = old_image_title_format; return PREFS_CORRUPT; } @@ -435,7 +435,7 @@ prefs_ok_callback (GtkWidget *widget, break; case PREFS_OK: - if (show_tool_tips) + if (gimprc.show_tool_tips) gimp_help_enable_tooltips (); else gimp_help_disable_tooltips (); @@ -498,7 +498,7 @@ prefs_save_callback (GtkWidget *widget, /* don't break */ case PREFS_OK: - if (show_tool_tips) + if (gimprc.show_tool_tips) gimp_help_enable_tooltips (); else gimp_help_disable_tooltips (); @@ -516,57 +516,57 @@ prefs_save_callback (GtkWidget *widget, /* Save variables so that we can restore them later */ save_stingy_memory_use = base_config->stingy_memory_use; - save_min_colors = min_colors; - save_install_cmap = install_cmap; - save_cycled_marching_ants = cycled_marching_ants; - save_last_opened_size = last_opened_size; - save_show_indicators = show_indicators; - save_nav_window_per_display = nav_window_per_display; - save_info_window_follows_mouse = info_window_follows_mouse; + save_min_colors = gimprc.min_colors; + save_install_cmap = gimprc.install_cmap; + save_cycled_marching_ants = gimprc.cycled_marching_ants; + save_last_opened_size = gimprc.last_opened_size; + save_show_indicators = gimprc.show_indicators; + save_nav_window_per_display = gimprc.nav_window_per_display; + save_info_window_follows_mouse = gimprc.info_window_follows_mouse; save_temp_path = base_config->temp_path; save_swap_path = base_config->swap_path; - save_brush_path = brush_path; - save_pattern_path = pattern_path; - save_palette_path = palette_path; - save_gradient_path = gradient_path; - save_plug_in_path = plug_in_path; - save_module_path = module_path; + save_brush_path = gimprc.brush_path; + save_pattern_path = gimprc.pattern_path; + save_palette_path = gimprc.palette_path; + save_gradient_path = gimprc.gradient_path; + save_plug_in_path = gimprc.plug_in_path; + save_module_path = gimprc.module_path; - if (levels_of_undo != old_levels_of_undo) + if (gimprc.levels_of_undo != old_levels_of_undo) { update = g_list_append (update, "undo-levels"); } - if (marching_speed != old_marching_speed) + if (gimprc.marching_speed != old_marching_speed) { update = g_list_append (update, "marching-ants-speed"); } - if (allow_resize_windows != old_allow_resize_windows) + if (gimprc.allow_resize_windows != old_allow_resize_windows) { update = g_list_append (update, "allow-resize-windows"); remove = g_list_append (remove, "dont-allow-resize-windows"); } - if (auto_save != old_auto_save) + if (gimprc.auto_save != old_auto_save) { update = g_list_append (update, "auto-save"); remove = g_list_append (remove, "dont-auto-save"); } - if (no_cursor_updating != old_no_cursor_updating) + if (gimprc.no_cursor_updating != old_no_cursor_updating) { update = g_list_append (update, "cursor-updating"); remove = g_list_append (remove, "no-cursor-updating"); } - if (show_tool_tips != old_show_tool_tips) + if (gimprc.show_tool_tips != old_show_tool_tips) { update = g_list_append (update, "show-tool-tips"); remove = g_list_append (remove, "dont-show-tool-tips"); } - if (show_rulers != old_show_rulers) + if (gimprc.show_rulers != old_show_rulers) { update = g_list_append (update, "show-rulers"); remove = g_list_append (remove, "dont-show-rulers"); } - if (show_statusbar != old_show_statusbar) + if (gimprc.show_statusbar != old_show_statusbar) { update = g_list_append (update, "show-statusbar"); remove = g_list_append (remove, "dont-show-statusbar"); @@ -575,132 +575,132 @@ prefs_save_callback (GtkWidget *widget, { update = g_list_append (update, "interpolation-type"); } - if (confirm_on_close != old_confirm_on_close) + if (gimprc.confirm_on_close != old_confirm_on_close) { update = g_list_append (update, "confirm-on-close"); remove = g_list_append (remove, "dont-confirm-on-close"); } - if (save_session_info != old_save_session_info) + if (gimprc.save_session_info != old_save_session_info) { update = g_list_append (update, "save-session-info"); remove = g_list_append (remove, "dont-save-session-info"); } - if (save_device_status!= old_save_device_status) + if (gimprc.save_device_status!= old_save_device_status) { update = g_list_append (update, "save-device-status"); remove = g_list_append (remove, "dont-save-device-status"); } - if (always_restore_session != old_always_restore_session) + if (gimprc.always_restore_session != old_always_restore_session) { update = g_list_append (update, "always-restore-session"); } - if (default_width != old_default_width || - default_height != old_default_height) + if (gimprc.default_width != old_default_width || + gimprc.default_height != old_default_height) { update = g_list_append (update, "default-image-size"); } - if (default_units != old_default_units) + if (gimprc.default_units != old_default_units) { update = g_list_append (update, "default-units"); } - if (ABS (default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) + if (ABS (gimprc.default_xresolution - old_default_xresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-xresolution"); } - if (ABS (default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) + if (ABS (gimprc.default_yresolution - old_default_yresolution) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "default-yresolution"); } - if (default_resolution_units != old_default_resolution_units) + if (gimprc.default_resolution_units != old_default_resolution_units) { update = g_list_append (update, "default-resolution-units"); } - if (default_type != old_default_type) + if (gimprc.default_type != old_default_type) { update = g_list_append (update, "default-image-type"); } - if (prefs_strcmp (default_comment, old_default_comment)) + if (prefs_strcmp (gimprc.default_comment, old_default_comment)) { update = g_list_append (update, "default-comment"); } - if (default_dot_for_dot != old_default_dot_for_dot) + if (gimprc.default_dot_for_dot != old_default_dot_for_dot) { update = g_list_append (update, "default-dot-for-dot"); remove = g_list_append (remove, "dont-default-dot-for-dot"); } - if (preview_size != old_preview_size) + if (gimprc.preview_size != old_preview_size) { update = g_list_append (update, "preview-size"); } - if (nav_preview_size != old_nav_preview_size) + if (gimprc.nav_preview_size != old_nav_preview_size) { update = g_list_append (update, "nav-preview-size"); } - if (perfectmouse != old_perfectmouse) + if (gimprc.perfectmouse != old_perfectmouse) { update = g_list_append (update, "perfect-mouse"); } - if (transparency_type != old_transparency_type) + if (gimprc.transparency_type != old_transparency_type) { update = g_list_append (update, "transparency-type"); } - if (transparency_size != old_transparency_size) + if (gimprc.transparency_size != old_transparency_size) { update = g_list_append (update, "transparency-size"); } - if (using_xserver_resolution != old_using_xserver_resolution || - ABS(monitor_xres - old_monitor_xres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != old_using_xserver_resolution || + ABS(gimprc.monitor_xres - old_monitor_xres) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "monitor-xresolution"); } - if (using_xserver_resolution != old_using_xserver_resolution || - ABS(monitor_yres - old_monitor_yres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != old_using_xserver_resolution || + ABS(gimprc.monitor_yres - old_monitor_yres) > GIMP_MIN_RESOLUTION) { update = g_list_append (update, "monitor-yresolution"); } - if (using_xserver_resolution) + if (gimprc.using_xserver_resolution) { /* special value of 0 for either x or y res in the gimprc file * means use the xserver's current resolution */ - monitor_xres = 0.0; - monitor_yres = 0.0; + gimprc.monitor_xres = 0.0; + gimprc.monitor_yres = 0.0; } - if (prefs_strcmp (image_title_format, old_image_title_format)) + if (prefs_strcmp (gimprc.image_title_format, old_image_title_format)) { update = g_list_append (update, "image-title-format"); } - if (global_paint_options != old_global_paint_options) + if (gimprc.global_paint_options != old_global_paint_options) { update = g_list_append (update, "global-paint-options"); remove = g_list_append (remove, "no-global-paint-options"); } - if (max_new_image_size != old_max_new_image_size) + if (gimprc.max_new_image_size != old_max_new_image_size) { update = g_list_append (update, "max-new-image-size"); } - if (thumbnail_mode != old_thumbnail_mode) + if (gimprc.thumbnail_mode != old_thumbnail_mode) { update = g_list_append (update, "thumbnail-mode"); } - if (trust_dirty_flag != old_trust_dirty_flag) + if (gimprc.trust_dirty_flag != old_trust_dirty_flag) { update = g_list_append (update, "trust-dirty-flag"); remove = g_list_append (remove, "dont-trust-dirty-flag"); } - if (use_help != old_use_help) + if (gimprc.use_help != old_use_help) { update = g_list_append (update, "use-help"); remove = g_list_append (remove, "dont-use-help"); } - if (help_browser != old_help_browser) + if (gimprc.help_browser != old_help_browser) { update = g_list_append (update, "help-browser"); } - if (cursor_mode != old_cursor_mode) + if (gimprc.cursor_mode != old_cursor_mode) { update = g_list_append (update, "cursor-mode"); } - if (default_threshold != old_default_threshold) + if (gimprc.default_threshold != old_default_threshold) { update = g_list_append (update, "default-threshold"); } @@ -717,45 +717,45 @@ prefs_save_callback (GtkWidget *widget, } if (edit_min_colors != old_min_colors) { - min_colors = edit_min_colors; + gimprc.min_colors = edit_min_colors; update = g_list_append (update, "min-colors"); } if (edit_install_cmap != old_install_cmap) { - install_cmap = edit_install_cmap; + gimprc.install_cmap = edit_install_cmap; update = g_list_append (update, "install-colormap"); } if (edit_cycled_marching_ants != old_cycled_marching_ants) { - cycled_marching_ants = edit_cycled_marching_ants; + gimprc.cycled_marching_ants = edit_cycled_marching_ants; update = g_list_append (update, "colormap-cycling"); } if (edit_last_opened_size != old_last_opened_size) { - last_opened_size = edit_last_opened_size; + gimprc.last_opened_size = edit_last_opened_size; update = g_list_append (update, "last-opened-size"); } if (edit_show_indicators != old_show_indicators) { - show_indicators = edit_show_indicators; + gimprc.show_indicators = edit_show_indicators; update = g_list_append (update, "show-indicators"); remove = g_list_append (remove, "dont-show-indicators"); } if (edit_nav_window_per_display != old_nav_window_per_display) { - nav_window_per_display = edit_nav_window_per_display; + gimprc.nav_window_per_display = edit_nav_window_per_display; update = g_list_append (update, "nav-window-per-display"); remove = g_list_append (remove, "nav-window-follows-auto"); } if (edit_info_window_follows_mouse != old_info_window_follows_mouse) { - info_window_follows_mouse = edit_info_window_follows_mouse; + gimprc.info_window_follows_mouse = edit_info_window_follows_mouse; update = g_list_append (update, "info-window-follows-mouse"); remove = g_list_append (remove, "info-window-per-display"); } if (edit_disable_tearoff_menus != old_disable_tearoff_menus) { - disable_tearoff_menus = edit_disable_tearoff_menus; + gimprc.disable_tearoff_menus = edit_disable_tearoff_menus; update = g_list_append (update, "disable-tearoff-menus"); } @@ -771,32 +771,32 @@ prefs_save_callback (GtkWidget *widget, } if (prefs_strcmp (old_brush_path, edit_brush_path)) { - brush_path = edit_brush_path; + gimprc.brush_path = edit_brush_path; update = g_list_append (update, "brush-path"); } if (prefs_strcmp (old_pattern_path, edit_pattern_path)) { - pattern_path = edit_pattern_path; + gimprc.pattern_path = edit_pattern_path; update = g_list_append (update, "pattern-path"); } if (prefs_strcmp (old_palette_path, edit_palette_path)) { - palette_path = edit_palette_path; + gimprc.palette_path = edit_palette_path; update = g_list_append (update, "palette-path"); } if (prefs_strcmp (old_gradient_path, edit_gradient_path)) { - gradient_path = edit_gradient_path; + gimprc.gradient_path = edit_gradient_path; update = g_list_append (update, "gradient-path"); } if (prefs_strcmp (old_plug_in_path, edit_plug_in_path)) { - plug_in_path = edit_plug_in_path; + gimprc.plug_in_path = edit_plug_in_path; update = g_list_append (update, "plug-in-path"); } if (prefs_strcmp (old_module_path, edit_module_path)) { - module_path = edit_module_path; + gimprc.module_path = edit_module_path; update = g_list_append (update, "module-path"); } @@ -811,27 +811,28 @@ prefs_save_callback (GtkWidget *widget, save_gimprc (&update, &remove); - if (using_xserver_resolution) - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); + if (gimprc.using_xserver_resolution) + gdisplay_xserver_resolution (&(gimprc.monitor_xres), + &(gimprc.monitor_yres)); /* restore variables which must not change */ base_config->stingy_memory_use = save_stingy_memory_use; - min_colors = save_min_colors; - install_cmap = save_install_cmap; - cycled_marching_ants = save_cycled_marching_ants; - last_opened_size = save_last_opened_size; - show_indicators = save_show_indicators; - nav_window_per_display = save_nav_window_per_display; - info_window_follows_mouse = save_info_window_follows_mouse; + gimprc.min_colors = save_min_colors; + gimprc.install_cmap = save_install_cmap; + gimprc.cycled_marching_ants = save_cycled_marching_ants; + gimprc.last_opened_size = save_last_opened_size; + gimprc.show_indicators = save_show_indicators; + gimprc.nav_window_per_display = save_nav_window_per_display; + gimprc.info_window_follows_mouse = save_info_window_follows_mouse; base_config->temp_path = save_temp_path; base_config->swap_path = save_swap_path; - brush_path = save_brush_path; - pattern_path = save_pattern_path; - palette_path = save_palette_path; - gradient_path = save_gradient_path; - plug_in_path = save_plug_in_path; - module_path = save_module_path; + gimprc.brush_path = save_brush_path; + gimprc.pattern_path = save_pattern_path; + gimprc.palette_path = save_palette_path; + gimprc.gradient_path = save_gradient_path; + gimprc.plug_in_path = save_plug_in_path; + gimprc.module_path = save_module_path; /* no need to restore values which are only changed on "OK" and "Save" */ @@ -850,55 +851,55 @@ prefs_cancel_callback (GtkWidget *widget, base_config->interpolation_type = old_interpolation_type; base_config->num_processors = old_num_processors; - levels_of_undo = old_levels_of_undo; - marching_speed = old_marching_speed; - allow_resize_windows = old_allow_resize_windows; - auto_save = old_auto_save; - no_cursor_updating = old_no_cursor_updating; - perfectmouse = old_perfectmouse; - show_tool_tips = old_show_tool_tips; - show_rulers = old_show_rulers; - show_statusbar = old_show_statusbar; - confirm_on_close = old_confirm_on_close; - save_session_info = old_save_session_info; - save_device_status = old_save_device_status; - default_width = old_default_width; - default_height = old_default_height; - default_units = old_default_units; - default_xresolution = old_default_xresolution; - default_yresolution = old_default_yresolution; - default_resolution_units = old_default_resolution_units; - default_type = old_default_type; - default_dot_for_dot = old_default_dot_for_dot; - monitor_xres = old_monitor_xres; - monitor_yres = old_monitor_yres; - using_xserver_resolution = old_using_xserver_resolution; - max_new_image_size = old_max_new_image_size; - thumbnail_mode = old_thumbnail_mode; - trust_dirty_flag = old_trust_dirty_flag; - use_help = old_use_help; - help_browser = old_help_browser; - cursor_mode = old_cursor_mode; - default_threshold = old_default_threshold; + gimprc.levels_of_undo = old_levels_of_undo; + gimprc.marching_speed = old_marching_speed; + gimprc.allow_resize_windows = old_allow_resize_windows; + gimprc.auto_save = old_auto_save; + gimprc.no_cursor_updating = old_no_cursor_updating; + gimprc.perfectmouse = old_perfectmouse; + gimprc.show_tool_tips = old_show_tool_tips; + gimprc.show_rulers = old_show_rulers; + gimprc.show_statusbar = old_show_statusbar; + gimprc.confirm_on_close = old_confirm_on_close; + gimprc.save_session_info = old_save_session_info; + gimprc.save_device_status = old_save_device_status; + gimprc.default_width = old_default_width; + gimprc.default_height = old_default_height; + gimprc.default_units = old_default_units; + gimprc.default_xresolution = old_default_xresolution; + gimprc.default_yresolution = old_default_yresolution; + gimprc.default_resolution_units = old_default_resolution_units; + gimprc.default_type = old_default_type; + gimprc.default_dot_for_dot = old_default_dot_for_dot; + gimprc.monitor_xres = old_monitor_xres; + gimprc.monitor_yres = old_monitor_yres; + gimprc.using_xserver_resolution = old_using_xserver_resolution; + gimprc.max_new_image_size = old_max_new_image_size; + gimprc.thumbnail_mode = old_thumbnail_mode; + gimprc.trust_dirty_flag = old_trust_dirty_flag; + gimprc.use_help = old_use_help; + gimprc.help_browser = old_help_browser; + gimprc.cursor_mode = old_cursor_mode; + gimprc.default_threshold = old_default_threshold; /* restore variables which need some magic */ - if (preview_size != old_preview_size) + if (gimprc.preview_size != old_preview_size) { /* lc_dialog_rebuild (old_preview_size); FIXME: update preview size */ layer_select_update_preview_size (); } - if (nav_preview_size != old_nav_preview_size) + if (gimprc.nav_preview_size != old_nav_preview_size) { - nav_preview_size = old_nav_preview_size; + gimprc.nav_preview_size = old_nav_preview_size; gdisplays_nav_preview_resized (); } - if ((transparency_type != old_transparency_type) || - (transparency_size != old_transparency_size)) + if ((gimprc.transparency_type != old_transparency_type) || + (gimprc.transparency_size != old_transparency_size)) { - transparency_type = old_transparency_type; - transparency_size = old_transparency_size; + gimprc.transparency_type = old_transparency_type; + gimprc.transparency_size = old_transparency_size; - render_setup (transparency_type, transparency_size); + render_setup (gimprc.transparency_type, gimprc.transparency_size); gimp_container_foreach (image_context, (GFunc) gimp_image_invalidate_layer_previews, NULL); @@ -909,8 +910,8 @@ prefs_cancel_callback (GtkWidget *widget, gdisplays_flush (); } - prefs_strset (&image_title_format, old_image_title_format); - prefs_strset (&default_comment, old_default_comment); + prefs_strset (&(gimprc.image_title_format), old_image_title_format); + prefs_strset (&(gimprc.default_comment), old_default_comment); context_manager_set_global_paint_options (old_global_paint_options); @@ -946,19 +947,19 @@ prefs_toggle_callback (GtkWidget *widget, val = (gint *) data; /* toggle buttos */ - if (data == &allow_resize_windows || - data == &auto_save || - data == &no_cursor_updating || - data == &perfectmouse || - data == &show_tool_tips || - data == &show_rulers || - data == &show_statusbar || - data == &confirm_on_close || - data == &save_session_info || - data == &save_device_status || - data == &always_restore_session || - data == &default_dot_for_dot || - data == &use_help || + if (data == &(gimprc.allow_resize_windows) || + data == &(gimprc.auto_save) || + data == &(gimprc.no_cursor_updating) || + data == &(gimprc.perfectmouse) || + data == &(gimprc.show_tool_tips) || + data == &(gimprc.show_rulers) || + data == &(gimprc.show_statusbar) || + data == &(gimprc.confirm_on_close) || + data == &(gimprc.save_session_info) || + data == &(gimprc.save_device_status) || + data == &(gimprc.always_restore_session) || + data == &(gimprc.default_dot_for_dot) || + data == &(gimprc.use_help) || data == &edit_stingy_memory_use || data == &edit_install_cmap || @@ -972,23 +973,23 @@ prefs_toggle_callback (GtkWidget *widget, } /* radio buttons */ - else if (data == &thumbnail_mode || + else if (data == &(gimprc.thumbnail_mode) || data == &base_config->interpolation_type || - data == &trust_dirty_flag || - data == &help_browser || - data == &cursor_mode || - data == &default_type) + data == &(gimprc.trust_dirty_flag) || + data == &(gimprc.help_browser) || + data == &(gimprc.cursor_mode) || + data == &(gimprc.default_type)) { *val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget)); } /* values which need some magic */ - else if ((data == &transparency_type) || - (data == &transparency_size)) + else if ((data == &(gimprc.transparency_type)) || + (data == &(gimprc.transparency_size))) { *val = (gint) gtk_object_get_user_data (GTK_OBJECT (widget)); - render_setup (transparency_type, transparency_size); + render_setup (gimprc.transparency_type, gimprc.transparency_size); gimp_container_foreach (image_context, (GFunc) gimp_image_invalidate_layer_previews, NULL); @@ -998,7 +999,7 @@ prefs_toggle_callback (GtkWidget *widget, gdisplays_expose_full (); gdisplays_flush (); } - else if (data == &global_paint_options) + else if (data == &(gimprc.global_paint_options)) { context_manager_set_global_paint_options (GTK_TOGGLE_BUTTON (widget)->active); @@ -1029,7 +1030,7 @@ static void prefs_nav_preview_size_callback (GtkWidget *widget, gpointer data) { - nav_preview_size = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));; + gimprc.nav_preview_size = (gint) gtk_object_get_user_data (GTK_OBJECT (widget));; gdisplays_nav_preview_resized (); } @@ -1105,11 +1106,11 @@ static void prefs_default_size_callback (GtkWidget *widget, gpointer data) { - default_width = + gimprc.default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0)); - default_height = + gimprc.default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1)); - default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); + gimprc.default_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } static void @@ -1154,15 +1155,15 @@ prefs_default_resolution_callback (GtkWidget *widget, gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 1, yres, FALSE); - default_width = + gimprc.default_width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 0)); - default_height = + gimprc.default_height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (size_sizeentry), 1)); - default_xresolution = xres; - default_yresolution = yres; + gimprc.default_xresolution = xres; + gimprc.default_yresolution = yres; - default_resolution_units = + gimprc.default_resolution_units = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (widget)); } @@ -1176,22 +1177,23 @@ prefs_res_source_callback (GtkWidget *widget, if (GTK_TOGGLE_BUTTON (widget)->active) { - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); - using_xserver_resolution = TRUE; + gdisplay_xserver_resolution (&(gimprc.monitor_xres), + &(gimprc.monitor_yres)); + gimprc.using_xserver_resolution = TRUE; } else { monitor_resolution_sizeentry = gtk_object_get_data (GTK_OBJECT (widget), "monitor_resolution_sizeentry"); - + if (monitor_resolution_sizeentry) { - monitor_xres = gimp_size_entry_get_refval + gimprc.monitor_xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 0); - monitor_yres = gimp_size_entry_get_refval + gimprc.monitor_yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (monitor_resolution_sizeentry), 1); } - using_xserver_resolution = FALSE; + gimprc.using_xserver_resolution = FALSE; } } @@ -1229,8 +1231,8 @@ prefs_monitor_resolution_callback (GtkWidget *widget, yres = new_yres; } - monitor_xres = xres; - monitor_yres = yres; + gimprc.monitor_xres = xres; + gimprc.monitor_yres = yres; } static void @@ -1393,23 +1395,23 @@ preferences_dialog_create (void) * copy config vals to edit variables. */ edit_stingy_memory_use = base_config->stingy_memory_use; - edit_min_colors = min_colors; - edit_install_cmap = install_cmap; - edit_cycled_marching_ants = cycled_marching_ants; - edit_last_opened_size = last_opened_size; - edit_show_indicators = show_indicators; - edit_nav_window_per_display = nav_window_per_display; - edit_info_window_follows_mouse = info_window_follows_mouse; - edit_disable_tearoff_menus = disable_tearoff_menus; + edit_min_colors = gimprc.min_colors; + edit_install_cmap = gimprc.install_cmap; + edit_cycled_marching_ants = gimprc.cycled_marching_ants; + edit_last_opened_size = gimprc.last_opened_size; + edit_show_indicators = gimprc.show_indicators; + edit_nav_window_per_display = gimprc.nav_window_per_display; + edit_info_window_follows_mouse = gimprc.info_window_follows_mouse; + edit_disable_tearoff_menus = gimprc.disable_tearoff_menus; edit_temp_path = prefs_strdup (base_config->temp_path); edit_swap_path = prefs_strdup (base_config->swap_path); - edit_plug_in_path = prefs_strdup (plug_in_path); - edit_module_path = prefs_strdup (module_path); - edit_brush_path = prefs_strdup (brush_path); - edit_pattern_path = prefs_strdup (pattern_path); - edit_palette_path = prefs_strdup (palette_path); - edit_gradient_path = prefs_strdup (gradient_path); + edit_plug_in_path = prefs_strdup (gimprc.plug_in_path); + edit_module_path = prefs_strdup (gimprc.module_path); + edit_brush_path = prefs_strdup (gimprc.brush_path); + edit_pattern_path = prefs_strdup (gimprc.pattern_path); + edit_palette_path = prefs_strdup (gimprc.palette_path); + edit_gradient_path = prefs_strdup (gimprc.gradient_path); } /* assign edit variables for values which get changed on "OK" and "Save" @@ -1421,45 +1423,45 @@ preferences_dialog_create (void) old_interpolation_type = base_config->interpolation_type; old_num_processors = base_config->num_processors; - old_perfectmouse = perfectmouse; - old_transparency_type = transparency_type; - old_transparency_size = transparency_size; - old_levels_of_undo = levels_of_undo; - old_marching_speed = marching_speed; - old_allow_resize_windows = allow_resize_windows; - old_auto_save = auto_save; - old_preview_size = preview_size; - old_nav_preview_size = nav_preview_size; - old_no_cursor_updating = no_cursor_updating; - old_show_tool_tips = show_tool_tips; - old_show_rulers = show_rulers; - old_show_statusbar = show_statusbar; - old_confirm_on_close = confirm_on_close; - old_save_session_info = save_session_info; - old_save_device_status = save_device_status; - old_always_restore_session = always_restore_session; - old_default_width = default_width; - old_default_height = default_height; - old_default_units = default_units; - old_default_xresolution = default_xresolution; - old_default_yresolution = default_yresolution; - old_default_resolution_units = default_resolution_units; - old_default_type = default_type; - old_default_dot_for_dot = default_dot_for_dot; - old_monitor_xres = monitor_xres; - old_monitor_yres = monitor_yres; - old_using_xserver_resolution = using_xserver_resolution; - old_global_paint_options = global_paint_options; - old_max_new_image_size = max_new_image_size; - old_thumbnail_mode = thumbnail_mode; - old_trust_dirty_flag = trust_dirty_flag; - old_use_help = use_help; - old_help_browser = help_browser; - old_cursor_mode = cursor_mode; - old_default_threshold = default_threshold; + old_perfectmouse = gimprc.perfectmouse; + old_transparency_type = gimprc.transparency_type; + old_transparency_size = gimprc.transparency_size; + old_levels_of_undo = gimprc.levels_of_undo; + old_marching_speed = gimprc.marching_speed; + old_allow_resize_windows = gimprc.allow_resize_windows; + old_auto_save = gimprc.auto_save; + old_preview_size = gimprc.preview_size; + old_nav_preview_size = gimprc.nav_preview_size; + old_no_cursor_updating = gimprc.no_cursor_updating; + old_show_tool_tips = gimprc.show_tool_tips; + old_show_rulers = gimprc.show_rulers; + old_show_statusbar = gimprc.show_statusbar; + old_confirm_on_close = gimprc.confirm_on_close; + old_save_session_info = gimprc.save_session_info; + old_save_device_status = gimprc.save_device_status; + old_always_restore_session = gimprc.always_restore_session; + old_default_width = gimprc.default_width; + old_default_height = gimprc.default_height; + old_default_units = gimprc.default_units; + old_default_xresolution = gimprc.default_xresolution; + old_default_yresolution = gimprc.default_yresolution; + old_default_resolution_units = gimprc.default_resolution_units; + old_default_type = gimprc.default_type; + old_default_dot_for_dot = gimprc.default_dot_for_dot; + old_monitor_xres = gimprc.monitor_xres; + old_monitor_yres = gimprc.monitor_yres; + old_using_xserver_resolution = gimprc.using_xserver_resolution; + old_global_paint_options = gimprc.global_paint_options; + old_max_new_image_size = gimprc.max_new_image_size; + old_thumbnail_mode = gimprc.thumbnail_mode; + old_trust_dirty_flag = gimprc.trust_dirty_flag; + old_use_help = gimprc.use_help; + old_help_browser = gimprc.help_browser; + old_cursor_mode = gimprc.cursor_mode; + old_default_threshold = gimprc.default_threshold; - prefs_strset (&old_image_title_format, image_title_format); - prefs_strset (&old_default_comment, default_comment); + prefs_strset (&old_image_title_format, gimprc.image_title_format); + prefs_strset (&old_default_comment, gimprc.default_comment); /* values which will need a restart */ old_stingy_memory_use = edit_stingy_memory_use; @@ -1540,7 +1542,7 @@ preferences_dialog_create (void) GTK_CTREE (ctree), _("New File"), "dialogs/preferences/new_file.html", - NULL, + NULL, &top_insert, page_index); gtk_widget_show (vbox); @@ -1559,7 +1561,7 @@ preferences_dialog_create (void) gtk_widget_show (hbox); sizeentry = - gimp_size_entry_new (2, default_units, "%p", FALSE, FALSE, TRUE, 75, + gimp_size_entry_new (2, gimprc.default_units, "%p", FALSE, FALSE, TRUE, 75, GIMP_SIZE_ENTRY_UPDATE_SIZE); gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry), @@ -1570,17 +1572,19 @@ preferences_dialog_create (void) _("Pixels"), 1, 4, 0.0); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), - 0, default_xresolution, FALSE); + 0, gimprc.default_xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (sizeentry), - 1, default_yresolution, FALSE); + 1, gimprc.default_yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 0, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry), 1, GIMP_MIN_IMAGE_SIZE, GIMP_MAX_IMAGE_SIZE); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, default_width); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, default_height); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, + gimprc.default_width); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, + gimprc.default_height); gtk_signal_connect (GTK_OBJECT (sizeentry), "unit_changed", GTK_SIGNAL_FUNC (prefs_default_size_callback), @@ -1607,12 +1611,12 @@ preferences_dialog_create (void) pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL); sizeentry2 = - gimp_size_entry_new (2, default_resolution_units, pixels_per_unit, + gimp_size_entry_new (2, gimprc.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 (default_xresolution - default_yresolution) < GIMP_MIN_RESOLUTION) + if (ABS (gimprc.default_xresolution - gimprc.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); @@ -1630,11 +1634,11 @@ preferences_dialog_create (void) (GIMP_SIZE_ENTRY (sizeentry2), 0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (sizeentry2), 1, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); - + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), - 0, default_xresolution); + 0, gimprc.default_xresolution); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry2), - 1, default_yresolution); + 1, gimprc.default_yresolution); gtk_signal_connect (GTK_OBJECT (sizeentry2), "unit_changed", (GtkSignalFunc) prefs_default_resolution_callback, @@ -1662,7 +1666,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &default_type, (gpointer) default_type, + &(gimprc.default_type), (gpointer) + gimprc.default_type, _("RGB"), (gpointer) RGB, NULL, _("Grayscale"), (gpointer) GRAY, NULL, @@ -1673,13 +1678,13 @@ preferences_dialog_create (void) optionmenu, 1, TRUE); /* The maximum size of a new image */ - adjustment = gtk_adjustment_new (max_new_image_size, + adjustment = gtk_adjustment_new (gimprc.max_new_image_size, 0, (4069.0 * 1024 * 1024 - 1), 1.0, 1.0, 0.0); hbox = gimp_mem_size_entry_new (GTK_ADJUSTMENT (adjustment)); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", GTK_SIGNAL_FUNC (gimp_uint_adjustment_update), - &max_new_image_size); + &(gimprc.max_new_image_size)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Maximum Image Size:"), 1.0, 0.5, hbox, 1, TRUE); @@ -1707,10 +1712,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, default_comment, -1); + gtk_text_insert (GTK_TEXT (text), NULL, NULL, NULL, gimprc.default_comment, -1); gtk_signal_connect (GTK_OBJECT (text), "changed", GTK_SIGNAL_FUNC (prefs_text_callback), - &default_comment); + &(gimprc.default_comment)); gtk_container_add (GTK_CONTAINER (hbox), text); gtk_widget_show (text); @@ -1743,7 +1748,7 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &transparency_type, (gpointer) transparency_type, + &(gimprc.transparency_type), (gpointer) gimprc.transparency_type, _("Light Checks"), (gpointer) LIGHT_CHECKS, NULL, _("Mid-Tone Checks"), (gpointer) GRAY_CHECKS, NULL, @@ -1759,7 +1764,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &transparency_size, (gpointer) transparency_size, + &(gimprc.transparency_size), (gpointer) + gimprc.transparency_size, _("Small"), (gpointer) SMALL_CHECKS, NULL, _("Medium"), (gpointer) MEDIUM_CHECKS, NULL, @@ -1849,7 +1855,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_preview_size_callback, - &preview_size, (gpointer) preview_size, + &(gimprc.preview_size), (gpointer) + gimprc.preview_size, _("None"), (gpointer) 0, NULL, _("Tiny"), (gpointer) 24, NULL, @@ -1865,7 +1872,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_nav_preview_size_callback, - &nav_preview_size, (gpointer) nav_preview_size, + &(gimprc.nav_preview_size), (gpointer) + gimprc.nav_preview_size, _("Small"), (gpointer) 48, NULL, _("Medium"), (gpointer) 80, NULL, @@ -1946,21 +1954,21 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Show Tool Tips")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - show_tool_tips); + gimprc.show_tool_tips); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &show_tool_tips); + &(gimprc.show_tool_tips)); gtk_widget_show (button); button = gtk_check_button_new_with_label (_("Context Sensitive Help with \"F1\"")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - use_help); + gimprc.use_help); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &use_help); + &(gimprc.use_help)); gtk_widget_show (button); vbox2 = prefs_frame_new (_("Help Browser"), GTK_BOX (vbox)); @@ -1973,7 +1981,7 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &help_browser, (gpointer) help_browser, + &(gimprc.help_browser), (gpointer) gimprc.help_browser, _("Internal"), (gpointer) HELP_BROWSER_GIMP, NULL, _("Netscape"), (gpointer) HELP_BROWSER_NETSCAPE, NULL, @@ -1999,38 +2007,38 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Use \"Dot for Dot\" by default")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - default_dot_for_dot); + gimprc.default_dot_for_dot); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &default_dot_for_dot); + &(gimprc.default_dot_for_dot)); gtk_widget_show (button); button = gtk_check_button_new_with_label(_("Resize Window on Zoom")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - allow_resize_windows); + gimprc.allow_resize_windows); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &allow_resize_windows); + &(gimprc.allow_resize_windows)); gtk_widget_show (button); button = gtk_check_button_new_with_label(_("Show Rulers")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - show_rulers); + gimprc.show_rulers); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &show_rulers); + &(gimprc.show_rulers)); gtk_widget_show (button); button = gtk_check_button_new_with_label(_("Show Statusbar")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - show_statusbar); + gimprc.show_statusbar); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &show_statusbar); + &(gimprc.show_statusbar)); gtk_widget_show (button); table = gtk_table_new (2, 2, FALSE); @@ -2042,11 +2050,11 @@ preferences_dialog_create (void) spinbutton = gimp_spin_button_new (&adjustment, - marching_speed, 50.0, 32000.0, 10.0, 100.0, 1.0, + gimprc.marching_speed, 50.0, 32000.0, 10.0, 100.0, 1.0, 1.0, 0.0); gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", GTK_SIGNAL_FUNC (gimp_int_adjustment_update), - &marching_speed); + &(gimprc.marching_speed)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Marching Ants Speed:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2058,7 +2066,7 @@ preferences_dialog_create (void) /* Set the currently used string as "Custom" */ comboitem = gtk_list_item_new_with_label (_("Custom")); gtk_combo_set_item_string (GTK_COMBO (combo), GTK_ITEM (comboitem), - image_title_format); + gimprc.image_title_format); gtk_container_add (GTK_CONTAINER (GTK_COMBO (combo)->list), comboitem); gtk_widget_show (comboitem); /* set some commonly used format strings */ @@ -2085,7 +2093,7 @@ preferences_dialog_create (void) gtk_signal_connect (GTK_OBJECT (GTK_COMBO (combo)->entry), "changed", GTK_SIGNAL_FUNC (prefs_string_callback), - &image_title_format); + &(gimprc.image_title_format)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 1, _("Image Title Format:"), 1.0, 0.5, @@ -2097,20 +2105,20 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Perfect-but-Slow Pointer Tracking")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - perfectmouse); + gimprc.perfectmouse); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &perfectmouse); + &(gimprc.perfectmouse)); gtk_widget_show (button); button = gtk_check_button_new_with_label (_("Disable Cursor Updating")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - no_cursor_updating); + gimprc.no_cursor_updating); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &no_cursor_updating); + &(gimprc.no_cursor_updating)); gtk_widget_show (button); table = gtk_table_new (1, 2, FALSE); @@ -2121,7 +2129,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &cursor_mode, (gpointer) cursor_mode, + &(gimprc.cursor_mode), + (gpointer) gimprc.cursor_mode, _("Tool Icon"), (gpointer) CURSOR_MODE_TOOL_ICON, NULL, @@ -2153,11 +2162,11 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label(_("Use Global Paint Options")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - global_paint_options); + gimprc.global_paint_options); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &global_paint_options); + &(gimprc.global_paint_options)); gtk_widget_show (button); vbox2 = prefs_frame_new (_("Finding Contiguous Regions"), GTK_BOX (vbox)); @@ -2172,11 +2181,11 @@ preferences_dialog_create (void) /* Default threshold */ spinbutton = gimp_spin_button_new (&adjustment, - default_threshold, 0.0, 255.0, + gimprc.default_threshold, 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), - &default_threshold); + &(gimprc.default_threshold)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Default Threshold:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2222,10 +2231,10 @@ preferences_dialog_create (void) /* Levels of Undo */ spinbutton = gimp_spin_button_new (&adjustment, - levels_of_undo, 0.0, 255.0, 1.0, 5.0, 0.0, 1.0, 0.0); + gimprc.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), - &levels_of_undo); + &(gimprc.levels_of_undo)); gimp_table_attach_aligned (GTK_TABLE (table), 0, 0, _("Levels of Undo:"), 1.0, 0.5, spinbutton, 1, TRUE); @@ -2300,7 +2309,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &thumbnail_mode, (gpointer) thumbnail_mode, + &(gimprc.thumbnail_mode), (gpointer) + gimprc.thumbnail_mode, _("Always"), (gpointer) 1, NULL, _("Never"), (gpointer) 0, NULL, @@ -2312,7 +2322,8 @@ preferences_dialog_create (void) optionmenu = gimp_option_menu_new2 (FALSE, prefs_toggle_callback, - &trust_dirty_flag, (gpointer) trust_dirty_flag, + &(gimprc.trust_dirty_flag), + (gpointer) gimprc.trust_dirty_flag, _("Only when Modified"), (gpointer) 1, NULL, _("Always"), (gpointer) 0, NULL, @@ -2339,11 +2350,11 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Save Window Positions on Exit")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - save_session_info); + gimprc.save_session_info); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &save_session_info); + &(gimprc.save_session_info)); gtk_widget_show (button); hbox = gtk_hbox_new (FALSE, 2); @@ -2361,22 +2372,22 @@ preferences_dialog_create (void) button = gtk_check_button_new_with_label (_("Always Try to Restore Session")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - always_restore_session); + gimprc.always_restore_session); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &always_restore_session); + &(gimprc.always_restore_session)); gtk_widget_show (button); vbox2 = prefs_frame_new (_("Devices"), GTK_BOX (vbox)); button = gtk_check_button_new_with_label (_("Save Device Status on Exit")); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), - save_device_status); + gimprc.save_device_status); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (prefs_toggle_callback), - &save_device_status); + &(gimprc.save_device_status)); gtk_widget_show (button); /* Monitor */ @@ -2416,9 +2427,9 @@ preferences_dialog_create (void) pixels_per_unit = NULL; button = gimp_chain_button_new (GIMP_CHAIN_BOTTOM); - if (ABS (monitor_xres - monitor_yres) < GIMP_MIN_RESOLUTION) + if (ABS (gimprc.monitor_xres - gimprc.monitor_yres) < GIMP_MIN_RESOLUTION) gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (button), TRUE); - gtk_object_set_data (GTK_OBJECT (sizeentry), "chain_button", button); + gtk_object_set_data (GTK_OBJECT (sizeentry), "chain_button", button); gtk_table_attach_defaults (GTK_TABLE (sizeentry), button, 1, 3, 3, 4); gtk_widget_show (button); @@ -2436,8 +2447,10 @@ preferences_dialog_create (void) GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, monitor_xres); - gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, monitor_yres); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 0, + gimprc.monitor_xres); + gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (sizeentry), 1, + gimprc.monitor_yres); gtk_signal_connect (GTK_OBJECT (sizeentry), "value_changed", GTK_SIGNAL_FUNC (prefs_monitor_resolution_callback), @@ -2448,11 +2461,11 @@ preferences_dialog_create (void) gtk_container_add (GTK_CONTAINER (abox), sizeentry); gtk_widget_show (sizeentry); - gtk_widget_set_sensitive (sizeentry, !using_xserver_resolution); - + gtk_widget_set_sensitive (sizeentry, !gimprc.using_xserver_resolution); + hbox = gtk_hbox_new (FALSE, 0); gtk_container_set_border_width (GTK_CONTAINER (hbox), 4); - + calibrate_button = gtk_button_new_with_label (_("Calibrate")); gtk_misc_set_padding (GTK_MISC (GTK_BIN (calibrate_button)->child), 4, 0); gtk_signal_connect (GTK_OBJECT (calibrate_button), "clicked", @@ -2460,7 +2473,7 @@ preferences_dialog_create (void) sizeentry); gtk_box_pack_start (GTK_BOX (hbox), calibrate_button, FALSE, FALSE, 0); gtk_widget_show (calibrate_button); - gtk_widget_set_sensitive (calibrate_button, !using_xserver_resolution); + gtk_widget_set_sensitive (calibrate_button, !gimprc.using_xserver_resolution); group = NULL; button = gtk_radio_button_new_with_label (group, _("From windowing system")); @@ -2480,23 +2493,23 @@ preferences_dialog_create (void) gtk_widget_show (button); gtk_box_pack_start (GTK_BOX (vbox2), label, FALSE, FALSE, 0); gtk_widget_show (label); - + separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (vbox2), separator, FALSE, FALSE, 0); gtk_widget_show (separator); - + button = gtk_radio_button_new_with_label (group, _("Manually:")); group = gtk_radio_button_group (GTK_RADIO_BUTTON (button)); gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0); gtk_widget_show (button); - + gtk_box_pack_start (GTK_BOX (vbox2), abox, FALSE, FALSE, 0); gtk_widget_show (abox); - + gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); gtk_widget_show (hbox); - - if (!using_xserver_resolution) + + if (!gimprc.using_xserver_resolution) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE); /* Directories */ @@ -2510,7 +2523,7 @@ preferences_dialog_create (void) page_index); gtk_widget_show (vbox); page_index++; - + { static const struct { @@ -2524,13 +2537,13 @@ preferences_dialog_create (void) { N_("Swap Dir:"), N_("Select Swap Dir"), &edit_swap_path }, }; static gint ndirs = sizeof (dirs) / sizeof (dirs[0]); - + table = gtk_table_new (ndirs + 1, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 2); gtk_table_set_col_spacings (GTK_TABLE (table), 4); gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, TRUE, 0); gtk_widget_show (table); - + for (i = 0; i < ndirs; i++) { fileselection = gimp_file_selection_new (gettext(dirs[i].fs_label), diff --git a/app/gui/resize-dialog.c b/app/gui/resize-dialog.c index 737ec55233..9cecabe728 100644 --- a/app/gui/resize-dialog.c +++ b/app/gui/resize-dialog.c @@ -598,7 +598,8 @@ resize_widget_new (ResizeType type, gtk_widget_set_usize (spinbutton, 75, 0); private->resolution_se = - gimp_size_entry_new (1, default_resolution_units, _("pixels/%a"), + gimp_size_entry_new (1, gimprc.default_resolution_units, + _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); gtk_table_set_col_spacing (GTK_TABLE (private->resolution_se), 1, 2); diff --git a/app/gui/session.c b/app/gui/session.c index e830c33056..2cebc9d11f 100644 --- a/app/gui/session.c +++ b/app/gui/session.c @@ -114,7 +114,7 @@ session_save (void) gimp_dialog_factories_session_save (fp); /* save last tip shown */ - fprintf (fp, "(last-tip-shown %d)\n\n", last_tip + 1); + fprintf (fp, "(last-tip-shown %d)\n\n", gimprc.last_tip + 1); color_history_write (fp); diff --git a/app/gui/tips-dialog.c b/app/gui/tips-dialog.c index d59212c726..b916e3ba66 100644 --- a/app/gui/tips-dialog.c +++ b/app/gui/tips-dialog.c @@ -83,8 +83,8 @@ tips_dialog_create (void) g_free (temp); } - if (last_tip >= tips_count || last_tip < 0) - last_tip = 0; + if (gimprc.last_tip >= tips_count || gimprc.last_tip < 0) + gimprc.last_tip = 0; if (tips_dialog) return tips_dialog; @@ -115,7 +115,7 @@ tips_dialog_create (void) gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); gtk_widget_show (hbox); - tips_label = gtk_label_new (tips_text[last_tip]); + tips_label = gtk_label_new (tips_text[gimprc.last_tip]); gtk_label_set_justify (GTK_LABEL (tips_label), GTK_JUSTIFY_LEFT); gtk_misc_set_alignment (GTK_MISC (tips_label), 0.5, 0.5); gtk_box_pack_start (GTK_BOX (hbox), tips_label, TRUE, TRUE, 3); @@ -140,14 +140,14 @@ tips_dialog_create (void) gtk_widget_show (hbox); button = gtk_check_button_new_with_label (_("Show tip next time GIMP starts")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), show_tips); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), gimprc.show_tips); gtk_signal_connect (GTK_OBJECT (button), "toggled", GTK_SIGNAL_FUNC (tips_toggle_update), - &show_tips); + &gimprc.show_tips); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_widget_show (button); - old_show_tips = show_tips; + old_show_tips = gimprc.show_tips; bbox = gtk_hbutton_box_new (); gtk_box_pack_end (GTK_BOX (hbox), bbox, FALSE, FALSE, 0); @@ -203,11 +203,11 @@ tips_dialog_destroy (GtkWidget *widget, /* the last-shown-tip is now saved in sessionrc */ - if (show_tips != old_show_tips) + if (gimprc.show_tips != old_show_tips) { update = g_list_append (update, "show-tips"); remove = g_list_append (remove, "dont-show-tips"); - old_show_tips = show_tips; + old_show_tips = gimprc.show_tips; save_gimprc (&update, &remove); } g_list_free (update); @@ -218,24 +218,24 @@ static void tips_show_previous (GtkWidget *widget, gpointer data) { - last_tip--; + gimprc.last_tip--; - if (last_tip < 0) - last_tip = tips_count - 1; + if (gimprc.last_tip < 0) + gimprc.last_tip = tips_count - 1; - gtk_label_set_text (GTK_LABEL (tips_label), tips_text[last_tip]); + gtk_label_set_text (GTK_LABEL (tips_label), tips_text[gimprc.last_tip]); } static void tips_show_next (GtkWidget *widget, gpointer data) { - last_tip++; + gimprc.last_tip++; - if (last_tip >= tips_count) - last_tip = 0; + if (gimprc.last_tip >= tips_count) + gimprc.last_tip = 0; - gtk_label_set_text (GTK_LABEL (tips_label), tips_text[last_tip]); + gtk_label_set_text (GTK_LABEL (tips_label), tips_text[gimprc.last_tip]); } static void diff --git a/app/gui/toolbox.c b/app/gui/toolbox.c index c4d5400003..97f3f496ec 100644 --- a/app/gui/toolbox.c +++ b/app/gui/toolbox.c @@ -414,7 +414,7 @@ toolbox_create (void) create_color_area (wbox); - if (show_indicators) + if (gimprc.show_indicators) create_indicator_area (wbox, gimp_context_get_user ()); gtk_drag_dest_set (window, diff --git a/app/gui/user-install-dialog.c b/app/gui/user-install-dialog.c index 007f50e575..a38860ad37 100644 --- a/app/gui/user-install-dialog.c +++ b/app/gui/user-install-dialog.c @@ -1206,16 +1206,16 @@ user_install_resolution (void) gimp_coordinates_new (GIMP_UNIT_INCH, pixels_per_unit, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION, - abs (monitor_xres - monitor_yres) < GIMP_MIN_RESOLUTION, + abs (gimprc.monitor_xres - gimprc.monitor_yres) < GIMP_MIN_RESOLUTION, FALSE, _("Monitor Resolution X:"), - monitor_xres, + gimprc.monitor_xres, 1.0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, 0, 0, _("Y:"), - monitor_yres, + gimprc.monitor_yres, 1.0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, @@ -1268,7 +1268,7 @@ user_install_resolution (void) GTK_SIGNAL_FUNC (gimp_toggle_button_sensitive_update), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (xserver_toggle), - using_xserver_resolution); + gimprc.using_xserver_resolution); } static void @@ -1305,33 +1305,33 @@ user_install_resolution_done (void) base_config->swap_path = new_swap_path; update = g_list_append (update, "swap-path"); } - if (using_xserver_resolution != new_using_xserver_resolution || - ABS (monitor_xres - new_monitor_xres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != new_using_xserver_resolution || + ABS (gimprc.monitor_xres - new_monitor_xres) > GIMP_MIN_RESOLUTION) { - monitor_xres = new_monitor_xres; + gimprc.monitor_xres = new_monitor_xres; update = g_list_append (update, "monitor-xresolution"); } - if (using_xserver_resolution != new_using_xserver_resolution || - ABS (monitor_yres - new_monitor_yres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != new_using_xserver_resolution || + ABS (gimprc.monitor_yres - new_monitor_yres) > GIMP_MIN_RESOLUTION) { - monitor_yres = new_monitor_yres; + gimprc.monitor_yres = new_monitor_yres; update = g_list_append (update, "monitor-yresolution"); } - using_xserver_resolution = new_using_xserver_resolution; + gimprc.using_xserver_resolution = new_using_xserver_resolution; - if (using_xserver_resolution) + if (gimprc.using_xserver_resolution) { /* special value of 0 for either x or y res in the gimprc file * means use the xserver's current resolution */ - monitor_xres = 0.0; - monitor_yres = 0.0; + gimprc.monitor_xres = 0.0; + gimprc.monitor_yres = 0.0; } save_gimprc (&update, &remove); - if (using_xserver_resolution) - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); + if (gimprc.using_xserver_resolution) + gdisplay_xserver_resolution (&gimprc.monitor_xres, &gimprc.monitor_yres); g_list_free (update); g_list_free (remove); diff --git a/app/image_new.c b/app/image_new.c index 8bbdcf9152..549effa76b 100644 --- a/app/image_new.c +++ b/app/image_new.c @@ -101,13 +101,13 @@ image_new_init (void) fill_type_names = g_list_append (fill_type_names, new_fill_type); /* Set the last values used to default values. */ - last_values.width = default_width; - last_values.height = default_height; - last_values.unit = default_units; - last_values.xresolution = default_xresolution; - last_values.yresolution = default_yresolution; - last_values.res_unit = default_resolution_units; - last_values.type = default_type; + last_values.width = gimprc.default_width; + last_values.height = gimprc.default_height; + last_values.unit = gimprc.default_units; + last_values.xresolution = gimprc.default_xresolution; + last_values.yresolution = gimprc.default_yresolution; + last_values.res_unit = gimprc.default_resolution_units; + last_values.type = gimprc.default_type; last_values.fill_type = BACKGROUND_FILL; } @@ -287,12 +287,12 @@ image_new_create_image (const GimpImageNewValues *values) gimp_image_set_resolution (image, values->xresolution, values->yresolution); gimp_image_set_unit (image, values->unit); - if (default_comment) + if (gimprc.default_comment) { comment_parasite = gimp_parasite_new ("gimp-comment", GIMP_PARASITE_PERSISTENT, - strlen (default_comment) + 1, - (gpointer) default_comment); + strlen (gimprc.default_comment) + 1, + (gpointer) gimprc.default_comment); gimp_image_parasite_attach (image, comment_parasite); gimp_parasite_free (comment_parasite); } diff --git a/app/interface.c b/app/interface.c index 5c425917b3..37edd17b93 100644 --- a/app/interface.c +++ b/app/interface.c @@ -526,7 +526,7 @@ create_display_shell (GDisplay *gdisp, /* show everything *******************************************************/ - if (show_rulers) + if (gimprc.show_rulers) { gtk_widget_show (gdisp->origin); gtk_widget_show (gdisp->hrule); @@ -545,7 +545,7 @@ create_display_shell (GDisplay *gdisp, gtk_widget_show (gdisp->statusbar); gtk_widget_show (gdisp->progressbar); gtk_widget_show (gdisp->cancelbutton); - if (show_statusbar) + if (gimprc.show_statusbar) { gtk_widget_show (gdisp->statusarea); } diff --git a/app/menus/menus.c b/app/menus/menus.c index a9220e742d..05e5e29914 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -1552,7 +1552,7 @@ menus_last_opened_add (gchar *filename) num_entries = g_slist_length (last_opened_raw_filenames); - if (num_entries == last_opened_size) + if (num_entries == gimprc.last_opened_size) { list = g_slist_last (last_opened_raw_filenames); if (list) @@ -1586,12 +1586,12 @@ menus_init_mru (void) gchar *accelerators; gint i; - last_opened_entries = g_new (GimpItemFactoryEntry, last_opened_size); + last_opened_entries = g_new (GimpItemFactoryEntry, gimprc.last_opened_size); - paths = g_new (gchar, last_opened_size * MRU_MENU_ENTRY_SIZE); + paths = g_new (gchar, gimprc.last_opened_size * MRU_MENU_ENTRY_SIZE); accelerators = g_new (gchar, 9 * MRU_MENU_ACCEL_SIZE); - for (i = 0; i < last_opened_size; i++) + for (i = 0; i < gimprc.last_opened_size; i++) { gchar *path, *accelerator; @@ -1615,10 +1615,10 @@ menus_init_mru (void) g_snprintf (accelerator, MRU_MENU_ACCEL_SIZE, "%d", i + 1); } - menus_create_items (toolbox_factory, last_opened_size, + menus_create_items (toolbox_factory, gimprc.last_opened_size, last_opened_entries, NULL, 2, TRUE); - for (i=0; i < last_opened_size; i++) + for (i=0; i < gimprc.last_opened_size; i++) { menu_item = gtk_item_factory_get_widget (toolbox_factory, @@ -1763,12 +1763,12 @@ menus_create_item (GtkItemFactory *item_factory, if (! (strstr (entry->entry.path, "tearoff1"))) { - if (! disable_tearoff_menus && create_tearoff) + if (! gimprc.disable_tearoff_menus && create_tearoff) { menus_create_branches (item_factory, entry); } } - else if (disable_tearoff_menus || ! create_tearoff) + else if (gimprc.disable_tearoff_menus || ! create_tearoff) { return; } diff --git a/app/menus/plug-in-menus.c b/app/menus/plug-in-menus.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/menus/plug-in-menus.c +++ b/app/menus/plug-in-menus.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/module_db.c b/app/module_db.c index 0e87298d4d..7d707d1665 100644 --- a/app/module_db.c +++ b/app/module_db.c @@ -217,7 +217,7 @@ module_db_init (void) modules = gimp_list_new (MODULE_INFO_TYPE, GIMP_CONTAINER_POLICY_WEAK); if (g_module_supported ()) - gimp_datafiles_read_directories (module_path, 0 /* no flags */, + gimp_datafiles_read_directories (gimprc.module_path, 0 /* no flags */, module_initialize, NULL); #ifdef DUMP_DB gimp_container_foreach (modules, print_module_info, NULL); @@ -614,7 +614,8 @@ module_initialize (const gchar *filename, */ mod->refs = 0; - mod->load_inhibit = module_inhibited (mod->fullpath, module_db_load_inhibit); + mod->load_inhibit = module_inhibited (mod->fullpath, + gimprc.module_db_load_inhibit); if (!mod->load_inhibit) { if (be_verbose) @@ -1136,7 +1137,7 @@ browser_refresh_callback (GtkWidget *widget, kill_list = NULL; /* walk filesystem and add new things we find */ - gimp_datafiles_read_directories (module_path, 0 /* no flags */, + gimp_datafiles_read_directories (gimprc.module_path, 0 /* no flags */, module_initialize, NULL); } diff --git a/app/nav_window.c b/app/nav_window.c index d015cec050..cc409fb6f8 100644 --- a/app/nav_window.c +++ b/app/nav_window.c @@ -1261,11 +1261,11 @@ create_dummy_iwd (GDisplay *gdisp, iwd->ratio = 1.0; iwd->block_window_marker = FALSE; iwd->nav_preview_width = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_WIDTH : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_WIDTH : gimprc.nav_preview_size; iwd->nav_preview_height = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_HEIGHT : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_HEIGHT : gimprc.nav_preview_size; iwd->block_adj_sig = FALSE; iwd->frozen = FALSE; iwd->timer_id = 0; @@ -1726,11 +1726,11 @@ nav_window_preview_resized (InfoDialog *idialog) iwd->imageheight = 1; iwd->nav_preview_width = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_WIDTH : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_WIDTH : gimprc.nav_preview_size; iwd->nav_preview_height = - (nav_preview_size < 0 || nav_preview_size > 256) ? - NAV_PREVIEW_HEIGHT : nav_preview_size; + (gimprc.nav_preview_size < 0 || gimprc.nav_preview_size > 256) ? + NAV_PREVIEW_HEIGHT : gimprc.nav_preview_size; nav_window_update_window_marker (idialog); } diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c index d962215f8b..e669b42368 100644 --- a/app/paint/gimpink.c +++ b/app/paint/gimpink.c @@ -928,7 +928,7 @@ ink_button_press (GimpTool *tool, gdisplays_selection_visibility (gdisp->gimage, SelectionPause); /* add motion memory if you press mod1 first ^ perfectmouse */ - if (((bevent->state & GDK_MOD1_MASK) != 0) != (perfectmouse != 0)) + if (((bevent->state & GDK_MOD1_MASK) != 0) != (gimprc.perfectmouse != 0)) gdk_pointer_grab (gdisp->canvas->window, FALSE, GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, NULL, NULL, bevent->time); diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index 61567981b5..8b10d2a023 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -422,7 +422,7 @@ gimp_paint_tool_button_press (GimpTool *tool, gdisplays_selection_visibility (gdisp->gimage, SelectionPause); /* add motion memory if perfectmouse is set */ - if (perfectmouse != 0) + if (gimprc.perfectmouse != 0) gdk_pointer_grab (gdisp->canvas->window, FALSE, GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, diff --git a/app/pdb/gimprc_cmds.c b/app/pdb/gimprc_cmds.c index 49ed15d45f..5367361cda 100644 --- a/app/pdb/gimprc_cmds.c +++ b/app/pdb/gimprc_cmds.c @@ -163,8 +163,8 @@ get_monitor_resolution_invoker (Argument *args) gdouble xres; gdouble yres; - xres = monitor_xres; - yres = monitor_yres; + xres = gimprc.monitor_xres; + yres = gimprc.monitor_yres; success = TRUE; return_args = procedural_db_return_args (&get_monitor_resolution_proc, success); diff --git a/app/plug-in/gimpplugin-message.c b/app/plug-in/gimpplugin-message.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/gimpplugin-message.c +++ b/app/plug-in/gimpplugin-message.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/gimpplugin-progress.c b/app/plug-in/gimpplugin-progress.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/gimpplugin-progress.c +++ b/app/plug-in/gimpplugin-progress.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/gimpplugin.c +++ b/app/plug-in/gimpplugin.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/gimppluginmanager-call.c b/app/plug-in/gimppluginmanager-call.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/gimppluginmanager-call.c +++ b/app/plug-in/gimppluginmanager-call.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/gimppluginmanager-run.c b/app/plug-in/gimppluginmanager-run.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/gimppluginmanager-run.c +++ b/app/plug-in/gimppluginmanager-run.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/gimppluginmanager.c b/app/plug-in/gimppluginmanager.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/gimppluginmanager.c +++ b/app/plug-in/gimppluginmanager.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/gimppluginshm.c b/app/plug-in/gimppluginshm.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/gimppluginshm.c +++ b/app/plug-in/gimppluginshm.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-in-def.c b/app/plug-in/plug-in-def.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-in-def.c +++ b/app/plug-in/plug-in-def.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-in-message.c b/app/plug-in/plug-in-message.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-in-message.c +++ b/app/plug-in/plug-in-message.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-in-params.c b/app/plug-in/plug-in-params.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-in-params.c +++ b/app/plug-in/plug-in-params.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-in-progress.c b/app/plug-in/plug-in-progress.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-in-progress.c +++ b/app/plug-in/plug-in-progress.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-in-run.c b/app/plug-in/plug-in-run.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-in-run.c +++ b/app/plug-in/plug-in-run.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-in-shm.c b/app/plug-in/plug-in-shm.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-in-shm.c +++ b/app/plug-in/plug-in-shm.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-in.c b/app/plug-in/plug-in.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-in.c +++ b/app/plug-in/plug-in.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug-in/plug-ins.c b/app/plug-in/plug-ins.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug-in/plug-ins.c +++ b/app/plug-in/plug-ins.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/plug_in.c b/app/plug_in.c index 8d5ba674fa..88dee63f3c 100644 --- a/app/plug_in.c +++ b/app/plug_in.c @@ -322,18 +322,18 @@ plug_in_init (void) plug_in_init_shm (); /* search for binaries in the plug-in directory path */ - gimp_datafiles_read_directories (plug_in_path, MODE_EXECUTABLE, + gimp_datafiles_read_directories (gimprc.plug_in_path, MODE_EXECUTABLE, plug_in_init_file, NULL); /* read the pluginrc file for cached data */ filename = NULL; - if (pluginrc_path) + if (gimprc.pluginrc_path) { - if (g_path_is_absolute (pluginrc_path)) - filename = g_strdup (pluginrc_path); + if (g_path_is_absolute (gimprc.pluginrc_path)) + filename = g_strdup (gimprc.pluginrc_path); else filename = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s", - gimp_directory (), pluginrc_path); + gimp_directory (), gimprc.pluginrc_path); } else filename = gimp_personal_rc_file ("pluginrc"); @@ -853,7 +853,7 @@ plug_in_new (gchar *name) if (! g_path_is_absolute (name)) { - path = plug_in_search_in_path (plug_in_path, name); + path = plug_in_search_in_path (gimprc.plug_in_path, name); if (! path) { @@ -1307,15 +1307,15 @@ plug_in_run (ProcRecord *proc_rec, config.tile_width = TILE_WIDTH; config.tile_height = TILE_HEIGHT; config.shm_ID = shm_ID; - config.gamma = gamma_val; - config.install_cmap = install_cmap; + config.gamma = gimprc.gamma_val; + config.install_cmap = gimprc.install_cmap; config.use_xshm = gdk_get_use_xshm (); config.gdisp_ID = gdisp_ID; if (gtk_check_version (1, 2, 8)) - config.min_colors = CLAMP (min_colors, 27, 216); + config.min_colors = CLAMP (gimprc.min_colors, 27, 216); else - config.min_colors = CLAMP (min_colors, 27, 256); + config.min_colors = CLAMP (gimprc.min_colors, 27, 256); proc_run.name = proc_rec->name; proc_run.nparams = argc; diff --git a/app/resize.c b/app/resize.c index 737ec55233..9cecabe728 100644 --- a/app/resize.c +++ b/app/resize.c @@ -598,7 +598,8 @@ resize_widget_new (ResizeType type, gtk_widget_set_usize (spinbutton, 75, 0); private->resolution_se = - gimp_size_entry_new (1, default_resolution_units, _("pixels/%a"), + gimp_size_entry_new (1, gimprc.default_resolution_units, + _("pixels/%a"), FALSE, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION); gtk_table_set_col_spacing (GTK_TABLE (private->resolution_se), 1, 2); diff --git a/app/scale.c b/app/scale.c index 802996c144..ad21c5d64f 100644 --- a/app/scale.c +++ b/app/scale.c @@ -172,7 +172,7 @@ change_scale (GDisplay *gdisp, gdisp->offset_y = (int) (offset_y - (gdisp->disp_height / 2)); /* resize the image */ - resize_display (gdisp, allow_resize_windows, TRUE); + resize_display (gdisp, gimprc.allow_resize_windows, TRUE); } } diff --git a/app/selection.c b/app/selection.c index 22732ce038..5a0cd1ea01 100644 --- a/app/selection.c +++ b/app/selection.c @@ -520,7 +520,7 @@ selection_create (GdkWindow *win, new = g_new (Selection, 1); base_type = gimp_image_base_type (gdisp->gimage); - if (cycled_marching_ants) + if (gimprc.cycled_marching_ants) { new->cycle = TRUE; if (!cycled_ants_pixmap) diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c index 61567981b5..8b10d2a023 100644 --- a/app/tools/gimpbrushtool.c +++ b/app/tools/gimpbrushtool.c @@ -422,7 +422,7 @@ gimp_paint_tool_button_press (GimpTool *tool, gdisplays_selection_visibility (gdisp->gimage, SelectionPause); /* add motion memory if perfectmouse is set */ - if (perfectmouse != 0) + if (gimprc.perfectmouse != 0) gdk_pointer_grab (gdisp->canvas->window, FALSE, GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index 6c9d276358..f7d8f57fa6 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -224,7 +224,7 @@ bucket_options_reset (ToolOptions *tool_options) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->sample_merged_w), options->sample_merged_d); gtk_adjustment_set_value (GTK_ADJUSTMENT (options->threshold_w), - default_threshold); + gimprc.default_threshold); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->fill_mode_w[options->fill_mode_d]), TRUE); } @@ -246,7 +246,7 @@ bucket_options_new (void) bucket_options_reset); options->sample_merged = options->sample_merged_d = FALSE; - options->threshold = default_threshold; + options->threshold = gimprc.default_threshold; options->fill_mode = options->fill_mode_d = FG_BUCKET_FILL; /* the main vbox */ @@ -271,7 +271,7 @@ bucket_options_new (void) gtk_widget_show (label); options->threshold_w = - gtk_adjustment_new (default_threshold, 0.0, 255.0, 1.0, 1.0, 0.0); + gtk_adjustment_new (gimprc.default_threshold, 0.0, 255.0, 1.0, 1.0, 0.0); scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w)); gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); diff --git a/app/tools/gimpbycolorselecttool.c b/app/tools/gimpbycolorselecttool.c index aa7493cf51..fddd5acd5b 100644 --- a/app/tools/gimpbycolorselecttool.c +++ b/app/tools/gimpbycolorselecttool.c @@ -830,7 +830,7 @@ by_color_select_dialog_new (void) bcd = g_new (ByColorDialog, 1); bcd->gimage = NULL; bcd->operation = SELECTION_REPLACE; - bcd->threshold = default_threshold; + bcd->threshold = gimprc.default_threshold; /* The shell and main vbox */ bcd->shell = gimp_dialog_new (_("By Color Selection"), "by_color_selection", @@ -1133,7 +1133,7 @@ by_color_select_reset_callback (GtkWidget *widget, gtk_widget_activate (bcd->replace_button); gtk_adjustment_set_value (GTK_ADJUSTMENT (bcd->threshold_adj), - default_threshold); + gimprc.default_threshold); } static void diff --git a/app/tools/gimpinktool.c b/app/tools/gimpinktool.c index d962215f8b..e669b42368 100644 --- a/app/tools/gimpinktool.c +++ b/app/tools/gimpinktool.c @@ -928,7 +928,7 @@ ink_button_press (GimpTool *tool, gdisplays_selection_visibility (gdisp->gimage, SelectionPause); /* add motion memory if you press mod1 first ^ perfectmouse */ - if (((bevent->state & GDK_MOD1_MASK) != 0) != (perfectmouse != 0)) + if (((bevent->state & GDK_MOD1_MASK) != 0) != (gimprc.perfectmouse != 0)) gdk_pointer_grab (gdisp->canvas->window, FALSE, GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, NULL, NULL, bevent->time); diff --git a/app/tools/gimpmagnifytool.c b/app/tools/gimpmagnifytool.c index db0b9a99e0..2917fe909d 100644 --- a/app/tools/gimpmagnifytool.c +++ b/app/tools/gimpmagnifytool.c @@ -224,7 +224,7 @@ magnify_options_new (void) tool_options_init ((ToolOptions *) options, magnify_options_reset); - options->allow_resize_d = allow_resize_windows; + options->allow_resize_d = gimprc.allow_resize_windows; options->type_d = options->type = GIMP_ZOOM_IN; /* the main vbox */ @@ -235,9 +235,9 @@ magnify_options_new (void) gtk_check_button_new_with_label (_("Allow Window Resizing")); gtk_signal_connect (GTK_OBJECT (options->allow_resize_w), "toggled", GTK_SIGNAL_FUNC (gimp_toggle_button_update), - &allow_resize_windows); + &(gimprc.allow_resize_windows)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->allow_resize_w), - allow_resize_windows); + gimprc.allow_resize_windows); gtk_box_pack_start (GTK_BOX (vbox), options->allow_resize_w, FALSE, FALSE, 0); gtk_widget_show (options->allow_resize_w); @@ -391,7 +391,7 @@ gimp_magnify_tool_button_release (GimpTool *tool, (win_height / 2); /* resize the image */ - resize_display (gdisp, allow_resize_windows, TRUE); + resize_display (gdisp, gimprc.allow_resize_windows, TRUE); } } diff --git a/app/tools/gimppaintoptions-gui.c b/app/tools/gimppaintoptions-gui.c index c81e545794..adca1e7767 100644 --- a/app/tools/gimppaintoptions-gui.c +++ b/app/tools/gimppaintoptions-gui.c @@ -214,7 +214,7 @@ paint_options_init (PaintOptions *options, gtk_widget_show (separator); } - if (! global_paint_options) + if (! gimprc.global_paint_options) gtk_widget_show (vbox); /* the "incremental" toggle */ @@ -266,7 +266,7 @@ paint_options_new (GtkType tool_type, options = g_new (PaintOptions, 1); paint_options_init (options, tool_type, reset_func); - if (global_paint_options && options->global) + if (gimprc.global_paint_options && options->global) gtk_widget_show (options->global); return options; @@ -311,10 +311,10 @@ paint_options_set_global (gboolean global) global = global ? TRUE : FALSE; - if (global_paint_options == global) + if (gimprc.global_paint_options == global) return; - global_paint_options = global; + gimprc.global_paint_options = global; for (list = paint_options_list; list; list = list->next) { diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c index 61567981b5..8b10d2a023 100644 --- a/app/tools/gimppainttool.c +++ b/app/tools/gimppainttool.c @@ -422,7 +422,7 @@ gimp_paint_tool_button_press (GimpTool *tool, gdisplays_selection_visibility (gdisp->gimage, SelectionPause); /* add motion memory if perfectmouse is set */ - if (perfectmouse != 0) + if (gimprc.perfectmouse != 0) gdk_pointer_grab (gdisp->canvas->window, FALSE, GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, diff --git a/app/tools/gimpselectionoptions.c b/app/tools/gimpselectionoptions.c index a19f54adf4..fccedaf650 100644 --- a/app/tools/gimpselectionoptions.c +++ b/app/tools/gimpselectionoptions.c @@ -65,7 +65,7 @@ selection_options_init (SelectionOptions *options, options->feather_radius = options->feather_radius_d = 10.0; options->antialias = options->antialias_d = TRUE; options->sample_merged = options->sample_merged_d = FALSE; - options->threshold = default_threshold; + options->threshold = gimprc.default_threshold; options->fixed_size = options->fixed_size_d = FALSE; options->fixed_height = options->fixed_height_d = 1; options->fixed_width = options->fixed_width_d = 1; @@ -198,7 +198,7 @@ selection_options_init (SelectionOptions *options, gtk_widget_show (label); options->threshold_w = - gtk_adjustment_new (default_threshold, 0.0, 255.0, 1.0, 1.0, 0.0); + gtk_adjustment_new (gimprc.default_threshold, 0.0, 255.0, 1.0, 1.0, 0.0); scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w)); gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); @@ -328,7 +328,7 @@ selection_options_reset (ToolOptions *tool_options) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->sample_merged_w), options->sample_merged_d); gtk_adjustment_set_value (GTK_ADJUSTMENT (options->threshold_w), - default_threshold); + gimprc.default_threshold); } if (options->fixed_size_w) diff --git a/app/tools/paint_options.c b/app/tools/paint_options.c index c81e545794..adca1e7767 100644 --- a/app/tools/paint_options.c +++ b/app/tools/paint_options.c @@ -214,7 +214,7 @@ paint_options_init (PaintOptions *options, gtk_widget_show (separator); } - if (! global_paint_options) + if (! gimprc.global_paint_options) gtk_widget_show (vbox); /* the "incremental" toggle */ @@ -266,7 +266,7 @@ paint_options_new (GtkType tool_type, options = g_new (PaintOptions, 1); paint_options_init (options, tool_type, reset_func); - if (global_paint_options && options->global) + if (gimprc.global_paint_options && options->global) gtk_widget_show (options->global); return options; @@ -311,10 +311,10 @@ paint_options_set_global (gboolean global) global = global ? TRUE : FALSE; - if (global_paint_options == global) + if (gimprc.global_paint_options == global) return; - global_paint_options = global; + gimprc.global_paint_options = global; for (list = paint_options_list; list; list = list->next) { diff --git a/app/tools/selection_options.c b/app/tools/selection_options.c index a19f54adf4..fccedaf650 100644 --- a/app/tools/selection_options.c +++ b/app/tools/selection_options.c @@ -65,7 +65,7 @@ selection_options_init (SelectionOptions *options, options->feather_radius = options->feather_radius_d = 10.0; options->antialias = options->antialias_d = TRUE; options->sample_merged = options->sample_merged_d = FALSE; - options->threshold = default_threshold; + options->threshold = gimprc.default_threshold; options->fixed_size = options->fixed_size_d = FALSE; options->fixed_height = options->fixed_height_d = 1; options->fixed_width = options->fixed_width_d = 1; @@ -198,7 +198,7 @@ selection_options_init (SelectionOptions *options, gtk_widget_show (label); options->threshold_w = - gtk_adjustment_new (default_threshold, 0.0, 255.0, 1.0, 1.0, 0.0); + gtk_adjustment_new (gimprc.default_threshold, 0.0, 255.0, 1.0, 1.0, 0.0); scale = gtk_hscale_new (GTK_ADJUSTMENT (options->threshold_w)); gtk_box_pack_start (GTK_BOX (hbox), scale, TRUE, TRUE, 0); gtk_scale_set_value_pos (GTK_SCALE (scale), GTK_POS_TOP); @@ -328,7 +328,7 @@ selection_options_reset (ToolOptions *tool_options) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (options->sample_merged_w), options->sample_merged_d); gtk_adjustment_set_value (GTK_ADJUSTMENT (options->threshold_w), - default_threshold); + gimprc.default_threshold); } if (options->fixed_size_w) diff --git a/app/undo.c b/app/undo.c index 3489eb0457..3d097acb8c 100644 --- a/app/undo.c +++ b/app/undo.c @@ -313,13 +313,13 @@ static gboolean undo_free_up_space (GimpImage *gimage) { /* If there are 0 levels of undo return FALSE. */ - if (levels_of_undo == 0) + if (gimprc.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 >= levels_of_undo) + while (gimage->undo_levels >= gimprc.levels_of_undo) gimage->undo_stack = remove_stack_bottom (gimage); return TRUE; diff --git a/app/undo_history.c b/app/undo_history.c index 075b725e8a..af919e38c3 100644 --- a/app/undo_history.c +++ b/app/undo_history.c @@ -747,7 +747,7 @@ undo_history_new (GimpImage *gimage) st = g_new0 (undo_history_st, 1); st->gimage = gimage; - st->preview_size = preview_size; + st->preview_size = gimprc.preview_size; /* gimage signals */ gtk_signal_connect (GTK_OBJECT (gimage), "undo_event", diff --git a/app/user_install.c b/app/user_install.c index 007f50e575..a38860ad37 100644 --- a/app/user_install.c +++ b/app/user_install.c @@ -1206,16 +1206,16 @@ user_install_resolution (void) gimp_coordinates_new (GIMP_UNIT_INCH, pixels_per_unit, FALSE, FALSE, 75, GIMP_SIZE_ENTRY_UPDATE_RESOLUTION, - abs (monitor_xres - monitor_yres) < GIMP_MIN_RESOLUTION, + abs (gimprc.monitor_xres - gimprc.monitor_yres) < GIMP_MIN_RESOLUTION, FALSE, _("Monitor Resolution X:"), - monitor_xres, + gimprc.monitor_xres, 1.0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, 0, 0, _("Y:"), - monitor_yres, + gimprc.monitor_yres, 1.0, GIMP_MIN_RESOLUTION, GIMP_MAX_RESOLUTION, @@ -1268,7 +1268,7 @@ user_install_resolution (void) GTK_SIGNAL_FUNC (gimp_toggle_button_sensitive_update), NULL); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (xserver_toggle), - using_xserver_resolution); + gimprc.using_xserver_resolution); } static void @@ -1305,33 +1305,33 @@ user_install_resolution_done (void) base_config->swap_path = new_swap_path; update = g_list_append (update, "swap-path"); } - if (using_xserver_resolution != new_using_xserver_resolution || - ABS (monitor_xres - new_monitor_xres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != new_using_xserver_resolution || + ABS (gimprc.monitor_xres - new_monitor_xres) > GIMP_MIN_RESOLUTION) { - monitor_xres = new_monitor_xres; + gimprc.monitor_xres = new_monitor_xres; update = g_list_append (update, "monitor-xresolution"); } - if (using_xserver_resolution != new_using_xserver_resolution || - ABS (monitor_yres - new_monitor_yres) > GIMP_MIN_RESOLUTION) + if (gimprc.using_xserver_resolution != new_using_xserver_resolution || + ABS (gimprc.monitor_yres - new_monitor_yres) > GIMP_MIN_RESOLUTION) { - monitor_yres = new_monitor_yres; + gimprc.monitor_yres = new_monitor_yres; update = g_list_append (update, "monitor-yresolution"); } - using_xserver_resolution = new_using_xserver_resolution; + gimprc.using_xserver_resolution = new_using_xserver_resolution; - if (using_xserver_resolution) + if (gimprc.using_xserver_resolution) { /* special value of 0 for either x or y res in the gimprc file * means use the xserver's current resolution */ - monitor_xres = 0.0; - monitor_yres = 0.0; + gimprc.monitor_xres = 0.0; + gimprc.monitor_yres = 0.0; } save_gimprc (&update, &remove); - if (using_xserver_resolution) - gdisplay_xserver_resolution (&monitor_xres, &monitor_yres); + if (gimprc.using_xserver_resolution) + gdisplay_xserver_resolution (&gimprc.monitor_xres, &gimprc.monitor_yres); g_list_free (update); g_list_free (remove); diff --git a/app/widgets/gimpdeviceinfo.c b/app/widgets/gimpdeviceinfo.c index 4ac7b4ee8a..bddf2d5774 100644 --- a/app/widgets/gimpdeviceinfo.c +++ b/app/widgets/gimpdeviceinfo.c @@ -973,7 +973,7 @@ void device_status_free (void) { /* Save device status on exit */ - if (save_device_status) + if (gimprc.save_device_status) devices_write_rc (); if (deviceD) diff --git a/app/widgets/gimpdevices.c b/app/widgets/gimpdevices.c index 4ac7b4ee8a..bddf2d5774 100644 --- a/app/widgets/gimpdevices.c +++ b/app/widgets/gimpdevices.c @@ -973,7 +973,7 @@ void device_status_free (void) { /* Save device status on exit */ - if (save_device_status) + if (gimprc.save_device_status) devices_write_rc (); if (deviceD) diff --git a/app/widgets/gimpdrawablelistview.c b/app/widgets/gimpdrawablelistview.c index f846b5d7f6..467d7c6228 100644 --- a/app/widgets/gimpdrawablelistview.c +++ b/app/widgets/gimpdrawablelistview.c @@ -394,7 +394,7 @@ gimp_drawable_list_view_new (GimpImage *gimage, view = GIMP_CONTAINER_VIEW (list_view); - view->preview_size = preview_size; + view->preview_size = gimprc.preview_size; list_view->drawable_type = drawable_type; list_view->signal_name = g_strdup (signal_name); diff --git a/app/widgets/gimpdrawabletreeview.c b/app/widgets/gimpdrawabletreeview.c index f846b5d7f6..467d7c6228 100644 --- a/app/widgets/gimpdrawabletreeview.c +++ b/app/widgets/gimpdrawabletreeview.c @@ -394,7 +394,7 @@ gimp_drawable_list_view_new (GimpImage *gimage, view = GIMP_CONTAINER_VIEW (list_view); - view->preview_size = preview_size; + view->preview_size = gimprc.preview_size; list_view->drawable_type = drawable_type; list_view->signal_name = g_strdup (signal_name); diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c index d99280bd2d..71bef9c431 100644 --- a/app/widgets/gimphelp.c +++ b/app/widgets/gimphelp.c @@ -78,7 +78,7 @@ void gimp_help (const gchar *help_path, const gchar *help_data) { - if (use_help) + if (gimprc.use_help) { GimpIdleHelp *idle_help; @@ -106,7 +106,7 @@ gimp_idle_help (gpointer data) idle_help = (GimpIdleHelp *) data; - if (idle_help->help_data == NULL && help_browser != HELP_BROWSER_GIMP) + if (idle_help->help_data == NULL && gimprc.help_browser != HELP_BROWSER_GIMP) idle_help->help_data = g_strdup ("introduction.html"); #ifdef DEBUG_HELP @@ -123,7 +123,7 @@ gimp_idle_help (gpointer data) g_print ("\n"); #endif /* DEBUG_HELP */ - switch (help_browser) + switch (gimprc.help_browser) { case HELP_BROWSER_GIMP: if (gimp_help_internal (idle_help->help_path, @@ -160,7 +160,7 @@ gimp_help_internal_not_found_callback (GtkWidget *widget, if (use_netscape) { - help_browser = HELP_BROWSER_NETSCAPE; + gimprc.help_browser = HELP_BROWSER_NETSCAPE; update = g_list_append (update, "help-browser"); save_gimprc (&update, &remove); @@ -201,7 +201,7 @@ gimp_help_internal (const gchar *help_path, gtk_widget_show (not_found); gtk_main (); - return (help_browser != HELP_BROWSER_NETSCAPE); + return (gimprc.help_browser != HELP_BROWSER_NETSCAPE); } args = g_new (Argument, 4); diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index a9220e742d..05e5e29914 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -1552,7 +1552,7 @@ menus_last_opened_add (gchar *filename) num_entries = g_slist_length (last_opened_raw_filenames); - if (num_entries == last_opened_size) + if (num_entries == gimprc.last_opened_size) { list = g_slist_last (last_opened_raw_filenames); if (list) @@ -1586,12 +1586,12 @@ menus_init_mru (void) gchar *accelerators; gint i; - last_opened_entries = g_new (GimpItemFactoryEntry, last_opened_size); + last_opened_entries = g_new (GimpItemFactoryEntry, gimprc.last_opened_size); - paths = g_new (gchar, last_opened_size * MRU_MENU_ENTRY_SIZE); + paths = g_new (gchar, gimprc.last_opened_size * MRU_MENU_ENTRY_SIZE); accelerators = g_new (gchar, 9 * MRU_MENU_ACCEL_SIZE); - for (i = 0; i < last_opened_size; i++) + for (i = 0; i < gimprc.last_opened_size; i++) { gchar *path, *accelerator; @@ -1615,10 +1615,10 @@ menus_init_mru (void) g_snprintf (accelerator, MRU_MENU_ACCEL_SIZE, "%d", i + 1); } - menus_create_items (toolbox_factory, last_opened_size, + menus_create_items (toolbox_factory, gimprc.last_opened_size, last_opened_entries, NULL, 2, TRUE); - for (i=0; i < last_opened_size; i++) + for (i=0; i < gimprc.last_opened_size; i++) { menu_item = gtk_item_factory_get_widget (toolbox_factory, @@ -1763,12 +1763,12 @@ menus_create_item (GtkItemFactory *item_factory, if (! (strstr (entry->entry.path, "tearoff1"))) { - if (! disable_tearoff_menus && create_tearoff) + if (! gimprc.disable_tearoff_menus && create_tearoff) { menus_create_branches (item_factory, entry); } } - else if (disable_tearoff_menus || ! create_tearoff) + else if (gimprc.disable_tearoff_menus || ! create_tearoff) { return; } diff --git a/app/widgets/gimpitemlistview.c b/app/widgets/gimpitemlistview.c index f846b5d7f6..467d7c6228 100644 --- a/app/widgets/gimpitemlistview.c +++ b/app/widgets/gimpitemlistview.c @@ -394,7 +394,7 @@ gimp_drawable_list_view_new (GimpImage *gimage, view = GIMP_CONTAINER_VIEW (list_view); - view->preview_size = preview_size; + view->preview_size = gimprc.preview_size; list_view->drawable_type = drawable_type; list_view->signal_name = g_strdup (signal_name); diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c index f846b5d7f6..467d7c6228 100644 --- a/app/widgets/gimpitemtreeview.c +++ b/app/widgets/gimpitemtreeview.c @@ -394,7 +394,7 @@ gimp_drawable_list_view_new (GimpImage *gimage, view = GIMP_CONTAINER_VIEW (list_view); - view->preview_size = preview_size; + view->preview_size = gimprc.preview_size; list_view->drawable_type = drawable_type; list_view->signal_name = g_strdup (signal_name); diff --git a/app/widgets/gimptoolbox.c b/app/widgets/gimptoolbox.c index c4d5400003..97f3f496ec 100644 --- a/app/widgets/gimptoolbox.c +++ b/app/widgets/gimptoolbox.c @@ -414,7 +414,7 @@ toolbox_create (void) create_color_area (wbox); - if (show_indicators) + if (gimprc.show_indicators) create_indicator_area (wbox, gimp_context_get_user ()); gtk_drag_dest_set (window, diff --git a/app/xcf.c b/app/xcf.c index 105870e0df..dc8e551e30 100644 --- a/app/xcf.c +++ b/app/xcf.c @@ -1945,8 +1945,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 = default_xresolution; - yres = default_yresolution; + xres = gimprc.default_xresolution; + yres = gimprc.default_yresolution; } gimage->xresolution = xres; gimage->yresolution = yres; diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index 105870e0df..dc8e551e30 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -1945,8 +1945,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 = default_xresolution; - yres = default_yresolution; + xres = gimprc.default_xresolution; + yres = gimprc.default_yresolution; } gimage->xresolution = xres; gimage->yresolution = yres; diff --git a/tools/pdbgen/pdb/gimprc.pdb b/tools/pdbgen/pdb/gimprc.pdb index 1fe024fd8b..b04abf9437 100644 --- a/tools/pdbgen/pdb/gimprc.pdb +++ b/tools/pdbgen/pdb/gimprc.pdb @@ -116,8 +116,8 @@ HELP %invoke = ( code => <<'CODE' { - xres = monitor_xres; - yres = monitor_yres; + xres = gimprc.monitor_xres; + yres = gimprc.monitor_yres; success = TRUE; } CODE