1997-11-25 06:05:25 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* 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
|
|
|
*/
|
2000-12-17 05:37:03 +08:00
|
|
|
|
1999-06-07 03:44:36 +08:00
|
|
|
#include "config.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <stdio.h>
|
1997-11-25 06:05:25 +08:00
|
|
|
#include <stdlib.h>
|
1999-02-21 07:20:54 +08:00
|
|
|
#include <string.h>
|
1999-09-28 01:58:10 +08:00
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-05-25 15:50:44 +08:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include "apptypes.h"
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "appenv.h"
|
|
|
|
#include "color_select.h"
|
|
|
|
#include "colormaps.h"
|
1999-08-24 07:05:46 +08:00
|
|
|
#include "gimpdnd.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
#include "gimprc.h"
|
1999-09-28 01:58:10 +08:00
|
|
|
#include "gimpui.h"
|
1998-06-23 04:28:48 +08:00
|
|
|
#include "session.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "color_area.h"
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
#include "libgimp/gimpcolorspace.h"
|
2000-05-27 09:30:21 +08:00
|
|
|
#include "libgimp/gimpcolorselector.h"
|
2000-12-29 23:22:01 +08:00
|
|
|
#include "libgimp/gimphelpui.h"
|
2000-04-28 01:27:28 +08:00
|
|
|
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
2000-04-28 01:27:28 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
#define XY_DEF_WIDTH 200
|
|
|
|
#define XY_DEF_HEIGHT 200
|
1997-11-25 06:05:25 +08:00
|
|
|
#define Z_DEF_WIDTH 15
|
2001-01-09 09:23:54 +08:00
|
|
|
#define Z_DEF_HEIGHT 200
|
1997-11-25 06:05:25 +08:00
|
|
|
#define COLOR_AREA_WIDTH 74
|
|
|
|
#define COLOR_AREA_HEIGHT 20
|
|
|
|
|
2001-01-08 13:00:22 +08:00
|
|
|
#define COLOR_AREA_MASK (GDK_EXPOSURE_MASK | \
|
|
|
|
GDK_BUTTON_PRESS_MASK | \
|
|
|
|
GDK_BUTTON_RELEASE_MASK | \
|
|
|
|
GDK_BUTTON1_MOTION_MASK | \
|
|
|
|
GDK_ENTER_NOTIFY_MASK)
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-10-03 21:50:19 +08:00
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
1999-10-28 23:05:49 +08:00
|
|
|
COLOR_SELECT_HUE = 0,
|
|
|
|
COLOR_SELECT_SATURATION,
|
|
|
|
COLOR_SELECT_VALUE,
|
|
|
|
COLOR_SELECT_RED,
|
|
|
|
COLOR_SELECT_GREEN,
|
|
|
|
COLOR_SELECT_BLUE,
|
2001-01-08 05:07:14 +08:00
|
|
|
COLOR_SELECT_ALPHA,
|
1999-10-28 23:05:49 +08:00
|
|
|
COLOR_SELECT_HUE_SATURATION,
|
|
|
|
COLOR_SELECT_HUE_VALUE,
|
|
|
|
COLOR_SELECT_SATURATION_VALUE,
|
|
|
|
COLOR_SELECT_RED_GREEN,
|
|
|
|
COLOR_SELECT_RED_BLUE,
|
|
|
|
COLOR_SELECT_GREEN_BLUE
|
1997-11-25 06:05:25 +08:00
|
|
|
} ColorSelectFillType;
|
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
UPDATE_VALUES = 1 << 0,
|
|
|
|
UPDATE_POS = 1 << 1,
|
|
|
|
UPDATE_XY_COLOR = 1 << 2,
|
|
|
|
UPDATE_Z_COLOR = 1 << 3,
|
|
|
|
UPDATE_CALLER = 1 << 6
|
1997-11-25 06:05:25 +08:00
|
|
|
} ColorSelectUpdateType;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
typedef void (* ColorSelectCallback) (const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb,
|
|
|
|
gpointer data);
|
1999-10-03 21:50:19 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
typedef struct _ColorSelect ColorSelect;
|
1999-10-03 21:50:19 +08:00
|
|
|
|
|
|
|
struct _ColorSelect
|
|
|
|
{
|
2000-05-27 21:53:49 +08:00
|
|
|
GtkWidget *xy_color;
|
|
|
|
GtkWidget *z_color;
|
1999-10-03 21:50:19 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
gint pos[3];
|
|
|
|
|
|
|
|
GimpHSV hsv;
|
|
|
|
GimpRGB rgb;
|
|
|
|
|
|
|
|
gint z_color_fill;
|
|
|
|
gint xy_color_fill;
|
|
|
|
GdkGC *gc;
|
1999-10-03 21:50:19 +08:00
|
|
|
|
|
|
|
ColorSelectCallback callback;
|
2001-01-08 05:07:14 +08:00
|
|
|
gpointer client_data;
|
1999-10-03 21:50:19 +08:00
|
|
|
};
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
typedef struct _ColorSelectFill ColorSelectFill;
|
1999-08-24 07:05:46 +08:00
|
|
|
|
2001-01-08 10:24:29 +08:00
|
|
|
typedef void (* ColorSelectFillUpdateProc) (ColorSelectFill *color_select_fill);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
struct _ColorSelectFill
|
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
guchar *buffer;
|
|
|
|
gint y;
|
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
GimpHSV hsv;
|
|
|
|
GimpRGB rgb;
|
1999-08-24 07:05:46 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
ColorSelectFillUpdateProc update;
|
|
|
|
};
|
|
|
|
|
2001-01-08 10:24:29 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
static GtkWidget * color_select_widget_new (ColorSelect *csp,
|
|
|
|
const GimpRGB *color);
|
2001-01-08 10:24:29 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
static void color_select_drop_color (GtkWidget *widget,
|
2001-01-20 23:37:26 +08:00
|
|
|
const GimpRGB *color,
|
2001-01-15 20:20:38 +08:00
|
|
|
gpointer data);
|
|
|
|
static void color_select_update (ColorSelect *csp,
|
2001-01-08 10:24:29 +08:00
|
|
|
ColorSelectUpdateType);
|
2001-01-15 20:20:38 +08:00
|
|
|
static void color_select_update_caller (ColorSelect *csp);
|
|
|
|
static void color_select_update_values (ColorSelect *csp);
|
|
|
|
static void color_select_update_rgb_values (ColorSelect *csp);
|
|
|
|
static void color_select_update_hsv_values (ColorSelect *csp);
|
|
|
|
static void color_select_update_pos (ColorSelect *csp);
|
2001-01-08 10:24:29 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
static gint color_select_xy_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *eevent,
|
|
|
|
ColorSelect *color_select);
|
|
|
|
static gint color_select_xy_events (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
ColorSelect *color_select);
|
|
|
|
static gint color_select_z_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *eevent,
|
|
|
|
ColorSelect *color_select);
|
|
|
|
static gint color_select_z_events (GtkWidget *widet,
|
|
|
|
GdkEvent *event,
|
|
|
|
ColorSelect *color_select);
|
2001-01-08 10:24:29 +08:00
|
|
|
|
|
|
|
static void color_select_image_fill (GtkWidget *,
|
|
|
|
ColorSelectFillType,
|
2001-01-15 20:20:38 +08:00
|
|
|
const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb);
|
2001-01-08 10:24:29 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
static void color_select_draw_z_marker (ColorSelect *csp,
|
2001-01-08 10:24:29 +08:00
|
|
|
GdkRectangle *);
|
2001-01-15 20:20:38 +08:00
|
|
|
static void color_select_draw_xy_marker (ColorSelect *csp,
|
2001-01-08 10:24:29 +08:00
|
|
|
GdkRectangle *);
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
static void color_select_update_red (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_green (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_blue (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_hue (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_saturation (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_value (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_red_green (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_red_blue (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_green_blue (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_hue_saturation (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_hue_value (ColorSelectFill *csf);
|
|
|
|
static void color_select_update_saturation_value (ColorSelectFill *csf);
|
|
|
|
|
|
|
|
static GtkWidget * color_select_notebook_new (const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb,
|
|
|
|
gboolean show_alpha,
|
2001-01-08 10:24:29 +08:00
|
|
|
GimpColorSelectorCallback,
|
2001-01-15 20:20:38 +08:00
|
|
|
gpointer ,
|
|
|
|
gpointer *);
|
|
|
|
static void color_select_notebook_free (gpointer );
|
|
|
|
static void color_select_notebook_set_color (gpointer ,
|
|
|
|
const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb);
|
2001-01-09 09:23:54 +08:00
|
|
|
static void color_select_notebook_set_channel (gpointer ,
|
|
|
|
GimpColorSelectorChannelType channel);
|
2001-01-15 20:20:38 +08:00
|
|
|
static void color_select_notebook_update_callback (const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb,
|
|
|
|
gpointer );
|
1999-08-24 07:05:46 +08:00
|
|
|
|
|
|
|
/* Static variables */
|
1997-11-25 06:05:25 +08:00
|
|
|
static ColorSelectFillUpdateProc update_procs[] =
|
|
|
|
{
|
|
|
|
color_select_update_hue,
|
|
|
|
color_select_update_saturation,
|
|
|
|
color_select_update_value,
|
|
|
|
color_select_update_red,
|
|
|
|
color_select_update_green,
|
|
|
|
color_select_update_blue,
|
2001-01-08 05:07:14 +08:00
|
|
|
NULL, /* alpha */
|
1997-11-25 06:05:25 +08:00
|
|
|
color_select_update_hue_saturation,
|
|
|
|
color_select_update_hue_value,
|
|
|
|
color_select_update_saturation_value,
|
|
|
|
color_select_update_red_green,
|
|
|
|
color_select_update_red_blue,
|
|
|
|
color_select_update_green_blue,
|
|
|
|
};
|
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
/* dnd stuff */
|
|
|
|
static GtkTargetEntry color_select_target_table[] =
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
GIMP_TARGET_COLOR
|
1997-11-25 06:05:25 +08:00
|
|
|
};
|
1999-08-24 07:05:46 +08:00
|
|
|
static guint n_color_select_targets = (sizeof (color_select_target_table) /
|
|
|
|
sizeof (color_select_target_table[0]));
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
|
1999-10-03 21:50:19 +08:00
|
|
|
/* Register the GIMP colour selector with the color notebook */
|
|
|
|
void
|
|
|
|
color_select_init (void)
|
|
|
|
{
|
|
|
|
GimpColorSelectorMethods methods =
|
|
|
|
{
|
|
|
|
color_select_notebook_new,
|
|
|
|
color_select_notebook_free,
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_notebook_set_color,
|
|
|
|
color_select_notebook_set_channel
|
1999-10-03 21:50:19 +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
|
|
|
|
1999-10-03 21:50:19 +08:00
|
|
|
gimp_color_selector_register ("GIMP", "built_in.html", &methods);
|
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
|
|
|
}
|
|
|
|
|
1999-10-03 21:50:19 +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
|
|
|
static GtkWidget *
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_widget_new (ColorSelect *csp,
|
|
|
|
const GimpRGB *color)
|
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 05:07:14 +08:00
|
|
|
GtkWidget *main_vbox;
|
|
|
|
GtkWidget *main_hbox;
|
2001-01-09 09:23:54 +08:00
|
|
|
GtkWidget *hbox;
|
2001-01-08 05:07:14 +08:00
|
|
|
GtkWidget *xy_frame;
|
|
|
|
GtkWidget *z_frame;
|
2000-05-27 21:53:49 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
main_vbox = gtk_vbox_new (FALSE, 0);
|
1998-12-04 07:01:44 +08:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
main_hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_vbox), main_hbox, TRUE, FALSE, 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (main_hbox);
|
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (main_hbox), hbox, TRUE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
/* The x/y component preview */
|
1997-11-25 06:05:25 +08:00
|
|
|
xy_frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (xy_frame), GTK_SHADOW_IN);
|
2001-01-09 09:23:54 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), xy_frame, FALSE, FALSE, 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (xy_frame);
|
|
|
|
|
|
|
|
csp->xy_color = gtk_preview_new (GTK_PREVIEW_COLOR);
|
1998-08-20 14:46:07 +08:00
|
|
|
gtk_preview_set_dither (GTK_PREVIEW (csp->xy_color), GDK_RGB_DITHER_MAX);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (csp->xy_color), XY_DEF_WIDTH, XY_DEF_HEIGHT);
|
|
|
|
gtk_widget_set_events (csp->xy_color, COLOR_AREA_MASK);
|
|
|
|
gtk_signal_connect_after (GTK_OBJECT (csp->xy_color), "expose_event",
|
2001-01-08 05:07:14 +08:00
|
|
|
GTK_SIGNAL_FUNC (color_select_xy_expose),
|
1997-11-25 06:05:25 +08:00
|
|
|
csp);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (csp->xy_color), "event",
|
2001-01-08 05:07:14 +08:00
|
|
|
GTK_SIGNAL_FUNC (color_select_xy_events),
|
1997-11-25 06:05:25 +08:00
|
|
|
csp);
|
|
|
|
gtk_container_add (GTK_CONTAINER (xy_frame), csp->xy_color);
|
|
|
|
gtk_widget_show (csp->xy_color);
|
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
/* dnd stuff */
|
|
|
|
gtk_drag_dest_set (csp->xy_color,
|
|
|
|
GTK_DEST_DEFAULT_HIGHLIGHT |
|
|
|
|
GTK_DEST_DEFAULT_MOTION |
|
|
|
|
GTK_DEST_DEFAULT_DROP,
|
|
|
|
color_select_target_table, n_color_select_targets,
|
|
|
|
GDK_ACTION_COPY);
|
2001-01-08 13:00:22 +08:00
|
|
|
gimp_dnd_color_dest_set (csp->xy_color, color_select_drop_color, csp);
|
1999-08-24 07:05:46 +08:00
|
|
|
|
|
|
|
/* The z component preview */
|
1997-11-25 06:05:25 +08:00
|
|
|
z_frame = gtk_frame_new (NULL);
|
|
|
|
gtk_frame_set_shadow_type (GTK_FRAME (z_frame), GTK_SHADOW_IN);
|
2001-01-09 09:23:54 +08:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), z_frame, FALSE, FALSE, 2);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_widget_show (z_frame);
|
|
|
|
|
|
|
|
csp->z_color = gtk_preview_new (GTK_PREVIEW_COLOR);
|
1998-08-20 14:46:07 +08:00
|
|
|
gtk_preview_set_dither (GTK_PREVIEW (csp->z_color), GDK_RGB_DITHER_MAX);
|
1997-11-25 06:05:25 +08:00
|
|
|
gtk_preview_size (GTK_PREVIEW (csp->z_color), Z_DEF_WIDTH, Z_DEF_HEIGHT);
|
|
|
|
gtk_widget_set_events (csp->z_color, COLOR_AREA_MASK);
|
|
|
|
gtk_signal_connect_after (GTK_OBJECT (csp->z_color), "expose_event",
|
2001-01-08 05:07:14 +08:00
|
|
|
GTK_SIGNAL_FUNC (color_select_z_expose),
|
1997-11-25 06:05:25 +08:00
|
|
|
csp);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (csp->z_color), "event",
|
2001-01-08 05:07:14 +08:00
|
|
|
GTK_SIGNAL_FUNC (color_select_z_events),
|
1997-11-25 06:05:25 +08:00
|
|
|
csp);
|
|
|
|
gtk_container_add (GTK_CONTAINER (z_frame), csp->z_color);
|
|
|
|
gtk_widget_show (csp->z_color);
|
|
|
|
|
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 main_vbox;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
static void
|
2001-01-20 23:37:26 +08:00
|
|
|
color_select_drop_color (GtkWidget *widget,
|
|
|
|
const GimpRGB *color,
|
|
|
|
gpointer data)
|
1999-08-24 07:05:46 +08:00
|
|
|
{
|
|
|
|
ColorSelect *csp;
|
|
|
|
|
|
|
|
csp = (ColorSelect *) data;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->rgb = *color;
|
1999-08-24 07:05:46 +08:00
|
|
|
|
|
|
|
color_select_update_hsv_values (csp);
|
|
|
|
color_select_update_pos (csp);
|
|
|
|
|
|
|
|
color_select_update (csp, UPDATE_Z_COLOR);
|
|
|
|
color_select_update (csp, UPDATE_XY_COLOR);
|
2001-01-09 09:23:54 +08:00
|
|
|
|
|
|
|
color_select_update (csp, UPDATE_CALLER);
|
1999-08-24 07:05:46 +08:00
|
|
|
}
|
|
|
|
|
1999-10-03 21:50:19 +08:00
|
|
|
static void
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_set_color (ColorSelect *csp,
|
|
|
|
const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
if (! csp)
|
2001-01-08 05:07:14 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->hsv = *hsv;
|
|
|
|
csp->rgb = *rgb;
|
2001-01-08 05:07:14 +08:00
|
|
|
|
2001-01-08 13:00:22 +08:00
|
|
|
color_select_update_pos (csp);
|
2001-01-08 05:07:14 +08:00
|
|
|
|
2001-01-08 13:00:22 +08:00
|
|
|
color_select_update (csp, UPDATE_Z_COLOR);
|
|
|
|
color_select_update (csp, UPDATE_XY_COLOR);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_update (ColorSelect *csp,
|
|
|
|
ColorSelectUpdateType update)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
if (!csp)
|
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (update & UPDATE_POS)
|
|
|
|
color_select_update_pos (csp);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (update & UPDATE_VALUES)
|
|
|
|
{
|
|
|
|
color_select_update_values (csp);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (update & UPDATE_XY_COLOR)
|
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_image_fill (csp->xy_color, csp->xy_color_fill,
|
|
|
|
&csp->hsv, &csp->rgb);
|
2001-01-08 05:07:14 +08:00
|
|
|
gtk_widget_draw (csp->xy_color, NULL);
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (update & UPDATE_Z_COLOR)
|
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_image_fill (csp->z_color, csp->z_color_fill,
|
|
|
|
&csp->hsv, &csp->rgb);
|
2001-01-08 05:07:14 +08:00
|
|
|
gtk_widget_draw (csp->z_color, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2001-01-08 05:07:14 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
if (update & UPDATE_CALLER)
|
|
|
|
color_select_update_caller (csp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_update_caller (ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-09 09:23:54 +08:00
|
|
|
if (csp && csp->callback)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
(* csp->callback) (&csp->hsv,
|
|
|
|
&csp->rgb,
|
1997-11-25 06:05:25 +08:00
|
|
|
csp->client_data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_update_values (ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
if (!csp)
|
|
|
|
return;
|
|
|
|
|
|
|
|
switch (csp->z_color_fill)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
case COLOR_SELECT_RED:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->rgb.b = csp->pos[0] / 255.0;
|
|
|
|
csp->rgb.g = csp->pos[1] / 255.0;
|
|
|
|
csp->rgb.r = csp->pos[2] / 255.0;
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_GREEN:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->rgb.b = csp->pos[0] / 255.0;
|
|
|
|
csp->rgb.r = csp->pos[1] / 255.0;
|
|
|
|
csp->rgb.g = csp->pos[2] / 255.0;
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_BLUE:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->rgb.g = csp->pos[0] / 255.0;
|
|
|
|
csp->rgb.r = csp->pos[1] / 255.0;
|
|
|
|
csp->rgb.b = csp->pos[2] / 255.0;
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
2001-01-15 20:20:38 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
case COLOR_SELECT_HUE:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->hsv.v = csp->pos[0] / 255.0;
|
|
|
|
csp->hsv.s = csp->pos[1] / 255.0;
|
|
|
|
csp->hsv.h = csp->pos[2] / 255.0;
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_SATURATION:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->hsv.v = csp->pos[0] / 255.0;
|
|
|
|
csp->hsv.h = csp->pos[1] / 255.0;
|
|
|
|
csp->hsv.s = csp->pos[2] / 255.0;
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_VALUE:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->hsv.s = csp->pos[0] / 255.0;
|
|
|
|
csp->hsv.h = csp->pos[1] / 255.0;
|
|
|
|
csp->hsv.v = csp->pos[2] / 255.0;
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
switch (csp->z_color_fill)
|
|
|
|
{
|
|
|
|
case COLOR_SELECT_RED:
|
|
|
|
case COLOR_SELECT_GREEN:
|
|
|
|
case COLOR_SELECT_BLUE:
|
|
|
|
color_select_update_hsv_values (csp);
|
|
|
|
break;
|
2001-01-15 20:20:38 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
case COLOR_SELECT_HUE:
|
|
|
|
case COLOR_SELECT_SATURATION:
|
|
|
|
case COLOR_SELECT_VALUE:
|
|
|
|
color_select_update_rgb_values (csp);
|
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_update_rgb_values (ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
if (! csp)
|
2001-01-08 05:07:14 +08:00
|
|
|
return;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
gimp_hsv_to_rgb (&csp->hsv, &csp->rgb);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_update_hsv_values (ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
if (! csp)
|
2001-01-08 05:07:14 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
gimp_rgb_to_hsv (&csp->rgb, &csp->hsv);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_update_pos (ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
if (! csp)
|
2001-01-08 05:07:14 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
switch (csp->z_color_fill)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
case COLOR_SELECT_RED:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->pos[0] = (gint) (csp->rgb.b * 255.999);
|
|
|
|
csp->pos[1] = (gint) (csp->rgb.g * 255.999);
|
|
|
|
csp->pos[2] = (gint) (csp->rgb.r * 255.999);
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_GREEN:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->pos[0] = (gint) (csp->rgb.b * 255.999);
|
|
|
|
csp->pos[1] = (gint) (csp->rgb.r * 255.999);
|
|
|
|
csp->pos[2] = (gint) (csp->rgb.g * 255.999);
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_BLUE:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->pos[0] = (gint) (csp->rgb.g * 255.999);
|
|
|
|
csp->pos[1] = (gint) (csp->rgb.r * 255.999);
|
|
|
|
csp->pos[2] = (gint) (csp->rgb.b * 255.999);
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
2001-01-15 20:20:38 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
case COLOR_SELECT_HUE:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->pos[0] = (gint) (csp->hsv.v * 255.999);
|
|
|
|
csp->pos[1] = (gint) (csp->hsv.s * 255.999);
|
|
|
|
csp->pos[2] = (gint) (csp->hsv.h * 255.999);
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_SATURATION:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->pos[0] = (gint) (csp->hsv.v * 255.999);
|
|
|
|
csp->pos[1] = (gint) (csp->hsv.h * 255.999);
|
|
|
|
csp->pos[2] = (gint) (csp->hsv.s * 255.999);
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
|
|
|
case COLOR_SELECT_VALUE:
|
2001-01-15 20:20:38 +08:00
|
|
|
csp->pos[0] = (gint) (csp->hsv.s * 255.999);
|
|
|
|
csp->pos[1] = (gint) (csp->hsv.h * 255.999);
|
|
|
|
csp->pos[2] = (gint) (csp->hsv.v * 255.999);
|
2001-01-08 05:07:14 +08:00
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
color_select_xy_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event,
|
1999-08-24 07:05:46 +08:00
|
|
|
ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
if (! csp->gc)
|
1997-11-25 06:05:25 +08:00
|
|
|
csp->gc = gdk_gc_new (widget->window);
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_xy_marker (csp, &event->area);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_xy_events (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GdkEventButton *bevent;
|
|
|
|
GdkEventMotion *mevent;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint tx, ty;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_xy_marker (csp, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
csp->pos[0] = (bevent->x * 255) / (XY_DEF_WIDTH - 1);
|
|
|
|
csp->pos[1] = 255 - (bevent->y * 255) / (XY_DEF_HEIGHT - 1);
|
|
|
|
|
|
|
|
if (csp->pos[0] < 0)
|
|
|
|
csp->pos[0] = 0;
|
|
|
|
if (csp->pos[0] > 255)
|
|
|
|
csp->pos[0] = 255;
|
|
|
|
if (csp->pos[1] < 0)
|
|
|
|
csp->pos[1] = 0;
|
|
|
|
if (csp->pos[1] > 255)
|
|
|
|
csp->pos[1] = 255;
|
|
|
|
|
|
|
|
gdk_pointer_grab (csp->xy_color->window, FALSE,
|
1999-08-24 07:05:46 +08:00
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
2001-01-15 20:20:38 +08:00
|
|
|
GDK_BUTTON1_MOTION_MASK |
|
1999-08-24 07:05:46 +08:00
|
|
|
GDK_BUTTON_RELEASE_MASK,
|
1997-11-25 06:05:25 +08:00
|
|
|
NULL, NULL, bevent->time);
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_xy_marker (csp, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_update (csp, UPDATE_VALUES | UPDATE_CALLER);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_xy_marker (csp, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
csp->pos[0] = (bevent->x * 255) / (XY_DEF_WIDTH - 1);
|
|
|
|
csp->pos[1] = 255 - (bevent->y * 255) / (XY_DEF_HEIGHT - 1);
|
|
|
|
|
|
|
|
if (csp->pos[0] < 0)
|
|
|
|
csp->pos[0] = 0;
|
|
|
|
if (csp->pos[0] > 255)
|
|
|
|
csp->pos[0] = 255;
|
|
|
|
if (csp->pos[1] < 0)
|
|
|
|
csp->pos[1] = 0;
|
|
|
|
if (csp->pos[1] > 255)
|
|
|
|
csp->pos[1] = 255;
|
|
|
|
|
|
|
|
gdk_pointer_ungrab (bevent->time);
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_xy_marker (csp, NULL);
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_update (csp, UPDATE_VALUES | UPDATE_CALLER);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
mevent = (GdkEventMotion *) event;
|
|
|
|
if (mevent->is_hint)
|
|
|
|
{
|
|
|
|
gdk_window_get_pointer (widget->window, &tx, &ty, NULL);
|
|
|
|
mevent->x = tx;
|
|
|
|
mevent->y = ty;
|
|
|
|
}
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_xy_marker (csp, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
csp->pos[0] = (mevent->x * 255) / (XY_DEF_WIDTH - 1);
|
|
|
|
csp->pos[1] = 255 - (mevent->y * 255) / (XY_DEF_HEIGHT - 1);
|
|
|
|
|
|
|
|
if (csp->pos[0] < 0)
|
|
|
|
csp->pos[0] = 0;
|
|
|
|
if (csp->pos[0] > 255)
|
|
|
|
csp->pos[0] = 255;
|
|
|
|
if (csp->pos[1] < 0)
|
|
|
|
csp->pos[1] = 0;
|
|
|
|
if (csp->pos[1] > 255)
|
|
|
|
csp->pos[1] = 255;
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_xy_marker (csp, NULL);
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_update (csp, UPDATE_VALUES | UPDATE_CALLER);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
color_select_z_expose (GtkWidget *widget,
|
|
|
|
GdkEventExpose *event,
|
1999-08-24 07:05:46 +08:00
|
|
|
ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
if (!csp->gc)
|
|
|
|
csp->gc = gdk_gc_new (widget->window);
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_z_marker (csp, &event->area);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_z_events (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
ColorSelect *csp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
GdkEventButton *bevent;
|
|
|
|
GdkEventMotion *mevent;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint tx, ty;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_z_marker (csp, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
csp->pos[2] = 255 - (bevent->y * 255) / (Z_DEF_HEIGHT - 1);
|
2001-01-15 20:20:38 +08:00
|
|
|
|
|
|
|
csp->pos[2] = CLAMP (csp->pos[2], 0, 255);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdk_pointer_grab (csp->z_color->window, FALSE,
|
1999-08-24 07:05:46 +08:00
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
|
|
|
GDK_BUTTON1_MOTION_MASK |
|
|
|
|
GDK_BUTTON_RELEASE_MASK,
|
1997-11-25 06:05:25 +08:00
|
|
|
NULL, NULL, bevent->time);
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_z_marker (csp, NULL);
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_update (csp, UPDATE_VALUES | UPDATE_CALLER);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
bevent = (GdkEventButton *) event;
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_z_marker (csp, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
csp->pos[2] = 255 - (bevent->y * 255) / (Z_DEF_HEIGHT - 1);
|
2001-01-15 20:20:38 +08:00
|
|
|
|
|
|
|
csp->pos[2] = CLAMP (csp->pos[2], 0, 255);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
gdk_pointer_ungrab (bevent->time);
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_z_marker (csp, NULL);
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_update (csp, UPDATE_VALUES | UPDATE_XY_COLOR | UPDATE_CALLER);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
mevent = (GdkEventMotion *) event;
|
|
|
|
if (mevent->is_hint)
|
|
|
|
{
|
|
|
|
gdk_window_get_pointer (widget->window, &tx, &ty, NULL);
|
|
|
|
mevent->x = tx;
|
|
|
|
mevent->y = ty;
|
|
|
|
}
|
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_z_marker (csp, NULL);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
csp->pos[2] = 255 - (mevent->y * 255) / (Z_DEF_HEIGHT - 1);
|
2001-01-15 20:20:38 +08:00
|
|
|
|
|
|
|
csp->pos[2] = CLAMP (csp->pos[2], 0, 255);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-10-12 06:50:03 +08:00
|
|
|
color_select_draw_z_marker (csp, NULL);
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_update (csp, UPDATE_VALUES | UPDATE_CALLER);
|
1997-11-25 06:05:25 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_set_channel (ColorSelect *csp,
|
|
|
|
GimpColorSelectorChannelType type)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-15 20:20:38 +08:00
|
|
|
if (! csp)
|
2001-01-08 05:07:14 +08:00
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
switch ((ColorSelectFillType) type)
|
2001-01-08 05:07:14 +08:00
|
|
|
{
|
|
|
|
case COLOR_SELECT_HUE:
|
|
|
|
csp->z_color_fill = COLOR_SELECT_HUE;
|
|
|
|
csp->xy_color_fill = COLOR_SELECT_SATURATION_VALUE;
|
|
|
|
break;
|
|
|
|
case COLOR_SELECT_SATURATION:
|
|
|
|
csp->z_color_fill = COLOR_SELECT_SATURATION;
|
|
|
|
csp->xy_color_fill = COLOR_SELECT_HUE_VALUE;
|
|
|
|
break;
|
|
|
|
case COLOR_SELECT_VALUE:
|
|
|
|
csp->z_color_fill = COLOR_SELECT_VALUE;
|
|
|
|
csp->xy_color_fill = COLOR_SELECT_HUE_SATURATION;
|
|
|
|
break;
|
|
|
|
case COLOR_SELECT_RED:
|
|
|
|
csp->z_color_fill = COLOR_SELECT_RED;
|
|
|
|
csp->xy_color_fill = COLOR_SELECT_GREEN_BLUE;
|
|
|
|
break;
|
|
|
|
case COLOR_SELECT_GREEN:
|
|
|
|
csp->z_color_fill = COLOR_SELECT_GREEN;
|
|
|
|
csp->xy_color_fill = COLOR_SELECT_RED_BLUE;
|
|
|
|
break;
|
|
|
|
case COLOR_SELECT_BLUE:
|
|
|
|
csp->z_color_fill = COLOR_SELECT_BLUE;
|
|
|
|
csp->xy_color_fill = COLOR_SELECT_RED_GREEN;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
2001-01-08 05:07:14 +08:00
|
|
|
|
|
|
|
color_select_update (csp, UPDATE_POS);
|
|
|
|
color_select_update (csp, UPDATE_Z_COLOR | UPDATE_XY_COLOR);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_image_fill (GtkWidget *preview,
|
|
|
|
ColorSelectFillType type,
|
2001-01-15 20:20:38 +08:00
|
|
|
const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
ColorSelectFill csf;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint height;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
csf.buffer = g_malloc (preview->requisition.width * 3);
|
|
|
|
|
|
|
|
csf.update = update_procs[type];
|
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
csf.y = -1;
|
|
|
|
csf.width = preview->requisition.width;
|
1997-11-25 06:05:25 +08:00
|
|
|
csf.height = preview->requisition.height;
|
2001-01-15 20:20:38 +08:00
|
|
|
csf.hsv = *hsv;
|
|
|
|
csf.rgb = *rgb;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
height = csf.height;
|
|
|
|
if (height > 0)
|
|
|
|
while (height--)
|
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
if (csf.update)
|
|
|
|
(* csf.update) (&csf);
|
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
gtk_preview_draw_row (GTK_PREVIEW (preview),
|
|
|
|
csf.buffer, 0, csf.y, csf.width);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (csf.buffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_draw_z_marker (ColorSelect *csp,
|
1998-10-12 06:50:03 +08:00
|
|
|
GdkRectangle *clip)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
gint y;
|
|
|
|
gint minx;
|
|
|
|
gint miny;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (!csp->gc)
|
|
|
|
return;
|
|
|
|
|
|
|
|
y = (Z_DEF_HEIGHT - 1) - ((Z_DEF_HEIGHT - 1) * csp->pos[2]) / 255;
|
2001-01-09 09:23:54 +08:00
|
|
|
width = csp->z_color->requisition.width;
|
2001-01-08 05:07:14 +08:00
|
|
|
height = csp->z_color->requisition.height;
|
|
|
|
minx = 0;
|
|
|
|
miny = 0;
|
|
|
|
if (width <= 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (clip)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
width = MIN(width, clip->x + clip->width);
|
|
|
|
height = MIN(height, clip->y + clip->height);
|
|
|
|
minx = MAX(0, clip->x);
|
|
|
|
miny = MAX(0, clip->y);
|
|
|
|
}
|
1998-10-12 06:50:03 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (y >= miny && y < height)
|
|
|
|
{
|
|
|
|
gdk_gc_set_function (csp->gc, GDK_INVERT);
|
|
|
|
gdk_draw_line (csp->z_color->window, csp->gc, minx, y, width - 1, y);
|
|
|
|
gdk_gc_set_function (csp->gc, GDK_COPY);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-08-24 07:05:46 +08:00
|
|
|
color_select_draw_xy_marker (ColorSelect *csp,
|
1998-10-12 06:50:03 +08:00
|
|
|
GdkRectangle *clip)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
gint width;
|
|
|
|
gint height;
|
|
|
|
gint x, y;
|
|
|
|
gint minx, miny;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (!csp->gc)
|
|
|
|
return;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
x = ((XY_DEF_WIDTH - 1) * csp->pos[0]) / 255;
|
|
|
|
y = (XY_DEF_HEIGHT - 1) - ((XY_DEF_HEIGHT - 1) * csp->pos[1]) / 255;
|
|
|
|
width = csp->xy_color->requisition.width;
|
|
|
|
height = csp->xy_color->requisition.height;
|
|
|
|
minx = 0;
|
|
|
|
miny = 0;
|
|
|
|
if ((width <= 0) || (height <= 0))
|
|
|
|
return;
|
1998-10-12 06:50:03 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
gdk_gc_set_function (csp->gc, GDK_INVERT);
|
1998-10-12 06:50:03 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (clip)
|
|
|
|
{
|
|
|
|
width = MIN(width, clip->x + clip->width);
|
|
|
|
height = MIN(height, clip->y + clip->height);
|
|
|
|
minx = MAX(0, clip->x);
|
|
|
|
miny = MAX(0, clip->y);
|
|
|
|
}
|
1998-10-12 06:50:03 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (y >= miny && y < height)
|
|
|
|
gdk_draw_line (csp->xy_color->window, csp->gc, minx, y, width - 1, y);
|
1998-10-12 06:50:03 +08:00
|
|
|
|
2001-01-08 05:07:14 +08:00
|
|
|
if (x >= minx && x < width)
|
|
|
|
gdk_draw_line (csp->xy_color->window, csp->gc, x, miny, x, height - 1);
|
|
|
|
|
|
|
|
gdk_gc_set_function (csp->gc, GDK_COPY);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_red (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint i, r;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
|
|
|
r = (csf->height - csf->y + 1) * 255 / csf->height;
|
|
|
|
|
|
|
|
if (r < 0)
|
|
|
|
r = 0;
|
|
|
|
if (r > 255)
|
|
|
|
r = 255;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = r;
|
|
|
|
*p++ = 0;
|
|
|
|
*p++ = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_green (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint i, g;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
|
|
|
g = (csf->height - csf->y + 1) * 255 / csf->height;
|
|
|
|
|
|
|
|
if (g < 0)
|
|
|
|
g = 0;
|
|
|
|
if (g > 255)
|
|
|
|
g = 255;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = 0;
|
|
|
|
*p++ = g;
|
|
|
|
*p++ = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_blue (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint i, b;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
|
|
|
b = (csf->height - csf->y + 1) * 255 / csf->height;
|
|
|
|
|
|
|
|
if (b < 0)
|
|
|
|
b = 0;
|
|
|
|
if (b > 255)
|
|
|
|
b = 255;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = 0;
|
|
|
|
*p++ = 0;
|
|
|
|
*p++ = b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_hue (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gfloat h, f;
|
|
|
|
gint r, g, b;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
2001-01-15 20:20:38 +08:00
|
|
|
h = csf->y * 360.0 / csf->height;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
h = CLAMP (360 - h, 0, 360);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
h /= 60;
|
|
|
|
f = (h - (int) h) * 255;
|
|
|
|
|
|
|
|
r = g = b = 0;
|
|
|
|
|
|
|
|
switch ((int) h)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
r = 255;
|
|
|
|
g = f;
|
|
|
|
b = 0;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
r = 255 - f;
|
|
|
|
g = 255;
|
|
|
|
b = 0;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
r = 0;
|
|
|
|
g = 255;
|
|
|
|
b = f;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
r = 0;
|
|
|
|
g = 255 - f;
|
|
|
|
b = 255;
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
r = f;
|
|
|
|
g = 0;
|
|
|
|
b = 255;
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
r = 255;
|
|
|
|
g = 0;
|
|
|
|
b = 255 - f;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = r;
|
|
|
|
*p++ = g;
|
|
|
|
*p++ = b;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_saturation (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint s;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
|
|
|
s = csf->y * 255 / csf->height;
|
|
|
|
|
|
|
|
if (s < 0)
|
|
|
|
s = 0;
|
|
|
|
if (s > 255)
|
|
|
|
s = 255;
|
|
|
|
|
|
|
|
s = 255 - s;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = s;
|
|
|
|
*p++ = s;
|
|
|
|
*p++ = s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_value (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint v;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
|
|
|
v = csf->y * 255 / csf->height;
|
|
|
|
|
|
|
|
if (v < 0)
|
|
|
|
v = 0;
|
|
|
|
if (v > 255)
|
|
|
|
v = 255;
|
|
|
|
|
|
|
|
v = 255 - v;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v;
|
|
|
|
*p++ = v;
|
|
|
|
*p++ = v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_red_green (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint i, r, b;
|
|
|
|
gfloat g, dg;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
2001-01-15 20:20:38 +08:00
|
|
|
b = (gint) (csf->rgb.b * 255.999);
|
1997-11-25 06:05:25 +08:00
|
|
|
r = (csf->height - csf->y + 1) * 255 / csf->height;
|
|
|
|
|
|
|
|
if (r < 0)
|
|
|
|
r = 0;
|
|
|
|
if (r > 255)
|
|
|
|
r = 255;
|
|
|
|
|
|
|
|
g = 0;
|
|
|
|
dg = 255.0 / csf->width;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = r;
|
|
|
|
*p++ = g;
|
|
|
|
*p++ = b;
|
|
|
|
|
|
|
|
g += dg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_red_blue (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint i, r, g;
|
|
|
|
gfloat b, db;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
2001-01-15 20:20:38 +08:00
|
|
|
g = (gint) (csf->rgb.g * 255.999);
|
1997-11-25 06:05:25 +08:00
|
|
|
r = (csf->height - csf->y + 1) * 255 / csf->height;
|
|
|
|
|
|
|
|
if (r < 0)
|
|
|
|
r = 0;
|
|
|
|
if (r > 255)
|
|
|
|
r = 255;
|
|
|
|
|
|
|
|
b = 0;
|
|
|
|
db = 255.0 / csf->width;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = r;
|
|
|
|
*p++ = g;
|
|
|
|
*p++ = b;
|
|
|
|
|
|
|
|
b += db;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_green_blue (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gint i, g, r;
|
|
|
|
gfloat b, db;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
2001-01-15 20:20:38 +08:00
|
|
|
r = (gint) (csf->rgb.r * 255.999);
|
1997-11-25 06:05:25 +08:00
|
|
|
g = (csf->height - csf->y + 1) * 255 / csf->height;
|
|
|
|
|
|
|
|
if (g < 0)
|
|
|
|
g = 0;
|
|
|
|
if (g > 255)
|
|
|
|
g = 255;
|
|
|
|
|
|
|
|
b = 0;
|
|
|
|
db = 255.0 / csf->width;
|
|
|
|
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = r;
|
|
|
|
*p++ = g;
|
|
|
|
*p++ = b;
|
|
|
|
|
|
|
|
b += db;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_hue_saturation (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gfloat h, v, s, ds;
|
|
|
|
gint f;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
|
|
|
h = 360 - (csf->y * 360 / csf->height);
|
|
|
|
|
|
|
|
if (h < 0)
|
|
|
|
h = 0;
|
|
|
|
if (h > 359)
|
|
|
|
h = 359;
|
|
|
|
|
|
|
|
h /= 60;
|
|
|
|
f = (h - (int) h) * 255;
|
|
|
|
|
|
|
|
s = 0;
|
|
|
|
ds = 1.0 / csf->width;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
v = csf->hsv.v;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch ((int) h)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
|
|
|
|
s += ds;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
|
|
|
|
s += ds;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v *255;
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
|
|
|
|
s += ds;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
*p++ = v * 255;
|
|
|
|
|
|
|
|
s += ds;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
*p++ = v * (255 * (1 - s));
|
|
|
|
*p++ = v * 255;
|
|
|
|
|
|
|
|
s += ds;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
|
|
|
|
s += ds;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_hue_value (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gfloat h, v, dv, s;
|
|
|
|
gint f;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
|
|
|
h = 360 - (csf->y * 360 / csf->height);
|
|
|
|
|
|
|
|
if (h < 0)
|
|
|
|
h = 0;
|
|
|
|
if (h > 359)
|
|
|
|
h = 359;
|
|
|
|
|
|
|
|
h /= 60;
|
|
|
|
f = (h - (int) h) * 255;
|
|
|
|
|
|
|
|
v = 0;
|
|
|
|
dv = 1.0 / csf->width;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
s = csf->hsv.s;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
switch ((int) h)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v *255;
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
*p++ = v * 255;
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
*p++ = v * (255 * (1 - s));
|
|
|
|
*p++ = v * 255;
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_update_saturation_value (ColorSelectFill *csf)
|
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
guchar *p;
|
2001-01-08 10:24:29 +08:00
|
|
|
gfloat h, v, dv, s;
|
|
|
|
gint f;
|
|
|
|
gint i;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
p = csf->buffer;
|
|
|
|
|
|
|
|
csf->y += 1;
|
2001-01-09 09:23:54 +08:00
|
|
|
s = (gfloat) csf->y / csf->height;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
if (s < 0)
|
|
|
|
s = 0;
|
|
|
|
if (s > 1)
|
|
|
|
s = 1;
|
|
|
|
|
|
|
|
s = 1 - s;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
h = (gfloat) csf->hsv.h * 360.0;
|
1997-11-25 06:05:25 +08:00
|
|
|
if (h >= 360)
|
|
|
|
h -= 360;
|
|
|
|
h /= 60;
|
2001-01-09 09:23:54 +08:00
|
|
|
f = (h - (gint) h) * 255;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
|
|
|
v = 0;
|
|
|
|
dv = 1.0 / csf->width;
|
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
switch ((gint) h)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v *255;
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
*p++ = v * 255;
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * (255 - (s * (255 - f)));
|
|
|
|
*p++ = v * (255 * (1 - s));
|
|
|
|
*p++ = v * 255;
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
for (i = 0; i < csf->width; i++)
|
|
|
|
{
|
|
|
|
*p++ = v * 255;
|
|
|
|
*p++ = v * 255 * (1 - s);
|
|
|
|
*p++ = v * (255 - s * f);
|
|
|
|
|
|
|
|
v += dv;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
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 05:07:14 +08:00
|
|
|
/****************************/
|
|
|
|
/* Color notebook glue */
|
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
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
2001-01-08 05:07:14 +08:00
|
|
|
GimpColorSelectorCallback callback;
|
|
|
|
gpointer *client_data;
|
|
|
|
ColorSelect *csp;
|
|
|
|
GtkWidget *main_vbox;
|
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
|
|
|
} notebook_glue;
|
|
|
|
|
|
|
|
static GtkWidget *
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_notebook_new (const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb,
|
2001-01-08 05:07:14 +08:00
|
|
|
gboolean show_alpha,
|
|
|
|
GimpColorSelectorCallback callback,
|
|
|
|
gpointer data,
|
1999-08-24 07:05:46 +08:00
|
|
|
/* RETURNS: */
|
2001-01-08 05:07:14 +08:00
|
|
|
gpointer *selector_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
|
|
|
{
|
1999-08-24 07:05:46 +08:00
|
|
|
ColorSelect *csp;
|
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
|
|
|
notebook_glue *glue;
|
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
glue = g_new (notebook_glue, 1);
|
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
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
csp = g_new (ColorSelect, 1);
|
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
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
glue->csp = csp;
|
|
|
|
glue->callback = callback;
|
|
|
|
glue->client_data = 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
|
|
|
|
1999-08-24 07:05:46 +08:00
|
|
|
csp->callback = color_select_notebook_update_callback;
|
|
|
|
csp->client_data = glue;
|
1999-10-28 23:05:49 +08:00
|
|
|
csp->z_color_fill = COLOR_SELECT_HUE;
|
|
|
|
csp->xy_color_fill = COLOR_SELECT_SATURATION_VALUE;
|
1999-08-24 07:05:46 +08:00
|
|
|
csp->gc = 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-01-15 20:20:38 +08:00
|
|
|
csp->hsv = *hsv;
|
|
|
|
csp->rgb = *rgb;
|
2001-01-09 09:23:54 +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
|
|
|
color_select_update_pos (csp);
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
glue->main_vbox = color_select_widget_new (csp, rgb);
|
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-15 20:20:38 +08:00
|
|
|
color_select_update (csp, UPDATE_XY_COLOR | UPDATE_Z_COLOR);
|
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 05:07:14 +08:00
|
|
|
*selector_data = glue;
|
|
|
|
|
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 glue->main_vbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-01-08 05:07:14 +08:00
|
|
|
color_select_notebook_free (gpointer 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
|
|
|
{
|
|
|
|
notebook_glue *glue = data;
|
|
|
|
|
1999-10-03 21:50:19 +08:00
|
|
|
gdk_gc_destroy (glue->csp->gc);
|
|
|
|
g_free (glue->csp);
|
2001-01-08 05:07:14 +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
|
|
|
/* don't need to destroy the widget, since it's done by the caller
|
2001-01-08 05:07:14 +08:00
|
|
|
* of this function
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
g_free (glue);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_notebook_set_color (gpointer data,
|
|
|
|
const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb)
|
2001-01-09 09:23:54 +08:00
|
|
|
{
|
|
|
|
notebook_glue *glue = data;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_set_color (glue->csp, hsv, rgb);
|
2001-01-09 09:23:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
color_select_notebook_set_channel (gpointer data,
|
|
|
|
GimpColorSelectorChannelType channel)
|
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
|
|
|
{
|
|
|
|
notebook_glue *glue = data;
|
|
|
|
|
2001-01-09 09:23:54 +08:00
|
|
|
color_select_set_channel (glue->csp, channel);
|
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
|
2001-01-15 20:20:38 +08:00
|
|
|
color_select_notebook_update_callback (const GimpHSV *hsv,
|
|
|
|
const GimpRGB *rgb,
|
|
|
|
gpointer 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
|
|
|
{
|
|
|
|
notebook_glue *glue = data;
|
|
|
|
|
2001-01-15 20:20:38 +08:00
|
|
|
glue->callback (glue->client_data, hsv, rgb);
|
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
|
|
|
}
|