mirror of https://github.com/GNOME/gimp.git
libgimpwidgets/gimpcolorbutton.c libgimpwidgets/gimpcolornotebook.c
2004-07-13 Sven Neumann <sven@gimp.org> * libgimpwidgets/gimpcolorbutton.c * libgimpwidgets/gimpcolornotebook.c * libgimpwidgets/gimpcolorscale.c * libgimpwidgets/gimpcolorscales.c * libgimpwidgets/gimpcolorselect.c * libgimpwidgets/gimpcolorselection.c * libgimpwidgets/gimpframe.c * libgimpwidgets/gimppickbutton.c * libgimpwidgets/gimpunitmenu.c: some code review and cosmetics.
This commit is contained in:
parent
6d3d212973
commit
45a7f5e459
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2004-07-13 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpwidgets/gimpcolorbutton.c
|
||||||
|
* libgimpwidgets/gimpcolornotebook.c
|
||||||
|
* libgimpwidgets/gimpcolorscale.c
|
||||||
|
* libgimpwidgets/gimpcolorscales.c
|
||||||
|
* libgimpwidgets/gimpcolorselect.c
|
||||||
|
* libgimpwidgets/gimpcolorselection.c
|
||||||
|
* libgimpwidgets/gimpframe.c
|
||||||
|
* libgimpwidgets/gimppickbutton.c
|
||||||
|
* libgimpwidgets/gimpunitmenu.c: some code review and cosmetics.
|
||||||
|
|
||||||
2004-07-13 Shlomi Fish <shlomif@iglu.org.il>
|
2004-07-13 Shlomi Fish <shlomif@iglu.org.il>
|
||||||
|
|
||||||
* plug-ins/gimpressionist/*.[ch]: normalized some of brush.c's
|
* plug-ins/gimpressionist/*.[ch]: normalized some of brush.c's
|
||||||
|
|
|
@ -137,13 +137,9 @@ gimp_color_button_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_color_button_class_init (GimpColorButtonClass *klass)
|
gimp_color_button_class_init (GimpColorButtonClass *klass)
|
||||||
{
|
{
|
||||||
GtkObjectClass *object_class;
|
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
|
||||||
GtkWidgetClass *widget_class;
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
GtkButtonClass *button_class;
|
GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass);
|
||||||
|
|
||||||
object_class = GTK_OBJECT_CLASS (klass);
|
|
||||||
widget_class = GTK_WIDGET_CLASS (klass);
|
|
||||||
button_class = GTK_BUTTON_CLASS (klass);
|
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
@ -196,9 +192,7 @@ gimp_color_button_init (GimpColorButton *button)
|
||||||
static void
|
static void
|
||||||
gimp_color_button_destroy (GtkObject *object)
|
gimp_color_button_destroy (GtkObject *object)
|
||||||
{
|
{
|
||||||
GimpColorButton *button;
|
GimpColorButton *button = GIMP_COLOR_BUTTON (object);
|
||||||
|
|
||||||
button = GIMP_COLOR_BUTTON (object);
|
|
||||||
|
|
||||||
if (button->title)
|
if (button->title)
|
||||||
{
|
{
|
||||||
|
@ -225,12 +219,10 @@ static gboolean
|
||||||
gimp_color_button_button_press (GtkWidget *widget,
|
gimp_color_button_button_press (GtkWidget *widget,
|
||||||
GdkEventButton *bevent)
|
GdkEventButton *bevent)
|
||||||
{
|
{
|
||||||
GimpColorButton *button;
|
GimpColorButton *button = GIMP_COLOR_BUTTON (widget);
|
||||||
gint x;
|
gint x;
|
||||||
gint y;
|
gint y;
|
||||||
|
|
||||||
button = GIMP_COLOR_BUTTON (widget);
|
|
||||||
|
|
||||||
if (bevent->button == 3)
|
if (bevent->button == 3)
|
||||||
{
|
{
|
||||||
gdk_window_get_origin (GTK_WIDGET (widget)->window, &x, &y);
|
gdk_window_get_origin (GTK_WIDGET (widget)->window, &x, &y);
|
||||||
|
|
|
@ -112,13 +112,9 @@ gimp_color_notebook_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_color_notebook_class_init (GimpColorNotebookClass *klass)
|
gimp_color_notebook_class_init (GimpColorNotebookClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class;
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
GtkWidgetClass *widget_class;
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
GimpColorSelectorClass *selector_class;
|
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
||||||
|
|
||||||
object_class = G_OBJECT_CLASS (klass);
|
|
||||||
widget_class = GTK_WIDGET_CLASS (klass);
|
|
||||||
selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
|
|
@ -83,14 +83,11 @@ gimp_color_scale_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_color_scale_class_init (GimpColorScaleClass *klass)
|
gimp_color_scale_class_init (GimpColorScaleClass *klass)
|
||||||
{
|
{
|
||||||
GtkObjectClass *object_class;
|
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
|
||||||
GtkWidgetClass *widget_class;
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
object_class = GTK_OBJECT_CLASS (klass);
|
|
||||||
widget_class = GTK_WIDGET_CLASS (klass);
|
|
||||||
|
|
||||||
object_class->destroy = gimp_color_scale_destroy;
|
object_class->destroy = gimp_color_scale_destroy;
|
||||||
|
|
||||||
widget_class->size_allocate = gimp_color_scale_size_allocate;
|
widget_class->size_allocate = gimp_color_scale_size_allocate;
|
||||||
|
@ -119,9 +116,7 @@ gimp_color_scale_init (GimpColorScale *scale)
|
||||||
static void
|
static void
|
||||||
gimp_color_scale_destroy (GtkObject *object)
|
gimp_color_scale_destroy (GtkObject *object)
|
||||||
{
|
{
|
||||||
GimpColorScale *scale;
|
GimpColorScale *scale = GIMP_COLOR_SCALE (object);
|
||||||
|
|
||||||
scale = GIMP_COLOR_SCALE (object);
|
|
||||||
|
|
||||||
if (scale->buf)
|
if (scale->buf)
|
||||||
{
|
{
|
||||||
|
@ -139,15 +134,12 @@ static void
|
||||||
gimp_color_scale_size_allocate (GtkWidget *widget,
|
gimp_color_scale_size_allocate (GtkWidget *widget,
|
||||||
GtkAllocation *allocation)
|
GtkAllocation *allocation)
|
||||||
{
|
{
|
||||||
GimpColorScale *scale;
|
GimpColorScale *scale = GIMP_COLOR_SCALE (widget);
|
||||||
GtkRange *range;
|
GtkRange *range = GTK_RANGE (widget);
|
||||||
gint focus = 0;
|
gint focus = 0;
|
||||||
gint scale_width;
|
gint scale_width;
|
||||||
gint scale_height;
|
gint scale_height;
|
||||||
|
|
||||||
scale = GIMP_COLOR_SCALE (widget);
|
|
||||||
range = GTK_RANGE (widget);
|
|
||||||
|
|
||||||
if (GTK_WIDGET_CAN_FOCUS (widget))
|
if (GTK_WIDGET_CAN_FOCUS (widget))
|
||||||
{
|
{
|
||||||
gint focus_padding = 0;
|
gint focus_padding = 0;
|
||||||
|
@ -199,7 +191,7 @@ static gboolean
|
||||||
gimp_color_scale_expose (GtkWidget *widget,
|
gimp_color_scale_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *event)
|
GdkEventExpose *event)
|
||||||
{
|
{
|
||||||
GimpColorScale *scale;
|
GimpColorScale *scale = GIMP_COLOR_SCALE (widget);
|
||||||
GtkRange *range;
|
GtkRange *range;
|
||||||
GdkRectangle expose_area; /* Relative to widget->allocation */
|
GdkRectangle expose_area; /* Relative to widget->allocation */
|
||||||
GdkRectangle area;
|
GdkRectangle area;
|
||||||
|
@ -208,8 +200,6 @@ gimp_color_scale_expose (GtkWidget *widget,
|
||||||
gint x, y;
|
gint x, y;
|
||||||
gint w, h;
|
gint w, h;
|
||||||
|
|
||||||
scale = GIMP_COLOR_SCALE (widget);
|
|
||||||
|
|
||||||
if (! scale->buf || ! GTK_WIDGET_DRAWABLE (widget))
|
if (! scale->buf || ! GTK_WIDGET_DRAWABLE (widget))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -462,7 +452,7 @@ should_invert (GtkRange *range)
|
||||||
static void
|
static void
|
||||||
gimp_color_scale_render (GimpColorScale *scale)
|
gimp_color_scale_render (GimpColorScale *scale)
|
||||||
{
|
{
|
||||||
GtkRange *range;
|
GtkRange *range = GTK_RANGE (scale);
|
||||||
GimpRGB rgb;
|
GimpRGB rgb;
|
||||||
GimpHSV hsv;
|
GimpHSV hsv;
|
||||||
guint x, y;
|
guint x, y;
|
||||||
|
@ -508,7 +498,6 @@ gimp_color_scale_render (GimpColorScale *scale)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
range = GTK_RANGE (scale);
|
|
||||||
invert = should_invert (range);
|
invert = should_invert (range);
|
||||||
|
|
||||||
switch (range->orientation)
|
switch (range->orientation)
|
||||||
|
@ -568,7 +557,7 @@ gimp_color_scale_render (GimpColorScale *scale)
|
||||||
static void
|
static void
|
||||||
gimp_color_scale_render_alpha (GimpColorScale *scale)
|
gimp_color_scale_render_alpha (GimpColorScale *scale)
|
||||||
{
|
{
|
||||||
GtkRange *range;
|
GtkRange *range = GTK_RANGE (scale);
|
||||||
GimpRGB rgb;
|
GimpRGB rgb;
|
||||||
gboolean invert;
|
gboolean invert;
|
||||||
gdouble a;
|
gdouble a;
|
||||||
|
@ -576,7 +565,6 @@ gimp_color_scale_render_alpha (GimpColorScale *scale)
|
||||||
guchar *buf;
|
guchar *buf;
|
||||||
guchar *d, *l;
|
guchar *d, *l;
|
||||||
|
|
||||||
range = GTK_RANGE (scale);
|
|
||||||
invert = should_invert (range);
|
invert = should_invert (range);
|
||||||
|
|
||||||
buf = scale->buf;
|
buf = scale->buf;
|
||||||
|
|
|
@ -69,8 +69,6 @@ struct _GimpColorScalesClass
|
||||||
static void gimp_color_scales_class_init (GimpColorScalesClass *klass);
|
static void gimp_color_scales_class_init (GimpColorScalesClass *klass);
|
||||||
static void gimp_color_scales_init (GimpColorScales *scales);
|
static void gimp_color_scales_init (GimpColorScales *scales);
|
||||||
|
|
||||||
static void gimp_color_scales_finalize (GObject *object);
|
|
||||||
|
|
||||||
static void gimp_color_scales_togg_sensitive (GimpColorSelector *selector,
|
static void gimp_color_scales_togg_sensitive (GimpColorSelector *selector,
|
||||||
gboolean sensitive);
|
gboolean sensitive);
|
||||||
static void gimp_color_scales_togg_visible (GimpColorSelector *selector,
|
static void gimp_color_scales_togg_visible (GimpColorSelector *selector,
|
||||||
|
@ -129,16 +127,10 @@ gimp_color_scales_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_color_scales_class_init (GimpColorScalesClass *klass)
|
gimp_color_scales_class_init (GimpColorScalesClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class;
|
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
||||||
GimpColorSelectorClass *selector_class;
|
|
||||||
|
|
||||||
object_class = G_OBJECT_CLASS (klass);
|
|
||||||
selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
object_class->finalize = gimp_color_scales_finalize;
|
|
||||||
|
|
||||||
selector_class->name = _("Scales");
|
selector_class->name = _("Scales");
|
||||||
selector_class->help_id = "gimp-colorselector-scales";
|
selector_class->help_id = "gimp-colorselector-scales";
|
||||||
selector_class->stock_id = GIMP_STOCK_TOOL_OPTIONS;
|
selector_class->stock_id = GIMP_STOCK_TOOL_OPTIONS;
|
||||||
|
@ -152,7 +144,7 @@ gimp_color_scales_class_init (GimpColorScalesClass *klass)
|
||||||
static void
|
static void
|
||||||
gimp_color_scales_init (GimpColorScales *scales)
|
gimp_color_scales_init (GimpColorScales *scales)
|
||||||
{
|
{
|
||||||
GimpColorSelector *selector;
|
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
|
@ -183,8 +175,6 @@ gimp_color_scales_init (GimpColorScales *scales)
|
||||||
static gdouble slider_max_vals[] = { 360, 100, 100, 255, 255, 255, 100 };
|
static gdouble slider_max_vals[] = { 360, 100, 100, 255, 255, 255, 100 };
|
||||||
static gdouble slider_incs[] = { 30, 10, 10, 16, 16, 16, 10 };
|
static gdouble slider_incs[] = { 30, 10, 10, 16, 16, 16, 10 };
|
||||||
|
|
||||||
selector = GIMP_COLOR_SELECTOR (scales);
|
|
||||||
|
|
||||||
/* don't needs the toggles for our own operation */
|
/* don't needs the toggles for our own operation */
|
||||||
selector->toggles_visible = FALSE;
|
selector->toggles_visible = FALSE;
|
||||||
|
|
||||||
|
@ -271,25 +261,13 @@ gimp_color_scales_init (GimpColorScales *scales)
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_color_scales_finalize (GObject *object)
|
|
||||||
{
|
|
||||||
GimpColorScales *scales;
|
|
||||||
|
|
||||||
scales = GIMP_COLOR_SCALES (object);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gimp_color_scales_togg_sensitive (GimpColorSelector *selector,
|
gimp_color_scales_togg_sensitive (GimpColorSelector *selector,
|
||||||
gboolean sensitive)
|
gboolean sensitive)
|
||||||
{
|
{
|
||||||
GimpColorScales *scales;
|
GimpColorScales *scales = GIMP_COLOR_SCALES (selector);
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
scales = GIMP_COLOR_SCALES (selector);
|
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
gtk_widget_set_sensitive (scales->toggles[i], sensitive);
|
gtk_widget_set_sensitive (scales->toggles[i], sensitive);
|
||||||
}
|
}
|
||||||
|
@ -298,11 +276,9 @@ static void
|
||||||
gimp_color_scales_togg_visible (GimpColorSelector *selector,
|
gimp_color_scales_togg_visible (GimpColorSelector *selector,
|
||||||
gboolean visible)
|
gboolean visible)
|
||||||
{
|
{
|
||||||
GimpColorScales *scales;
|
GimpColorScales *scales = GIMP_COLOR_SCALES (selector);
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
scales = GIMP_COLOR_SCALES (selector);
|
|
||||||
|
|
||||||
for (i = 0; i < 6; i++)
|
for (i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
if (visible)
|
if (visible)
|
||||||
|
@ -316,13 +292,11 @@ static void
|
||||||
gimp_color_scales_set_show_alpha (GimpColorSelector *selector,
|
gimp_color_scales_set_show_alpha (GimpColorSelector *selector,
|
||||||
gboolean show_alpha)
|
gboolean show_alpha)
|
||||||
{
|
{
|
||||||
GimpColorScales *scales;
|
GimpColorScales *scales = GIMP_COLOR_SCALES (selector);
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GtkWidget *scale;
|
GtkWidget *scale;
|
||||||
GtkWidget *spin;
|
GtkWidget *spin;
|
||||||
|
|
||||||
scales = GIMP_COLOR_SCALES (selector);
|
|
||||||
|
|
||||||
label = GIMP_SCALE_ENTRY_LABEL (scales->slider_data[6]);
|
label = GIMP_SCALE_ENTRY_LABEL (scales->slider_data[6]);
|
||||||
scale = GIMP_SCALE_ENTRY_SCALE (scales->slider_data[6]);
|
scale = GIMP_SCALE_ENTRY_SCALE (scales->slider_data[6]);
|
||||||
spin = GIMP_SCALE_ENTRY_SPINBUTTON (scales->slider_data[6]);
|
spin = GIMP_SCALE_ENTRY_SPINBUTTON (scales->slider_data[6]);
|
||||||
|
@ -346,9 +320,7 @@ gimp_color_scales_set_color (GimpColorSelector *selector,
|
||||||
const GimpRGB *rgb,
|
const GimpRGB *rgb,
|
||||||
const GimpHSV *hsv)
|
const GimpHSV *hsv)
|
||||||
{
|
{
|
||||||
GimpColorScales *scales;
|
GimpColorScales *scales = GIMP_COLOR_SCALES (selector);
|
||||||
|
|
||||||
scales = GIMP_COLOR_SCALES (selector);
|
|
||||||
|
|
||||||
gimp_color_scales_update_scales (scales, -1);
|
gimp_color_scales_update_scales (scales, -1);
|
||||||
}
|
}
|
||||||
|
@ -357,9 +329,7 @@ static void
|
||||||
gimp_color_scales_set_channel (GimpColorSelector *selector,
|
gimp_color_scales_set_channel (GimpColorSelector *selector,
|
||||||
GimpColorSelectorChannel channel)
|
GimpColorSelectorChannel channel)
|
||||||
{
|
{
|
||||||
GimpColorScales *scales;
|
GimpColorScales *scales = GIMP_COLOR_SCALES (selector);
|
||||||
|
|
||||||
scales = GIMP_COLOR_SCALES (selector);
|
|
||||||
|
|
||||||
if (channel >= 0 && channel <= 7)
|
if (channel >= 0 && channel <= 7)
|
||||||
{
|
{
|
||||||
|
@ -380,13 +350,11 @@ static void
|
||||||
gimp_color_scales_update_scales (GimpColorScales *scales,
|
gimp_color_scales_update_scales (GimpColorScales *scales,
|
||||||
gint skip)
|
gint skip)
|
||||||
{
|
{
|
||||||
GimpColorSelector *selector;
|
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
|
||||||
gint values[7];
|
gint values[7];
|
||||||
gchar buffer[8];
|
gchar buffer[8];
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
selector = GIMP_COLOR_SELECTOR (scales);
|
|
||||||
|
|
||||||
values[GIMP_COLOR_SELECTOR_HUE] = ROUND (selector->hsv.h * 360.0);
|
values[GIMP_COLOR_SELECTOR_HUE] = ROUND (selector->hsv.h * 360.0);
|
||||||
values[GIMP_COLOR_SELECTOR_SATURATION] = ROUND (selector->hsv.s * 100.0);
|
values[GIMP_COLOR_SELECTOR_SATURATION] = ROUND (selector->hsv.s * 100.0);
|
||||||
values[GIMP_COLOR_SELECTOR_VALUE] = ROUND (selector->hsv.v * 100.0);
|
values[GIMP_COLOR_SELECTOR_VALUE] = ROUND (selector->hsv.v * 100.0);
|
||||||
|
@ -427,9 +395,7 @@ static void
|
||||||
gimp_color_scales_toggle_update (GtkWidget *widget,
|
gimp_color_scales_toggle_update (GtkWidget *widget,
|
||||||
GimpColorScales *scales)
|
GimpColorScales *scales)
|
||||||
{
|
{
|
||||||
GimpColorSelector *selector;
|
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
|
||||||
|
|
||||||
selector = GIMP_COLOR_SELECTOR (scales);
|
|
||||||
|
|
||||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||||
{
|
{
|
||||||
|
@ -450,11 +416,9 @@ static void
|
||||||
gimp_color_scales_scale_update (GtkAdjustment *adjustment,
|
gimp_color_scales_scale_update (GtkAdjustment *adjustment,
|
||||||
GimpColorScales *scales)
|
GimpColorScales *scales)
|
||||||
{
|
{
|
||||||
GimpColorSelector *selector;
|
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
selector = GIMP_COLOR_SELECTOR (scales);
|
|
||||||
|
|
||||||
for (i = 0; i < 7; i++)
|
for (i = 0; i < 7; i++)
|
||||||
if (scales->slider_data[i] == GTK_OBJECT (adjustment))
|
if (scales->slider_data[i] == GTK_OBJECT (adjustment))
|
||||||
break;
|
break;
|
||||||
|
@ -510,14 +474,12 @@ gimp_color_scales_hex_events (GtkWidget *widget,
|
||||||
GdkEvent *event,
|
GdkEvent *event,
|
||||||
GimpColorScales *scales)
|
GimpColorScales *scales)
|
||||||
{
|
{
|
||||||
GimpColorSelector *selector;
|
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (scales);
|
||||||
const gchar *hex_color;
|
const gchar *hex_color;
|
||||||
gchar buffer[8];
|
gchar buffer[8];
|
||||||
guint hex_rgb;
|
guint hex_rgb;
|
||||||
guchar r, g, b;
|
guchar r, g, b;
|
||||||
|
|
||||||
selector = GIMP_COLOR_SELECTOR (scales);
|
|
||||||
|
|
||||||
switch (event->type)
|
switch (event->type)
|
||||||
{
|
{
|
||||||
case GDK_KEY_PRESS:
|
case GDK_KEY_PRESS:
|
||||||
|
|
|
@ -251,11 +251,8 @@ gimp_color_select_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_color_select_class_init (GimpColorSelectClass *klass)
|
gimp_color_select_class_init (GimpColorSelectClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class;
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
GimpColorSelectorClass *selector_class;
|
GimpColorSelectorClass *selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
||||||
|
|
||||||
object_class = G_OBJECT_CLASS (klass);
|
|
||||||
selector_class = GIMP_COLOR_SELECTOR_CLASS (klass);
|
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
@ -395,9 +392,7 @@ gimp_color_select_init (GimpColorSelect *select)
|
||||||
static void
|
static void
|
||||||
gimp_color_select_finalize (GObject *object)
|
gimp_color_select_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
GimpColorSelect *select;
|
GimpColorSelect *select = GIMP_COLOR_SELECT (object);
|
||||||
|
|
||||||
select = GIMP_COLOR_SELECT (object);
|
|
||||||
|
|
||||||
if (select->gc)
|
if (select->gc)
|
||||||
{
|
{
|
||||||
|
@ -412,9 +407,7 @@ static void
|
||||||
gimp_color_select_togg_visible (GimpColorSelector *selector,
|
gimp_color_select_togg_visible (GimpColorSelector *selector,
|
||||||
gboolean visible)
|
gboolean visible)
|
||||||
{
|
{
|
||||||
GimpColorSelect *select;
|
GimpColorSelect *select = GIMP_COLOR_SELECT (selector);
|
||||||
|
|
||||||
select = GIMP_COLOR_SELECT (selector);
|
|
||||||
|
|
||||||
if (visible)
|
if (visible)
|
||||||
gtk_widget_show (select->toggle_box);
|
gtk_widget_show (select->toggle_box);
|
||||||
|
@ -426,9 +419,7 @@ static void
|
||||||
gimp_color_select_togg_sensitive (GimpColorSelector *selector,
|
gimp_color_select_togg_sensitive (GimpColorSelector *selector,
|
||||||
gboolean sensitive)
|
gboolean sensitive)
|
||||||
{
|
{
|
||||||
GimpColorSelect *select;
|
GimpColorSelect *select = GIMP_COLOR_SELECT (selector);
|
||||||
|
|
||||||
select = GIMP_COLOR_SELECT (selector);
|
|
||||||
|
|
||||||
gtk_widget_set_sensitive (select->toggle_box, sensitive);
|
gtk_widget_set_sensitive (select->toggle_box, sensitive);
|
||||||
}
|
}
|
||||||
|
@ -438,9 +429,7 @@ gimp_color_select_set_color (GimpColorSelector *selector,
|
||||||
const GimpRGB *rgb,
|
const GimpRGB *rgb,
|
||||||
const GimpHSV *hsv)
|
const GimpHSV *hsv)
|
||||||
{
|
{
|
||||||
GimpColorSelect *select;
|
GimpColorSelect *select = GIMP_COLOR_SELECT (selector);
|
||||||
|
|
||||||
select = GIMP_COLOR_SELECT (selector);
|
|
||||||
|
|
||||||
gimp_color_select_update (select,
|
gimp_color_select_update (select,
|
||||||
UPDATE_POS | UPDATE_XY_COLOR | UPDATE_Z_COLOR);
|
UPDATE_POS | UPDATE_XY_COLOR | UPDATE_Z_COLOR);
|
||||||
|
@ -450,9 +439,7 @@ static void
|
||||||
gimp_color_select_set_channel (GimpColorSelector *selector,
|
gimp_color_select_set_channel (GimpColorSelector *selector,
|
||||||
GimpColorSelectorChannel channel)
|
GimpColorSelectorChannel channel)
|
||||||
{
|
{
|
||||||
GimpColorSelect *select;
|
GimpColorSelect *select = GIMP_COLOR_SELECT (selector);
|
||||||
|
|
||||||
select = GIMP_COLOR_SELECT (selector);
|
|
||||||
|
|
||||||
switch ((ColorSelectFillType) channel)
|
switch ((ColorSelectFillType) channel)
|
||||||
{
|
{
|
||||||
|
@ -500,11 +487,9 @@ gimp_color_select_channel_toggled (GtkWidget *widget,
|
||||||
{
|
{
|
||||||
if (GTK_TOGGLE_BUTTON (widget)->active)
|
if (GTK_TOGGLE_BUTTON (widget)->active)
|
||||||
{
|
{
|
||||||
GimpColorSelector *selector;
|
GimpColorSelector *selector = GIMP_COLOR_SELECTOR (select);
|
||||||
GimpColorSelectorChannel channel;
|
GimpColorSelectorChannel channel;
|
||||||
|
|
||||||
selector = GIMP_COLOR_SELECTOR (select);
|
|
||||||
|
|
||||||
channel = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
|
channel = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
|
||||||
"channel"));
|
"channel"));
|
||||||
|
|
||||||
|
|
|
@ -271,11 +271,7 @@ gimp_color_selection_init (GimpColorSelection *selection)
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
gimp_color_selection_new (void)
|
gimp_color_selection_new (void)
|
||||||
{
|
{
|
||||||
GimpColorSelection *selection;
|
return g_object_new (GIMP_TYPE_COLOR_SELECTION, NULL);
|
||||||
|
|
||||||
selection = g_object_new (GIMP_TYPE_COLOR_SELECTION, NULL);
|
|
||||||
|
|
||||||
return GTK_WIDGET (selection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -443,11 +439,9 @@ gimp_color_selection_switch_page (GtkWidget *widget,
|
||||||
guint page_num,
|
guint page_num,
|
||||||
GimpColorSelection *selection)
|
GimpColorSelection *selection)
|
||||||
{
|
{
|
||||||
GimpColorNotebook *notebook;
|
GimpColorNotebook *notebook = GIMP_COLOR_NOTEBOOK (selection->notebook);
|
||||||
gboolean sensitive;
|
gboolean sensitive;
|
||||||
|
|
||||||
notebook = GIMP_COLOR_NOTEBOOK (selection->notebook);
|
|
||||||
|
|
||||||
sensitive =
|
sensitive =
|
||||||
(GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->set_channel != NULL);
|
(GIMP_COLOR_SELECTOR_GET_CLASS (notebook->cur_page)->set_channel != NULL);
|
||||||
|
|
||||||
|
|
|
@ -90,14 +90,11 @@ gimp_frame_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_frame_class_init (GimpFrameClass *klass)
|
gimp_frame_class_init (GimpFrameClass *klass)
|
||||||
{
|
{
|
||||||
GtkWidgetClass *widget_class;
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
GtkFrameClass *frame_class;
|
GtkFrameClass *frame_class = GTK_FRAME_CLASS (klass);
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
widget_class = GTK_WIDGET_CLASS (klass);
|
|
||||||
frame_class = GTK_FRAME_CLASS (klass);
|
|
||||||
|
|
||||||
widget_class->size_request = gimp_frame_size_request;
|
widget_class->size_request = gimp_frame_size_request;
|
||||||
widget_class->size_allocate = gimp_frame_size_allocate;
|
widget_class->size_allocate = gimp_frame_size_allocate;
|
||||||
widget_class->style_set = gimp_frame_style_set;
|
widget_class->style_set = gimp_frame_style_set;
|
||||||
|
|
|
@ -102,11 +102,8 @@ gimp_pick_button_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_pick_button_class_init (GimpPickButtonClass* klass)
|
gimp_pick_button_class_init (GimpPickButtonClass* klass)
|
||||||
{
|
{
|
||||||
GtkObjectClass *object_class;
|
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
|
||||||
GtkButtonClass *button_class;
|
GtkButtonClass *button_class = GTK_BUTTON_CLASS (klass);
|
||||||
|
|
||||||
object_class = GTK_OBJECT_CLASS (klass);
|
|
||||||
button_class = GTK_BUTTON_CLASS (klass);
|
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
|
|
@ -98,9 +98,7 @@ gimp_unit_menu_get_type (void)
|
||||||
static void
|
static void
|
||||||
gimp_unit_menu_class_init (GimpUnitMenuClass *klass)
|
gimp_unit_menu_class_init (GimpUnitMenuClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *object_class;
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
|
|
||||||
object_class = G_OBJECT_CLASS (klass);
|
|
||||||
|
|
||||||
parent_class = g_type_class_peek_parent (klass);
|
parent_class = g_type_class_peek_parent (klass);
|
||||||
|
|
||||||
|
@ -712,10 +710,9 @@ static void
|
||||||
gimp_unit_menu_callback (GtkWidget *widget,
|
gimp_unit_menu_callback (GtkWidget *widget,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GimpUnitMenu *menu;
|
GimpUnitMenu *menu = data;
|
||||||
GimpUnit new_unit;
|
GimpUnit new_unit;
|
||||||
|
|
||||||
menu = data;
|
|
||||||
new_unit = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget),
|
new_unit = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget),
|
||||||
"gimp_unit_menu"));
|
"gimp_unit_menu"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue