gimp/app/gui/preferences-dialog.c

1912 lines
62 KiB
C
Raw Normal View History

/* The GIMP -- an image manipulation program
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
Makefile.am configure.in added new directory libgimpbase/ 2001-05-21 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool-1.4.in: added new directory libgimpbase/ * app/Makefile.am: link against the new lib. * app/appenums.h: removed the PDB enums which are in libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed. * app/apptypes.h: #include "libgimpbase/gimpbasetypes.h" * app/[lots] * app/core/[of] * app/gui/[files] * app/tools/: changed includes and all PDB types. * app/pdb/*: regenerated. * libgimp/Makefile.am: don't build libgimpi.a uglyness any more. * libgimp/gimpenv.[ch] * libgimp/gimplimits.[hh] * libgimp/gimpparasite.[ch] * libgimp/gimpparasiteio.[ch] * libgimp/gimpprotocol.[ch] * libgimp/gimpsignal.[ch] * libgimp/gimpunit.h * libgimp/gimputils.[ch] * libgimp/gimpwire.[ch]: removed... * libgimpbase/*: ...and added here as new library. * libgimp/gimp.[ch] * libgimp/gimpdrawable.[ch] * libgimp/gimpenums.h * libgimp/gimpimage.[ch] * libgimp/gimptile.c * libgimp/gimptypes.h * libgimp/gimpunit.c: changed accordingly. Added the gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and gimpimage.[ch]. * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpsizeentry.c * libgimpwidgets/gimpunitmenu.c * libgimpwidgets/gimpwidgets.c * libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly. * plug-ins/*/Makefile.am * plug-ins/common/mkgen.pl: link against libgimpbase. * tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so the enums are known to pdbgen... * tools/pdbgen/enumcode.pl: ...but don't write them out to libgimp/gimpenums.h * tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c files. Added GIMP_ to the type names ganerated in app/. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb.pl * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 21:58:46 +08:00
#include "libgimpbase/gimpbase.h"
Makefile.am configure.in added the new library below. 2001-01-24 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool.in: added the new library below. * libgimpwidgets/Makefile.am * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.[ch] * libgimpwidgets/gimpcolorbutton.[ch] * libgimpwidgets/gimpdialog.[ch] * libgimpwidgets/gimpfileselection.[ch] * libgimpwidgets/gimphelpui.[ch] * libgimpwidgets/gimppatheditor.[ch] * libgimpwidgets/gimppixmap.[ch] * libgimpwidgets/gimpquerybox.[ch] * libgimpwidgets/gimpsizeentry.[ch] * libgimpwidgets/gimpunitmenu.[ch] * libgimpwidgets/gimpwidgets.[ch] * libgimpwidgets/gimpwidgets.def * libgimpwidgets/gimpwidgetstypes.h: new shared library. Currently there are some ugly dependencies into libgimp. These will be removed and go to a "libgimpglue" library which will be a library for functions which share a common interface between plug-ins and the app but have different implementations. Include "libgimp/gimpunit.h" from "libgimpwidgets/gimpwidgetstypes.h" to simulate this upcoming separation. * libgimp/Makefile.am * libgimp/gimpchainbutton.[ch] * libgimp/gimpcolorarea.[ch] * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimpfileselection.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimppixmap.[ch] * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: removed from here. * libgimp/gimpui.h * libgimp/gimpuitypes.h * libgimp/makefile.mingw.in * libgimp/makefile.msc: changed accordingly. * app/[all ui files] * app/pdb/palette_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: #include "libgimpwidgets/gimpwidgets.h" and removed useless includes. * app/apptypes.h: #include "libgimpwidgets/gimpwidgetstypes.h" * app/Makefile.am * plug-ins/[all makefiles which link against libgimpui]: link against libgimpwidgets.la * po-libgimp/POTFILES.in: changed file locations.
2001-01-25 06:36:18 +08:00
#include "libgimpwidgets/gimpwidgets.h"
#include "gui-types.h"
#include "config/gimpconfig.h"
#include "config/gimpconfig-params.h"
#include "config/gimpconfig-utils.h"
#include "config/gimprc.h"
app/core/Makefile.am app/core/core-types.h added an "application object" 2001-07-04 Michael Natterer <mitch@gimp.org> * app/core/Makefile.am * app/core/core-types.h * app/core/gimp.[ch]: added an "application object" called Gimp. Currently, it contains the image list, the clipboard, the data factories, the procedural hashtable and the tool info list. It's the toplevel object of the core object system. Finally, creating a Gimp object will return a standalone gimp core engine instance with no other global states/variables involved. * app/app_procs.[ch]: allocate a "Gimp" instance called "the_gimp" :) Removed stuff which is now done by the "Gimp" object. Merged gimp_init() into app_init() because gimp_init() is taken now. * app/context_manager.[ch]: removed stuff done by "Gimp". * app/batch.[ch] * app/gimage.[ch] * app/xcf/xcf-load.[ch] * app/xcf/xcf.[ch] * app/core/gimpedit.[ch] * app/tools/tool_manager.[ch]: pass around an additional "Gimp" argument. * app/pdb/procedural_db.[ch]: pass a "Gimp" pointer as first parameter to all internal procedures and to all procedural_db_* functions. * app/core/gimpcontext.[ch] * app/core/gimpimage.[ch]: added a "Gimp" pointer to the structs. * app/devices.c * app/errors.c * app/file-open.c * app/file-save.c * app/gimphelp.c * app/gimpunit.c * app/image_new.c * app/main.c * app/nav_window.c * app/plug_in.c * app/base/base.c * app/core/gimpdatafactory.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-mask.c * app/core/gimptoolinfo.[ch] * app/gui/brush-select.c * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/edit-commands.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/image-commands.c * app/gui/info-window.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-import-dialog.c * app/gui/palette-select.c * app/gui/paths-dialog.c * app/gui/pattern-select.c * app/gui/preferences-dialog.c * app/gui/test-commands.c * app/gui/toolbox.c * app/gui/tools-commands.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimppainttool.h * app/tools/gimptexttool.c * app/tools/gimptransformtool.h * app/widgets/gimpbufferview.c * app/widgets/gimpcontainerview-utils.c * app/widgets/gimpcursor.c * app/widgets/gimpdnd.c * app/widgets/gimpimagedock.c: changed accordingly. Cleaned up lots of includes. Many files still access the global "the_gimp" variable exported by app_procs.h. * tools/pdbgen/app.pl * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. Don't use "the_gimp" here because all procedures get passed a "Gimp" pointer now. * app/pdb/*: regenerated.
2001-07-05 03:31:35 +08:00
#include "core/gimp.h"
#include "widgets/gimpcolorpanel.h"
#include "widgets/gimpdeviceinfo.h"
#include "widgets/gimpdevices.h"
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimppropwidgets.h"
#include "widgets/gimpwidgets-utils.h"
2001-11-01 05:20:09 +08:00
#include "gui.h"
#include "menus.h"
#include "resolution-calibrate-dialog.h"
app/Makefile.am app/gui/Makefile.am app/about_dialog.[ch] 2001-04-17 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gui/Makefile.am * app/about_dialog.[ch] * app/brush_edit.[ch] * app/brush_select.[ch] * app/channels_dialog.[ch] * app/color_area.[ch] * app/color_notebook.[ch] * app/color_select.[ch] * app/colormap_dialog.[ch] * app/commands.[ch] * app/file_new_dialog.[ch] * app/gradient_editor.[ch] * app/gradient_select.[ch] * app/indicator_area.[ch] * app/info_dialog.[ch] * app/info_window.[ch] * app/layer_select.[ch] * app/layers_dialog.[ch] * app/menus.[ch] * app/palette.[ch] * app/palette_import.[ch] * app/palette_select.[ch] * app/paths_dialog.[ch] * app/pattern_select.[ch] * app/preferences_dialog.[ch] * app/session.[ch] * app/test_commands.[ch] * app/tips_dialog.[ch] * app/toolbox.[ch]: moved to gui/ (s/_/-/ and some more useful filenames on the way). * app/app_procs.c * app/context_manager.c * app/convert.c * app/disp_callbacks.c * app/errorconsole.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/gdisplay.c * app/gimage.c * app/gimprc.c * app/image_new.c * app/interface.c * app/nav_window.c * app/path.c * app/plug_in.c * app/gui/dialogs-constructors.c * app/pdb/brush_select_cmds.c * app/pdb/convert_cmds.c * app/pdb/gradient_select_cmds.c * app/pdb/pattern_select_cmds.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpscaletool.c * app/tools/gimptransformtool.c * app/widgets/gimpcolorpanel.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * po/POTFILES.in: changed accordingly.
2001-04-18 05:43:29 +08:00
#include "session.h"
#include "gimp-intl.h"
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
#define MAX_COMMENT_LENGTH 512 /* arbitrary */
/* preferences local functions */
static GtkWidget * prefs_dialog_new (Gimp *gimp,
GObject *config);
static void prefs_config_notify (GObject *config,
GParamSpec *param_spec,
GObject *config_copy);
static void prefs_config_copy_notify (GObject *config_copy,
GParamSpec *param_spec,
GObject *config);
static void prefs_cancel_callback (GtkWidget *widget,
GtkWidget *dialog);
static void prefs_ok_callback (GtkWidget *widget,
GtkWidget *dialog);
static void prefs_default_resolution_callback (GtkWidget *widget,
GtkWidget *size_sizeentry);
static void prefs_res_source_callback (GtkWidget *widget,
GObject *config);
static void prefs_resolution_calibrate_callback (GtkWidget *widget,
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
GtkWidget *sizeentry);
static void prefs_input_devices_dialog (GtkWidget *widget);
static void prefs_input_dialog_able_callback (GtkWidget *widget,
GdkDevice *device,
gpointer data);
/* private variables */
static GtkWidget *prefs_dialog = NULL;
/* public function */
GtkWidget *
preferences_dialog_create (Gimp *gimp)
{
GObject *config;
GObject *config_copy;
GObject *config_orig;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (prefs_dialog)
return prefs_dialog;
/* turn of autosaving while the prefs dialog is open */
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), FALSE);
config = G_OBJECT (gimp->edit_config);
config_copy = gimp_config_duplicate (config);
config_orig = gimp_config_duplicate (config);
g_signal_connect_object (config, "notify",
G_CALLBACK (prefs_config_notify),
config_copy, 0);
g_signal_connect_object (config_copy, "notify",
G_CALLBACK (prefs_config_copy_notify),
config, 0);
prefs_dialog = prefs_dialog_new (gimp, config_copy);
g_object_add_weak_pointer (G_OBJECT (prefs_dialog),
2002-11-27 18:55:59 +08:00
(gpointer *) &prefs_dialog);
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
g_object_set_data (G_OBJECT (prefs_dialog), "gimp", gimp);
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
g_object_set_data_full (G_OBJECT (prefs_dialog), "config-copy", config_copy,
(GDestroyNotify) g_object_unref);
g_object_set_data_full (G_OBJECT (prefs_dialog), "config-orig", config_orig,
(GDestroyNotify) g_object_unref);
return prefs_dialog;
}
/* private functions */
static void
prefs_config_notify (GObject *config,
GParamSpec *param_spec,
GObject *config_copy)
{
GValue global_value = { 0, };
GValue copy_value = { 0, };
g_value_init (&global_value, param_spec->value_type);
g_value_init (&copy_value, param_spec->value_type);
g_object_get_property (config, param_spec->name, &global_value);
g_object_get_property (config_copy, param_spec->name, &copy_value);
if (g_param_values_cmp (param_spec, &global_value, &copy_value))
{
g_signal_handlers_block_by_func (config_copy,
prefs_config_copy_notify,
config);
g_object_set_property (config_copy, param_spec->name, &global_value);
g_signal_handlers_unblock_by_func (config_copy,
prefs_config_copy_notify,
config);
}
g_value_unset (&global_value);
g_value_unset (&copy_value);
}
static void
prefs_config_copy_notify (GObject *config_copy,
GParamSpec *param_spec,
GObject *config)
{
GValue copy_value = { 0, };
GValue global_value = { 0, };
g_value_init (&copy_value, param_spec->value_type);
g_value_init (&global_value, param_spec->value_type);
g_object_get_property (config_copy, param_spec->name, &copy_value);
g_object_get_property (config, param_spec->name, &global_value);
if (g_param_values_cmp (param_spec, &copy_value, &global_value))
{
if (param_spec->flags & GIMP_PARAM_CONFIRM)
{
#ifdef GIMP_CONFIG_DEBUG
The unbelievable happened: a menu bar per display (optionally) 2002-12-10 Michael Natterer <mitch@gimp.org> The unbelievable happened: a menu bar per display (optionally) * app/widgets/gimpitemfactory.[ch]: Added the possibility to have more than one item factory per <Prefix>. Added gimp_item_factories_set_foobar() variants of all functions which set menu item properties (label, sensitive, ...). Removed the #ifndef ENABLE_NLS code since that's no longer possible. * app/widgets/gimptoolbox.c: made it robust againt the <Image> factory not existing at the time of toolbox creation. * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: added boolean "menu_bar_per_display" property. * app/gui/preferences-dialog.c: added a toggle for the new option. * app/gui/menus.[ch]: added menus_get_new_image_factory() as temporary solution. Will add a GimpMenuFactory which creates the item factories soon. * app/display/gimpdisplayshell.c: add the menu bar if requested. Changed widget packing slightly for the menu bar case. * app/display/gimpdisplayshell-callbacks.c: changed accordingly. Currently there is no right-click popup menu when we have a menu bar. This will change soon. * app/gui/file-dialog-utils.c * app/gui/gui.c: use gimp_item_factories_set_foo(). * app/gui/channels-commands.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/plug-in-commands.c * app/gui/select-commands.c * app/gui/tools-commands.c * app/gui/vectors-commands.c * app/gui/view-commands.c: per-display item factories pass the GimpDisplay as user_data to callbacks, not a Gimp. Changed all return_if_no_foo() macros to handle both cases. Cleaned up the plug-in menu stuff: * app/plug-in/plug-in-types.h: removed PlugInMenuEntry type. * app/plug-in/plug-ins.[ch]: added plug_ins_proc_def_add() as counterpart to plug_ins_proc_def_remove(). Added plug_ins_locale_domain() as counterpart to plug_ins_help_path(). Remember the locale domains just as the help paths. Changed plug-in initialization so that their menus can be created multiple times. * app/plug-in/plug-in.[ch]: use plug_ins_proc_def_add() instead of doing it manually. * app/gui/plug-in-menus.[ch]: added plug_in_menus_init() which just registers the locale domains. Changed plug_in_make_menu() to take a list of proc_defs, not plug_ins_defs so it can be used after plug-in query.
2002-12-11 00:38:16 +08:00
g_print ("NOT Applying prefs change of '%s' to edit_config "
"because it needs confirmation\n",
param_spec->name);
#endif
}
else
{
#ifdef GIMP_CONFIG_DEBUG
The unbelievable happened: a menu bar per display (optionally) 2002-12-10 Michael Natterer <mitch@gimp.org> The unbelievable happened: a menu bar per display (optionally) * app/widgets/gimpitemfactory.[ch]: Added the possibility to have more than one item factory per <Prefix>. Added gimp_item_factories_set_foobar() variants of all functions which set menu item properties (label, sensitive, ...). Removed the #ifndef ENABLE_NLS code since that's no longer possible. * app/widgets/gimptoolbox.c: made it robust againt the <Image> factory not existing at the time of toolbox creation. * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: added boolean "menu_bar_per_display" property. * app/gui/preferences-dialog.c: added a toggle for the new option. * app/gui/menus.[ch]: added menus_get_new_image_factory() as temporary solution. Will add a GimpMenuFactory which creates the item factories soon. * app/display/gimpdisplayshell.c: add the menu bar if requested. Changed widget packing slightly for the menu bar case. * app/display/gimpdisplayshell-callbacks.c: changed accordingly. Currently there is no right-click popup menu when we have a menu bar. This will change soon. * app/gui/file-dialog-utils.c * app/gui/gui.c: use gimp_item_factories_set_foo(). * app/gui/channels-commands.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/plug-in-commands.c * app/gui/select-commands.c * app/gui/tools-commands.c * app/gui/vectors-commands.c * app/gui/view-commands.c: per-display item factories pass the GimpDisplay as user_data to callbacks, not a Gimp. Changed all return_if_no_foo() macros to handle both cases. Cleaned up the plug-in menu stuff: * app/plug-in/plug-in-types.h: removed PlugInMenuEntry type. * app/plug-in/plug-ins.[ch]: added plug_ins_proc_def_add() as counterpart to plug_ins_proc_def_remove(). Added plug_ins_locale_domain() as counterpart to plug_ins_help_path(). Remember the locale domains just as the help paths. Changed plug-in initialization so that their menus can be created multiple times. * app/plug-in/plug-in.[ch]: use plug_ins_proc_def_add() instead of doing it manually. * app/gui/plug-in-menus.[ch]: added plug_in_menus_init() which just registers the locale domains. Changed plug_in_make_menu() to take a list of proc_defs, not plug_ins_defs so it can be used after plug-in query.
2002-12-11 00:38:16 +08:00
g_print ("Applying prefs change of '%s' to edit_config\n",
param_spec->name);
#endif
g_signal_handlers_block_by_func (config,
prefs_config_notify,
config_copy);
g_object_set_property (config, param_spec->name, &copy_value);
g_signal_handlers_unblock_by_func (config,
prefs_config_notify,
config_copy);
}
}
g_value_unset (&copy_value);
g_value_unset (&global_value);
}
static void
prefs_cancel_callback (GtkWidget *widget,
GtkWidget *dialog)
{
Gimp *gimp;
GObject *config_orig;
GList *diff;
GList *list;
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
gimp = g_object_get_data (G_OBJECT (dialog), "gimp");
config_orig = g_object_get_data (G_OBJECT (dialog), "config-orig");
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
g_object_ref (config_orig);
gtk_widget_destroy (dialog); /* destroys config_copy */
major cleanup. After being finished, I decided that it needs to be 2001-06-18 Michael Natterer <mitch@gimp.org> * app/nav_window.[ch]: major cleanup. After being finished, I decided that it needs to be factored out to a widget (see below), so like 90% of this file will go away soon. * app/apptypes.h: added opaque NavigationDialog typedef. * app/gdisplay.[ch]: Added gdisplay_selection_visibility() which is called from gdisplays_selection_visibility(). Capitalized the SelectionControl enum values. Cleaned up the GDisplay struct and it's initialisation while i was on it. * app/gimage.c: gimage_size_changed_handler(): removed stuff which is now done by GimpImage itself. * app/scale.c * app/scroll.c: also update the navigation popup, not only the dialog. * app/selection.[ch]: major indentation & cleanup attack. Maybe found the "Selection vanishes" bug (the timeout id was assinged to a gint, not a _guint_). * app/undo.c: s/gimp_image_size_changed/gimp_viweable_size_changed/ * app/core/gimpdrawable.c: invalidate the image's preview from our "invalidate_preview" implementation. This means that the image's preview is invalidated way too often currently, which cries for some general freeze/thaw mechanism on the GimpViewable level. (Note that previews are rendered in the idle loop, so this is not really a major performance impact, it's just ugly). * app/core/gimpimage.[ch]: removed the "size_changed" signal... * app/core/gimpviewable.[ch]: ...and added it here. * app/core/gimplayer.c: invalidate_preview(): always chain up, also if it's a floating selection. * app/gui/info-dialog.[ch] * app/gui/info-window.c: minor cleanups. * app/gui/preferences-dialog.c: no need to invalidate the image after we have invalidated all it's layers. * app/core/gimpimage-mask.c * app/gui/commands.c * app/tools/gimpeditselectiontool.c * app/tools/gimpinktool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c: capitalized the SelectionCommand enum values. * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/widgets/gimpnavigationpreview.[ch]: new widget. * app/widgets/gimppreview.[ch]: added a non-working non-dot-for-dot mode. Added xres/yres params to the gimp_preview_calc_size() helper function. Cache the "size" value which was passed to the simple function variants (gimp_preview_new() and gimp_preview_set_size()) so we can re-calculate the preview's extents on the underlying viewable's "size_changed" signal and on gimp_preview_set_viewable(). * app/widgets/gimpdrawablepreview.c * app/widgets/gimpimagepreview.c: changed accordingly.
2001-06-18 21:10:03 +08:00
diff = gimp_config_diff (G_OBJECT (gimp->edit_config), config_orig,
GIMP_PARAM_SERIALIZE);
build display/ before tools/. 2001-11-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am: build display/ before tools/. * app/devices.c: devices_check_change(): added all events which have a GdkDevice pointer. * app/gimpprogress.c: include "display-types.h" instead of "core-types.h". * app/core/Makefile.am * app/core/gimpdrawable-bucket-fill.[ch]: new files: the bucket_fill stuff taken from tools/gimpbucketfilltool.[ch]. * app/core/core-types.h: added "BucketFillMode". * app/core/gimpimage-mask-select.[ch]: cleanup. * app/core/gimpmarshal.list: added more marshallers for GimpTool's new signal signatures. * app/core/gimpmarshal.[ch]: regenerated. * app/display/Makefile.am * app/display/gimpdisplayshell-dnd.[ch] * app/display/gimpdisplayshell-layer-select.[ch]: new files: the canvas drop callbacks from gimpdisplayshell-callbacks.[ch] and the stuff formerly knows as gui/layer-select.[ch]. * app/display/gimpdisplay.h: don't include "gui/gui-types.h". * app/display/gximage.c: include "display-types.h". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell.[ch]: call gdsplay_delete(), don't destroy the shell widget. * app/gui/Makefile.am * app/gui/layer-select.[ch]: removed. * app/gui/gradients-commands.c: fixed "Save as POV" fprintf()s. * app/gui/preferences-dialog.c: removed the layer_select stuff because it is useless with the new preview system. * app/gui/tool-options-dialog.c: send the correct data to the close_callback. * app/gui/tools-commands.c: changed to follow the new gimp_tool_initialize() semantics (see below). Tool & canvas event handling chainsawing: * app/tools/tools-types.h: new struct GimpCoords which contains x, y, pressure, tilt etc. * app/display/gimpdisplayshell-callbacks.[ch]: added utility functions which transparently retreive the current event's GimpCoords or take it from the device directly if the event has none. Pass GimpCoords _in_image_coordinates_ to all tool functions. Most important: don't pass GdkEvents and display coordinates to tools any more. * app/tools/gimptool.[ch]: changed virtual functions to take GimpCoords, time and state separately instead of GdkEvents. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.[ch] * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.[ch] * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.[ch] * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.[ch] * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.[ch] * app/tools/path_tool.[ch] * app/tools/selection_options.c: tons and tons of changes: - changed to use the new virtual function parameters. - removed zillions of gdisplay_untransform_coords(). - get the active drawable's offsets manually in many cases. (questionable, but IMHO ok because it's obvious and not simply a "TRUE" passed to some function) - reordered some functions to be consistent across tools. - some tools had to be changed to work on image coords, not display ones (esp. crop). - fixed strange rotate tool behaviour which should be backported to stable. - some stuff i came across. - indentation and other paranoia. - rounding of coordinated may be broken in some tools. - new bugs guaranteed. * app/tools/tool_manager.[ch]: new semantic of tool_manager_initialize_active() (looked at the places where it was used from and put common code together). Should be a bit better now :) * app/tools/gimpblendtool.c * app/tools/transform_options.c: use the new GTK+ feature that a widget (toggle button) can be a frame's title for this tools' tool options. * app/widgets/widgets-types.h: stuff. * themes/Default/gtkrc: s/GtkDialog/GimpDialog/. * tools/pdbgen/Makefile.am: don't scan tools/gimpbucketfilltool.h any more. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb/tools.pdb: changed bucket_fill wrapper. * app/pdb/tools_cmds.c: regenerated.
2001-11-09 03:14:51 +08:00
g_object_freeze_notify (G_OBJECT (gimp->edit_config));
for (list = diff; list; list = g_list_next (list))
{
GParamSpec *param_spec;
GValue value = { 0, };
param_spec = (GParamSpec *) list->data;
g_value_init (&value, param_spec->value_type);
g_object_get_property (config_orig,
param_spec->name,
&value);
g_object_set_property (G_OBJECT (gimp->edit_config),
param_spec->name,
&value);
g_value_unset (&value);
}
g_object_thaw_notify (G_OBJECT (gimp->edit_config));
g_list_free (diff);
g_object_unref (config_orig);
/* enable autosaving again */
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), TRUE);
}
static void
prefs_ok_callback (GtkWidget *widget,
GtkWidget *dialog)
{
Gimp *gimp;
GObject *config_copy;
GList *restart_diff;
GList *confirm_diff;
GList *list;
gimp = g_object_get_data (G_OBJECT (dialog), "gimp");
config_copy = g_object_get_data (G_OBJECT (dialog), "config-copy");
g_object_ref (config_copy);
gtk_widget_destroy (dialog); /* destroys config_orig */
confirm_diff = gimp_config_diff (G_OBJECT (gimp->edit_config), config_copy,
GIMP_PARAM_CONFIRM);
g_object_freeze_notify (G_OBJECT (gimp->edit_config));
for (list = confirm_diff; list; list = g_list_next (list))
{
GParamSpec *param_spec;
GValue value = { 0, };
param_spec = (GParamSpec *) list->data;
g_value_init (&value, param_spec->value_type);
g_object_get_property (config_copy,
param_spec->name,
&value);
g_object_set_property (G_OBJECT (gimp->edit_config),
param_spec->name,
&value);
g_value_unset (&value);
}
g_object_thaw_notify (G_OBJECT (gimp->edit_config));
g_list_free (confirm_diff);
g_object_unref (config_copy);
gimp_rc_save (GIMP_RC (gimp->edit_config));
/* enable autosaving again */
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), TRUE);
/* spit out a solely informational warning about changed values
* which need restart
*/
restart_diff = gimp_config_diff (G_OBJECT (gimp->edit_config),
G_OBJECT (gimp->config),
GIMP_PARAM_RESTART);
if (restart_diff)
{
GString *string;
string = g_string_new (_("You will have to restart GIMP for\n"
"the following changes to take effect:"));
g_string_append (string, "\n\n");
for (list = restart_diff; list; list = g_list_next (list))
{
GParamSpec *param_spec;
param_spec = (GParamSpec *) list->data;
g_string_append_printf (string, "%s\n", param_spec->name);
}
g_message (string->str);
g_string_free (string, TRUE);
}
g_list_free (restart_diff);
}
static void
prefs_default_resolution_callback (GtkWidget *widget,
GtkWidget *size_sizeentry)
{
gdouble xres;
gdouble yres;
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
xres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0);
yres = gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1);
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 0,
xres, FALSE);
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (size_sizeentry), 1,
yres, FALSE);
}
static void
prefs_res_source_callback (GtkWidget *widget,
GObject *config)
{
gdouble xres;
gdouble yres;
gboolean from_gdk;
gimp_toggle_button_sensitive_update (GTK_TOGGLE_BUTTON (widget));
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
from_gdk = GTK_TOGGLE_BUTTON (widget)->active;
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
if (from_gdk)
{
gimp_get_screen_resolution (NULL, &xres, &yres);
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
}
else
{
GimpSizeEntry *sizeentry;
sizeentry = g_object_get_data (G_OBJECT (widget),
"monitor_resolution_sizeentry");
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
if (sizeentry)
{
xres = gimp_size_entry_get_refval (sizeentry, 0);
yres = gimp_size_entry_get_refval (sizeentry, 1);
}
}
g_object_set (config,
"monitor-xresolution", xres,
"monitor-yresolution", yres,
"monitor-resolution-from-windowing-system", from_gdk,
NULL);
}
static void
prefs_resolution_calibrate_callback (GtkWidget *widget,
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
GtkWidget *sizeentry)
{
GtkWidget *dialog;
GtkWidget *notebook;
GtkWidget *image;
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
dialog = gtk_widget_get_toplevel (sizeentry);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
notebook = g_object_get_data (G_OBJECT (dialog), "notebook");
image = g_object_get_data (G_OBJECT (notebook), "image");
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
resolution_calibrate_dialog (sizeentry,
gtk_image_get_pixbuf (GTK_IMAGE (image)),
NULL, NULL, NULL);
}
static void
prefs_input_devices_dialog (GtkWidget *widget)
{
static GtkWidget *input_dialog = NULL;
if (input_dialog)
{
gtk_window_present (GTK_WINDOW (input_dialog));
return;
}
input_dialog = gtk_input_dialog_new ();
g_object_add_weak_pointer (G_OBJECT (input_dialog),
(gpointer *) &input_dialog);
gtk_window_set_transient_for (GTK_WINDOW (input_dialog),
GTK_WINDOW (prefs_dialog));
gtk_window_set_destroy_with_parent (GTK_WINDOW (input_dialog), TRUE);
gtk_widget_hide (GTK_INPUT_DIALOG (input_dialog)->save_button);
g_signal_connect_swapped (GTK_INPUT_DIALOG (input_dialog)->close_button,
"clicked",
G_CALLBACK (gtk_widget_destroy),
input_dialog);
g_signal_connect (input_dialog, "enable_device",
G_CALLBACK (prefs_input_dialog_able_callback),
NULL);
g_signal_connect (input_dialog, "disable_device",
G_CALLBACK (prefs_input_dialog_able_callback),
NULL);
gtk_widget_show (input_dialog);
}
static void
prefs_input_dialog_able_callback (GtkWidget *widget,
GdkDevice *device,
gpointer data)
{
gimp_device_info_changed_by_device (device);
}
static GtkWidget *
prefs_notebook_append_page (Gimp *gimp,
GtkNotebook *notebook,
const gchar *notebook_label,
const gchar *notebook_icon,
GtkTreeStore *tree,
const gchar *tree_label,
const gchar *help_data,
GtkTreeIter *parent,
GtkTreeIter *iter,
gint page_index)
{
GtkWidget *event_box;
GtkWidget *vbox;
GdkPixbuf *pixbuf = NULL;
GdkPixbuf *small_pixbuf = NULL;
event_box = gtk_event_box_new ();
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
gtk_notebook_append_page (notebook, event_box, NULL);
gtk_widget_show (event_box);
gimp_help_set_help_data (event_box, NULL, help_data);
vbox = gtk_vbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
gtk_container_add (GTK_CONTAINER (event_box), vbox);
gtk_widget_show (vbox);
if (notebook_icon)
{
gchar *filename;
filename = g_build_filename (gui_themes_get_theme_dir (gimp),
"images",
"preferences",
notebook_icon,
NULL);
add appconfig.lib. Statically link libgimptool/gimptool.lib. 2001-05-11 Hans Breuer <hans@breuer.org> * app/makefile.msc : add appconfig.lib. Statically link libgimptool/gimptool.lib. * app/main.c : use gimp_locale_directory() * app/config/gimpconfig-utils.c : <string.h> * app/config/makefile.msc : add gimpscanner * app/core/gimpimagefile.c : some G_OS_WIN32 mess to get mkdir() and chmod() * app/display/gimpdisplayshell.c app/plug-in/plug-in-progrss.c app/tool/gimpcolorpickertool.c app/tool/gimpcroptool.c app/tool/gimpmeasuretool.c app/tool/gimpperspectivetool.c app/tool/gimprotatetool.c app/tool/gimpscaletool.c app/tool/gimpsheartool.c app/tool/gimptransformtool.c app/widgets/gimpcolormapeditor.c app/widgets/gimpcolorpanel.c app/widgets/gimptoolbox-color-area.c add #ifdef __GNUC__ to avoid breaking on non standard pragma #warning * app/tools/makefile.msc : add gimptoolcontrol remove tools-enum * app/tools/tool_manager.c : need to include libgimptool/gimptoolcontrol.h after core includes otherwise we would compile without prototypes or break miserably * app/gui/plug-in-menus.c : replace LOCALEDIR with gimp_locale_directory () * app/gui/preferences-dialog.c (prefs_notebook_append_page) : only try to gdk_pixbuf_new_from_file() with a valid filename. It should simply return NULL otherwise, but fails if the filename is an empty string. * app/paint-funcs/makefile.msc : add -FImsvc_recommended_pragmas.h * app/widgets/gimpcolormapeditor.c : the 'row' allocated needs to be 'xn * cellsize * 2' (to avoid accessing unowned memory) not only width, which has become allocation.width by someone commenting out the correct size calculation * app/widgets/gimpdialogfactory.c : varargs to macros are GCCism or at least non standard. #define DEBUG to g_print or nothing - without arguments - does fix it somewhat dirty as the compiler needs to tolerate the '(blah, foo, bar);' statement than * app/widgets/makefile.msc : updated * app/xcf/makefile.msc : add -FImsvc_recommended_pragmas.h * etc/gimprc.win32 : use ';' to separate theme-path * libgimpbase/gimpenv.c : #include <stdio.h> for sprintf() * app/widgets/gimpdnd.c (gimp_dnd_set_file_data) : the passed in vals chunk is not always null-terminated (at least not on win32). Use the length parameter too to avoid reading junk filenames. * libgimp/gimp.def : export gimp_image_get_name() * libgimpbase/gimpbase.def : export gimp_locale_directory() * libgimpbase/gimpenv.[ch] : added gimp_locale_directory () * libgimpbase/makefile.msc : define DATADIR and SYSCONFDIR to empty string to let gimp find its files in the common place (win32: relative to the top level gimp dir) * plug-ins/common/pixelize.c : <string.h> * plug-ins/flame/cmap.c : #include <glib.h> for g_random_int() * plug-ins/makefile.msc : -FImsvc_recommended_pragams.h and a little hack to give imagemap the prototypes it desires without changing the lexed source * themes/Default/images/makefile.msc : now added (see below) * themes/Default/images/stock-button-reset.png : made it binary
2002-05-11 07:30:09 +08:00
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR))
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
else
pixbuf = NULL;
g_free (filename);
if (pixbuf)
{
small_pixbuf = gdk_pixbuf_scale_simple (pixbuf,
18, 18,
GDK_INTERP_BILINEAR);
}
}
gtk_tree_store_append (tree, iter, parent);
gtk_tree_store_set (tree, iter,
0, small_pixbuf,
1, tree_label,
2, page_index,
3, notebook_label,
4, pixbuf,
-1);
if (pixbuf)
g_object_unref (pixbuf);
if (small_pixbuf)
g_object_unref (small_pixbuf);
return vbox;
}
static void
prefs_tree_select_callback (GtkTreeSelection *sel,
GtkNotebook *notebook)
{
GtkWidget *label;
GtkWidget *image;
GtkTreeModel *model;
GtkTreeIter iter;
GValue val = { 0, };
if (! gtk_tree_selection_get_selected (sel, &model, &iter))
return;
label = g_object_get_data (G_OBJECT (notebook), "label");
image = g_object_get_data (G_OBJECT (notebook), "image");
gtk_tree_model_get_value (model, &iter, 3, &val);
gtk_label_set_text (GTK_LABEL (label),
g_value_get_string (&val));
g_value_unset (&val);
gtk_tree_model_get_value (model, &iter, 4, &val);
gtk_image_set_from_pixbuf (GTK_IMAGE (image),
g_value_get_object (&val));
g_value_unset (&val);
gtk_tree_model_get_value (model, &iter, 2, &val);
gtk_notebook_set_current_page (GTK_NOTEBOOK (notebook),
g_value_get_int (&val));
g_value_unset (&val);
}
static void
prefs_format_string_select_callback (GtkTreeSelection *sel,
GtkEntry *entry)
{
GtkTreeModel *model;
GtkTreeIter iter;
GValue val = { 0, };
if (! gtk_tree_selection_get_selected (sel, &model, &iter))
return;
gtk_tree_model_get_value (model, &iter, 1, &val);
gtk_entry_set_text (entry, g_value_get_string (&val));
g_value_unset (&val);
}
static GtkWidget *
prefs_frame_new (gchar *label,
GtkContainer *parent,
gboolean expand)
{
GtkWidget *frame;
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
GtkWidget *vbox;
frame = gtk_frame_new (label);
if (FALSE)
{
PangoAttrList *attrs;
PangoAttribute *attr;
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
attrs = pango_attr_list_new ();
attr = pango_attr_scale_new (PANGO_SCALE_LARGE);
attr->start_index = 0;
attr->end_index = -1;
pango_attr_list_insert (attrs, attr);
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
attr->start_index = 0;
attr->end_index = -1;
pango_attr_list_insert (attrs, attr);
gtk_label_set_attributes (GTK_LABEL (gtk_frame_get_label_widget (GTK_FRAME (frame))), attrs);
pango_attr_list_unref (attrs);
}
if (GTK_IS_BOX (parent))
gtk_box_pack_start (GTK_BOX (parent), frame, expand, expand, 0);
else
gtk_container_add (parent, frame);
gtk_widget_show (frame);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 2);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
return vbox;
}
static GtkWidget *
prefs_table_new (gint rows,
GtkContainer *parent,
gboolean left_align)
{
GtkWidget *table;
if (left_align)
{
GtkWidget *hbox;
hbox = gtk_hbox_new (FALSE, 0);
if (GTK_IS_BOX (parent))
gtk_box_pack_start (GTK_BOX (parent), hbox, FALSE, FALSE, 0);
else
gtk_container_add (parent, hbox);
gtk_widget_show (hbox);
parent = GTK_CONTAINER (hbox);
}
table = gtk_table_new (rows, 2, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 2);
if (rows > 1)
gtk_table_set_row_spacings (GTK_TABLE (table), 2);
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
if (GTK_IS_BOX (parent))
gtk_box_pack_start (GTK_BOX (parent), table, FALSE, FALSE, 0);
else
gtk_container_add (parent, table);
gtk_widget_show (table);
return table;
}
static GtkWidget *
prefs_check_button_add (GObject *config,
const gchar *property_name,
const gchar *label,
GtkBox *vbox)
{
GtkWidget *button;
button = gimp_prop_check_button_new (config, property_name, label);
if (button)
{
gtk_box_pack_start (vbox, button, FALSE, FALSE, 0);
gtk_widget_show (button);
}
return button;
}
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
static GtkWidget *
prefs_color_button_add (GObject *config,
const gchar *property_name,
const gchar *label,
const gchar *title,
GtkTable *table,
gint table_row)
{
GtkWidget *button;
button = gimp_prop_color_button_new (config, property_name, title,
20, 20, GIMP_COLOR_AREA_FLAT);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
if (button)
gimp_table_attach_aligned (table, 0, table_row,
label, 1.0, 0.5,
button, 1, TRUE);
return button;
}
static GtkWidget *
prefs_enum_option_menu_add (GObject *config,
const gchar *property_name,
gint minimum,
gint maximum,
const gchar *label,
GtkTable *table,
gint table_row)
{
GtkWidget *menu;
menu = gimp_prop_enum_option_menu_new (config, property_name,
minimum, maximum);
if (menu)
gimp_table_attach_aligned (table, 0, table_row,
label, 1.0, 0.5,
menu, 1, TRUE);
return menu;
}
static GtkWidget *
prefs_boolean_option_menu_add (GObject *config,
const gchar *property_name,
const gchar *true_text,
const gchar *false_text,
const gchar *label,
GtkTable *table,
gint table_row)
{
GtkWidget *menu;
menu = gimp_prop_boolean_option_menu_new (config, property_name,
true_text, false_text);
if (menu)
gimp_table_attach_aligned (table, 0, table_row,
label, 1.0, 0.5,
menu, 1, TRUE);
return menu;
}
static GtkWidget *
prefs_spin_button_add (GObject *config,
const gchar *property_name,
gdouble step_increment,
gdouble page_increment,
gint digits,
const gchar *label,
GtkTable *table,
gint table_row)
{
GtkWidget *spinbutton;
spinbutton = gimp_prop_spin_button_new (config, property_name,
step_increment, page_increment,
digits);
if (spinbutton)
gimp_table_attach_aligned (table, 0, table_row,
label, 1.0, 0.5,
spinbutton, 1, TRUE);
return spinbutton;
}
static GtkWidget *
prefs_memsize_entry_add (GObject *config,
const gchar *property_name,
const gchar *label,
GtkTable *table,
gint table_row)
{
GtkWidget *entry;
entry = gimp_prop_memsize_entry_new (config, property_name);
if (entry)
gimp_table_attach_aligned (table, 0, table_row,
label, 1.0, 0.5,
entry, 1, TRUE);
return entry;
}
static void
prefs_help_func (const gchar *help_data)
{
if (prefs_dialog)
{
GtkWidget *notebook;
GtkWidget *event_box;
gint page_num;
notebook = g_object_get_data (G_OBJECT (prefs_dialog), "notebook");
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
event_box = gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook), page_num);
help_data = g_object_get_data (G_OBJECT (event_box), "gimp_help_data");
gimp_standard_help_func (help_data);
}
}
static GtkWidget *
prefs_dialog_new (Gimp *gimp,
GObject *config)
{
GtkWidget *dialog;
GtkWidget *tv;
GtkTreeStore *tree;
GtkTreeViewColumn *column;
GtkCellRenderer *cell;
GtkTreeSelection *sel;
GtkTreeIter top_iter;
GtkTreeIter child_iter;
GtkTreeIter grandchild_iter;
gint page_index;
GtkWidget *ebox;
GtkWidget *frame;
GtkWidget *notebook;
GtkWidget *vbox;
GtkWidget *vbox2;
GtkWidget *hbox;
GtkWidget *abox;
GtkWidget *button;
GtkWidget *fileselection;
GtkWidget *patheditor;
GtkWidget *table;
GtkWidget *label;
GtkWidget *image;
GtkWidget *sizeentry;
GtkWidget *sizeentry2;
GtkWidget *separator;
GtkWidget *calibrate_button;
GtkWidget *scrolled_window;
GtkWidget *text_view;
GtkTextBuffer *text_buffer;
PangoAttrList *attrs;
PangoAttribute *attr;
GSList *group;
gint i;
gchar *pixels_per_unit;
GimpCoreConfig *core_config;
GimpDisplayConfig *display_config;
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (G_IS_OBJECT (config), NULL);
Cleanup weekend... 2001-10-29 Michael Natterer <mitch@gimp.org> Cleanup weekend... * app/app_procs.c: pass "no_interface" to gimp_new(). * app/core/gimp.[ch]: added "gboolean no_interface" and the load_procs and save_procs GSLists. * app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the GimpToolInfo object so more functions find their context without accessing the global "the_gimp" variable. * app/display/display-types.h: removed the GDisplay -> GimpDisplay typedef. * app/display/gimpdisplay.c: look at gimp->no_interface, don't include "appenv.h". * app/file/file-open.[ch] * app/file/file-save.[ch]: don't use "the_gimp" any more. Instead, pass around lots of "Gimp" pointers. Removed the global load_procs and save_procs variables here. Use access() to find out whether a file is readable/writable, removed the manual voodoo and it's Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef" parameter to file_save(), removed file_save_with_proc(). * app/gui/menus.c: Use the unused "gpointer data" parameter of the GtkItemFactory callbacks to pass a "Gimp" pointer to all of them. This reduces the usage of the global "the_gimp" hack to zero in app/gui/... yeah. * app/gui/channels-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/palettes-commands.c * app/gui/select-commands.c * app/gui/test-commands.c * app/gui/tools-commands.c * app/gui/view-commands.c: use the passed "Gimp" pointer. * app/gui/color-area.[ch] * app/gui/convert-dialog.c * app/gui/dialogs-constructors.c * app/gui/file-new-dialog.[ch] * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.[ch] * app/gui/gui.c * app/gui/info-window.[ch] * app/gui/module-browser.[ch] * app/gui/palette-editor.c * app/gui/palette-import-dialog.[ch] * app/gui/paths-dialog.c * app/gui/preferences-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/tool-options-dialog.[ch] * app/gui/toolbox.c: pass around lots more "Gimp" and "GimpContext" pointers and don't use "the_gimp" any more. * app/tools/gimptool.h: added a pointer to the corresponding GimpToolInfo object (which in turn has a pointer to a Gimp). * app/tools/tool_manager.[ch]: set the pointer after creating the tool object. Removed tool_manager_get_info_by_tool() as there is a tool->tool_info pointer now. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/path_tool.c * app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g. Use tool->tool_info and tool_info->gimp in some places to get rid of using "the_gimp". Removing the remaining ones involves changing the tool options system and is scheduled next... * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all file_open_*() functions. * app/gdisplay_color.[ch] * app/gdisplay_color_ui.[ch] * app/image_map.[ch] * app/nav_window.[ch] * app/path.c * app/path_bezier.c * app/path_transform.h * app/qmask.[ch]: s/GDisplay/GimpDisplay/g * tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are members of the "Gimp" object now. * tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't include "appenv.h". * app/pdb/fileops_cmds.c * app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 19:47:11 +08:00
core_config = GIMP_CORE_CONFIG (config);
display_config = GIMP_DISPLAY_CONFIG (config);
dialog = gimp_dialog_new (_("Preferences"), "preferences",
prefs_help_func,
"dialogs/preferences/preferences.html",
GTK_WIN_POS_NONE,
FALSE, TRUE, FALSE,
GTK_STOCK_CANCEL, prefs_cancel_callback,
NULL, NULL, NULL, FALSE, TRUE,
GTK_STOCK_OK, prefs_ok_callback,
NULL, NULL, NULL, TRUE, FALSE,
NULL);
/* The main hbox */
hbox = gtk_hbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
gtk_widget_show (hbox);
/* The categories tree */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
tree = gtk_tree_store_new (5,
GDK_TYPE_PIXBUF, G_TYPE_STRING,
G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF);
tv = gtk_tree_view_new_with_model (GTK_TREE_MODEL (tree));
g_object_unref (tree);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
column = gtk_tree_view_column_new ();
cell = gtk_cell_renderer_pixbuf_new ();
gtk_tree_view_column_pack_start (column, cell, FALSE);
gtk_tree_view_column_set_attributes (column, cell, "pixbuf", 0, NULL);
cell = gtk_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (column, cell, TRUE);
gtk_tree_view_column_set_attributes (column, cell, "text", 1, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
gtk_container_add (GTK_CONTAINER (frame), tv);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
gtk_widget_show (frame);
vbox = gtk_vbox_new (FALSE, 4);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
ebox = gtk_event_box_new ();
gtk_widget_set_state (ebox, GTK_STATE_PRELIGHT);
gtk_box_pack_start (GTK_BOX (vbox), ebox, FALSE, TRUE, 0);
gtk_widget_show (ebox);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_add (GTK_CONTAINER (ebox), frame);
gtk_widget_show (frame);
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_container_add (GTK_CONTAINER (frame), hbox);
gtk_widget_show (hbox);
label = gtk_label_new (NULL);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
attrs = pango_attr_list_new ();
attr = pango_attr_scale_new (PANGO_SCALE_X_LARGE);
attr->start_index = 0;
attr->end_index = -1;
pango_attr_list_insert (attrs, attr);
attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
attr->start_index = 0;
attr->end_index = -1;
pango_attr_list_insert (attrs, attr);
gtk_label_set_attributes (GTK_LABEL (label), attrs);
pango_attr_list_unref (attrs);
image = gtk_image_new ();
gtk_box_pack_end (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
/* The main preferences notebook */
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
g_object_set_data (G_OBJECT (dialog), "notebook", notebook);
g_object_set_data (G_OBJECT (notebook), "label", label);
g_object_set_data (G_OBJECT (notebook), "image", image);
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
g_signal_connect (sel, "changed",
G_CALLBACK (prefs_tree_select_callback),
notebook);
page_index = 0;
/***************/
/* New Image */
/***************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("New Image"),
"new-image.png",
GTK_TREE_STORE (tree),
_("New Image"),
"dialogs/preferences/new_file.html",
NULL,
&top_iter,
page_index++);
/* select this page in the tree */
gtk_tree_selection_select_iter (sel, &top_iter);
/* Default Image Size and Unit */
vbox2 = prefs_frame_new (_("Default Image Size and Unit"),
GTK_CONTAINER (vbox), FALSE);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (vbox2), hbox);
gtk_widget_show (hbox);
sizeentry = gimp_prop_coordinates_new (config,
"default-image-width",
"default-image-height",
"default-unit",
"%p", GIMP_SIZE_ENTRY_UPDATE_SIZE,
core_config->default_xresolution,
core_config->default_yresolution,
FALSE);
gtk_table_set_col_spacings (GTK_TABLE (sizeentry), 2);
gtk_table_set_row_spacings (GTK_TABLE (sizeentry), 2);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
_("Width"), 0, 1, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
_("Height"), 0, 2, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
_("Pixels"), 1, 4, 0.0);
gtk_box_pack_start (GTK_BOX (hbox), sizeentry, FALSE, FALSE, 0);
gtk_widget_show (sizeentry);
/* Default Image Resolution and Resolution Unit */
vbox2 = prefs_frame_new (_("Default Image Resolution and Resolution Unit"),
GTK_CONTAINER (vbox), FALSE);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (vbox2), hbox);
gtk_widget_show (hbox);
pixels_per_unit = g_strconcat (_("Pixels"), "/%s", NULL);
sizeentry2 = gimp_prop_coordinates_new (config,
"default-xresolution",
"default-yresolution",
"default-resolution_unit",
pixels_per_unit,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION,
0.0, 0.0,
TRUE);
gtk_table_set_col_spacings (GTK_TABLE (sizeentry2), 2);
gtk_table_set_row_spacings (GTK_TABLE (sizeentry2), 2);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
_("Horizontal"), 0, 1, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
_("Vertical"), 0, 2, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry2),
_("dpi"), 1, 4, 0.0);
g_signal_connect (sizeentry2, "value_changed",
G_CALLBACK (prefs_default_resolution_callback),
sizeentry);
g_signal_connect (sizeentry2, "refval_changed",
G_CALLBACK (prefs_default_resolution_callback),
sizeentry);
gtk_box_pack_start (GTK_BOX (hbox), sizeentry2, FALSE, FALSE, 0);
gtk_widget_show (sizeentry2);
table = prefs_table_new (2, GTK_CONTAINER (vbox), TRUE);
prefs_enum_option_menu_add (config, "default-image-type",
GIMP_RGB, GIMP_GRAY,
_("Default Image _Type:"),
GTK_TABLE (table), 0);
prefs_memsize_entry_add (config, "max-new-image-size",
_("Maximum Image Size:"),
GTK_TABLE (table), 1);
/*********************************/
/* New Image / Default Comment */
/*********************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Default Comment"),
"default-comment.png",
GTK_TREE_STORE (tree),
_("Default Comment"),
"dialogs/preferences/new_file.html#default_comment",
&top_iter,
&child_iter,
page_index++);
/* Comment */
vbox2 = prefs_frame_new (_("Comment Used for New Images"),
GTK_CONTAINER (vbox), TRUE);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_set_border_width (GTK_CONTAINER (scrolled_window), 4);
gtk_container_add (GTK_CONTAINER (vbox2), scrolled_window);
gtk_widget_show (scrolled_window);
text_buffer = gimp_prop_text_buffer_new (config, "default-comment",
MAX_COMMENT_LENGTH);
text_view = gtk_text_view_new_with_buffer (text_buffer);
gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text_view), GTK_WRAP_WORD);
gtk_container_add (GTK_CONTAINER (scrolled_window), text_view);
gtk_widget_show (text_view);
g_object_unref (text_buffer);
/***************/
/* Interface */
/***************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Interface"),
"interface.png",
GTK_TREE_STORE (tree),
_("Interface"),
"dialogs/preferences/interface.html",
NULL,
&top_iter,
page_index++);
/* General */
vbox2 = prefs_frame_new (_("Previews"), GTK_CONTAINER (vbox), FALSE);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
prefs_check_button_add (config, "layer-previews",
_("_Enable Layer & Channel Previews"),
GTK_BOX (vbox2));
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
themes/Default/images/stock-delete-16.png 2003-03-06 Michael Natterer <mitch@gimp.org> * themes/Default/images/stock-delete-16.png * themes/Default/images/stock-lower-16.png * themes/Default/images/stock-new-16.png * themes/Default/images/stock-paste-16.png * themes/Default/images/stock-raise-16.png * themes/Default/images/stock-refresh-16.png: removed these files since we use the icons provided by GTK+ now. * themes/Default/gtkrc * themes/Default/images/Makefile.am: removed them here hoo. * libgimpwidgets/gimpstock.[ch]: reordered stuff to be consistent in the header and the .c file. Added GIMP_STOCK_ERROR and GIMP_STOCK_QUESTION which are available in all sizes (unlike GTK_STOCK_DIALOG_ERROR and GTK_STOCK_DIALOG_QUESTION). * app/core/gimpviewable.c * app/display/gimpdisplayshell.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/widgets/gimpwidgets-utils.c * app/widgets/gimpdatafactoryview.c: use the new stock IDs. * app/config/gimpcoreconfig.[ch]: renamed "preview_size" to "layer_preview_size" and added "gboolean layer_previews" which switches layer previews on/off independent of their size. * app/config/gimprc-blurbs.h: added/changed their blurbs. * app/core/core-enums.[ch]: removed GIMP_PREVIEW_SIZE_NONE. * app/core/gimpdrawable-preview.c * app/core/gimpdrawable.c * app/core/gimpimage.c: return NULL previews if core_config->layer_previews is FALSE. Invalidate all layer/channel previews whenever "layer_previews" changes. * app/widgets/gimppreviewrendererdrawable.c * app/widgets/gimppreviewrendererimage.c: render the stock_id if the drawable/image returns a NULL preview. Fixes bug #107242. * app/display/gimpdisplayshell-handlers.c: don't set the sensitivity of the navigation button because it can no longer be disabled. * app/display/gimpdisplayshell-layer-select.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/paths-dialog.c: changed accordingly. * app/gui/preferences-dialog.c: added a toggle button for the new "layer_previews" boolean. * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c: chain up unconditionally in GimpContainerView::clear_items(). * app/widgets/gimpcontainertreeview.c: ditto. Made the reorder() implementation lengthy and eeky (but working) again... Stop signal emission on double clicks so GtkTreeView doesn't re-select the item we are about change. * app/widgets/gimpcontainerview.c (gimp_container_view_real_clear_items): need to use g_hash_table_new_full() here too or everything will b0rk. * app/widgets/gimppreviewrenderer.c (gimp_preview_renderer_default_render_stock): use gtk_widget_render_icon() instead of gtk_icon_set_render_icon(). * tools/pdbgen/enums.pl: this file wanted to be regenerated...
2003-03-07 00:47:34 +08:00
prefs_enum_option_menu_add (config, "layer-preview-size", 0, 0,
_("_Layer & Channel Preview Size:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (config, "navigation-preview-size", 0, 0,
_("_Navigation Preview Size:"),
GTK_TABLE (table), 1);
/* Dialog Bahavior */
vbox2 = prefs_frame_new (_("Dialog Behavior"), GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "info-window-per-display",
_("_Info Window Per Display"),
GTK_BOX (vbox2));
/* Menus */
vbox2 = prefs_frame_new (_("Menus"), GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "tearoff-menus",
The unbelievable happened: a menu bar per display (optionally) 2002-12-10 Michael Natterer <mitch@gimp.org> The unbelievable happened: a menu bar per display (optionally) * app/widgets/gimpitemfactory.[ch]: Added the possibility to have more than one item factory per <Prefix>. Added gimp_item_factories_set_foobar() variants of all functions which set menu item properties (label, sensitive, ...). Removed the #ifndef ENABLE_NLS code since that's no longer possible. * app/widgets/gimptoolbox.c: made it robust againt the <Image> factory not existing at the time of toolbox creation. * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: added boolean "menu_bar_per_display" property. * app/gui/preferences-dialog.c: added a toggle for the new option. * app/gui/menus.[ch]: added menus_get_new_image_factory() as temporary solution. Will add a GimpMenuFactory which creates the item factories soon. * app/display/gimpdisplayshell.c: add the menu bar if requested. Changed widget packing slightly for the menu bar case. * app/display/gimpdisplayshell-callbacks.c: changed accordingly. Currently there is no right-click popup menu when we have a menu bar. This will change soon. * app/gui/file-dialog-utils.c * app/gui/gui.c: use gimp_item_factories_set_foo(). * app/gui/channels-commands.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/plug-in-commands.c * app/gui/select-commands.c * app/gui/tools-commands.c * app/gui/vectors-commands.c * app/gui/view-commands.c: per-display item factories pass the GimpDisplay as user_data to callbacks, not a Gimp. Changed all return_if_no_foo() macros to handle both cases. Cleaned up the plug-in menu stuff: * app/plug-in/plug-in-types.h: removed PlugInMenuEntry type. * app/plug-in/plug-ins.[ch]: added plug_ins_proc_def_add() as counterpart to plug_ins_proc_def_remove(). Added plug_ins_locale_domain() as counterpart to plug_ins_help_path(). Remember the locale domains just as the help paths. Changed plug-in initialization so that their menus can be created multiple times. * app/plug-in/plug-in.[ch]: use plug_ins_proc_def_add() instead of doing it manually. * app/gui/plug-in-menus.[ch]: added plug_in_menus_init() which just registers the locale domains. Changed plug_in_make_menu() to take a list of proc_defs, not plug_ins_defs so it can be used after plug-in query.
2002-12-11 00:38:16 +08:00
_("Enable _Tearoff Menus"),
GTK_BOX (vbox2));
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_spin_button_add (config, "last-opened-size", 1.0, 5.0, 0,
_("Open _Recent Menu Size:"),
GTK_TABLE (table), 3);
/* Keyboard Shortcuts */
vbox2 = prefs_frame_new (_("Keyboard Shortcuts"), GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "can-change-accels",
_("Dynamic _Keyboard Shortcuts"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "save-accels",
_("Save Keyboard Shortcuts on Exit"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "restore-accels",
_("Restore Saved Keyboard Shortcuts on Start-up"),
GTK_BOX (vbox2));
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
button = gtk_button_new_with_label (_("Save Keyboard Shortcuts Now"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (menus_save),
gimp);
button = gtk_button_new_with_label (_("Clear Saved Keyboard Shortcuts Now"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (menus_clear),
gimp);
/* Window Positions */
vbox2 = prefs_frame_new (_("Window Positions"), GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "save-session-info",
_("_Save Window Positions on Exit"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "restore-session",
_("R_estore Saved Window Positions on Start-up"),
GTK_BOX (vbox2));
hbox = gtk_hbox_new (FALSE, 4);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
button = gtk_button_new_with_label (_("Save Window Positions Now"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (session_save),
gimp);
button = gtk_button_new_with_label (_("Clear Saved Window Positions Now"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (session_clear),
gimp);
/*****************************/
/* Interface / Help System */
/*****************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Help System"),
"help-system.png",
GTK_TREE_STORE (tree),
_("Help System"),
"dialogs/preferences/interface.html#help_system",
&top_iter,
&child_iter,
page_index++);
/* General */
vbox2 = prefs_frame_new (_("General"), GTK_CONTAINER (vbox), FALSE);
app/Makefile.am app/gimphelp.[ch] new files 1999-09-27 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimphelp.[ch] * app/gimpui.[ch]: new files * app/interface.[ch] * app/preferences_dialog.[ch] The GIMP Help System part 1: Press "F1" in any dialog to pop up the help page for this dialog. Moved the widget constructors from preferences_dialog.[ch] and the query boxes from interface.[ch] to gimpui.[ch]. The dialog constructors take a help_func and a help_data parameter and install the "F1" accelerator which emits the new "help" signal. The "help" signal callback calls help_func(help_data) which finally has to call gimp_help() which in turn invokes the help browser. Still have to find a proper way to (1) prevent "F1" being assigned to some menu item and (2) to catch "F1" while browsing the menu trees in order to pop up the help for the selected item. * app/menus.c: a <Toolbox>/File/Help... menu item. * app/commands.[ch]: a command callback for the "Help..." menu item. * app/gimprc.[ch]: new boolean gimprc variable "use_help". * app/info_dialog.[ch]: pass a help function and data to the info dialog constructor. * app/tools.[ch]: store the tools help page names in the tool info structure. Export a special tools_help_func() which shows the help page for the active tool. * app/[all files calling a dialog constructor]: pass the dialog's help page to the constructor. Most dialogs are now created by gimp_dialog_new() which also sets up the action_area and the WM delete event callback, so I removed the resp. code from these files. Fixed some minor bugs and did some other stuff but didn't change any logic except dialog creation. * plug-ins/helpbrowser/helpbrowser.c: don't try to call a running help browser and don't install any menu path (all done in app/gimphelp.[ch] now).
1999-09-28 01:58:10 +08:00
prefs_check_button_add (config, "show-tool-tips",
_("Show Tool _Tips"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "use-help",
_("Context Sensitive _Help with \"F1\""),
GTK_BOX (vbox2));
prefs_check_button_add (config, "show-tips",
_("Show Tips on _Startup"),
GTK_BOX (vbox2));
/* Help Browser */
vbox2 = prefs_frame_new (_("Help Browser"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (config, "help-browser", 0, 0,
_("Help _Browser to Use:"),
GTK_TABLE (table), 0);
/******************************/
/* Interface / Tool Options */
/******************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Tool Options"),
"tool-options.png",
GTK_TREE_STORE (tree),
_("Tool Options"),
"dialogs/preferences/interface.html#tool_options",
&top_iter,
&child_iter,
page_index++);
/* Contiguous Regions */
vbox2 = prefs_frame_new (_("Finding Contiguous Regions"),
GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_spin_button_add (config, "default-threshold", 1.0, 5.0, 0,
_("Default _Threshold:"),
GTK_TABLE (table), 0);
/* Scaling */
vbox2 = prefs_frame_new (_("Scaling"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), TRUE);
prefs_enum_option_menu_add (config, "interpolation-type", 0, 0,
_("Default _Interpolation:"),
GTK_TABLE (table), 0);
/*******************************/
/* Interface / Input Devices */
/*******************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Input Devices"),
"input-devices.png",
GTK_TREE_STORE (tree),
_("Input Devices"),
"dialogs/preferences/input-devices.html",
&top_iter,
&child_iter,
page_index++);
/* Input Device Settings */
hbox = gtk_hbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
button = gtk_button_new_with_label (_("Configure Input Devices"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect (button, "clicked",
G_CALLBACK (prefs_input_devices_dialog),
NULL);
prefs_check_button_add (config, "save-device-status",
_("Save Input Device Settings on Exit"),
GTK_BOX (vbox));
hbox = gtk_hbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
button = gtk_button_new_with_label (_("Save Input Device Settings Now"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (button)->child), 2, 0);
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_signal_connect_swapped (button, "clicked",
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
G_CALLBACK (gimp_devices_save),
gimp);
/*******************************/
/* Interface / Image Windows */
/*******************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Image Windows"),
"image-windows.png",
GTK_TREE_STORE (tree),
_("Image Windows"),
"dialogs/preferences/interface.html#image_windows",
&top_iter,
&child_iter,
page_index++);
/* Appearance */
vbox2 = prefs_frame_new (_("Appearance"), GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "default-dot-for-dot",
_("Use \"_Dot for Dot\" by default"),
GTK_BOX (vbox2));
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
prefs_check_button_add (config, "show-menubar",
_("Show Menubar"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "show-rulers",
_("Show _Rulers"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "show-scrollbars",
_("Show Scrollbars"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "show-statusbar",
_("Show S_tatusbar"),
GTK_BOX (vbox2));
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
prefs_boolean_option_menu_add (config, "initial-zoom-to-fit",
_("Fit to Window"),
"1:1",
_("Inital Zoom Ratio:"),
GTK_TABLE (table), 0);
prefs_spin_button_add (config, "marching-ants-speed", 10.0, 100.0, 0,
_("Marching _Ants Speed:"),
GTK_TABLE (table), 1);
/* Canvas Padding Color */
vbox2 = prefs_frame_new (_("Canvas Padding Color"),
GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (2, GTK_CONTAINER (vbox2), FALSE);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
prefs_enum_option_menu_add (config, "canvas-padding-mode", 0, 0,
_("Padding Mode:"),
GTK_TABLE (table), 0);
button = prefs_color_button_add (config, "canvas-padding-color",
_("Custom Color:"),
_("Select Custom Canvas Padding Color"),
GTK_TABLE (table), 1);
gimp_color_panel_set_context (GIMP_COLOR_PANEL (button),
gimp_get_user_context (gimp));
/* Zoom & Resize Behavior */
vbox2 = prefs_frame_new (_("Zoom & Resize Behavior"),
Changed menubar showing/hiding to work like rulers and statusbar: 2002-12-14 Michael Natterer <mitch@gimp.org> Changed menubar showing/hiding to work like rulers and statusbar: * app/config/gimpconfig-blurbs.h * app/config/gimpdisplayconfig.[ch]: renamed "menu_bar_per_display" to "show_menubar". Removed GIMP_PARAM_RESTART flag. * app/display/gimpdisplayshell.[ch]: chaged shell->item_factory to shell->menubar_factory plus shell->popup_factory and always create both of them. Added "gboolean update_popup" to gimp_display_shell_set_menu_sensitivity() and call it recursively with update_popup == TRUE if the display it is called for is the active one. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c: changed accordinly. * app/gui/gui.c: ditto. Set the menu sensitivity of new displays. * app/gui/menus.c: added "<Image>/View/Toggle Menubar" menu item. Moved some factory initialization code from gimpdisplayshell.c here. * app/gui/view-commands.[ch]: added view_toggle_menubar_cmd_callback(). Update the menu sensitivity manually in all callbacks which don't call gimp_image_flush(). * app/gui/preferences-dialog.c (prefs_dialog_new): moved the "Show Menubar" toggle to the "Appearance" frame of the "Image Windows" page. Added an own frame for the display zoom/scaling settings. (preferences_dialog_create): Attach config_copy and config_orig using g_object_set_data_full() instead of just g_object_set_data() plus a g_object_weak_ref(). (prefs_default_resolution_callback): set the resolution for both fields of the "size_sizeentry" instead of setting it for "x" twice.
2002-12-14 22:13:54 +08:00
GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "resize-windows-on-zoom",
_("Resize Window on _Zoom"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "resize-windows-on-resize",
_("Resize Window on Image _Size Change"),
GTK_BOX (vbox2));
/* Pointer Movement Feedback */
vbox2 = prefs_frame_new (_("Pointer Movement Feedback"),
GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "perfect-mouse",
_("Perfect-but-Slow _Pointer Tracking"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "cursor-updating",
_("Enable Cursor _Updating"),
GTK_BOX (vbox2));
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_enum_option_menu_add (config, "cursor-mode", 0, 0,
_("Cursor M_ode:"),
GTK_TABLE (table), 0);
/****************************************************************/
/* Interface / Image Windows / Image Title & Statusbar Format */
/****************************************************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Image Title & Statusbar Format"),
"image-title.png",
GTK_TREE_STORE (tree),
_("Title & Status"),
"dialogs/preferences/image_windows.html",
&child_iter,
&grandchild_iter,
page_index++);
{
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
const gchar *format_strings[] =
{
NULL,
"%f-%p.%i (%t)",
"%f-%p.%i (%t) %z%%",
"%f-%p.%i (%t) %d:%s",
made the gimp_object_get_memsize() debugging output configurable by a 2002-02-06 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.c: made the gimp_object_get_memsize() debugging output configurable by a global "gimp_debug_memsize" boolean. * app/display/gimpdisplay.c: removed duplicated prototype. * app/display/gimpdisplayshell.[ch]: renamed the various cursor functions to be more consistent and shorter. Compress window title updates by adding a "gboolean title_dirty" and updating the title in gimp_display_shell_flush(). Added "%m" (memory size) to the possible title string substitutions. * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell-handlers.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptool.c: changed accordingly. * app/display/gimpdisplayshell-callbacks.c: forgot to grab the pointer when dragging guides from the rulers. Coincidentially, this also fixes the buggy offset between guide and mouse pointer... Cleaned up the main tool event callback a but more. * app/widgets/gimppreview.c * app/gui/commands.c: set the new global "gimp_debug_memsize" toggle to TRUE while calling gimp_object_get_memsize(). * app/gui/preferences-dialog.c: added a image title example containing the new "%m" feature. * docs/gimprc-1.3.5.in: document "%m" in the manpage. * app/tools/gimpbezierselecttool.c: reordered some statements. * app/tools/gimpdrawtool.[ch]: store the GimpDisplay passed to gimp_draw_tool_start() in draw_tool->gdisp and use it for coordinate transfomration. This way we can paint on a display which is not tool->gdisp. * app/tools/gimppainttool.c: changed the gimp_draw_tool_foo() calls needed to make the straight_line preview work in a way that does not interfere with paint_tool subclasses which want to do their own drawing (like the clone tool). Also changed the paint_tools PRETRACE_PAINT and POSTTRACE_PAINT flags usage in a way that subclasses can use them without major hackery: don't simply wrap gimp_display_flush_now() with PRETRACE/POSTTRACE calls, but wrap the actual painting calls, so subclasses are able to do useful things with paint_tool->*_coords. * app/tools/gimpclonetool.c: removed poking around in draw_tool internals and simply suspend()/resume() it in PRETRACE_PAINT/POSTTRACE_PAINT to get the clone_src indicator drawn correctly.
2002-02-07 19:33:01 +08:00
"%f-%p.%i (%t) %s:%d",
"%f-%p.%i (%t) %m"
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
};
const gchar *format_names[] =
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
{
N_("Custom"),
N_("Standard"),
N_("Show zoom percentage"),
N_("Show zoom ratio"),
made the gimp_object_get_memsize() debugging output configurable by a 2002-02-06 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.c: made the gimp_object_get_memsize() debugging output configurable by a global "gimp_debug_memsize" boolean. * app/display/gimpdisplay.c: removed duplicated prototype. * app/display/gimpdisplayshell.[ch]: renamed the various cursor functions to be more consistent and shorter. Compress window title updates by adding a "gboolean title_dirty" and updating the title in gimp_display_shell_flush(). Added "%m" (memory size) to the possible title string substitutions. * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell-handlers.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptool.c: changed accordingly. * app/display/gimpdisplayshell-callbacks.c: forgot to grab the pointer when dragging guides from the rulers. Coincidentially, this also fixes the buggy offset between guide and mouse pointer... Cleaned up the main tool event callback a but more. * app/widgets/gimppreview.c * app/gui/commands.c: set the new global "gimp_debug_memsize" toggle to TRUE while calling gimp_object_get_memsize(). * app/gui/preferences-dialog.c: added a image title example containing the new "%m" feature. * docs/gimprc-1.3.5.in: document "%m" in the manpage. * app/tools/gimpbezierselecttool.c: reordered some statements. * app/tools/gimpdrawtool.[ch]: store the GimpDisplay passed to gimp_draw_tool_start() in draw_tool->gdisp and use it for coordinate transfomration. This way we can paint on a display which is not tool->gdisp. * app/tools/gimppainttool.c: changed the gimp_draw_tool_foo() calls needed to make the straight_line preview work in a way that does not interfere with paint_tool subclasses which want to do their own drawing (like the clone tool). Also changed the paint_tools PRETRACE_PAINT and POSTTRACE_PAINT flags usage in a way that subclasses can use them without major hackery: don't simply wrap gimp_display_flush_now() with PRETRACE/POSTTRACE calls, but wrap the actual painting calls, so subclasses are able to do useful things with paint_tool->*_coords. * app/tools/gimpclonetool.c: removed poking around in draw_tool internals and simply suspend()/resume() it in PRETRACE_PAINT/POSTTRACE_PAINT to get the clone_src indicator drawn correctly.
2002-02-07 19:33:01 +08:00
N_("Show reversed zoom ratio"),
N_("Show memory usage")
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
};
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
struct
{
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
gchar *current_setting;
const gchar *title;
const gchar *property_name;
}
formats[] =
{
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
{
display_config->image_title_format,
N_("Image Title Format"),
"image-title-format"
},
{
display_config->image_status_format,
N_("Image Statusbar Format"),
"image-status-format"
}
};
gint format;
g_assert (G_N_ELEMENTS (format_strings) == G_N_ELEMENTS (format_names));
for (format = 0; format < G_N_ELEMENTS (formats); format++)
{
GtkListStore *list_store;
GtkWidget *view;
GtkWidget *scrolled_win;
GtkWidget *entry;
GtkCellRenderer *rend;
GtkTreeViewColumn *col;
GtkTreeIter iter;
GtkTreeSelection *sel;
gint i;
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
format_strings[0] = formats[format].current_setting;
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
vbox2 = prefs_frame_new (gettext (formats[format].title),
GTK_CONTAINER (vbox), TRUE);
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
entry = gimp_prop_entry_new (config, formats[format].property_name, 0);
gtk_box_pack_start (GTK_BOX (vbox2), entry, FALSE, FALSE, 0);
gtk_widget_show (entry);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (vbox2), scrolled_win, TRUE, TRUE, 0);
gtk_widget_show (scrolled_win);
list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING);
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view), FALSE);
gtk_container_add (GTK_CONTAINER (scrolled_win), view);
gtk_widget_show (view);
g_object_unref (list_store);
rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes (NULL, rend,
"text", 0,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes (NULL, rend,
"text", 1,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (view), col);
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
g_signal_connect (sel, "changed",
G_CALLBACK (prefs_format_string_select_callback),
entry);
for (i = 0; i < G_N_ELEMENTS (format_strings); i++)
{
gtk_list_store_append (list_store, &iter);
gtk_list_store_set (list_store, &iter,
0, format_names[i],
1, format_strings[i],
-1);
if (i == 0)
gtk_tree_selection_select_iter (sel, &iter);
}
}
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
}
/*************************/
/* Interface / Display */
/*************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Display"),
"display.png",
GTK_TREE_STORE (tree),
_("Display"),
"dialogs/preferences/display.html",
&top_iter,
&child_iter,
page_index++);
First version of per-tool paint options. No PDB interface yet. The tool 1999-04-22 Michael Natterer <mitschel@cs.tu-berlin.de> First version of per-tool paint options. No PDB interface yet. The tool options dialog got rather big when in per-tool mode, so it will probably have to become a notebook. It's not yet 100% consistent. If switched off, everything should behave exactly like before. * app/Makefile.am * app/paint_options.h: new file * app/tool_options.c: PaintOptions gui. Maintain a list of all paint tools' ToolOptions to enable switching between global and per-tool paint options. * app/brush_select.[ch]: changed packing boxes, tables, ... The paint options in the brush selection can be hidden now. Moved create_paint_mode_menu() to paint_options.h and tool_options.c and renamed it to paint_mode_menu_new(). * app/gimage_mask.c * app/gimpbrush.[ch] * app/gimpbrushlist.[ch] * app/paint_core.c: moved gimp_brush_[set|get]_spacing() from gimpbrushlist.[ch] to gimpbrush.[ch]. Moved gimp_brush_[get|set]_[opacity|paint_mode]() to paint_options.h and tool_options.c and renamed them to paint_options_*_*(). They are "global paint options" now. * app/airbrush.c * app/blend.c * app/bucket_fill.c * app/clone.c * app/convolve.c * app/eraser.c * app/ink.c * app/paintbrush.c * app/pencil.c: all paint tools' options are derived from "PaintOptions" now. Opacity and paint mode are obtained through macros which take into account the current paint options mode. * app/buildmenu.h: #include <gtk/gtk.h> * app/color_picker.c * app/text_tool.c: changed spacings. * app/gimprc.[ch]: new gimprc option "global-paint-options" * app/preferences_dialog.c: Added a "Tool Options" page. Code cleanup. Some work on the convenience constructors test site. * app/tools.c: fixed "unused variable" warning.
1999-04-22 22:34:00 +08:00
/* Transparency */
vbox2 = prefs_frame_new (_("Transparency"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (2, GTK_CONTAINER (vbox2), TRUE);
prefs_enum_option_menu_add (config, "transparency-type", 0, 0,
_("Transparency _Type:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (config, "transparency-size", 0, 0,
_("Check _Size:"),
GTK_TABLE (table), 1);
/* 8-Bit Displays */
vbox2 = prefs_frame_new (_("8-Bit Displays"), GTK_CONTAINER (vbox), FALSE);
if (gdk_rgb_get_visual ()->depth != 8)
gtk_widget_set_sensitive (GTK_WIDGET (vbox2->parent), FALSE);
table = prefs_table_new (1, GTK_CONTAINER (vbox2), FALSE);
prefs_spin_button_add (config, "min-colors", 1.0, 8.0, 0,
_("Minimum Number of Colors:"),
GTK_TABLE (table), 0);
prefs_check_button_add (config, "install-colormap",
_("Install Colormap"),
GTK_BOX (vbox2));
prefs_check_button_add (config, "colormap-cycling",
_("Colormap Cycling"),
GTK_BOX (vbox2));
/*************************/
/* Interface / Monitor */
/*************************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Monitor"),
"monitor.png",
GTK_TREE_STORE (tree),
_("Monitor"),
"dialogs/preferences/monitor.html",
&top_iter,
&child_iter,
page_index++);
vbox2 = prefs_frame_new (_("Get Monitor Resolution"),
GTK_CONTAINER (vbox), FALSE);
{
gdouble xres, yres;
gchar *str;
gimp_get_screen_resolution (NULL, &xres, &yres);
str = g_strdup_printf (_("(Currently %d x %d dpi)"),
ROUND (xres), ROUND (yres));
label = gtk_label_new (str);
g_free (str);
}
abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
sizeentry = gimp_prop_coordinates_new (config,
"monitor-xresolution",
"monitor-yresolution",
NULL,
pixels_per_unit,
GIMP_SIZE_ENTRY_UPDATE_RESOLUTION,
0.0, 0.0,
TRUE);
g_free (pixels_per_unit);
pixels_per_unit = NULL;
gtk_table_set_col_spacings (GTK_TABLE (sizeentry), 2);
gtk_table_set_row_spacings (GTK_TABLE (sizeentry), 2);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
_("Horizontal"), 0, 1, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
_("Vertical"), 0, 2, 0.0);
gimp_size_entry_attach_label (GIMP_SIZE_ENTRY (sizeentry),
1999-05-19 01:33:39 +08:00
_("dpi"), 1, 4, 0.0);
gtk_container_add (GTK_CONTAINER (abox), sizeentry);
gtk_widget_show (sizeentry);
gtk_widget_set_sensitive (sizeentry, ! display_config->monitor_res_from_gdk);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
calibrate_button = gtk_button_new_with_mnemonic (_("C_alibrate"));
gtk_misc_set_padding (GTK_MISC (GTK_BIN (calibrate_button)->child), 4, 0);
gtk_box_pack_start (GTK_BOX (hbox), calibrate_button, FALSE, FALSE, 0);
gtk_widget_show (calibrate_button);
gtk_widget_set_sensitive (calibrate_button,
! display_config->monitor_res_from_gdk);
g_signal_connect (calibrate_button, "clicked",
G_CALLBACK (prefs_resolution_calibrate_callback),
sizeentry);
group = NULL;
button = gtk_radio_button_new_with_mnemonic (group,
_("From _Windowing System"));
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
gtk_widget_show (button);
g_object_set_data (G_OBJECT (button), "monitor_resolution_sizeentry",
sizeentry);
g_object_set_data (G_OBJECT (button), "set_sensitive",
label);
g_object_set_data (G_OBJECT (button), "inverse_sensitive",
sizeentry);
g_object_set_data (G_OBJECT (sizeentry), "inverse_sensitive",
calibrate_button);
g_signal_connect (button, "toggled",
G_CALLBACK (prefs_res_source_callback),
config);
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_mnemonic (group, _("_Manually"));
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
group = gtk_radio_button_get_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);
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
if (! display_config->monitor_res_from_gdk)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
/*****************/
/* Environment */
/*****************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Environment"),
"environment.png",
GTK_TREE_STORE (tree),
_("Environment"),
"dialogs/preferences/environment.html",
NULL,
&top_iter,
page_index++);
/* Resource Consumption */
vbox2 = prefs_frame_new (_("Resource Consumption"),
GTK_CONTAINER (vbox), FALSE);
prefs_check_button_add (config, "stingy-memory-use",
_("Conservative Memory Usage"),
GTK_BOX (vbox2));
#ifdef ENABLE_MP
2003-02-13 01:11:34 +08:00
table = prefs_table_new (4, GTK_CONTAINER (vbox2), FALSE);
#else
2003-02-13 01:11:34 +08:00
table = prefs_table_new (3, GTK_CONTAINER (vbox2), FALSE);
#endif /* ENABLE_MP */
prefs_spin_button_add (config, "undo-levels", 1.0, 5.0, 0,
_("Minimal Number of Undo Levels:"),
GTK_TABLE (table), 0);
2003-02-13 01:11:34 +08:00
prefs_memsize_entry_add (config, "undo-size",
_("Maximum Undo Memory:"),
GTK_TABLE (table), 1);
prefs_memsize_entry_add (config, "tile-cache-size",
_("Tile Cache Size:"),
2003-02-13 01:11:34 +08:00
GTK_TABLE (table), 2);
#ifdef ENABLE_MP
prefs_spin_button_add (config, "num-processors", 1.0, 4.0, 0,
_("Number of Processors to Use:"),
2003-02-13 01:11:34 +08:00
GTK_TABLE (table), 3);
#endif /* ENABLE_MP */
/* File Saving */
vbox2 = prefs_frame_new (_("File Saving"), GTK_CONTAINER (vbox), FALSE);
table = prefs_table_new (2, GTK_CONTAINER (vbox2), TRUE);
prefs_boolean_option_menu_add (config, "trust-dirty-flag",
_("Only when Modified"),
_("Always"),
_("\"File -> Save\" Saves the Image:"),
GTK_TABLE (table), 0);
prefs_enum_option_menu_add (config, "thumbnail-size", 0, 0,
_("Size of Thumbnail Files:"),
GTK_TABLE (table), 1);
/*************/
/* Folders */
/*************/
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
_("Folders"),
"folders.png",
GTK_TREE_STORE (tree),
_("Folders"),
"dialogs/preferences/folders.html",
NULL,
&top_iter,
page_index++);
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
{
static const struct
{
const gchar *label;
const gchar *fs_label;
const gchar *property_name;
}
dirs[] =
{
{ N_("Temp Dir:"), N_("Select Temp Dir"), "temp-path" },
{ N_("Swap Dir:"), N_("Select Swap Dir"), "swap-path" },
};
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
table = prefs_table_new (G_N_ELEMENTS (dirs) + 1,
GTK_CONTAINER (vbox), FALSE);
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
for (i = 0; i < G_N_ELEMENTS (dirs); i++)
{
fileselection = gimp_prop_file_entry_new (config, dirs[i].property_name,
gettext (dirs[i].fs_label),
TRUE, TRUE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, i,
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
gettext (dirs[i].label), 1.0, 0.5,
fileselection, 1, FALSE);
}
}
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
/*********************/
/* Folders / <paths> */
removed gimp_config_values_equal(). 2002-11-23 Michael Natterer <mitch@gimp.org> * app/config/gimpconfig-utils.[ch]: removed gimp_config_values_equal(). * app/config/gimpconfig-serialize.c * app/config/gimpconfig.c: use g_param_values_cmp() instead so our registered compare methods are used. * app/config/gimpdisplayconfig.[ch]: added "canvas_padding_mode" and "canvas_padding_color" properties. * app/display/display-enums.[ch]: added enum GimpDisplayPaddingMode which can be one of { theme, light check, dark check, custom }. * app/display/gimpdisplay.h * app/display/gimpdisplay-handlers.c: removed cached monitor resolution values... * app/display/gimpdisplayshell.[ch]: ...and added them here. Added padding state as in GimpDisplayConfig. Added utility function gimp_display_shell_set_padding() which hides all the details. Added the new padding modes to the padding color button's context menu. * app/display/gimpdisplayshell-callbacks.[ch]: don't fiddle with colors manually but use gimp_display_shell_set_padding() in realize() and in the color button callbacks. * app/display/gimpdisplayshell-handlers.c: connect to notify::monitor-[xy]resolution and notify::canvas-padding-[mode|color] and update accordingly. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_color_button_new(). * app/widgets/gimpdialogfactory.[ch]: added gimp_dialog_factories_session_clear() (unimplemented). * app/gui/preferences-dialog.c: added widgets for padding mode and color. Removed some callbacks by connecting the functions they called directly. Cleanup.
2002-11-24 06:22:21 +08:00
/*********************/
{
static const struct
{
const gchar *tree_label;
const gchar *label;
const gchar *icon;
const gchar *help_data;
const gchar *fs_label;
const gchar *property_name;
}
paths[] =
{
{ N_("Brushes"), N_("Brush Folders"), "folders-brushes.png",
"dialogs/preferences/folders.html#brushes",
N_("Select Brush Folders"),
"brush-path" },
{ N_("Patterns"), N_("Pattern Folders"), "folders-patterns.png",
"dialogs/preferences/folders.html#patterns",
N_("Select Pattern Folders"),
"pattern-path" },
{ N_("Palettes"), N_("Palette Folders"), "folders-palettes.png",
"dialogs/preferences/folders.html#palettes",
N_("Select Palette Folders"),
"palette-path" },
{ N_("Gradients"), N_("Gradient Folders"), "folders-gradients.png",
"dialogs/preferences/folders.html#gradients",
N_("Select Gradient Folders"),
"gradient-path" },
{ N_("Plug-Ins"), N_("Plug-In Folders"), "folders-plug-ins.png",
"dialogs/preferences/folders.html#plug_ins",
N_("Select Plug-In Folders"),
"plug-in-path" },
{ N_("Tool Plug-Ins"), N_("Tool Plug-In Folders"), "folders-tool-plug-ins.png",
"dialogs/preferences/folders.html#tool_plug_ins",
N_("Select Tool Plug-In Folders"),
"tool-plug-in-path" },
{ N_("Modules"), N_("Module Folders"), "folders-modules.png",
"dialogs/preferences/folders.html#modules",
N_("Select Module Folders"),
"module-path" },
{ N_("Environment"), N_("Environment Folders"), "folders-environ.png",
"dialogs/preferences/folders.html#environ",
N_("Select Environment Folders"),
"environ-path" },
{ N_("Themes"), N_("Theme Folders"), "folders-themes.png",
"dialogs/preferences/folders.html#themes",
N_("Select Theme Folders"),
"theme-path" }
};
app/Makefile.am removed, chopped... 2001-12-07 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/devices.[ch]: removed, chopped... * app/widgets/Makefile.am * app/widgets/widgets-types.h * app/gui/Makefile.am * app/widgets/gimpdeviceinfo.[ch] * app/widgets/gimpdevices.[ch] * app/gui/device-status-dialog.[ch] * app/gui/input-dialog.[ch]: ...and added here. Made GimpToolInfo a GimpContext subclass. Create a GimpDeviceManager struct in gimpdevices.c and attach it to the Gimp instance. * app/core/gimp.[ch]: removed gimp_create_context(). It was a bad idea in the first place beause it prevented GimpContext subclasses from being be properly registered with their Gimp instance. * app/core/gimpcontext.c: moved the stuff which used to be in gimp_create_context() back here. Added a "gimp" property which must be set on construction. Added a "dispose" implementation which removes the context from it's Gimp's context_list. * app/gimprc.c * app/core/gimptoolinfo.[ch] * app/display/gimpdisplayshell-callbacks.c * app/gui/brush-select.c * app/gui/dialogs-constructors.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/gui.c * app/gui/menus.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/toolbox.c * app/tools/gimppainttool.c * app/tools/tool_manager.c * app/widgets/gimpimagedock.c: changed accordingly. * app/gui/tools-commands.[ch]: made all callback signatures the same. * app/gui/preferences-dialog.c: cleaned up the display_format_string GtkCombo code.
2001-12-08 01:39:51 +08:00
for (i = 0; i < G_N_ELEMENTS (paths); i++)
{
vbox = prefs_notebook_append_page (gimp,
GTK_NOTEBOOK (notebook),
gettext (paths[i].label),
paths[i].icon,
GTK_TREE_STORE (tree),
gettext (paths[i].tree_label),
paths[i].help_data,
&top_iter,
&child_iter,
page_index++);
patheditor = gimp_prop_path_editor_new (config, paths[i].property_name,
gettext (paths[i].fs_label));
gtk_container_add (GTK_CONTAINER (vbox), patheditor);
gtk_widget_show (patheditor);
}
}
gtk_widget_show (tv);
gtk_widget_show (notebook);
gtk_tree_view_expand_all (GTK_TREE_VIEW (tv));
return dialog;
}