Commit 88286d32 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Color selection dialog rewrite.

Wed May 10 16:38:17 2000  Owen Taylor  <otaylor@redhat.com>

	* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
	gtk/gtkhsv.[ch]: Color selection dialog rewrite.

	(Original triangle color selector from Simon Budig
	<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
	from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
	Santiago <mrcooger@cyberverse.com>)

	* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
	out into a separate widget.

	* gtk/testgtk.c: Add some checkbuttons for toggling palette
	and opacity controls.

Wed May 10 16:08:09 2000  Owen Taylor  <otaylor@redhat.com>

	* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
	snuck in prematurely.
parent ac9090ed
Wed May 10 16:38:17 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
gtk/gtkhsv.[ch]: Color selection dialog rewrite.
(Original triangle color selector from Simon Budig
<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
Santiago <mrcooger@cyberverse.com>)
* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
out into a separate widget.
* gtk/testgtk.c: Add some checkbuttons for toggling palette
and opacity controls.
Wed May 10 16:08:09 2000 Owen Taylor <otaylor@redhat.com>
* configure.in (GTK_LIBS_EXTRA): Remove gobject that snuck
in prematurely.
* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
snuck in prematurely.
2000-05-07 Tor Lillqvist <tml@iki.fi>
......
Wed May 10 16:38:17 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
gtk/gtkhsv.[ch]: Color selection dialog rewrite.
(Original triangle color selector from Simon Budig
<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
Santiago <mrcooger@cyberverse.com>)
* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
out into a separate widget.
* gtk/testgtk.c: Add some checkbuttons for toggling palette
and opacity controls.
Wed May 10 16:08:09 2000 Owen Taylor <otaylor@redhat.com>
* configure.in (GTK_LIBS_EXTRA): Remove gobject that snuck
in prematurely.
* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
snuck in prematurely.
2000-05-07 Tor Lillqvist <tml@iki.fi>
......
Wed May 10 16:38:17 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
gtk/gtkhsv.[ch]: Color selection dialog rewrite.
(Original triangle color selector from Simon Budig
<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
Santiago <mrcooger@cyberverse.com>)
* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
out into a separate widget.
* gtk/testgtk.c: Add some checkbuttons for toggling palette
and opacity controls.
Wed May 10 16:08:09 2000 Owen Taylor <otaylor@redhat.com>
* configure.in (GTK_LIBS_EXTRA): Remove gobject that snuck
in prematurely.
* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
snuck in prematurely.
2000-05-07 Tor Lillqvist <tml@iki.fi>
......
Wed May 10 16:38:17 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
gtk/gtkhsv.[ch]: Color selection dialog rewrite.
(Original triangle color selector from Simon Budig
<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
Santiago <mrcooger@cyberverse.com>)
* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
out into a separate widget.
* gtk/testgtk.c: Add some checkbuttons for toggling palette
and opacity controls.
Wed May 10 16:08:09 2000 Owen Taylor <otaylor@redhat.com>
* configure.in (GTK_LIBS_EXTRA): Remove gobject that snuck
in prematurely.
* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
snuck in prematurely.
2000-05-07 Tor Lillqvist <tml@iki.fi>
......
Wed May 10 16:38:17 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
gtk/gtkhsv.[ch]: Color selection dialog rewrite.
(Original triangle color selector from Simon Budig
<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
Santiago <mrcooger@cyberverse.com>)
* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
out into a separate widget.
* gtk/testgtk.c: Add some checkbuttons for toggling palette
and opacity controls.
Wed May 10 16:08:09 2000 Owen Taylor <otaylor@redhat.com>
* configure.in (GTK_LIBS_EXTRA): Remove gobject that snuck
in prematurely.
* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
snuck in prematurely.
2000-05-07 Tor Lillqvist <tml@iki.fi>
......
Wed May 10 16:38:17 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
gtk/gtkhsv.[ch]: Color selection dialog rewrite.
(Original triangle color selector from Simon Budig
<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
Santiago <mrcooger@cyberverse.com>)
* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
out into a separate widget.
* gtk/testgtk.c: Add some checkbuttons for toggling palette
and opacity controls.
Wed May 10 16:08:09 2000 Owen Taylor <otaylor@redhat.com>
* configure.in (GTK_LIBS_EXTRA): Remove gobject that snuck
in prematurely.
* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
snuck in prematurely.
2000-05-07 Tor Lillqvist <tml@iki.fi>
......
Wed May 10 16:38:17 2000 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am docs/Changes-1.4.txt gtk/gtkcolorsel.[ch]
gtk/gtkhsv.[ch]: Color selection dialog rewrite.
(Original triangle color selector from Simon Budig
<Simon.Budig@unix-ag.org>, Cleaned up and rewritten for GTK+ by
from Jonathan, Havoc, and Federico. Merge into GTK+ done by David
Santiago <mrcooger@cyberverse.com>)
* gtk/gtkcolorseldialog.[ch]: Split color selection dialog
out into a separate widget.
* gtk/testgtk.c: Add some checkbuttons for toggling palette
and opacity controls.
Wed May 10 16:08:09 2000 Owen Taylor <otaylor@redhat.com>
* configure.in (GTK_LIBS_EXTRA): Remove gobject that snuck
in prematurely.
* configure.in (GTK_LIBS_EXTRA): Remove references to gobject that
snuck in prematurely.
2000-05-07 Tor Lillqvist <tml@iki.fi>
......
......@@ -259,9 +259,9 @@ if test x$with_glib = x ; then
gmodule gthread)
# we do not want to make all gtk progs to link to thread libraries.
glib_cflags=`$GLIB_CONFIG glib gobject gmodule --cflags`
glib_cflags=`$GLIB_CONFIG glib gmodule --cflags`
glib_thread_cflags="$GLIB_CFLAGS"
glib_libs=`$GLIB_CONFIG glib gobject gmodule --libs`
glib_libs=`$GLIB_CONFIG glib gmodule --libs`
glib_thread_libs="$GLIB_LIBS"
GLIB_LIBS="$glib_libs"
GLIB_DEPLIBS="$glib_libs"
......@@ -276,10 +276,10 @@ else
fi
# For use in gtk-config
glib_cflags=`$GLIB_CONFIG --cflags gobject gmodule`
glib_thread_cflags=`$GLIB_CONFIG --cflags gobject gmodule gthread`
glib_libs=`$GLIB_CONFIG --libs gobject gmodule`
glib_thread_libs=`$GLIB_CONFIG --libs gobject gmodule gthread`
glib_cflags=`$GLIB_CONFIG --cflags gmodule`
glib_thread_cflags=`$GLIB_CONFIG --cflags gmodule gthread`
glib_libs=`$GLIB_CONFIG --libs gmodule`
glib_thread_libs=`$GLIB_CONFIG --libs gmodule gthread`
glib_release=`$GLIB_CONFIG --version | sed 's%\\.[[0-9]]*$%%'`
......@@ -294,7 +294,7 @@ else
esac
GLIB_CFLAGS="-I$glib_dir -I$glib_dir/gmodule"
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgobject.la $glib_dir/gmodule/libgmodule.la"
GLIB_LIBS="$glib_dir/libglib.la $glib_dir/gmodule/libgmodule.la"
GLIB_DEPLIBS=
AC_SUBST(GLIB_CFLAGS)
......
......@@ -21,3 +21,6 @@ Incompatible Changes from GTK+-1.2 to GTK+-1.4:
window's owner.
- The detail arguments in the GtkStyleClass structure are now 'const gchar *'.
- GtkColorSelectionDialog has now been moved into it's own set of files,
gtkcolorseldialog.c and gtkcolorseldialog.h.
......@@ -62,6 +62,7 @@ gtk_public_h_sources = @STRIP_BEGIN@ \
gtkcheckmenuitem.h \
gtkclist.h \
gtkcolorsel.h \
gtkcolorseldialog.h \
gtkcombo.h \
gtkcompat.h \
gtkcontainer.h \
......@@ -177,6 +178,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtkcheckmenuitem.c \
gtkclist.c \
gtkcolorsel.c \
gtkcolorseldialog.c \
gtkcombo.c \
gtkcontainer.c \
gtkctree.c \
......@@ -202,6 +204,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtkhscale.c \
gtkhscrollbar.c \
gtkhseparator.c \
gtkhsv.c \
gtkimage.c \
gtkinputdialog.c \
gtkintl.h \
......
......@@ -46,6 +46,7 @@
#include <gtk/gtkcheckmenuitem.h>
#include <gtk/gtkclist.h>
#include <gtk/gtkcolorsel.h>
#include <gtk/gtkcolorseldialog.h>
#include <gtk/gtkcombo.h>
#include <gtk/gtkcompat.h>
#include <gtk/gtkcontainer.h>
......
This diff is collapsed.
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat, Inc.
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
......@@ -23,132 +24,87 @@
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GTK_COLOR_SELECTION_H__
#define __GTK_COLOR_SELECTION_H__
#ifndef __GTK_COLORSEL_H__
#define __GTK_COLORSEL_H__
#include <gtk/gtkwindow.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkframe.h>
#include <gtk/gtkpreview.h>
#include <gtk/gtkbutton.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkhbox.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkmain.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkmisc.h>
#include <gtk/gtkrange.h>
#include <gtk/gtkscale.h>
#include <gtk/gtkhscale.h>
#include <gtk/gtktable.h>
#include <gtk/gtkeventbox.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ())
#define GTK_COLOR_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection))
#define GTK_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
#define GTK_IS_COLOR_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
#define GTK_IS_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION))
#define GTK_COLOR_SELECTION_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
#define GTK_TYPE_COLOR_SELECTION (gtk_color_selection_get_type ())
#define GTK_COLOR_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelection))
#define GTK_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
#define GTK_IS_COLOR_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
#define GTK_IS_COLOR_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((obj), GTK_TYPE_COLOR_SELECTION))
#define GTK_COLOR_SELECTION_GET_CLASS(obj) (GTK_CHECK_GET_CLAS ((obj), GTK_TYPE_COLOR_SELECTION, GtkColorSelectionClass))
#define GTK_TYPE_COLOR_SELECTION_DIALOG (gtk_color_selection_dialog_get_type ())
#define GTK_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialog))
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass))
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG))
#define GTK_IS_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG))
#define GTK_COLOR_SELECTION_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass))
/* Number of elements in the custom palatte */
#define CUSTOM_PALETTE_WIDTH 10
#define CUSTOM_PALETTE_HEIGHT 2
typedef struct _GtkColorSelection GtkColorSelection;
typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
typedef struct _GtkColorSelectionDialog GtkColorSelectionDialog;
typedef struct _GtkColorSelectionDialogClass GtkColorSelectionDialogClass;
typedef struct _GtkColorSelection GtkColorSelection;
typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
struct _GtkColorSelection
{
GtkVBox vbox;
GtkWidget *wheel_area;
GtkWidget *value_area;
GtkWidget *sample_area;
GtkWidget *sample_area_eb;
GtkWidget *scales[8];
GtkWidget *entries[8];
GtkWidget *opacity_label;
GdkGC *wheel_gc;
GdkGC *value_gc;
GdkGC *sample_gc;
GtkUpdateType policy;
gint use_opacity;
gint timer_active;
gint timer_tag;
gdouble values[8];
gdouble old_values[8];
guchar *wheel_buf;
guchar *value_buf;
guchar *sample_buf;
GtkVBox parent;
/* < private > */
gpointer private;
};
struct _GtkColorSelectionClass
{
GtkVBoxClass parent_class;
void (* color_changed) (GtkColorSelection *colorsel);
};
struct _GtkColorSelectionDialog
{
GtkWindow window;
GtkWidget *colorsel;
GtkWidget *main_vbox;
GtkWidget *ok_button;
GtkWidget *reset_button;
GtkWidget *cancel_button;
GtkWidget *help_button;
};
struct _GtkColorSelectionDialogClass
{
GtkWindowClass parent_class;
void (*color_changed) (GtkColorSelection *color_selection);
};
/* ColorSelection */
/* ColorSelection */
GtkType gtk_color_selection_get_type (void);
GtkWidget* gtk_color_selection_new (void);
void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel,
GtkUpdateType policy);
void gtk_color_selection_set_opacity (GtkColorSelection *colorsel,
gint use_opacity);
void gtk_color_selection_set_color (GtkColorSelection *colorsel,
gdouble *color);
void gtk_color_selection_get_color (GtkColorSelection *colorsel,
gdouble *color);
/* ColorSelectionDialog */
GtkType gtk_color_selection_dialog_get_type (void);
GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
GtkWidget *gtk_color_selection_new (void);
void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel,
GtkUpdateType policy);
gboolean gtk_color_selection_get_use_opacity (GtkColorSelection *colorsel);
void gtk_color_selection_set_use_opacity (GtkColorSelection *colorsel,
gboolean use_opacity);
gboolean gtk_color_selection_get_use_palette (GtkColorSelection *colorsel);
void gtk_color_selection_set_use_palette (GtkColorSelection *colorsel,
gboolean use_palette);
/* The Color set is an array of doubles, of the following format:
* color[0] = red_channel;
* color[1] = green_channel;
* color[2] = blue_channel;
* color[3] = alpha_channel;
*/
void gtk_color_selection_set_color (GtkColorSelection *colorsel,
gdouble *color);
void gtk_color_selection_get_color (GtkColorSelection *colorsel,
gdouble *color);
void gtk_color_selection_set_old_color (GtkColorSelection *colorsel,
gdouble *color);
void gtk_color_selection_get_old_color (GtkColorSelection *colorsel,
gdouble *color);
void gtk_color_selection_set_palette_color (GtkColorSelection *colorsel,
gint x,
gint y,
gdouble *color);
gboolean gtk_color_selection_get_palette_color (GtkColorSelection *colorsel,
gint x,
gint y,
gdouble *color);
void gtk_color_selection_unset_palette_color(GtkColorSelection *colorsel,
gint x,
gint y);
gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel);
#ifdef __cplusplus
......@@ -156,4 +112,4 @@ GtkWidget* gtk_color_selection_dialog_new (const gchar *title);
#endif /* __cplusplus */
#endif /* __GTK_COLORSEL_H__ */
#endif /* __GTK_COLOR_SELECTION_H__ */
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* 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.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include <glib.h>
#include "gtkcolorseldialog.h"
#include "gtkframe.h"
#include "gtkhbbox.h"
#include "gtkbutton.h"
static void gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass);
static void gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag);
static GtkWindowClass *color_selection_dialog_parent_class = NULL;
/***************************/
/* GtkColorSelectionDialog */
/***************************/
GtkType
gtk_color_selection_dialog_get_type (void)
{
static GtkType color_selection_dialog_type = 0;
if (!color_selection_dialog_type)
{
GtkTypeInfo colorsel_diag_info =
{
"GtkColorSelectionDialog",
sizeof (GtkColorSelectionDialog),
sizeof (GtkColorSelectionDialogClass),
(GtkClassInitFunc) gtk_color_selection_dialog_class_init,
(GtkObjectInitFunc) gtk_color_selection_dialog_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
color_selection_dialog_type = gtk_type_unique (GTK_TYPE_DIALOG, &colorsel_diag_info);
}
return color_selection_dialog_type;
}
static void
gtk_color_selection_dialog_class_init (GtkColorSelectionDialogClass *klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) klass;
color_selection_dialog_parent_class = gtk_type_class (GTK_TYPE_DIALOG);
}
static void
gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
{
GtkWidget *action_area_button_box, *frame;
gtk_widget_set_visual (GTK_WIDGET (colorseldiag), gdk_rgb_get_visual ());
gtk_widget_set_colormap (GTK_WIDGET (colorseldiag), gdk_rgb_get_cmap ());
gtk_widget_push_visual (gdk_rgb_get_visual ());
gtk_widget_push_colormap (gdk_rgb_get_cmap ());
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (colorseldiag)->vbox), frame);
gtk_container_set_border_width (GTK_CONTAINER (frame), 10);
gtk_widget_show (frame);
colorseldiag->colorsel = gtk_color_selection_new ();
gtk_color_selection_set_use_palette (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
gtk_color_selection_set_use_opacity (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
gtk_container_add (GTK_CONTAINER (frame), colorseldiag->colorsel);
gtk_widget_show (colorseldiag->colorsel);
action_area_button_box = gtk_hbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX(action_area_button_box), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing (GTK_BUTTON_BOX(action_area_button_box), 5);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (colorseldiag)->action_area), action_area_button_box, TRUE, TRUE, 0);
gtk_widget_show (action_area_button_box);
colorseldiag->ok_button = gtk_button_new_with_label (_("OK"));
GTK_WIDGET_SET_FLAGS (colorseldiag->ok_button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->ok_button, TRUE, TRUE, 0);
gtk_widget_grab_default (colorseldiag->ok_button);
gtk_widget_show (colorseldiag->ok_button);
colorseldiag->cancel_button = gtk_button_new_with_label (_("Cancel"));
GTK_WIDGET_SET_FLAGS (colorseldiag->cancel_button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->cancel_button, TRUE, TRUE, 0);
gtk_widget_show (colorseldiag->cancel_button);
colorseldiag->help_button = gtk_button_new_with_label (_("Help"));
GTK_WIDGET_SET_FLAGS (colorseldiag->help_button, GTK_CAN_DEFAULT);
gtk_box_pack_start (GTK_BOX (action_area_button_box), colorseldiag->help_button, TRUE, TRUE, 0);
gtk_widget_show (colorseldiag->help_button);
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
}
GtkWidget*
gtk_color_selection_dialog_new (const gchar *title)
{
GtkColorSelectionDialog *colorseldiag;
colorseldiag = gtk_type_new (GTK_TYPE_COLOR_SELECTION_DIALOG);
gtk_window_set_title (GTK_WINDOW (colorseldiag), title);
gtk_window_set_policy(GTK_WINDOW (colorseldiag), FALSE, FALSE, TRUE);
return GTK_WIDGET (colorseldiag);
}
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* 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.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GTK_COLOR_SELECTION_DIALOG_H__
#define __GTK_COLOR_SELECTION_DIALOG_H__
#include <gtk/gtkdialog.h>
#include <gtk/gtkcolorsel.h>
#include <gtk/gtkvbox.h>
#include "gtkintl.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_COLOR_SELECTION_DIALOG (gtk_color_selection_dialog_get_type ())
#define GTK_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialog))
#define GTK_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass))
#define GTK_IS_COLOR_SELECTION_DIALOG(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG))
#define GTK_IS_COLOR_SELECTION_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_COLOR_SELECTION_DIALOG))
#define GTK_COLOR_SELECTION_DIALOG_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_COLOR_SELECTION_DIALOG, GtkColorSelectionDialogClass))
typedef struct _GtkColorSelectionDialog GtkColorSelectionDialog;
typedef struct _GtkColorSelectionDialogClass GtkColorSelectionDialogClass;
struct _GtkColorSelectionDialog
{
GtkDialog dialog;
GtkWidget *colorsel;
GtkWidget *ok_button;
GtkWidget *cancel_button;
GtkWidget *help_button;
};
struct _GtkColorSelectionDialogClass
{
GtkDialogClass parent_class;