Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* color_notebook module (C) 1998 Austin Donnelly <austin@greenend.org.uk>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2001-01-09 09:23:54 +08:00
|
|
|
|
1999-06-07 03:44:36 +08:00
|
|
|
#include "config.h"
|
1999-07-03 16:27:30 +08:00
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
1999-03-07 20:56:03 +08:00
|
|
|
#include <string.h>
|
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2001-01-09 09:23:54 +08:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2001-01-24 07:56:18 +08:00
|
|
|
#include "libgimpcolor/gimpcolor.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2001-08-17 22:27:31 +08:00
|
|
|
#include "gui-types.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
#include "widgets/gimpviewabledialog.h"
|
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
#include "color-history.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "color-notebook.h"
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-05-27 09:30:21 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
#define COLOR_AREA_SIZE 20
|
|
|
|
|
2001-01-08 13:00:22 +08:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
UPDATE_NOTEBOOK = 1 << 0,
|
2001-01-09 09:23:54 +08:00
|
|
|
UPDATE_CHANNEL = 1 << 1,
|
2002-10-28 21:19:02 +08:00
|
|
|
UPDATE_SCALES = 1 << 2,
|
2002-10-29 04:13:17 +08:00
|
|
|
UPDATE_ORIG_COLOR = 1 << 3,
|
|
|
|
UPDATE_NEW_COLOR = 1 << 4,
|
2002-10-28 21:19:02 +08:00
|
|
|
UPDATE_CALLER = 1 << 5
|
2001-01-08 13:00:22 +08:00
|
|
|
} ColorNotebookUpdateType;
|
|
|
|
|
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
struct _ColorNotebook
|
|
|
|
{
|
|
|
|
GtkWidget *shell;
|
2002-10-29 04:13:17 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
GtkWidget *notebook;
|
2002-10-29 04:13:17 +08:00
|
|
|
GtkWidget *scales;
|
2001-01-09 09:23:54 +08:00
|
|
|
|
|
|
|
GtkWidget *new_color;
|
|
|
|
GtkWidget *orig_color;
|
2001-01-16 08:02:17 +08:00
|
|
|
GtkWidget *history[COLOR_HISTORY_SIZE];
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
GimpHSV hsv;
|
|
|
|
GimpRGB rgb;
|
2001-01-15 09:48:53 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
GimpRGB orig_rgb;
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2002-10-20 18:14:17 +08:00
|
|
|
GimpColorSelectorChannel active_channel;
|
2001-01-09 09:23:54 +08:00
|
|
|
|
|
|
|
ColorNotebookCallback callback;
|
|
|
|
gpointer client_data;
|
|
|
|
|
2001-01-09 12:01:20 +08:00
|
|
|
gboolean wants_updates;
|
|
|
|
gboolean show_alpha;
|
2001-01-09 09:23:54 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
static ColorNotebook *
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_new_internal (GimpViewable *viewable,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *wmclass_name,
|
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *desc,
|
|
|
|
const GimpRGB *color,
|
|
|
|
ColorNotebookCallback callback,
|
|
|
|
gpointer client_data,
|
|
|
|
gboolean wants_updates,
|
|
|
|
gboolean show_alpha);
|
|
|
|
|
|
|
|
static void color_notebook_help_func (const gchar *help_data);
|
|
|
|
|
|
|
|
static void color_notebook_ok_callback (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp);
|
|
|
|
static void color_notebook_cancel_callback (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp);
|
|
|
|
|
|
|
|
static void color_notebook_update (ColorNotebook *cnp,
|
|
|
|
ColorNotebookUpdateType update);
|
|
|
|
|
|
|
|
static void color_notebook_reset_clicked (ColorNotebook *cnp);
|
|
|
|
static void color_notebook_new_color_changed (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp);
|
|
|
|
|
2002-10-29 20:49:02 +08:00
|
|
|
static void color_notebook_notebook_changed (GimpColorSelector *selector,
|
2002-10-29 04:13:17 +08:00
|
|
|
const GimpRGB *rgb,
|
|
|
|
const GimpHSV *hsv,
|
|
|
|
ColorNotebook *cnp);
|
2002-10-29 20:49:02 +08:00
|
|
|
static void color_notebook_switch_page (GtkWidget *widget,
|
2002-10-29 04:13:17 +08:00
|
|
|
GtkNotebookPage *page,
|
|
|
|
guint page_num,
|
|
|
|
ColorNotebook *cnp);
|
|
|
|
|
|
|
|
static void color_notebook_channel_changed (GimpColorSelector *selector,
|
|
|
|
GimpColorSelectorChannel channel,
|
|
|
|
ColorNotebook *cnp);
|
|
|
|
static void color_notebook_scales_changed (GimpColorSelector *selector,
|
|
|
|
const GimpRGB *rgb,
|
|
|
|
const GimpHSV *hsv,
|
|
|
|
ColorNotebook *cnp);
|
|
|
|
|
|
|
|
static void color_history_color_clicked (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp);
|
|
|
|
static void color_history_color_changed (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void color_history_add_clicked (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
static GList *color_notebooks = NULL;
|
2001-01-16 08:02:17 +08:00
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
/* public functions */
|
|
|
|
|
2000-02-14 07:42:19 +08:00
|
|
|
ColorNotebook *
|
2001-01-21 21:41:07 +08:00
|
|
|
color_notebook_new (const gchar *title,
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
const GimpRGB *color,
|
|
|
|
ColorNotebookCallback callback,
|
|
|
|
gpointer client_data,
|
|
|
|
gboolean wants_updates,
|
|
|
|
gboolean show_alpha)
|
|
|
|
{
|
|
|
|
return color_notebook_new_internal (NULL,
|
|
|
|
title,
|
|
|
|
"color_selection",
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
color,
|
|
|
|
callback, client_data,
|
|
|
|
wants_updates, show_alpha);
|
|
|
|
}
|
|
|
|
|
|
|
|
ColorNotebook *
|
|
|
|
color_notebook_viewable_new (GimpViewable *viewable,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *desc,
|
|
|
|
const GimpRGB *color,
|
|
|
|
ColorNotebookCallback callback,
|
|
|
|
gpointer client_data,
|
|
|
|
gboolean wants_updates,
|
|
|
|
gboolean show_alpha)
|
|
|
|
{
|
|
|
|
return color_notebook_new_internal (viewable,
|
|
|
|
title,
|
|
|
|
"color_selection",
|
|
|
|
stock_id,
|
|
|
|
desc,
|
|
|
|
color,
|
|
|
|
callback, client_data,
|
|
|
|
wants_updates, show_alpha);
|
|
|
|
}
|
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
void
|
|
|
|
color_notebook_free (ColorNotebook *cnp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (cnp != NULL);
|
|
|
|
|
|
|
|
color_notebooks = g_list_remove (color_notebooks, cnp);
|
|
|
|
|
|
|
|
gtk_widget_destroy (cnp->shell);
|
|
|
|
|
|
|
|
g_free (cnp);
|
|
|
|
}
|
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
void
|
|
|
|
color_notebook_set_viewable (ColorNotebook *cnb,
|
|
|
|
GimpViewable *viewable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (cnb != NULL);
|
|
|
|
|
|
|
|
if (GIMP_IS_VIEWABLE_DIALOG (cnb->shell))
|
|
|
|
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (cnb->shell),
|
|
|
|
viewable);
|
|
|
|
}
|
|
|
|
|
2002-09-08 17:26:45 +08:00
|
|
|
void
|
|
|
|
color_notebook_set_title (ColorNotebook *cnb,
|
|
|
|
const gchar *title)
|
|
|
|
{
|
|
|
|
g_return_if_fail (cnb != NULL);
|
|
|
|
g_return_if_fail (title != NULL);
|
|
|
|
|
|
|
|
gtk_window_set_title (GTK_WINDOW (cnb->shell), title);
|
|
|
|
}
|
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
void
|
|
|
|
color_notebook_set_color (ColorNotebook *cnp,
|
|
|
|
const GimpRGB *color)
|
|
|
|
{
|
|
|
|
g_return_if_fail (cnp != NULL);
|
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
cnp->rgb = *color;
|
|
|
|
cnp->orig_rgb = *color;
|
|
|
|
|
|
|
|
gimp_rgb_to_hsv (&cnp->rgb, &cnp->hsv);
|
|
|
|
|
|
|
|
color_notebook_update (cnp,
|
|
|
|
UPDATE_NOTEBOOK |
|
|
|
|
UPDATE_SCALES |
|
|
|
|
UPDATE_ORIG_COLOR |
|
|
|
|
UPDATE_NEW_COLOR);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
color_notebook_get_color (ColorNotebook *cnp,
|
|
|
|
GimpRGB *color)
|
|
|
|
{
|
|
|
|
g_return_if_fail (cnp != NULL);
|
|
|
|
g_return_if_fail (color != NULL);
|
|
|
|
|
|
|
|
*color = cnp->rgb;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
color_notebook_show (ColorNotebook *cnp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (cnp != NULL);
|
|
|
|
|
|
|
|
gtk_window_present (GTK_WINDOW (cnp->shell));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
color_notebook_hide (ColorNotebook *cnp)
|
|
|
|
{
|
|
|
|
g_return_if_fail (cnp != NULL);
|
|
|
|
|
|
|
|
gtk_widget_hide (cnp->shell);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
static ColorNotebook *
|
|
|
|
color_notebook_new_internal (GimpViewable *viewable,
|
|
|
|
const gchar *title,
|
|
|
|
const gchar *wmclass_name,
|
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *desc,
|
|
|
|
const GimpRGB *color,
|
|
|
|
ColorNotebookCallback callback,
|
|
|
|
gpointer client_data,
|
|
|
|
gboolean wants_updates,
|
|
|
|
gboolean show_alpha)
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
{
|
2002-10-28 21:19:02 +08:00
|
|
|
ColorNotebook *cnp;
|
|
|
|
GtkWidget *main_vbox;
|
|
|
|
GtkWidget *main_hbox;
|
|
|
|
GtkWidget *left_vbox;
|
|
|
|
GtkWidget *right_vbox;
|
|
|
|
GtkWidget *color_frame;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *image;
|
|
|
|
GtkWidget *arrow;
|
|
|
|
gint i;
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2001-01-15 09:48:53 +08:00
|
|
|
g_return_val_if_fail (color != NULL, NULL);
|
|
|
|
|
2001-01-08 13:00:22 +08:00
|
|
|
cnp = g_new0 (ColorNotebook, 1);
|
|
|
|
|
1999-09-28 01:58:10 +08:00
|
|
|
cnp->callback = callback;
|
|
|
|
cnp->client_data = client_data;
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
cnp->wants_updates = wants_updates;
|
2001-01-09 12:01:20 +08:00
|
|
|
cnp->show_alpha = show_alpha;
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2001-01-16 02:29:48 +08:00
|
|
|
cnp->rgb = *color;
|
|
|
|
cnp->orig_rgb = *color;
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2002-10-28 21:19:02 +08:00
|
|
|
gimp_rgb_to_hsv (&cnp->rgb, &cnp->hsv);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
if (desc)
|
|
|
|
{
|
|
|
|
cnp->shell = gimp_viewable_dialog_new (viewable,
|
|
|
|
title, wmclass_name,
|
|
|
|
stock_id, desc,
|
|
|
|
color_notebook_help_func,
|
|
|
|
(const gchar *) cnp,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_window_set_resizable (GTK_WINDOW (cnp->shell), FALSE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cnp->shell = gimp_dialog_new (title, wmclass_name,
|
|
|
|
color_notebook_help_func,
|
|
|
|
(const gchar *) cnp,
|
|
|
|
GTK_WIN_POS_NONE,
|
|
|
|
FALSE, TRUE, TRUE,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2002-11-18 03:59:18 +08:00
|
|
|
gimp_dialog_create_action_area (GIMP_DIALOG (cnp->shell),
|
2001-05-30 08:20:48 +08:00
|
|
|
|
2002-11-18 03:59:18 +08:00
|
|
|
GTK_STOCK_CANCEL,
|
|
|
|
color_notebook_cancel_callback,
|
|
|
|
cnp, NULL, NULL, FALSE, TRUE,
|
2001-05-30 08:20:48 +08:00
|
|
|
|
2002-11-18 03:59:18 +08:00
|
|
|
GTK_STOCK_OK,
|
|
|
|
color_notebook_ok_callback,
|
|
|
|
cnp, NULL, NULL, TRUE, FALSE,
|
2002-11-01 06:36:46 +08:00
|
|
|
|
2002-11-18 03:59:18 +08:00
|
|
|
NULL);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2001-05-30 08:20:48 +08:00
|
|
|
main_vbox = gtk_vbox_new (FALSE, 4);
|
2002-11-18 03:59:18 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 4);
|
2001-01-16 08:02:17 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (cnp->shell)->vbox), main_vbox);
|
|
|
|
gtk_widget_show (main_vbox);
|
|
|
|
|
2001-05-30 08:20:48 +08:00
|
|
|
main_hbox = gtk_hbox_new (FALSE, 4);
|
2001-01-16 08:02:17 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (main_vbox), main_hbox);
|
2001-01-08 13:00:22 +08:00
|
|
|
gtk_widget_show (main_hbox);
|
|
|
|
|
2001-05-30 08:20:48 +08:00
|
|
|
/* The left vbox with the notebook */
|
|
|
|
left_vbox = gtk_vbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_hbox), left_vbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (left_vbox);
|
|
|
|
|
|
|
|
/* The right vbox with color areas and color space sliders */
|
|
|
|
right_vbox = gtk_vbox_new (FALSE, 4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_hbox), right_vbox, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (right_vbox);
|
|
|
|
|
2002-10-29 20:49:02 +08:00
|
|
|
cnp->notebook = gimp_color_selector_new (GIMP_TYPE_COLOR_NOTEBOOK,
|
|
|
|
&cnp->rgb,
|
|
|
|
&cnp->hsv,
|
|
|
|
cnp->active_channel);
|
2002-11-05 08:02:56 +08:00
|
|
|
gimp_color_selector_set_toggles_visible (GIMP_COLOR_SELECTOR (cnp->notebook),
|
|
|
|
FALSE);
|
2002-10-29 20:49:02 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (left_vbox), cnp->notebook, TRUE, TRUE, 0);
|
2002-10-28 21:19:02 +08:00
|
|
|
gtk_widget_show (cnp->notebook);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2002-10-28 21:19:02 +08:00
|
|
|
g_signal_connect (G_OBJECT (cnp->notebook), "color_changed",
|
2002-10-29 04:13:17 +08:00
|
|
|
G_CALLBACK (color_notebook_notebook_changed),
|
2002-10-28 21:19:02 +08:00
|
|
|
cnp);
|
2002-10-29 20:49:02 +08:00
|
|
|
g_signal_connect (G_OBJECT (GIMP_COLOR_NOTEBOOK (cnp->notebook)->notebook),
|
|
|
|
"switch_page",
|
|
|
|
G_CALLBACK (color_notebook_switch_page),
|
|
|
|
cnp);
|
2002-10-20 18:14:17 +08:00
|
|
|
|
2001-05-30 08:20:48 +08:00
|
|
|
/* The table for the color_areas */
|
2002-10-31 21:55:49 +08:00
|
|
|
table = gtk_table_new (2, 3, FALSE);
|
2001-05-30 08:20:48 +08:00
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 1);
|
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 3);
|
|
|
|
gtk_box_pack_start (GTK_BOX (left_vbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
2001-01-08 13:00:22 +08:00
|
|
|
|
2001-05-30 08:20:48 +08:00
|
|
|
/* The new color area */
|
|
|
|
color_frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (color_frame), GTK_SHADOW_IN);
|
2001-12-29 21:26:29 +08:00
|
|
|
gtk_widget_set_size_request (color_frame, -1, COLOR_AREA_SIZE);
|
2001-05-30 08:20:48 +08:00
|
|
|
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
|
|
|
_("Current:"), 1.0, 0.5,
|
|
|
|
color_frame, 1, FALSE);
|
|
|
|
|
|
|
|
cnp->new_color =
|
|
|
|
gimp_color_area_new (&cnp->rgb,
|
|
|
|
show_alpha ?
|
|
|
|
GIMP_COLOR_AREA_SMALL_CHECKS : GIMP_COLOR_AREA_FLAT,
|
|
|
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK);
|
|
|
|
gtk_container_add (GTK_CONTAINER (color_frame), cnp->new_color);
|
|
|
|
gtk_widget_show (cnp->new_color);
|
|
|
|
|
2001-08-10 00:39:08 +08:00
|
|
|
g_signal_connect (G_OBJECT (cnp->new_color), "color_changed",
|
2002-10-29 04:13:17 +08:00
|
|
|
G_CALLBACK (color_notebook_new_color_changed),
|
2001-08-10 00:39:08 +08:00
|
|
|
cnp);
|
2001-05-30 08:20:48 +08:00
|
|
|
|
|
|
|
/* The old color area */
|
|
|
|
color_frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (color_frame), GTK_SHADOW_IN);
|
2001-12-29 21:26:29 +08:00
|
|
|
gtk_widget_set_size_request (color_frame, -1, COLOR_AREA_SIZE);
|
2001-05-30 08:20:48 +08:00
|
|
|
|
|
|
|
gimp_table_attach_aligned (GTK_TABLE (table), 0, 1,
|
|
|
|
_("Old:"), 1.0, 0.5,
|
|
|
|
color_frame, 1, FALSE);
|
|
|
|
|
|
|
|
cnp->orig_color =
|
|
|
|
gimp_color_area_new (&cnp->orig_rgb,
|
|
|
|
show_alpha ?
|
|
|
|
GIMP_COLOR_AREA_SMALL_CHECKS : GIMP_COLOR_AREA_FLAT,
|
|
|
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK);
|
|
|
|
gtk_drag_dest_unset (cnp->orig_color);
|
|
|
|
gtk_container_add (GTK_CONTAINER (color_frame), cnp->orig_color);
|
|
|
|
gtk_widget_show (cnp->orig_color);
|
|
|
|
|
|
|
|
button = gtk_button_new ();
|
2002-10-31 21:55:49 +08:00
|
|
|
gtk_table_attach (GTK_TABLE (table), button, 2, 3, 0, 2,
|
2001-05-30 08:20:48 +08:00
|
|
|
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
image = gtk_image_new_from_stock (GIMP_STOCK_RESET, GTK_ICON_SIZE_MENU);
|
2001-08-10 00:39:08 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (button), image);
|
|
|
|
gtk_widget_show (image);
|
2001-05-30 08:20:48 +08:00
|
|
|
|
2002-10-31 21:55:49 +08:00
|
|
|
gimp_help_set_help_data (button, _("Revert to old color"), NULL);
|
2001-05-30 08:20:48 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
g_signal_connect_swapped (G_OBJECT (button), "clicked",
|
|
|
|
G_CALLBACK (color_notebook_reset_clicked),
|
|
|
|
cnp);
|
2001-01-16 02:29:48 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
/* The color space sliders, toggle buttons and entries */
|
2002-10-29 04:13:17 +08:00
|
|
|
cnp->scales = gimp_color_selector_new (GIMP_TYPE_COLOR_SCALES,
|
|
|
|
&cnp->rgb,
|
|
|
|
&cnp->hsv,
|
|
|
|
cnp->active_channel);
|
2002-11-05 08:02:56 +08:00
|
|
|
gimp_color_selector_set_toggles_visible (GIMP_COLOR_SELECTOR (cnp->scales),
|
|
|
|
TRUE);
|
2002-10-29 04:13:17 +08:00
|
|
|
gimp_color_selector_set_show_alpha (GIMP_COLOR_SELECTOR (cnp->scales),
|
|
|
|
cnp->show_alpha);
|
|
|
|
gtk_box_pack_start (GTK_BOX (right_vbox), cnp->scales, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (cnp->scales);
|
|
|
|
|
|
|
|
g_signal_connect (G_OBJECT (cnp->scales), "channel_changed",
|
|
|
|
G_CALLBACK (color_notebook_channel_changed),
|
|
|
|
cnp);
|
|
|
|
g_signal_connect (G_OBJECT (cnp->scales), "color_changed",
|
|
|
|
G_CALLBACK (color_notebook_scales_changed),
|
|
|
|
cnp);
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2001-01-16 08:02:17 +08:00
|
|
|
/* The color history */
|
2001-05-30 08:20:48 +08:00
|
|
|
table = gtk_table_new (2, 9, TRUE);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), 1);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 1);
|
|
|
|
gtk_table_set_col_spacing (GTK_TABLE (table), 0, 3);
|
|
|
|
gtk_box_pack_end (GTK_BOX (right_vbox), table, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (table);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
|
|
|
button = gtk_button_new ();
|
2001-12-29 21:26:29 +08:00
|
|
|
gtk_widget_set_size_request (button, COLOR_AREA_SIZE, COLOR_AREA_SIZE);
|
2001-05-30 08:20:48 +08:00
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), button, 0, 1, 0, 1);
|
2001-01-16 08:02:17 +08:00
|
|
|
gimp_help_set_help_data (button,
|
|
|
|
_("Add the current color to the color history"),
|
|
|
|
NULL);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-08-10 00:39:08 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "clicked",
|
|
|
|
G_CALLBACK (color_history_add_clicked),
|
|
|
|
cnp);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
|
|
|
arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
|
|
|
|
gtk_container_add (GTK_CONTAINER (button), arrow);
|
|
|
|
gtk_widget_show (arrow);
|
|
|
|
|
|
|
|
for (i = 0; i < COLOR_HISTORY_SIZE; i++)
|
|
|
|
{
|
2002-10-25 07:10:50 +08:00
|
|
|
GimpRGB history_color;
|
|
|
|
|
|
|
|
color_history_get (i, &history_color);
|
|
|
|
|
2001-01-16 08:02:17 +08:00
|
|
|
button = gtk_button_new ();
|
2001-12-29 21:26:29 +08:00
|
|
|
gtk_widget_set_size_request (button, COLOR_AREA_SIZE, COLOR_AREA_SIZE);
|
2001-05-30 08:20:48 +08:00
|
|
|
gtk_table_attach_defaults (GTK_TABLE (table), button,
|
|
|
|
(i > 7 ? i - 8 : i) + 1,
|
|
|
|
(i > 7 ? i - 8 : i) + 2,
|
|
|
|
i > 7 ? 1 : 0,
|
|
|
|
i > 7 ? 2 : 1);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
cnp->history[i] = gimp_color_area_new (&history_color,
|
2001-01-16 08:02:17 +08:00
|
|
|
GIMP_COLOR_AREA_SMALL_CHECKS,
|
|
|
|
GDK_BUTTON2_MASK);
|
|
|
|
gtk_container_add (GTK_CONTAINER (button), cnp->history[i]);
|
|
|
|
gtk_widget_show (cnp->history[i]);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2001-08-10 00:39:08 +08:00
|
|
|
g_signal_connect (G_OBJECT (button), "clicked",
|
|
|
|
G_CALLBACK (color_history_color_clicked),
|
|
|
|
cnp);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2001-08-10 00:39:08 +08:00
|
|
|
g_signal_connect (G_OBJECT (cnp->history[i]), "color_changed",
|
|
|
|
G_CALLBACK (color_history_color_changed),
|
2002-10-25 07:10:50 +08:00
|
|
|
GINT_TO_POINTER (i));
|
2001-01-16 08:02:17 +08:00
|
|
|
}
|
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
gtk_widget_show (cnp->shell);
|
|
|
|
|
2001-01-16 08:02:17 +08:00
|
|
|
color_notebooks = g_list_prepend (color_notebooks, cnp);
|
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
return cnp;
|
|
|
|
}
|
|
|
|
|
2001-01-16 02:29:48 +08:00
|
|
|
static void
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_help_func (const gchar *data)
|
2001-01-16 02:29:48 +08:00
|
|
|
{
|
2002-10-29 04:13:17 +08:00
|
|
|
ColorNotebook *cnp;
|
|
|
|
GimpColorNotebook *notebook;
|
|
|
|
gchar *help_path;
|
2001-01-16 02:29:48 +08:00
|
|
|
|
|
|
|
cnp = (ColorNotebook *) data;
|
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
help_path = g_strconcat ("dialogs/color_selectors/",
|
|
|
|
GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->help_page,
|
|
|
|
NULL);
|
|
|
|
gimp_standard_help_func (help_path);
|
|
|
|
g_free (help_path);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-10-20 18:14:17 +08:00
|
|
|
color_notebook_ok_callback (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp)
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
{
|
2001-01-17 03:42:37 +08:00
|
|
|
color_history_add_clicked (NULL, cnp);
|
|
|
|
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
if (cnp->callback)
|
2002-10-29 20:49:02 +08:00
|
|
|
cnp->callback (cnp,
|
|
|
|
&cnp->rgb,
|
|
|
|
COLOR_NOTEBOOK_OK,
|
|
|
|
cnp->client_data);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-10-20 18:14:17 +08:00
|
|
|
color_notebook_cancel_callback (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp)
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
{
|
|
|
|
if (cnp->callback)
|
2002-10-29 20:49:02 +08:00
|
|
|
cnp->callback (cnp,
|
|
|
|
&cnp->orig_rgb,
|
|
|
|
COLOR_NOTEBOOK_CANCEL,
|
|
|
|
cnp->client_data);
|
Bit of a large checkin this - it's basically three things: 1 - GimpModules
Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk>
Bit of a large checkin this - it's basically three things:
1 - GimpModules using gmodules to dynamically load and
initialise modules at gimp start of day.
2 - Color selectors now register themselves with a color
notebook.
3 - progress bars have been cleaned up a bit, so now have
progress indictations on all transform tool and gradient
fill operations. Not done bucket fill, but that seems to
be the next candidate.
New directories:
* modules/: new directory for dynamically loadable modules.
New files:
* modules/.cvsignore
* modules/Makefile.am
* modules/colorsel_gtk.c: GTK color selector wrapped up as a
color selector the gimp can use.
* app/gimpprogress.[ch]: progress bars within gimp core, either as
popups, or in the status bar. This is mainly code moved out
of plug-in.c
* app/color_notebook.[ch]: color selector notebook, implementing
very similar interface to color_select.h so it can be used as
a drop-in replacement for it.
* libgimp/color_selector.h: API color selectors need to implement
to become a page in the color_notebook.
* libgimp/gimpmodule.h: API gimp modules need to implement to be
initialised by gimp at start of day.
Modified files:
* Makefile.am: add modules/ to SUBDIRS
* libgimp/Makefile.am: install gimpmodule.h and color_selector.h
* app/gimprc.[ch]: recognise module-path variable.
* gimprc.in: set module-path variable to something sensible
(currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules").
* app/Makefile.am: build color notebook and gimpprogress
* app/app_procs.c: register internal GIMP color selector with
color notebook.
* app/asupsample.c: call progress function less frequently for
better performance.
* app/asupsample.h: progress_func_t typedef moved to gimpprogress.h
* app/blend.c: make callbacks to a progress function
* app/color_area.c: use a color notebook rather than a color selector
* app/color_panel.c: ditto
* app/color_select.c: export color selector interface for notebook
* app/color_select.h: color_select_init() prototype
* app/flip_tool.c: flip the image every time, rather than every
second click.
* app/interface.c: move progress bar stuff out to
gimpprogress.c. Make the code actually work while we're at it.
* app/interface.h: move prototypes for progress functions out to
gimpprogress.h
* app/plug_in.c: load and initialise modules (if possible). Move
progress bar handling code out to gimpprogress.c
* app/plug_in.h: keep only a gimp_progress * for each plugin, not
a whole bunch of GtkWidgets.
* app/scale_tool.c
* app/rotate_tool.c
* app/shear_tool.c
* app/perspective_tool.c: progress bar during operation.
De-sensitise the dialog to discourage the user from running
two transforms in parallel.
* app/transform_core.c: recalculate grid coords when bounding box
changes. Only initialise the action area of the dialog once,
to avoid multiple "ok" / "reset" buttons appearing. Undraw
transform tool with correct matrix to get rid of handle
remains on screen. Call a progress function as we apply the
transform matrix. A few new i18n markups. Invalidate
floating selection marching ants after applying matrix.
* app/transform_core.h: transform_core_do() takes an optional
progress callback argument (and data).
* plug-ins/oilify/oilify.c: send progress bar updates after every
pixel region, not only if they processed a multiple of 5
pixels (which was quite unlikely, and therefore gave a jerky
progress indication).
1999-01-11 08:57:33 +08:00
|
|
|
}
|
|
|
|
|
2001-01-08 13:00:22 +08:00
|
|
|
static void
|
|
|
|
color_notebook_update (ColorNotebook *cnp,
|
|
|
|
ColorNotebookUpdateType update)
|
|
|
|
{
|
|
|
|
if (!cnp)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (update & UPDATE_NOTEBOOK)
|
2002-11-05 08:02:56 +08:00
|
|
|
{
|
|
|
|
g_signal_handlers_block_by_func (G_OBJECT (cnp->notebook),
|
|
|
|
G_CALLBACK (color_notebook_notebook_changed),
|
|
|
|
cnp);
|
|
|
|
|
|
|
|
gimp_color_selector_set_color (GIMP_COLOR_SELECTOR (cnp->notebook),
|
|
|
|
&cnp->rgb,
|
|
|
|
&cnp->hsv);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (G_OBJECT (cnp->notebook),
|
|
|
|
G_CALLBACK (color_notebook_notebook_changed),
|
|
|
|
cnp);
|
|
|
|
}
|
2001-01-08 13:00:22 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
if (update & UPDATE_CHANNEL)
|
2002-10-29 20:49:02 +08:00
|
|
|
gimp_color_selector_set_channel (GIMP_COLOR_SELECTOR (cnp->notebook),
|
2002-10-28 21:19:02 +08:00
|
|
|
cnp->active_channel);
|
|
|
|
|
|
|
|
if (update & UPDATE_SCALES)
|
2002-11-05 08:02:56 +08:00
|
|
|
{
|
|
|
|
g_signal_handlers_block_by_func (G_OBJECT (cnp->scales),
|
|
|
|
G_CALLBACK (color_notebook_scales_changed),
|
|
|
|
cnp);
|
|
|
|
|
|
|
|
gimp_color_selector_set_color (GIMP_COLOR_SELECTOR (cnp->scales),
|
|
|
|
&cnp->rgb,
|
|
|
|
&cnp->hsv);
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (G_OBJECT (cnp->scales),
|
|
|
|
G_CALLBACK (color_notebook_scales_changed),
|
|
|
|
cnp);
|
|
|
|
}
|
2001-01-08 13:00:22 +08:00
|
|
|
|
|
|
|
if (update & UPDATE_ORIG_COLOR)
|
2002-10-29 04:13:17 +08:00
|
|
|
gimp_color_area_set_color (GIMP_COLOR_AREA (cnp->orig_color),
|
|
|
|
&cnp->orig_rgb);
|
2001-01-08 13:00:22 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
if (update & UPDATE_NEW_COLOR)
|
2001-01-08 13:00:22 +08:00
|
|
|
{
|
2001-08-10 00:39:08 +08:00
|
|
|
g_signal_handlers_block_by_func (G_OBJECT (cnp->new_color),
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_new_color_changed,
|
2001-08-10 00:39:08 +08:00
|
|
|
cnp);
|
|
|
|
|
2001-01-16 02:29:48 +08:00
|
|
|
gimp_color_area_set_color (GIMP_COLOR_AREA (cnp->new_color),
|
|
|
|
&cnp->rgb);
|
2001-08-10 00:39:08 +08:00
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func (G_OBJECT (cnp->new_color),
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_new_color_changed,
|
2001-08-10 00:39:08 +08:00
|
|
|
cnp);
|
2002-10-29 04:13:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (update & UPDATE_CALLER)
|
|
|
|
{
|
|
|
|
if (cnp->wants_updates && cnp->callback)
|
2002-10-29 20:49:02 +08:00
|
|
|
cnp->callback (cnp,
|
|
|
|
&cnp->rgb,
|
|
|
|
COLOR_NOTEBOOK_UPDATE,
|
|
|
|
cnp->client_data);
|
2001-01-08 13:00:22 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
static void
|
|
|
|
color_notebook_reset_clicked (ColorNotebook *cnp)
|
|
|
|
{
|
|
|
|
cnp->rgb = cnp->orig_rgb;
|
|
|
|
gimp_rgb_to_hsv (&cnp->rgb, &cnp->hsv);
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_update (cnp,
|
|
|
|
UPDATE_NOTEBOOK |
|
|
|
|
UPDATE_SCALES |
|
|
|
|
UPDATE_NEW_COLOR |
|
|
|
|
UPDATE_CALLER);
|
2001-01-09 09:23:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_new_color_changed (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp)
|
2001-01-09 09:23:54 +08:00
|
|
|
{
|
2002-10-29 04:13:17 +08:00
|
|
|
gimp_color_area_get_color (GIMP_COLOR_AREA (widget), &cnp->rgb);
|
|
|
|
gimp_rgb_to_hsv (&cnp->rgb, &cnp->hsv);
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_update (cnp,
|
|
|
|
UPDATE_NOTEBOOK |
|
|
|
|
UPDATE_SCALES |
|
|
|
|
UPDATE_NEW_COLOR |
|
|
|
|
UPDATE_CALLER);
|
|
|
|
}
|
2001-01-09 09:23:54 +08:00
|
|
|
|
|
|
|
|
2002-10-29 20:49:02 +08:00
|
|
|
/* color notebook callbacks */
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
static void
|
2002-10-29 20:49:02 +08:00
|
|
|
color_notebook_notebook_changed (GimpColorSelector *selector,
|
2002-10-29 04:13:17 +08:00
|
|
|
const GimpRGB *rgb,
|
|
|
|
const GimpHSV *hsv,
|
|
|
|
ColorNotebook *cnp)
|
|
|
|
{
|
|
|
|
cnp->hsv = *hsv;
|
|
|
|
cnp->rgb = *rgb;
|
2001-01-15 20:20:38 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_update (cnp,
|
|
|
|
UPDATE_SCALES |
|
|
|
|
UPDATE_NEW_COLOR |
|
|
|
|
UPDATE_CALLER);
|
|
|
|
}
|
2001-01-15 20:20:38 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
static void
|
2002-10-29 20:49:02 +08:00
|
|
|
color_notebook_switch_page (GtkWidget *widget,
|
|
|
|
GtkNotebookPage *page,
|
|
|
|
guint page_num,
|
|
|
|
ColorNotebook *cnp)
|
2002-10-29 04:13:17 +08:00
|
|
|
{
|
2002-10-29 20:49:02 +08:00
|
|
|
GimpColorNotebook *notebook;
|
|
|
|
gboolean set_channel;
|
|
|
|
|
|
|
|
notebook = GIMP_COLOR_NOTEBOOK (cnp->notebook);
|
2001-01-15 20:20:38 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
set_channel =
|
|
|
|
(GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->set_channel != NULL);
|
2001-01-15 20:20:38 +08:00
|
|
|
|
2002-11-05 08:02:56 +08:00
|
|
|
gimp_color_selector_set_toggles_sensitive (GIMP_COLOR_SELECTOR (cnp->scales),
|
|
|
|
set_channel);
|
2002-10-29 04:13:17 +08:00
|
|
|
}
|
2001-01-15 20:20:38 +08:00
|
|
|
|
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
/* color scales callbacks */
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
static void
|
|
|
|
color_notebook_channel_changed (GimpColorSelector *selector,
|
|
|
|
GimpColorSelectorChannel channel,
|
|
|
|
ColorNotebook *cnp)
|
|
|
|
{
|
|
|
|
cnp->active_channel = channel;
|
2001-01-09 09:23:54 +08:00
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
color_notebook_update (cnp, UPDATE_CHANNEL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_notebook_scales_changed (GimpColorSelector *selector,
|
|
|
|
const GimpRGB *rgb,
|
|
|
|
const GimpHSV *hsv,
|
|
|
|
ColorNotebook *cnp)
|
|
|
|
{
|
|
|
|
cnp->rgb = *rgb;
|
|
|
|
cnp->hsv = *hsv;
|
2001-01-09 09:23:54 +08:00
|
|
|
|
|
|
|
color_notebook_update (cnp,
|
|
|
|
UPDATE_NOTEBOOK |
|
|
|
|
UPDATE_NEW_COLOR |
|
|
|
|
UPDATE_CALLER);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-10-29 04:13:17 +08:00
|
|
|
/* color history callbacks */
|
2001-01-16 08:02:17 +08:00
|
|
|
|
|
|
|
static void
|
2002-10-29 04:13:17 +08:00
|
|
|
color_history_color_clicked (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp)
|
2001-01-16 08:02:17 +08:00
|
|
|
{
|
|
|
|
GimpColorArea *color_area;
|
|
|
|
|
|
|
|
color_area = GIMP_COLOR_AREA (GTK_BIN (widget)->child);
|
|
|
|
|
|
|
|
gimp_color_area_get_color (color_area, &cnp->rgb);
|
2002-10-28 21:19:02 +08:00
|
|
|
gimp_rgb_to_hsv (&cnp->rgb, &cnp->hsv);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
|
|
|
color_notebook_update (cnp,
|
|
|
|
UPDATE_NOTEBOOK |
|
2002-10-29 04:13:17 +08:00
|
|
|
UPDATE_SCALES |
|
2001-01-16 08:02:17 +08:00
|
|
|
UPDATE_ORIG_COLOR |
|
|
|
|
UPDATE_NEW_COLOR |
|
|
|
|
UPDATE_CALLER);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_history_color_changed (GtkWidget *widget,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2002-10-25 07:10:50 +08:00
|
|
|
GimpRGB changed_color;
|
|
|
|
gint color_index;
|
|
|
|
GList *list;
|
|
|
|
ColorNotebook *notebook;
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
color_index = GPOINTER_TO_INT (data);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
|
|
|
gimp_color_area_get_color (GIMP_COLOR_AREA (widget), &changed_color);
|
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
color_history_set (color_index, &changed_color);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
for (list = color_notebooks; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
notebook = (ColorNotebook *) list->data;
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
if (notebook->history[color_index] == widget)
|
|
|
|
continue;
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
g_signal_handlers_block_by_func (G_OBJECT (notebook->history[color_index]),
|
|
|
|
color_history_color_changed,
|
|
|
|
data);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
gimp_color_area_set_color
|
|
|
|
(GIMP_COLOR_AREA (notebook->history[color_index]), &changed_color);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
g_signal_handlers_unblock_by_func (G_OBJECT (notebook->history[color_index]),
|
|
|
|
color_history_color_changed,
|
|
|
|
data);
|
2001-01-16 08:02:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-10-29 04:13:17 +08:00
|
|
|
color_history_add_clicked (GtkWidget *widget,
|
|
|
|
ColorNotebook *cnp)
|
2001-01-16 08:02:17 +08:00
|
|
|
{
|
2002-10-29 04:13:17 +08:00
|
|
|
gint shift_begin;
|
|
|
|
gint i;
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
shift_begin = color_history_add (&cnp->rgb);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
for (i = shift_begin; i >= 0; i--)
|
2001-01-16 08:02:17 +08:00
|
|
|
{
|
2002-10-25 07:10:50 +08:00
|
|
|
GimpRGB color;
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
color_history_get (i, &color);
|
2001-01-16 08:02:17 +08:00
|
|
|
|
2002-10-25 07:10:50 +08:00
|
|
|
gimp_color_area_set_color (GIMP_COLOR_AREA (cnp->history[i]), &color);
|
2001-01-16 08:02:17 +08:00
|
|
|
}
|
|
|
|
}
|