Commit 35cb0fa4 authored by Sven Neumann's avatar Sven Neumann

libgimp/Makefile.am new widget which provides a simple button with a color

        * libgimp/Makefile.am
        * libgimp/gimpcolorbutton.[ch]: new widget which provides a simple
        button with a color preview together with a completely wired
        gtk_color_select_dialog. Color dnd will be added next.

        * libgimp/gimpchainbutton.c
        * libgimp/gimpchainbutton.h: cleaned up the code a bit and provided
        a destroy function which takes care of freeing the memory allocated
        for the pixmaps/bitmaps (well at least I hope it does).

        * libgimp/gimpunit.c: some cases were handled wrong in
        gimp_unit_get_digits().

        * plug-ins/megawidget/megawidget.c: follow the GUI conventions when
        building the action_area and internationalized the code.

        * plug-ins/common/CML_explorer.c: fixed a typo

--Sven
parent 26199cae
Sun Oct 31 21:51:10 MET 1999 Sven Neumann <sven@gimp.org>
* libgimp/Makefile.am
* libgimp/gimpcolorbutton.[ch]: new widget which provides a simple
button with a color preview together with a completely wired
gtk_color_select_dialog. Color dnd will be added next.
* libgimp/gimpchainbutton.c
* libgimp/gimpchainbutton.h: cleaned up the code a bit and provided
a destroy function which takes care of freeing the memory allocated
for the pixmaps/bitmaps (well at least I hope it does).
* libgimp/gimpunit.c: some cases were handled wrong in
gimp_unit_get_digits().
* plug-ins/megawidget/megawidget.c: follow the GUI conventions when
building the action_area and internationalized the code.
* plug-ins/common/CML_explorer.c: fixed a typo
1999-10-31 Tor Lillqvist <tml@iki.fi>
* app/about_dialog.c (scroll_text): Add a couple of missing commas
......
......@@ -29,6 +29,8 @@ libgimpi_a_SOURCES = \
gimpenv.h \
gimpchainbutton.c \
gimpchainbutton.h \
gimpcolorbutton.c \
gimpcolorbutton.h \
gimpfileselection.c \
gimpfileselection.h \
gimpmatrix.c \
......@@ -100,6 +102,7 @@ libgimpui_la_SOURCES = \
gimppatternmenu.c \
gimpexport.c \
gimpchainbutton.c \
gimpcolorbutton.c \
gimpfileselection.c \
gimppatheditor.c \
gimpsizeentry.c \
......@@ -110,6 +113,7 @@ gimpinclude_HEADERS = \
color_selector.h \
gimp.h \
gimpchainbutton.h \
gimpcolorbutton.h \
gimpcompat.h \
gimpenums.h \
gimpenv.h \
......
......@@ -31,14 +31,36 @@ static char **gimp_chain_broken_xpm[] = {
chain_broken_ver_xpm
};
static void gimp_chain_button_realize (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_callback (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_draw_lines (GtkWidget *widget,
GdkEvent* event,
GimpChainButton *gcb);
static void gimp_chain_button_destroy (GtkObject *object);
static void gimp_chain_button_realize_callback (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_clicked_callback (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_draw_lines (GtkWidget *widget,
GdkEvent* event,
GimpChainButton *gcb);
static GtkWidgetClass *parent_class = NULL;
static void
gimp_chain_button_destroy (GtkObject *object)
{
GimpChainButton *gcb;
g_return_if_fail (gcb = GIMP_CHAIN_BUTTON (object));
if (gcb->broken)
gdk_pixmap_unref (gcb->broken);
if (gcb->broken_mask)
gdk_bitmap_unref (gcb->broken_mask);
if (gcb->chain)
gdk_pixmap_unref (gcb->chain);
if (gcb->chain_mask)
gdk_bitmap_unref (gcb->chain_mask);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
gimp_chain_button_class_init (GimpChainButtonClass *class)
{
......@@ -47,14 +69,14 @@ gimp_chain_button_class_init (GimpChainButtonClass *class)
object_class = (GtkObjectClass*) class;
parent_class = gtk_type_class (gtk_widget_get_type ());
object_class->destroy = gimp_chain_button_destroy;
}
static void
gimp_chain_button_init (GimpChainButton *gcb)
{
gcb->position = GIMP_CHAIN_TOP;
gcb->tooltips = NULL;
gcb->tip = NULL;
gcb->button = gtk_button_new ();
gcb->line1 = gtk_drawing_area_new ();
gcb->line2 = gtk_drawing_area_new ();
......@@ -66,12 +88,12 @@ gimp_chain_button_init (GimpChainButton *gcb)
gcb->active = FALSE;
gtk_signal_connect (GTK_OBJECT(gcb->button), "clicked",
GTK_SIGNAL_FUNC(gimp_chain_button_callback), gcb);
GTK_SIGNAL_FUNC (gimp_chain_button_clicked_callback), gcb);
/* That's all we do here, since setting the pixmaps won't work before
the parent window is realized.
We connect to the realized-signal instead and do the rest there. */
gtk_signal_connect (GTK_OBJECT(gcb), "realize",
GTK_SIGNAL_FUNC(gimp_chain_button_realize), gcb);
GTK_SIGNAL_FUNC(gimp_chain_button_realize_callback), gcb);
gtk_signal_connect (GTK_OBJECT(gcb->line1), "expose_event",
GTK_SIGNAL_FUNC(gimp_chain_button_draw_lines), gcb);
gtk_signal_connect (GTK_OBJECT(gcb->line2), "expose_event",
......@@ -136,8 +158,8 @@ gimp_chain_button_new (GimpChainPosition position)
}
static void
gimp_chain_button_realize (GtkWidget *widget,
GimpChainButton *gcb)
gimp_chain_button_realize_callback (GtkWidget *widget,
GimpChainButton *gcb)
{
GtkStyle *style;
GtkWidget *parent;
......@@ -167,8 +189,8 @@ gimp_chain_button_realize (GtkWidget *widget,
}
static void
gimp_chain_button_callback (GtkWidget *widget,
GimpChainButton *gcb)
gimp_chain_button_clicked_callback (GtkWidget *widget,
GimpChainButton *gcb)
{
g_return_if_fail (gcb != NULL);
g_return_if_fail (GIMP_IS_CHAIN_BUTTON (gcb));
......
......@@ -59,8 +59,6 @@ struct _GimpChainButton
GtkTable table;
GimpChainPosition position;
GtkTooltips *tooltips;
gchar *tip;
GtkWidget *button;
GtkWidget *line1;
GtkWidget *line2;
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Gimp Color Button
* Copyright (C) 1999 Sven Neumann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* TODO:
*
* add DND -- this will be trivial as soon as gimpdnd.[ch] is moved into libgimp
*
* handle bytes != 3|4 -- would we have to provide a special color select dialog
* for that case? Another possibility could be to destroy
* all color-related widgets in the gtk colorselector.
*/
#include "gimpcolorbutton.h"
#include "gimplimits.h"
static void gimp_color_button_destroy (GtkObject *object);
static void gimp_color_button_clicked (GtkButton *button);
static void gimp_color_button_paint (GimpColorButton *gcb);
static void gimp_color_button_dialog_ok (GtkWidget *widget, gpointer data);
static void gimp_color_button_dialog_cancel (GtkWidget *widget, gpointer data);
enum {
COLOR_CHANGED,
LAST_SIGNAL
};
static gint gimp_color_button_signals[LAST_SIGNAL] = { 0 };
static GtkWidgetClass *parent_class = NULL;
static void
gimp_color_button_destroy (GtkObject *object)
{
GimpColorButton *gcb;
g_return_if_fail (gcb = GIMP_COLOR_BUTTON (object));
g_free (gcb->title);
if (gcb->dialog)
gtk_widget_destroy (gcb->dialog);
g_free (gcb->dcolor);
g_free (gcb->even);
g_free (gcb->odd);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
gimp_color_button_class_init (GimpColorButtonClass *class)
{
GtkObjectClass *object_class;
GtkButtonClass *widget_class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkButtonClass*) class;
parent_class = gtk_type_class (gtk_widget_get_type ());
gimp_color_button_signals[COLOR_CHANGED] =
gtk_signal_new ("color_changed",
GTK_RUN_FIRST,
object_class->type,
GTK_SIGNAL_OFFSET (GimpColorButtonClass,
color_changed),
gtk_signal_default_marshaller, GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, gimp_color_button_signals,
LAST_SIGNAL);
class->color_changed = NULL;
widget_class->clicked = gimp_color_button_clicked;
object_class->destroy = gimp_color_button_destroy;
}
static void
gimp_color_button_init (GimpColorButton *gcb)
{
gcb->title = NULL;
gcb->bpp = 0;
gcb->color = NULL;
gcb->dcolor = NULL;
gcb->preview = NULL;
gcb->dialog = NULL;
gcb->even = NULL;
gcb->odd = NULL;
}
GtkType
gimp_color_button_get_type (void)
{
static guint gcb_type = 0;
if (!gcb_type)
{
GtkTypeInfo gcb_info =
{
"GimpColorButton",
sizeof (GimpColorButton),
sizeof (GimpColorButtonClass),
(GtkClassInitFunc) gimp_color_button_class_init,
(GtkObjectInitFunc) gimp_color_button_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL
};
gcb_type = gtk_type_unique (gtk_button_get_type (), &gcb_info);
}
return gcb_type;
}
GtkWidget*
gimp_color_button_new (gchar *title,
gint width,
gint height,
guchar *color,
gint bpp)
{
GimpColorButton *gcb;
gint i;
g_return_val_if_fail (width > 0 && height > 0, NULL);
g_return_val_if_fail (bpp == 3 || bpp == 4, NULL);
gcb = gtk_type_new (gimp_color_button_get_type ());
gcb->title = g_strdup (title);
gcb->width = width;
gcb->height = height;
gcb->color = color;
gcb->bpp = bpp;
gcb->dcolor = g_new (gdouble, 4);
gcb->even = g_new (guchar, 3 * width);
gcb->odd = g_new (guchar, 3 * width);
for (i = 0; i < bpp; i++)
gcb->dcolor[i] = (gdouble)color[i] / 255.0;
if (bpp == 3)
gcb->dcolor[3] = 1.0;
gcb->preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_signal_connect (GTK_OBJECT (gcb->preview), "destroy",
gtk_widget_destroyed, &gcb->preview);
gtk_preview_size (GTK_PREVIEW (gcb->preview), width, height);
gtk_container_add (GTK_CONTAINER (gcb), gcb->preview);
gtk_widget_show (gcb->preview);
gimp_color_button_paint (gcb);
return (GTK_WIDGET (gcb));
}
static void
gimp_color_button_clicked (GtkButton *button)
{
GimpColorButton *gcb;
GtkColorSelection *colorsel;
g_return_if_fail (GIMP_IS_COLOR_BUTTON (button));
gcb = GIMP_COLOR_BUTTON (button);
if (!gcb->dialog)
{
gcb->dialog = gtk_color_selection_dialog_new (gcb->title);
colorsel = GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->colorsel);
gtk_color_selection_set_opacity (colorsel, (gcb->bpp == 4));
gtk_color_selection_set_color (colorsel, gcb->dcolor);
gtk_widget_destroy (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->help_button);
gtk_signal_connect (GTK_OBJECT (gcb->dialog), "destroy",
(GtkSignalFunc) gtk_widget_destroyed, &gcb->dialog);
gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->ok_button),
"clicked",
(GtkSignalFunc) gimp_color_button_dialog_ok, gcb);
gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->cancel_button),
"clicked",
(GtkSignalFunc) gimp_color_button_dialog_cancel, gcb);
gtk_window_position (GTK_WINDOW (gcb->dialog), GTK_WIN_POS_MOUSE);
}
gtk_widget_show (gcb->dialog);
}
static void
gimp_color_button_paint (GimpColorButton *gcb)
{
gint x, y, i;
gdouble c0, c1;
guchar *p0, *p1;
g_return_if_fail (GIMP_IS_COLOR_BUTTON (gcb));
p0 = gcb->even;
p1 = gcb->odd;
if (gcb->bpp == 3)
{
for (x = 0; x < gcb->width; x++)
{
for (i = 0; i < 3; i++)
*p0++ = gcb->dcolor[i] * 255.999;
}
for (y = 0; y < gcb->height; y++)
gtk_preview_draw_row (GTK_PREVIEW (gcb->preview), gcb->even, 0, y, gcb->width);
}
else /* gcb->bpp == 4 */
{
for (x = 0; x < gcb->width; x++)
{
if ((x / GIMP_CHECK_SIZE_SM) & 1)
{
c0 = GIMP_CHECK_LIGHT;
c1 = GIMP_CHECK_DARK;
}
else
{
c0 = GIMP_CHECK_DARK;
c1 = GIMP_CHECK_LIGHT;
}
for (i = 0; i < 3; i++)
{
*p0++ = (c0 + (gcb->dcolor[i] - c0) * gcb->dcolor[3]) * 255.999;
*p1++ = (c1 + (gcb->dcolor[i] - c1) * gcb->dcolor[3]) * 255.999;
}
}
for (y = 0; y < gcb->height; y++)
{
if ((y / GIMP_CHECK_SIZE_SM) & 1)
gtk_preview_draw_row (GTK_PREVIEW (gcb->preview), gcb->odd, 0, y, gcb->width);
else
gtk_preview_draw_row (GTK_PREVIEW (gcb->preview), gcb->even, 0, y, gcb->width);
}
}
gtk_widget_queue_draw (gcb->preview);
}
static void
gimp_color_button_dialog_ok (GtkWidget *widget,
gpointer data)
{
GimpColorButton *gcb;
guchar new_color[4];
gboolean color_changed = FALSE;
gint i;
g_return_if_fail (GIMP_IS_COLOR_BUTTON (data));
gcb = GIMP_COLOR_BUTTON (data);
gtk_color_selection_get_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (gcb->dialog)->colorsel), gcb->dcolor);
for (i = 0; i < gcb->bpp; i++)
{
new_color[i] = gcb->dcolor[i] * 255.999;
if (new_color[i] != gcb->color[i])
color_changed = TRUE;
gcb->color[i] = new_color[i];
}
gtk_widget_destroy (gcb->dialog);
gimp_color_button_paint (gcb);
if (color_changed)
gtk_signal_emit (GTK_OBJECT (gcb),
gimp_color_button_signals[COLOR_CHANGED]);
}
static void
gimp_color_button_dialog_cancel (GtkWidget *widget,
gpointer data)
{
GimpColorButton *gcb;
g_return_if_fail (GIMP_IS_COLOR_BUTTON (data));
gcb = GIMP_COLOR_BUTTON (data);
gtk_widget_destroy (gcb->dialog);
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Gimp Color Button
* Copyright (C) 1999 Sven Neumann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* This provides a button with a color preview. The preview
* can handle transparency by showing the checkerboard.
* On click, a color selector is opened, which is already
* fully functional wired to the preview button.
*/
#ifndef __GIMP_COLOR_BUTTON_H__
#define __GIMP_COLOR_BUTTON_H__
#include <gtk/gtk.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GIMP_TYPE_COLOR_BUTTON (gimp_color_button_get_type ())
#define GIMP_COLOR_BUTTON(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_COLOR_BUTTON, GimpColorButton))
#define GIMP_COLOR_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLOR_BUTTON, GimpColorButtonClass))
#define GIMP_IS_COLOR_BUTTON(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_COLOR_BUTTON))
#define GIMP_IS_COLOR_BUTTON_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLOR_BUTTON))
typedef struct _GimpColorButton GimpColorButton;
typedef struct _GimpColorButtonClass GimpColorButtonClass;
struct _GimpColorButton
{
GtkButton button;
gchar *title;
gint width;
gint height;
guchar *color;
gint bpp;
gdouble *dcolor;
GtkWidget *preview;
GtkWidget *dialog;
guchar *even;
guchar *odd;
};
struct _GimpColorButtonClass
{
GtkButtonClass parent_class;
void (* color_changed) (GimpColorButton *gcb);
};
GtkType gimp_color_button_get_type (void);
GtkWidget* gimp_color_button_new (gchar *title,
gint width,
gint height,
guchar *color,
gint bpp);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __COLOR_BUTTON_H__ */
......@@ -209,7 +209,8 @@ gimp_unit_get_digits (GUnit unit)
gint digits;
g_return_val_if_fail (unit >= UNIT_INCH, 2.0);
if (unit < 0)
return 0;
if (unit < UNIT_END)
return gimp_unit_defs[unit].digits;
......@@ -219,7 +220,7 @@ gimp_unit_get_digits (GUnit unit)
PARAM_INT32, unit,
PARAM_END);
digits = 2.0;
digits = gimp_unit_defs[UNIT_INCH].digits;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
digits = return_vals[1].data.d_int32;
......
......@@ -209,7 +209,8 @@ gimp_unit_get_digits (GUnit unit)
gint digits;
g_return_val_if_fail (unit >= UNIT_INCH, 2.0);
if (unit < 0)
return 0;
if (unit < UNIT_END)
return gimp_unit_defs[unit].digits;
......@@ -219,7 +220,7 @@ gimp_unit_get_digits (GUnit unit)
PARAM_INT32, unit,
PARAM_END);
digits = 2.0;
digits = gimp_unit_defs[UNIT_INCH].digits;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
digits = return_vals[1].data.d_int32;
......
......@@ -209,7 +209,8 @@ gimp_unit_get_digits (GUnit unit)
gint digits;
g_return_val_if_fail (unit >= UNIT_INCH, 2.0);
if (unit < 0)
return 0;
if (unit < UNIT_END)
return gimp_unit_defs[unit].digits;
......@@ -219,7 +220,7 @@ gimp_unit_get_digits (GUnit unit)
PARAM_INT32, unit,
PARAM_END);
digits = 2.0;
digits = gimp_unit_defs[UNIT_INCH].digits;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
digits = return_vals[1].data.d_int32;
......
......@@ -31,14 +31,36 @@ static char **gimp_chain_broken_xpm[] = {
chain_broken_ver_xpm
};
static void gimp_chain_button_realize (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_callback (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_draw_lines (GtkWidget *widget,
GdkEvent* event,
GimpChainButton *gcb);
static void gimp_chain_button_destroy (GtkObject *object);
static void gimp_chain_button_realize_callback (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_clicked_callback (GtkWidget *widget, GimpChainButton *gcb);
static void gimp_chain_button_draw_lines (GtkWidget *widget,
GdkEvent* event,
GimpChainButton *gcb);
static GtkWidgetClass *parent_class = NULL;
static void
gimp_chain_button_destroy (GtkObject *object)
{
GimpChainButton *gcb;
g_return_if_fail (gcb = GIMP_CHAIN_BUTTON (object));
if (gcb->broken)
gdk_pixmap_unref (gcb->broken);
if (gcb->broken_mask)
gdk_bitmap_unref (gcb->broken_mask);
if (gcb->chain)
gdk_pixmap_unref (gcb->chain);
if (gcb->chain_mask)
gdk_bitmap_unref (gcb->chain_mask);
if (GTK_OBJECT_CLASS (parent_class)->destroy)
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
}
static void
gimp_chain_button_class_init (GimpChainButtonClass *class)
{
......@@ -47,14 +69,14 @@ gimp_chain_button_class_init (GimpChainButtonClass *class)
object_class = (GtkObjectClass*) class;
parent_class = gtk_type_class (gtk_widget_get_type ());
object_class->destroy = gimp_chain_button_destroy;
}
static void
gimp_chain_button_init (GimpChainButton *gcb)
{
gcb->position = GIMP_CHAIN_TOP;
gcb->tooltips = NULL;
gcb->tip = NULL;
gcb->button = gtk_button_new ();
gcb->line1 = gtk_drawing_area_new ();
gcb->line2 = gtk_drawing_area_new ();
......@@ -66,12 +88,12 @@ gimp_chain_button_init (GimpChainButton *gcb)
gcb->active = FALSE;
gtk_signal_connect (GTK_OBJECT(gcb->button), "clicked",
GTK_SIGNAL_FUNC(gimp_chain_button_callback), gcb);
GTK_SIGNAL_FUNC (gimp_chain_button_clicked_callback), gcb);
/* That's all we do here, since setting the pixmaps won't work before
the parent window is realized.
We connect to the realized-signal instead and do the rest there. */
gtk_signal_connect (GTK_OBJECT(gcb), "realize",
GTK_SIGNAL_FUNC(gimp_chain_button_realize), gcb);
GTK_SIGNAL_FUNC(gimp_chain_button_realize_callback), gcb);
gtk_signal_connect (GTK_OBJECT(gcb->line1), "expose_event",
GTK_SIGNAL_FUNC(gimp_chain_button_draw_lines), gcb);
gtk_signal_connect (GTK_OBJECT(gcb->line2), "expose_event",
......@@ -136,8 +158,8 @@ gimp_chain_button_new (GimpChainPosition position)
}
static void
gimp_chain_button_realize (GtkWidget *widget,
GimpChainButton *gcb)
gimp_chain_button_realize_callback (GtkWidget *widget,
GimpChainButton *gcb)
{
GtkStyle *style;
GtkWidget *parent;
......@@ -167,8 +189,8 @@ gimp_chain_button_realize (GtkWidget *widget,
}
static void
gimp_chain_button_callback (GtkWidget *widget,
GimpChainButton *gcb)
gimp_chain_button_clicked_callback (GtkWidget *widget,
GimpChainButton *gcb)
{
g_return_if_fail (gcb != NULL);
g_return_if_fail (GIMP_IS_CHAIN_BUTTON (gcb));
......
......@@ -59,8 +59,6 @@ struct _GimpChainButton
GtkTable table;
GimpChainPosition position;
GtkTooltips *tooltips;
gchar *tip;
GtkWidget *button;
GtkWidget *line1;
GtkWidget *line2;
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* Gimp Color Button
* Copyright (C) 1999 Sven Neumann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/* TODO:
*
* add DND -- this will be trivial as soon as gimpdnd.[ch] is moved into libgimp
*
* handle bytes != 3|4 -- would we have to provide a special color select dialog