1998-03-09 09:45:26 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
|
|
|
#include <stdlib.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <string.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "color_area.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 "color_notebook.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "colormaps.h"
|
2000-01-02 08:16:47 +08:00
|
|
|
#include "gdisplay.h"
|
|
|
|
#include "gdisplay_color.h"
|
1999-10-27 02:27:27 +08:00
|
|
|
#include "gimpcontext.h"
|
1999-08-22 19:45:31 +08:00
|
|
|
#include "gimpdnd.h"
|
2000-01-03 15:49:19 +08:00
|
|
|
#include "gimpimageP.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
FORE_AREA,
|
|
|
|
BACK_AREA,
|
|
|
|
SWAP_AREA,
|
|
|
|
DEF_AREA,
|
|
|
|
INVALID_AREA
|
|
|
|
} ColorAreaTarget;
|
|
|
|
|
|
|
|
/* local function prototypes */
|
1999-10-27 02:27:27 +08:00
|
|
|
static void color_area_drop_color (GtkWidget *,
|
|
|
|
guchar, guchar, guchar, gpointer);
|
|
|
|
static void color_area_drag_color (GtkWidget *,
|
|
|
|
guchar *, guchar *, guchar *, gpointer);
|
|
|
|
static void color_area_color_changed (GimpContext *,
|
|
|
|
gint, gint, gint, gpointer);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Global variables */
|
1999-08-23 22:19:26 +08:00
|
|
|
gint active_color = FOREGROUND;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-01-03 15:49:19 +08:00
|
|
|
GDisplay *color_area_gdisp = NULL;
|
2000-01-02 08:16:47 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
/* Static variables */
|
2000-02-14 07:42:19 +08:00
|
|
|
static GdkGC *color_area_gc = NULL;
|
|
|
|
static GtkWidget *color_area = NULL;
|
|
|
|
static GdkPixmap *color_area_pixmap = NULL;
|
|
|
|
static GdkPixmap *default_pixmap = NULL;
|
|
|
|
static GdkPixmap *swap_pixmap = NULL;
|
|
|
|
static ColorNotebook *color_notebook = NULL;
|
|
|
|
static gboolean color_notebook_active = FALSE;
|
|
|
|
static gint edit_color;
|
|
|
|
static guchar revert_fg_r, revert_fg_g, revert_fg_b;
|
|
|
|
static guchar revert_bg_r, revert_bg_g, revert_bg_b;
|
1999-08-22 19:45:31 +08:00
|
|
|
|
1999-08-23 22:19:26 +08:00
|
|
|
/* dnd stuff */
|
1999-08-22 19:45:31 +08:00
|
|
|
static GtkTargetEntry color_area_target_table[] =
|
|
|
|
{
|
|
|
|
GIMP_TARGET_COLOR
|
|
|
|
};
|
|
|
|
static guint n_color_area_targets = (sizeof (color_area_target_table) /
|
|
|
|
sizeof (color_area_target_table[0]));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
/* Local functions */
|
1999-08-22 19:45:31 +08:00
|
|
|
static ColorAreaTarget
|
|
|
|
color_area_target (gint x,
|
|
|
|
gint y)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
gint rect_w, rect_h;
|
|
|
|
gint width, height;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdk_window_get_size (color_area_pixmap, &width, &height);
|
|
|
|
|
|
|
|
rect_w = width * 0.65;
|
|
|
|
rect_h = height * 0.65;
|
|
|
|
|
|
|
|
/* foreground active */
|
|
|
|
if (x > 0 && x < rect_w &&
|
|
|
|
y > 0 && y < rect_h)
|
|
|
|
return FORE_AREA;
|
|
|
|
else if (x > (width - rect_w) && x < width &&
|
|
|
|
y > (height - rect_h) && y < height)
|
|
|
|
return BACK_AREA;
|
|
|
|
else if (x > 0 && x < (width - rect_w) &&
|
|
|
|
y > rect_h && y < height)
|
|
|
|
return DEF_AREA;
|
|
|
|
else if (x > rect_w && x < width &&
|
|
|
|
y > 0 && y < (height - rect_h))
|
|
|
|
return SWAP_AREA;
|
|
|
|
else
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
1998-09-01 06:22:23 +08:00
|
|
|
void
|
|
|
|
color_area_draw_rect (GdkDrawable *drawable,
|
1999-08-22 19:45:31 +08:00
|
|
|
GdkGC *gc,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
guchar r,
|
|
|
|
guchar g,
|
|
|
|
guchar b)
|
1998-09-01 06:22:23 +08:00
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
static guchar *color_area_rgb_buf = NULL;
|
1998-09-01 06:22:23 +08:00
|
|
|
static gint color_area_rgb_buf_size;
|
|
|
|
static gint rowstride;
|
|
|
|
gint xx, yy;
|
1999-08-22 19:45:31 +08:00
|
|
|
guchar *bp;
|
2000-01-02 08:16:47 +08:00
|
|
|
GList *list;
|
1998-09-01 06:22:23 +08:00
|
|
|
|
|
|
|
rowstride = 3 * ((width + 3) & -4);
|
2000-01-02 08:16:47 +08:00
|
|
|
|
1998-09-01 06:22:23 +08:00
|
|
|
if (color_area_rgb_buf == NULL ||
|
|
|
|
color_area_rgb_buf_size < height * rowstride)
|
|
|
|
{
|
|
|
|
if (color_area_rgb_buf)
|
|
|
|
g_free (color_area_rgb_buf);
|
1999-10-28 04:09:46 +08:00
|
|
|
color_area_rgb_buf = g_malloc (color_area_rgb_buf_size = rowstride * height);
|
1998-09-01 06:22:23 +08:00
|
|
|
}
|
2000-01-02 08:16:47 +08:00
|
|
|
|
1998-09-01 06:22:23 +08:00
|
|
|
bp = color_area_rgb_buf;
|
|
|
|
for (xx = 0; xx < width; xx++)
|
|
|
|
{
|
|
|
|
*bp++ = r;
|
|
|
|
*bp++ = g;
|
|
|
|
*bp++ = b;
|
|
|
|
}
|
2000-01-02 08:16:47 +08:00
|
|
|
|
1998-09-01 06:22:23 +08:00
|
|
|
bp = color_area_rgb_buf;
|
2000-01-02 08:16:47 +08:00
|
|
|
|
2000-01-03 15:49:19 +08:00
|
|
|
list = color_area_gdisp->cd_list;
|
2000-01-02 08:16:47 +08:00
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
ColorDisplayNode *node = (ColorDisplayNode *) list->data;
|
|
|
|
node->cd_convert (node->cd_ID, bp, width, 1, 3, rowstride);
|
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
|
1998-09-01 06:22:23 +08:00
|
|
|
for (yy = 1; yy < height; yy++)
|
|
|
|
{
|
|
|
|
bp += rowstride;
|
|
|
|
memcpy (bp, color_area_rgb_buf, rowstride);
|
|
|
|
}
|
2000-01-02 08:16:47 +08:00
|
|
|
|
1998-09-01 06:22:23 +08:00
|
|
|
gdk_draw_rgb_image (drawable, gc, x, y, width, height,
|
|
|
|
GDK_RGB_DITHER_MAX,
|
|
|
|
color_area_rgb_buf,
|
|
|
|
rowstride);
|
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
|
|
|
color_area_draw (void)
|
|
|
|
{
|
|
|
|
GdkColor *win_bg;
|
|
|
|
GdkColor fg, bg, bd;
|
1999-08-22 19:45:31 +08:00
|
|
|
gint rect_w, rect_h;
|
|
|
|
gint width, height;
|
|
|
|
gint def_width, def_height;
|
|
|
|
gint swap_width, swap_height;
|
|
|
|
guchar r, g, b;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-08-13 23:25:41 +08:00
|
|
|
/* Check we haven't gotten initial expose yet,
|
|
|
|
* no point in drawing anything */
|
|
|
|
if (!color_area_pixmap || !color_area_gc)
|
1997-12-18 14:30:11 +08:00
|
|
|
return;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
gdk_window_get_size (color_area_pixmap, &width, &height);
|
|
|
|
|
|
|
|
win_bg = &(color_area->style->bg[GTK_STATE_NORMAL]);
|
|
|
|
fg.pixel = foreground_pixel;
|
|
|
|
bg.pixel = background_pixel;
|
|
|
|
bd.pixel = g_black_pixel;
|
|
|
|
|
|
|
|
rect_w = width * 0.65;
|
|
|
|
rect_h = height * 0.65;
|
|
|
|
|
|
|
|
gdk_gc_set_foreground (color_area_gc, win_bg);
|
|
|
|
gdk_draw_rectangle (color_area_pixmap, color_area_gc, 1,
|
|
|
|
0, 0, width, height);
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_get_background (gimp_context_get_user (), &r, &g, &b);
|
1998-09-01 06:22:23 +08:00
|
|
|
color_area_draw_rect (color_area_pixmap, color_area_gc,
|
|
|
|
(width - rect_w), (height - rect_h), rect_w, rect_h,
|
|
|
|
r, g, b);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (active_color == FOREGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
|
|
|
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
|
1997-11-25 06:05:25 +08:00
|
|
|
(width - rect_w), (height - rect_h), rect_w, rect_h);
|
|
|
|
else
|
1999-10-27 02:27:27 +08:00
|
|
|
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
|
|
|
GTK_STATE_NORMAL, GTK_SHADOW_IN,
|
1997-11-25 06:05:25 +08:00
|
|
|
(width - rect_w), (height - rect_h), rect_w, rect_h);
|
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_get_foreground (gimp_context_get_user (), &r, &g, &b);
|
1998-09-01 06:22:23 +08:00
|
|
|
color_area_draw_rect (color_area_pixmap, color_area_gc,
|
|
|
|
0, 0, rect_w, rect_h,
|
|
|
|
r, g, b);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (active_color == FOREGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
|
|
|
GTK_STATE_NORMAL, GTK_SHADOW_IN,
|
1997-11-25 06:05:25 +08:00
|
|
|
0, 0, rect_w, rect_h);
|
|
|
|
else
|
1999-10-27 02:27:27 +08:00
|
|
|
gtk_draw_shadow (color_area->style, color_area_pixmap,
|
|
|
|
GTK_STATE_NORMAL, GTK_SHADOW_OUT,
|
1997-11-25 06:05:25 +08:00
|
|
|
0, 0, rect_w, rect_h);
|
|
|
|
|
|
|
|
|
|
|
|
gdk_window_get_size (default_pixmap, &def_width, &def_height);
|
|
|
|
gdk_draw_pixmap (color_area_pixmap, color_area_gc, default_pixmap,
|
|
|
|
0, 0, 0, height - def_height, def_width, def_height);
|
|
|
|
|
|
|
|
gdk_window_get_size (swap_pixmap, &swap_width, &swap_height);
|
|
|
|
gdk_draw_pixmap (color_area_pixmap, color_area_gc, swap_pixmap,
|
|
|
|
0, 0, width - swap_width, 0, swap_width, swap_height);
|
|
|
|
|
|
|
|
gdk_draw_pixmap (color_area->window, color_area_gc, color_area_pixmap,
|
|
|
|
0, 0, 0, 0, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-22 19:45:31 +08:00
|
|
|
color_area_select_callback (gint r,
|
|
|
|
gint g,
|
|
|
|
gint b,
|
|
|
|
ColorNotebookState state,
|
|
|
|
void *client_data)
|
1997-11-25 06:05:25 +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
|
|
|
if (color_notebook)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
case COLOR_NOTEBOOK_OK:
|
|
|
|
color_notebook_hide (color_notebook);
|
|
|
|
color_notebook_active = FALSE;
|
|
|
|
/* Fallthrough */
|
|
|
|
case COLOR_NOTEBOOK_UPDATE:
|
|
|
|
if (edit_color == FOREGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_foreground (gimp_context_get_user (), r, g, b);
|
1999-08-22 19:45:31 +08:00
|
|
|
else
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_background (gimp_context_get_user (), r, g, b);
|
1999-08-22 19:45:31 +08:00
|
|
|
break;
|
|
|
|
case COLOR_NOTEBOOK_CANCEL:
|
|
|
|
color_notebook_hide (color_notebook);
|
|
|
|
color_notebook_active = FALSE;
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_foreground (gimp_context_get_user (),
|
|
|
|
revert_fg_r, revert_fg_g, revert_fg_b);
|
|
|
|
gimp_context_set_background (gimp_context_get_user (),
|
|
|
|
revert_bg_r, revert_bg_g, revert_bg_b);
|
1999-08-22 19:45:31 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_area_edit (void)
|
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
GimpContext *user_context;
|
1999-08-22 19:45:31 +08:00
|
|
|
guchar r, g, b;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
user_context = gimp_context_get_user ();
|
|
|
|
|
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 (!color_notebook_active)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_get_foreground (user_context,
|
|
|
|
&revert_fg_r, &revert_fg_g, &revert_fg_b);
|
|
|
|
gimp_context_get_background (user_context,
|
|
|
|
&revert_bg_r, &revert_bg_g, &revert_bg_b);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1999-08-23 22:19:26 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (active_color == FOREGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_get_foreground (user_context, &r, &g, &b);
|
1997-11-25 06:05:25 +08:00
|
|
|
else
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_get_background (user_context, &r, &g, &b);
|
|
|
|
|
1999-08-23 22:19:26 +08:00
|
|
|
edit_color = active_color;
|
1997-11-25 06:05:25 +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
|
|
|
if (! color_notebook)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
color_notebook = color_notebook_new (r, g, b, color_area_select_callback,
|
|
|
|
NULL, TRUE);
|
|
|
|
color_notebook_active = TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
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 (! color_notebook_active)
|
1999-08-22 19:45:31 +08:00
|
|
|
{
|
|
|
|
color_notebook_show (color_notebook);
|
|
|
|
color_notebook_active = TRUE;
|
|
|
|
}
|
1998-07-09 11:35:39 +08:00
|
|
|
else
|
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
|
|
|
gdk_window_raise (color_notebook->shell->window);
|
1998-07-09 11:35:39 +08:00
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
color_notebook_set_color (color_notebook, r, g, b, TRUE);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
color_area_events (GtkWidget *widget,
|
|
|
|
GdkEvent *event)
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
GdkEventButton *bevent;
|
|
|
|
ColorAreaTarget target;
|
|
|
|
|
|
|
|
static ColorAreaTarget press_target = INVALID_AREA;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch (event->type)
|
|
|
|
{
|
1998-06-11 12:36:22 +08:00
|
|
|
case GDK_CONFIGURE:
|
|
|
|
if (color_area_pixmap)
|
|
|
|
gdk_pixmap_unref (color_area_pixmap);
|
|
|
|
|
|
|
|
color_area_pixmap = gdk_pixmap_new (widget->window,
|
|
|
|
widget->allocation.width,
|
|
|
|
widget->allocation.height, -1);
|
|
|
|
break;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
case GDK_EXPOSE:
|
1998-06-11 12:36:22 +08:00
|
|
|
if (GTK_WIDGET_DRAWABLE (widget))
|
|
|
|
{
|
|
|
|
if (!color_area_gc)
|
|
|
|
color_area_gc = gdk_gc_new (widget->window);
|
|
|
|
|
|
|
|
color_area_draw ();
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
if (bevent->button == 1)
|
1999-08-23 22:19:26 +08:00
|
|
|
{
|
|
|
|
target = color_area_target (bevent->x, bevent->y);
|
|
|
|
press_target = INVALID_AREA;
|
|
|
|
|
|
|
|
switch (target)
|
|
|
|
{
|
|
|
|
case FORE_AREA:
|
|
|
|
case BACK_AREA:
|
|
|
|
if (target != active_color)
|
|
|
|
{
|
|
|
|
active_color = target;
|
|
|
|
color_area_draw ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
press_target = target;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case SWAP_AREA:
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_swap_colors (gimp_context_get_user ());
|
1999-08-23 22:19:26 +08:00
|
|
|
break;
|
|
|
|
case DEF_AREA:
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_default_colors (gimp_context_get_user ());
|
1999-08-23 22:19:26 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
1999-08-22 19:45:31 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
if (bevent->button == 1)
|
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
target = color_area_target (bevent->x, bevent->y);
|
|
|
|
|
|
|
|
if (target == press_target)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
switch (target)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-22 19:45:31 +08:00
|
|
|
case FORE_AREA:
|
|
|
|
case BACK_AREA:
|
1999-08-23 22:19:26 +08:00
|
|
|
color_area_edit ();
|
1999-08-22 19:45:31 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
1999-08-22 19:45:31 +08:00
|
|
|
press_target = INVALID_AREA;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
case GDK_LEAVE_NOTIFY:
|
|
|
|
press_target = INVALID_AREA;
|
|
|
|
break;
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
1999-08-22 19:45:31 +08:00
|
|
|
color_area_create (gint width,
|
|
|
|
gint height,
|
1997-11-25 06:05:25 +08:00
|
|
|
GdkPixmap *default_pmap,
|
|
|
|
GdkPixmap *swap_pmap)
|
|
|
|
{
|
|
|
|
color_area = gtk_drawing_area_new ();
|
|
|
|
gtk_drawing_area_size (GTK_DRAWING_AREA (color_area), width, height);
|
1999-08-22 19:45:31 +08:00
|
|
|
gtk_widget_set_events (color_area,
|
|
|
|
GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (color_area), "event",
|
|
|
|
(GtkSignalFunc) color_area_events,
|
|
|
|
NULL);
|
|
|
|
default_pixmap = default_pmap;
|
|
|
|
swap_pixmap = swap_pmap;
|
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
/* dnd stuff */
|
1999-08-23 22:19:26 +08:00
|
|
|
gtk_drag_source_set (color_area,
|
1999-11-03 17:58:46 +08:00
|
|
|
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
1999-08-23 22:19:26 +08:00
|
|
|
color_area_target_table, n_color_area_targets,
|
|
|
|
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
1999-08-24 08:36:57 +08:00
|
|
|
gimp_dnd_color_source_set (color_area, color_area_drag_color, NULL);
|
1999-08-23 22:19:26 +08:00
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
gtk_drag_dest_set (color_area,
|
|
|
|
GTK_DEST_DEFAULT_HIGHLIGHT |
|
|
|
|
GTK_DEST_DEFAULT_MOTION |
|
|
|
|
GTK_DEST_DEFAULT_DROP,
|
|
|
|
color_area_target_table, n_color_area_targets,
|
|
|
|
GDK_ACTION_COPY);
|
1999-08-24 08:36:57 +08:00
|
|
|
gimp_dnd_color_dest_set (color_area, color_area_drop_color, NULL);
|
1999-08-22 19:45:31 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
gtk_signal_connect (GTK_OBJECT (gimp_context_get_user ()),
|
|
|
|
"foreground_changed",
|
|
|
|
GTK_SIGNAL_FUNC (color_area_color_changed),
|
|
|
|
color_area);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (gimp_context_get_user ()),
|
|
|
|
"background_changed",
|
|
|
|
GTK_SIGNAL_FUNC (color_area_color_changed),
|
|
|
|
color_area);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-01-02 08:16:47 +08:00
|
|
|
/* display filter dummy gdisplay */
|
2000-01-03 15:49:19 +08:00
|
|
|
color_area_gdisp = g_new (GDisplay, 1);
|
|
|
|
color_area_gdisp->cd_list = NULL;
|
|
|
|
color_area_gdisp->cd_ui = NULL;
|
|
|
|
color_area_gdisp->gimage = g_new (GimpImage, 1);
|
|
|
|
color_area_gdisp->gimage->base_type = RGB;
|
2000-01-02 08:16:47 +08:00
|
|
|
|
1999-10-27 02:27:27 +08:00
|
|
|
return color_area;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
1998-07-09 11:35:39 +08:00
|
|
|
|
1999-08-22 19:45:31 +08:00
|
|
|
static void
|
1999-08-24 08:36:57 +08:00
|
|
|
color_area_drag_color (GtkWidget *widget,
|
|
|
|
guchar *r,
|
|
|
|
guchar *g,
|
|
|
|
guchar *b,
|
|
|
|
gpointer data)
|
1999-08-22 19:45:31 +08:00
|
|
|
{
|
|
|
|
if (active_color == FOREGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_get_foreground (gimp_context_get_user (), r, g, b);
|
1999-08-22 19:45:31 +08:00
|
|
|
else
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_get_background (gimp_context_get_user (), r, g, b);
|
1999-08-22 19:45:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 08:36:57 +08:00
|
|
|
color_area_drop_color (GtkWidget *widget,
|
|
|
|
guchar r,
|
|
|
|
guchar g,
|
|
|
|
guchar b,
|
|
|
|
gpointer data)
|
1999-08-22 19:45:31 +08:00
|
|
|
{
|
|
|
|
if (color_notebook_active &&
|
|
|
|
active_color == edit_color)
|
|
|
|
{
|
|
|
|
color_notebook_set_color (color_notebook, r, g, b, TRUE);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (active_color == FOREGROUND)
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_foreground (gimp_context_get_user (), r, g, b);
|
1999-08-22 19:45:31 +08:00
|
|
|
else
|
1999-10-27 02:27:27 +08:00
|
|
|
gimp_context_set_background (gimp_context_get_user (), r, g, b);
|
1999-08-22 19:45:31 +08:00
|
|
|
}
|
|
|
|
}
|
1999-10-27 02:27:27 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
color_area_color_changed (GimpContext *context,
|
|
|
|
gint r,
|
|
|
|
gint g,
|
|
|
|
gint b,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
color_area_draw ();
|
|
|
|
}
|