gimp/libgimpwidgets/gimpcolorbutton.c

905 lines
28 KiB
C
Raw Normal View History

To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpcolorbutton.c
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* Copyright (C) 1999-2001 Sven Neumann
*
* This library is free software: you can redistribute it and/or
1999-11-18 05:13:50 +08:00
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
*
* This library 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
* Library General Public License for more details.
*
1999-11-18 05:13:50 +08:00
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
1999-11-20 09:01:25 +08:00
#include "config.h"
#include <string.h>
#include <gegl.h>
#include <gtk/gtk.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 "libgimpcolor/gimpcolor.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
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 "gimpwidgetstypes.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
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
#include "gimpcolorarea.h"
#include "gimpcolorbutton.h"
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
#include "gimpcolornotebook.h"
#include "gimpcolorselection.h"
#include "gimpdialog.h"
#include "gimphelpui.h"
#include "gimpstock.h"
#include "gimpwidgets-private.h"
#include "gimp3migration.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 "libgimp/libgimp-intl.h"
/**
* SECTION: gimpcolorbutton
* @title: GimpColorButton
* @short_description: Widget for selecting a color from a simple button.
* @see_also: #libgimpcolor-gimpcolorspace
*
* This widget provides a simple button with a preview showing the
* color.
*
* On click a color selection dialog is opened. Additionally the
* button supports Drag and Drop and has a right-click menu that
* allows one to choose the color from the current FG or BG color. If
* the user changes the color, the "color-changed" signal is emitted.
**/
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
#define COLOR_SELECTION_KEY "gimp-color-selection"
#define RESPONSE_RESET 1
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
#define TODOUBLE(i) (i / 65535.0)
#define TOUINT16(d) ((guint16) (d * 65535 + 0.5))
#define GIMP_COLOR_BUTTON_COLOR_FG "color-button-use-foreground"
#define GIMP_COLOR_BUTTON_COLOR_BG "color-button-use-background"
#define GIMP_COLOR_BUTTON_COLOR_BLACK "color-button-use-black"
#define GIMP_COLOR_BUTTON_COLOR_WHITE "color-button-use-white"
enum
{
COLOR_CHANGED,
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_TITLE,
PROP_COLOR,
PROP_TYPE,
PROP_UPDATE,
PROP_AREA_WIDTH,
PROP_AREA_HEIGHT
};
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
static void gimp_color_button_class_init (GimpColorButtonClass *klass);
static void gimp_color_button_init (GimpColorButton *button,
GimpColorButtonClass *klass);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
static void gimp_color_button_finalize (GObject *object);
static void gimp_color_button_dispose (GObject *object);
static void gimp_color_button_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_color_button_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
static gboolean gimp_color_button_button_press (GtkWidget *widget,
GdkEventButton *bevent);
static void gimp_color_button_state_changed (GtkWidget *widget,
GtkStateType prev_state);
static void gimp_color_button_clicked (GtkButton *button);
static GType gimp_color_button_get_action_type (GimpColorButton *button);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
static void gimp_color_button_dialog_response (GtkWidget *dialog,
gint response_id,
GimpColorButton *button);
static void gimp_color_button_use_color (GtkAction *action,
GimpColorButton *button);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
static void gimp_color_button_area_changed (GtkWidget *color_area,
GimpColorButton *button);
static void gimp_color_button_selection_changed (GtkWidget *selection,
GimpColorButton *button);
static void gimp_color_button_help_func (const gchar *help_id,
gpointer help_data);
static const GtkActionEntry actions[] =
{
{ "color-button-popup", NULL,
"Color Button Menu", NULL, NULL,
NULL
},
{ GIMP_COLOR_BUTTON_COLOR_FG, NULL,
N_("_Foreground Color"), NULL, NULL,
G_CALLBACK (gimp_color_button_use_color)
},
{ GIMP_COLOR_BUTTON_COLOR_BG, NULL,
N_("_Background Color"), NULL, NULL,
G_CALLBACK (gimp_color_button_use_color)
},
{ GIMP_COLOR_BUTTON_COLOR_BLACK, NULL,
N_("Blac_k"), NULL, NULL,
G_CALLBACK (gimp_color_button_use_color)
},
{ GIMP_COLOR_BUTTON_COLOR_WHITE, NULL,
N_("_White"), NULL, NULL,
G_CALLBACK (gimp_color_button_use_color)
}
};
static guint gimp_color_button_signals[LAST_SIGNAL] = { 0 };
static GimpButtonClass * parent_class = NULL;
GType
gimp_color_button_get_type (void)
{
static GType button_type = 0;
if (! button_type)
{
const GTypeInfo button_info =
{
sizeof (GimpColorButtonClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_color_button_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpColorButton),
0, /* n_preallocs */
(GInstanceInitFunc) gimp_color_button_init,
};
button_type = g_type_register_static (GIMP_TYPE_BUTTON,
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
"GimpColorButton",
&button_info, 0);
}
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
return button_type;
}
static void
gimp_color_button_class_init (GimpColorButtonClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass);
GimpRGB color;
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
parent_class = g_type_class_peek_parent (klass);
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
gimp_color_button_signals[COLOR_CHANGED] =
g_signal_new ("color-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpColorButtonClass, color_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->finalize = gimp_color_button_finalize;
object_class->dispose = gimp_color_button_dispose;
object_class->get_property = gimp_color_button_get_property;
object_class->set_property = gimp_color_button_set_property;
widget_class->button_press_event = gimp_color_button_button_press;
widget_class->state_changed = gimp_color_button_state_changed;
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
button_class->clicked = gimp_color_button_clicked;
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
klass->color_changed = NULL;
klass->get_action_type = gimp_color_button_get_action_type;
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 1.0);
/**
* GimpColorButton:title:
*
* The title to be used for the color selection dialog.
*
* Since: 2.4
*/
g_object_class_install_property (object_class, PROP_TITLE,
g_param_spec_string ("title", NULL, NULL,
NULL,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
/**
* GimpColorButton:color:
*
* The color displayed in the button's color area.
*
* Since: 2.4
*/
g_object_class_install_property (object_class, PROP_COLOR,
gimp_param_spec_rgb ("color", NULL, NULL,
added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct 2006-04-27 Sven Neumann <sven@gimp.org> * libgimpcolor/gimprgb.[ch]: added "has_alpha" to GimpParamSpecRGB. Made the GimpParamSpecRGB struct public. When validating a color, only look at the alpha channel if has_alpha is set. * libgimpconfig/gimpconfig-params.h: added "has_alpha" to GIMP_CONFIG_INSTALL_PROP_RGB macro definition. * libgimpconfig/gimpconfig-serialize.c: serialize color values as "(rgb r g b)" if the param-spec indicates that the alpha channel is meaningless. * app/config/gimpconfig-dump.c: take "has_alpha" into account when documenting color properties. * app/core/gimpcontext.c * app/core/gimpgrid.c * app/display/gimpdisplayoptions.c * app/text/gimptext.c * app/widgets/gimpaction.c * app/widgets/gimpcolorbar.c * libgimpwidgets/gimpcolorarea.c * libgimpwidgets/gimpcolorbutton.c: specify whether color properties have an alpha channel. * tools/pdbgen/app.pl: handle "has_alpha" for color paramaters. * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/grid.pdb * tools/pdbgen/pdb/image.pdb: set the "has_alpha" flag where appropriate. * app/pdb/gimp-pdb-compat.c (gimp_pdb_compat_param_spec): set "has_alpha" to TRUE for GIMP_PDB_COLOR. * app/pdb/channel_cmds.c * app/pdb/context_cmds.c * app/pdb/gradient_cmds.c * app/pdb/grid_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/selection_tools_cmds.c: regenerated. * app/config/gimpdisplayconfig.c (gimp_display_config_class_init): removed unused code.
2006-04-27 23:19:59 +08:00
TRUE, &color,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
/**
* GimpColorButton:type:
*
* The type of the button's color area.
*
* Since: 2.4
*/
g_object_class_install_property (object_class, PROP_TYPE,
g_param_spec_enum ("type", NULL, NULL,
GIMP_TYPE_COLOR_AREA_TYPE,
GIMP_COLOR_AREA_FLAT,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
/**
* GimpColorButton:continuous-update:
*
* The update policy of the color button.
*
* Since: 2.4
*/
g_object_class_install_property (object_class, PROP_UPDATE,
g_param_spec_boolean ("continuous-update",
NULL, NULL,
FALSE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
/**
* GimpColorButton:area-width:
*
* The minimum width of the button's #GimpColorArea.
*
* Since: 2.8
*/
g_object_class_install_property (object_class, PROP_AREA_WIDTH,
g_param_spec_int ("area-width",
NULL, NULL,
1, G_MAXINT, 16,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT));
/**
* GimpColorButton:area-height:
*
* The minimum height of the button's #GimpColorArea.
*
* Since: 2.8
*/
g_object_class_install_property (object_class, PROP_AREA_HEIGHT,
g_param_spec_int ("area-height",
NULL, NULL,
1, G_MAXINT, 16,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT));
}
static void
gimp_color_button_init (GimpColorButton *button,
GimpColorButtonClass *klass)
{
GtkActionGroup *group;
GtkUIManager *ui_manager;
gint i;
button->title = NULL;
button->dialog = NULL;
button->color_area = g_object_new (GIMP_TYPE_COLOR_AREA,
"drag-mask", GDK_BUTTON1_MASK,
NULL);
g_signal_connect (button->color_area, "color-changed",
G_CALLBACK (gimp_color_button_area_changed),
button);
gtk_container_add (GTK_CONTAINER (button), button->color_area);
gtk_widget_show (button->color_area);
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
/* right-click opens a popup */
button->popup_menu = ui_manager = gtk_ui_manager_new ();
group = gtk_action_group_new ("color-button");
for (i = 0; i < G_N_ELEMENTS (actions); i++)
{
const gchar *label = gettext (actions[i].label);
const gchar *tooltip = gettext (actions[i].tooltip);
GtkAction *action;
action = g_object_new (klass->get_action_type (button),
"name", actions[i].name,
"label", label,
"tooltip", tooltip,
"icon-name", actions[i].stock_id,
NULL);
if (actions[i].callback)
g_signal_connect (action, "activate",
actions[i].callback,
button);
gtk_action_group_add_action_with_accel (group, action,
actions[i].accelerator);
g_object_unref (action);
}
gtk_ui_manager_insert_action_group (ui_manager, group, -1);
g_object_unref (group);
gtk_ui_manager_add_ui_from_string
(ui_manager,
"<ui>\n"
" <popup action=\"color-button-popup\">\n"
" <menuitem action=\"" GIMP_COLOR_BUTTON_COLOR_FG "\" />\n"
" <menuitem action=\"" GIMP_COLOR_BUTTON_COLOR_BG "\" />\n"
" <separator />\n"
" <menuitem action=\"" GIMP_COLOR_BUTTON_COLOR_BLACK "\" />\n"
" <menuitem action=\"" GIMP_COLOR_BUTTON_COLOR_WHITE "\" />\n"
" </popup>\n"
"</ui>\n",
-1, NULL);
}
static void
gimp_color_button_finalize (GObject *object)
{
GimpColorButton *button = GIMP_COLOR_BUTTON (object);
if (button->title)
{
g_free (button->title);
button->title = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_color_button_dispose (GObject *object)
{
GimpColorButton *button = GIMP_COLOR_BUTTON (object);
if (button->dialog)
{
gtk_widget_destroy (button->dialog);
button->dialog = NULL;
}
if (button->color_area)
{
gtk_widget_destroy (button->color_area);
button->color_area = NULL;
}
if (button->popup_menu)
{
g_object_unref (button->popup_menu);
button->popup_menu = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_color_button_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpColorButton *button = GIMP_COLOR_BUTTON (object);
switch (property_id)
{
case PROP_TITLE:
g_value_set_string (value, button->title);
break;
case PROP_COLOR:
g_object_get_property (G_OBJECT (button->color_area), "color", value);
break;
case PROP_TYPE:
g_object_get_property (G_OBJECT (button->color_area), "type", value);
break;
case PROP_UPDATE:
g_value_set_boolean (value, button->continuous_update);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_color_button_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpColorButton *button = GIMP_COLOR_BUTTON (object);
gint other;
switch (property_id)
{
case PROP_TITLE:
g_free (button->title);
button->title = g_value_dup_string (value);
break;
case PROP_COLOR:
g_object_set_property (G_OBJECT (button->color_area), "color", value);
break;
case PROP_TYPE:
g_object_set_property (G_OBJECT (button->color_area), "type", value);
break;
case PROP_UPDATE:
gimp_color_button_set_update (button, g_value_get_boolean (value));
break;
case PROP_AREA_WIDTH:
gtk_widget_get_size_request (button->color_area, NULL, &other);
gtk_widget_set_size_request (button->color_area,
g_value_get_int (value), other);
break;
case PROP_AREA_HEIGHT:
gtk_widget_get_size_request (button->color_area, &other, NULL);
gtk_widget_set_size_request (button->color_area,
other, g_value_get_int (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static gboolean
gimp_color_button_button_press (GtkWidget *widget,
GdkEventButton *bevent)
{
GimpColorButton *button = GIMP_COLOR_BUTTON (widget);
if (gdk_event_triggers_context_menu ((GdkEvent *) bevent))
{
GtkWidget *menu = gtk_ui_manager_get_widget (button->popup_menu,
"/color-button-popup");
gtk_menu_set_screen (GTK_MENU (menu), gtk_widget_get_screen (widget));
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
gtk_menu_popup (GTK_MENU (menu),
NULL, NULL, NULL, NULL,
bevent->button, bevent->time);
}
if (GTK_WIDGET_CLASS (parent_class)->button_press_event)
return GTK_WIDGET_CLASS (parent_class)->button_press_event (widget, bevent);
return FALSE;
}
static void
gimp_color_button_state_changed (GtkWidget *widget,
GtkStateType prev_state)
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
{
g_return_if_fail (GIMP_IS_COLOR_BUTTON (widget));
if (! gtk_widget_is_sensitive (widget) && GIMP_COLOR_BUTTON (widget)->dialog)
gtk_widget_hide (GIMP_COLOR_BUTTON (widget)->dialog);
if (GTK_WIDGET_CLASS (parent_class)->state_changed)
GTK_WIDGET_CLASS (parent_class)->state_changed (widget, prev_state);
}
static void
gimp_color_button_clicked (GtkButton *button)
{
GimpColorButton *color_button = GIMP_COLOR_BUTTON (button);
if (! color_button->dialog)
{
GtkWidget *dialog;
GtkWidget *selection;
GimpRGB color;
gimp_color_button_get_color (color_button, &color);
dialog = color_button->dialog =
gimp_dialog_new (color_button->title, COLOR_SELECTION_KEY,
gtk_widget_get_toplevel (GTK_WIDGET (button)), 0,
gimp_color_button_help_func, NULL,
GIMP_STOCK_RESET, RESPONSE_RESET,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
RESPONSE_RESET,
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
g_signal_connect (dialog, "response",
G_CALLBACK (gimp_color_button_dialog_response),
color_button);
g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed),
&color_button->dialog);
selection = gimp_color_selection_new ();
gtk_container_set_border_width (GTK_CONTAINER (selection), 6);
gimp_color_selection_set_show_alpha (GIMP_COLOR_SELECTION (selection),
gimp_color_button_has_alpha (color_button));
gimp_color_selection_set_color (GIMP_COLOR_SELECTION (selection), &color);
gimp_color_selection_set_old_color (GIMP_COLOR_SELECTION (selection),
&color);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
selection, TRUE, TRUE, 0);
gtk_widget_show (selection);
g_signal_connect (selection, "color-changed",
G_CALLBACK (gimp_color_button_selection_changed),
button);
g_object_set_data (G_OBJECT (color_button->dialog), COLOR_SELECTION_KEY,
selection);
}
gtk_window_present (GTK_WINDOW (color_button->dialog));
}
static GType
gimp_color_button_get_action_type (GimpColorButton *button)
{
return GTK_TYPE_ACTION;
}
/* public functions */
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
/**
* gimp_color_button_new:
* @title: String that will be used as title for the color_selector.
* @width: Width of the colorpreview in pixels.
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* @height: Height of the colorpreview in pixels.
* @color: A pointer to a #GimpRGB color.
* @type: The type of transparency to be displayed.
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
*
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* Creates a new #GimpColorButton widget.
*
* This returns a button with a preview showing the color.
* When the button is clicked a GtkColorSelectionDialog is opened.
* If the user changes the color the new color is written into the
* array that was used to pass the initial color and the "color-changed"
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* signal is emitted.
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
*
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* Returns: Pointer to the new #GimpColorButton widget.
**/
GtkWidget *
gimp_color_button_new (const gchar *title,
gint width,
gint height,
const GimpRGB *color,
GimpColorAreaType type)
{
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
g_return_val_if_fail (color != NULL, NULL);
g_return_val_if_fail (width > 0, NULL);
g_return_val_if_fail (height > 0, NULL);
return g_object_new (GIMP_TYPE_COLOR_BUTTON,
"title", title,
"type", type,
"color", color,
"area-width", width,
"area-height", height,
NULL);
}
/**
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* gimp_color_button_set_color:
* @button: Pointer to a #GimpColorButton.
* @color: Pointer to the new #GimpRGB color.
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
*
* Sets the @button to the given @color.
**/
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
void
gimp_color_button_set_color (GimpColorButton *button,
const GimpRGB *color)
{
g_return_if_fail (GIMP_IS_COLOR_BUTTON (button));
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
g_return_if_fail (color != NULL);
gimp_color_area_set_color (GIMP_COLOR_AREA (button->color_area), color);
g_object_notify (G_OBJECT (button), "color");
}
/**
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* gimp_color_button_get_color:
* @button: Pointer to a #GimpColorButton.
* @color: Pointer to a #GimpRGB struct used to return the color.
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
*
* Retrieves the currently set color from the @button.
**/
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
void
gimp_color_button_get_color (GimpColorButton *button,
GimpRGB *color)
{
g_return_if_fail (GIMP_IS_COLOR_BUTTON (button));
g_return_if_fail (color != NULL);
gimp_color_area_get_color (GIMP_COLOR_AREA (button->color_area), color);
}
/**
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
* gimp_color_button_has_alpha:
* @button: Pointer to a #GimpColorButton.
*
* Checks whether the @buttons shows transparency information.
*
* Returns: %TRUE if the @button shows transparency information, %FALSE
* otherwise.
**/
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
gboolean
gimp_color_button_has_alpha (GimpColorButton *button)
{
g_return_val_if_fail (GIMP_IS_COLOR_BUTTON (button), FALSE);
return gimp_color_area_has_alpha (GIMP_COLOR_AREA (button->color_area));
}
/**
* gimp_color_button_set_type:
* @button: Pointer to a #GimpColorButton.
* @type: the new #GimpColorAreaType
*
* Sets the @button to the given @type. See also gimp_color_area_set_type().
**/
void
gimp_color_button_set_type (GimpColorButton *button,
GimpColorAreaType type)
{
g_return_if_fail (GIMP_IS_COLOR_BUTTON (button));
gimp_color_area_set_type (GIMP_COLOR_AREA (button->color_area), type);
g_object_notify (G_OBJECT (button), "type");
}
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
/**
* gimp_color_button_get_update:
* @button: A #GimpColorButton widget.
*
* Returns the color button's @continuous_update property.
*
* Return value: the @continuous_update property.
**/
gboolean
gimp_color_button_get_update (GimpColorButton *button)
{
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
g_return_val_if_fail (GIMP_IS_COLOR_BUTTON (button), FALSE);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
return button->continuous_update;
}
/**
* gimp_color_button_set_update:
* @button: A #GimpColorButton widget.
* @continuous: The new setting of the @continuous_update property.
*
* When set to #TRUE, the @button will emit the "color-changed"
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
* continuously while the color is changed in the color selection
* dialog.
**/
void
gimp_color_button_set_update (GimpColorButton *button,
gboolean continuous)
{
g_return_if_fail (GIMP_IS_COLOR_BUTTON (button));
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
if (continuous != button->continuous_update)
{
button->continuous_update = continuous ? TRUE : FALSE;
if (button->dialog)
{
GimpColorSelection *selection;
GimpRGB color;
selection = g_object_get_data (G_OBJECT (button->dialog),
COLOR_SELECTION_KEY);
if (button->continuous_update)
{
gimp_color_selection_get_color (selection, &color);
gimp_color_button_set_color (button, &color);
}
else
{
gimp_color_selection_get_old_color (selection, &color);
gimp_color_button_set_color (button, &color);
}
}
g_object_notify (G_OBJECT (button), "continuous-update");
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
}
}
/* private functions */
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
static void
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gimp_color_button_dialog_response (GtkWidget *dialog,
gint response_id,
GimpColorButton *button)
{
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
GtkWidget *selection;
GimpRGB color;
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
selection = g_object_get_data (G_OBJECT (dialog), COLOR_SELECTION_KEY);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
switch (response_id)
{
case RESPONSE_RESET:
gimp_color_selection_reset (GIMP_COLOR_SELECTION (selection));
break;
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
case GTK_RESPONSE_OK:
if (! button->continuous_update)
{
gimp_color_selection_get_color (GIMP_COLOR_SELECTION (selection),
&color);
gimp_color_button_set_color (button, &color);
}
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gtk_widget_hide (dialog);
break;
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
default:
if (button->continuous_update)
{
gimp_color_selection_get_old_color (GIMP_COLOR_SELECTION (selection),
&color);
gimp_color_button_set_color (button, &color);
}
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gtk_widget_hide (dialog);
break;
}
}
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
static void
gimp_color_button_use_color (GtkAction *action,
GimpColorButton *button)
{
const gchar *name;
GimpRGB color;
name = gtk_action_get_name (action);
gimp_color_button_get_color (button, &color);
if (! strcmp (name, GIMP_COLOR_BUTTON_COLOR_FG))
{
if (_gimp_get_foreground_func)
_gimp_get_foreground_func (&color);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
else
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 1.0);
}
else if (! strcmp (name, GIMP_COLOR_BUTTON_COLOR_BG))
{
if (_gimp_get_background_func)
_gimp_get_background_func (&color);
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
else
gimp_rgba_set (&color, 1.0, 1.0, 1.0, 1.0);
}
else if (! strcmp (name, GIMP_COLOR_BUTTON_COLOR_BLACK))
{
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gimp_rgba_set (&color, 0.0, 0.0, 0.0, 1.0);
}
else if (! strcmp (name, GIMP_COLOR_BUTTON_COLOR_WHITE))
{
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gimp_rgba_set (&color, 1.0, 1.0, 1.0, 1.0);
}
gimp_color_button_set_color (button, &color);
}
static void
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gimp_color_button_area_changed (GtkWidget *color_area,
GimpColorButton *button)
{
if (button->dialog)
{
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
GimpColorSelection *selection;
GimpRGB color;
selection = g_object_get_data (G_OBJECT (button->dialog),
COLOR_SELECTION_KEY);
finished new GimpColorArea widget which uses GimpRGB and handles DND and 2001-01-10 Sven Neumann <sven@gimp.org> * libgimp/gimpcolorarea.[ch]: finished new GimpColorArea widget which uses GimpRGB and handles DND and alpha channel. * libgimp/gimpcolorbutton.[ch]: use GimpColorArea. The API of the GimpColorButton has changed! * libgimp/gimpwidgets.[ch]: added temporary function gimp_color_update_uchar() to ease migration of plug-ins to GimpRGB. This function will go away. * plug-ins/Lighting/lighting_main.h * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_main.h * plug-ins/MapObject/mapobject_ui.c * plug-ins/common/colorify.c * plug-ins/common/colortoalpha.c * plug-ins/common/exchange.c * plug-ins/common/film.c * plug-ins/common/grid.c * plug-ins/common/mapcolor.c * plug-ins/common/nova.c * plug-ins/common/papertile.c * plug-ins/common/sinus.c * plug-ins/gdyntext/gdyntext_ui.c * plug-ins/ifscompose/ifscompose.[ch] * plug-ins/ifscompose/ifscompose_storage.c * plug-ins/ifscompose/ifscompose_utils.c * plug-ins/script-fu/script-fu-scripts.c: use new GimpColorArea and GimpColorButton. Started to introduce GimpRGB color type. This change might have broken some of these plug-ins. This is work in progress. * libgimp/Makefile.am: added GimpColorArea and GimpColorButton to libgimpi. * app/gimpcontext.[ch]: added gimp_palette_get_[fore|back]ground() functions so the app can link against libgimp/gimpcolorbutton.o. These functions will go away. * app/gimpdnd.c: use a GimpColorArea for DND
2001-01-11 06:49:45 +08:00
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gimp_color_button_get_color (button, &color);
To be multihead safe, each new window or menu needs to be associated with 2003-11-08 Michael Natterer <mitch@gimp.org> To be multihead safe, each new window or menu needs to be associated with a GdkScreen or it will pop up on the default screen. * libgimpwidgets/gimpquerybox.[ch] * app/display/gimpdisplayshell-layer-select.[ch] * app/widgets/widgets-types.h * app/widgets/gimpitemfactory.[ch] * app/widgets/gimpitemtreeview.[ch] * app/widgets/gimptemplateview.[ch] * app/widgets/gimptooldialog.[ch] * app/widgets/gimpviewabledialog.[ch] * app/gui/channels-commands.[ch] * app/gui/color-notebook.[ch] * app/gui/convert-dialog.[ch] * app/gui/edit-commands.[ch] * app/gui/grid-dialog.[ch] * app/gui/image-commands.[ch] * app/gui/info-dialog.[ch] * app/gui/layers-commands.[ch] * app/gui/offset-dialog.[ch] * app/gui/resize-dialog.[ch] * app/gui/stroke-dialog.[ch] * app/gui/templates-commands.[ch] * app/gui/vectors-commands.[ch]: added "GtkWidget *parent" paramaters to all functions which create menus, popups or windows and pass "parent" to gimp_dialog_new() or one of the various wrappers around it. As a side effect, this fixes bug #61092. * app/widgets/gimpdialogfactory.[ch]: added "GdkScreen *screen" instead of "parent" here since there are no possible parent windows on startup. * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_origin_button_press): added a quick hack to send a display to another screen: click the origin button with the middle mouse button. * app/display/gimpdisplayshell.c (gimp_display_shell_screen_changed): don't chain up undonditionally (don't crash). * libgimpwidgets/gimpdialog.c (gimp_dialog_new_valist): set the dialog's screen from a non-GtkWidget parent widget. The rest of non-window parent widget handling is still unimplemented. * libgimpwidgets/gimpcolorbutton.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponenteditor.c * app/widgets/gimpcontainereditor.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerpopup.c * app/widgets/gimpcontainertreeview.c * app/widgets/gimpdatafactoryview.c * app/widgets/gimpdevicestatus.c * app/widgets/gimpdockable.c * app/widgets/gimpdrawabletreeview.c * app/widgets/gimperrorconsole.c * app/widgets/gimpgradienteditor.c * app/widgets/gimphelp.c * app/widgets/gimppaletteeditor.c * app/widgets/gimppreview-popup.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpsessioninfo.c * app/widgets/gimptoolbox-color-area.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c * app/widgets/gimptooloptionseditor.c * app/widgets/gimpvectorstreeview.c * app/widgets/gimpwidgets-utils.c * app/display/gimpdisplayshell-scale.c * app/display/gimpnavigationview.c * app/gui/module-browser.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/drawable-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor-commands.c * app/gui/gui-vtable.c * app/gui/gui.c * app/gui/info-window.c * app/gui/palette-import-dialog.c * app/gui/palettes-commands.c * app/gui/qmask-commands.c * app/gui/select-commands.c * app/gui/tool-options-commands.c * app/gui/view-commands.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptransformtool.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c: changed accordingly. Changed all menu_position funcs to place the menu on the right screen.
2003-11-08 23:32:38 +08:00
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
g_signal_handlers_block_by_func (selection,
gimp_color_button_selection_changed,
button);
app/gimpprogress.c app/nav_window.c app/ops_buttons.c app/undo_history.c 2001-12-29 Michael Natterer <mitch@gimp.org> * app/gimpprogress.c * app/nav_window.c * app/ops_buttons.c * app/undo_history.c * app/display/gimpdisplayshell.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/channels-commands.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/color-select.c * app/gui/colormap-dialog.c * app/gui/convert-dialog.c * app/gui/device-status-dialog.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/info-dialog.c * app/gui/layers-commands.c * app/gui/module-browser.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/paths-dialog.c * app/gui/qmask-commands.c * app/gui/resize-dialog.c * app/gui/resolution-calibrate-dialog.c * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/toolbox.c * app/gui/user-install-dialog.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpposterizetool.c * app/tools/gimprotatetool.c * app/tools/gimpthresholdtool.c * app/tools/paint_options.c * app/tools/selection_options.c * app/widgets/gimpchannellistview.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcomponentlistitem.c * app/widgets/gimpconstrainedhwrapbox.c * app/widgets/gimpcontainergridview.c * app/widgets/gimpcontainerlistview.c * app/widgets/gimpcontainermenuimpl.c * app/widgets/gimpdialogfactory.c * app/widgets/gimpdnd.c * app/widgets/gimpdock.c * app/widgets/gimpdockbook.c * app/widgets/gimpdrawablelistitem.c * app/widgets/gimpdrawablelistview.c * app/widgets/gimpfontselection-dialog.c * app/widgets/gimphistogramview.c * app/widgets/gimpitemfactory.c * app/widgets/gimplayerlistitem.c * app/widgets/gimplistitem.[ch] * app/widgets/gimpmenuitem.c * app/widgets/gimppreview.[ch] * app/widgets/gtkhwrapbox.c * app/widgets/gtkvwrapbox.c * app/widgets/gtkwrapbox.c * libgimp/gimpbrushmenu.c * libgimp/gimpexport.c * libgimp/gimpgradientmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimpwidgets/gimpbutton.c * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.h * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpfileselection.c * libgimpwidgets/gimphelpui.c * libgimpwidgets/gimpoffsetarea.c * libgimpwidgets/gimppatheditor.c * libgimpwidgets/gimppixmap.h * libgimpwidgets/gimpquerybox.c * libgimpwidgets/gimpstock.[ch] * libgimpwidgets/gimpwidgets.h * plug-ins/FractalExplorer/Dialogs.c * plug-ins/FractalExplorer/Events.c * plug-ins/FractalExplorer/FractalExplorer.c * plug-ins/Lighting/lighting_ui.c * plug-ins/MapObject/mapobject_ui.c * plug-ins/bmp/bmpwrite.c * plug-ins/dbbrowser/dbbrowser_utils.c * plug-ins/fits/fits.c * plug-ins/flame/flame.c * plug-ins/fp/fp_gtk.c * plug-ins/fp/fp_misc.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/gfli/gfli.c * plug-ins/gimpressionist/*.c * plug-ins/imagemap/*.[ch] * plug-ins/maze/maze_face.c * plug-ins/mosaic/mosaic.c * plug-ins/pagecurl/pagecurl.c * plug-ins/print/print_gimp.h * plug-ins/rcm/rcm_callback.c * plug-ins/rcm/rcm_dialog.c * plug-ins/rcm/rcm_misc.c * plug-ins/script-fu/script-fu-console.c * plug-ins/script-fu/script-fu-scripts.c * plug-ins/script-fu/script-fu-server.c * plug-ins/sel2path/sel2path.c * plug-ins/sel2path/sel2path_adv_dialog.c * plug-ins/sgi/sgi.c * plug-ins/webbrowser/webbrowser.c * plug-ins/xjt/xjt.c * plug-ins/common/[A-n]*.c: compile with GTK_DISABLE_DEPRECATED defined. Not everything is fully ported yet, had to #undef GTK_DISABLE_DEPRECATED in many places and added #warnings when doing so. * pixmaps/Makefile.am * pixmaps/chain.xpm: removed. * themes/Default/Makefile.am * themes/Default/images/Makefile.am * themes/Default/images/stock-button-hchain-broken.png * themes/Default/images/stock-button-hchain.png * themes/Default/images/stock-button-vchain-broken.png * themes/Default/images/stock-button-vchain.png: new stock icons.
2001-12-29 21:26:29 +08:00
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gimp_color_selection_set_color (selection, &color);
g_signal_handlers_unblock_by_func (selection,
gimp_color_button_selection_changed,
button);
}
g_signal_emit (button, gimp_color_button_signals[COLOR_CHANGED], 0);
}
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
static void
gimp_color_button_selection_changed (GtkWidget *selection,
GimpColorButton *button)
{
if (button->continuous_update)
{
GimpRGB color;
gimp_color_selection_get_color (GIMP_COLOR_SELECTION (selection), &color);
g_signal_handlers_block_by_func (button->color_area,
gimp_color_button_area_changed,
button);
gimp_color_area_set_color (GIMP_COLOR_AREA (button->color_area), &color);
g_signal_handlers_unblock_by_func (button->color_area,
gimp_color_button_area_changed,
button);
g_signal_emit (button, gimp_color_button_signals[COLOR_CHANGED], 0);
}
}
static void
gimp_color_button_help_func (const gchar *help_id,
gpointer help_data)
{
GimpColorSelection *selection;
GimpColorNotebook *notebook;
selection = g_object_get_data (G_OBJECT (help_data), COLOR_SELECTION_KEY);
notebook = GIMP_COLOR_NOTEBOOK (selection->notebook);
help_id = GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_id;
added new API gimp_color_button_[get|set]_update() which configures the 2003-11-11 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpcolorbutton.[ch]: added new API gimp_color_button_[get|set]_update() which configures the button to emit "color_changed" continuously while the color in the color selection dialog is being changed. Fixes bug #90091. Renamed GimpColorButton struct member "GtkItemFactory *item_factory" to a /*< private >*/ member named "gpointer popup_menu". This is ugly but fixes bug #125115, * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c * app/widgets/gimpcolorpanel.c: changed accordingly. * libgimpwidgets/gimpcolorbutton.c: use a GimpColorSelection with a handmade GimpDialog instead of GtkColorSelectionDialog. Enabled module loading for plug-ins so the color selection can show the color selectors which are implemented in modules: * libgimpwidgets/gimpwidgets-private.[ch]: added GimpEnsureModlesFunc which can be called by modules users. * app/gui/gui.c (gui_libs_init): pass NULL as GimpEnsureModulesFunc since the core loads the modules itself. * libgimp/gimpui.c (gimp_ui_init): pass new private function gimp_ensure_modules() which will load the modules upon first invocation. * libgimp/Makefile.am: link libgimpui against libgimpmodule. * libgimpwidgets/gimpcolorselection.c: call _gimp_ensure_modules_func() if it is non-NULL so color selector modules are available for plug-ins. * tools/pdbgen/pdb/gimprc.pdb: added new PDB wrapper gimp_get_module_load_inhibit(). * app/pdb/gimprc_cmds.c * app/pdb/internal_procs.c * libgimp/gimpgimprc_pdb.[ch]: regenerated.
2003-11-12 01:55:45 +08:00
gimp_standard_help_func (help_id, NULL);
}