Commit ca20af0b authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

API Change. Take GdkColor arguments instead of gdouble *. Leave the old

2001-04-20  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkcolorsel.[ch]:
	API Change. Take GdkColor arguments instead of gdouble *.
	Leave the old gtk_color_selection_set_color for compatibility,
	but marked deprecated.
	Do correct rounding when converting RGB <-> HSV.

	* gtk/gtkcolorseldialog.c:
	* tests/testgtk.c:
	Use new GtkColorSelection API.

	* gtk/gtkhsv.c:
	Fix problem selecting colors in triangle when Hue is 330.
	Fix some black dots around the HSB triangle.

	* gtk/gtkfilesel.c:
	return FALSE from the focus_in_event handler to fix focus problems.
parent bf660df9
2001-04-20 Alexander Larsson <alexl@redhat.com>
* gtk/gtkcolorsel.[ch]:
API Change. Take GdkColor arguments instead of gdouble *.
Leave the old gtk_color_selection_set_color for compatibility,
but marked deprecated.
Do correct rounding when converting RGB <-> HSV.
* gtk/gtkcolorseldialog.c:
* tests/testgtk.c:
Use new GtkColorSelection API.
* gtk/gtkhsv.c:
Fix problem selecting colors in triangle when Hue is 330.
Fix some black dots around the HSB triangle.
* gtk/gtkfilesel.c:
return FALSE from the focus_in_event handler to fix focus problems.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (gtk_window_class_init): add signals and binding
......
2001-04-20 Alexander Larsson <alexl@redhat.com>
* gtk/gtkcolorsel.[ch]:
API Change. Take GdkColor arguments instead of gdouble *.
Leave the old gtk_color_selection_set_color for compatibility,
but marked deprecated.
Do correct rounding when converting RGB <-> HSV.
* gtk/gtkcolorseldialog.c:
* tests/testgtk.c:
Use new GtkColorSelection API.
* gtk/gtkhsv.c:
Fix problem selecting colors in triangle when Hue is 330.
Fix some black dots around the HSB triangle.
* gtk/gtkfilesel.c:
return FALSE from the focus_in_event handler to fix focus problems.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (gtk_window_class_init): add signals and binding
......
2001-04-20 Alexander Larsson <alexl@redhat.com>
* gtk/gtkcolorsel.[ch]:
API Change. Take GdkColor arguments instead of gdouble *.
Leave the old gtk_color_selection_set_color for compatibility,
but marked deprecated.
Do correct rounding when converting RGB <-> HSV.
* gtk/gtkcolorseldialog.c:
* tests/testgtk.c:
Use new GtkColorSelection API.
* gtk/gtkhsv.c:
Fix problem selecting colors in triangle when Hue is 330.
Fix some black dots around the HSB triangle.
* gtk/gtkfilesel.c:
return FALSE from the focus_in_event handler to fix focus problems.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (gtk_window_class_init): add signals and binding
......
2001-04-20 Alexander Larsson <alexl@redhat.com>
* gtk/gtkcolorsel.[ch]:
API Change. Take GdkColor arguments instead of gdouble *.
Leave the old gtk_color_selection_set_color for compatibility,
but marked deprecated.
Do correct rounding when converting RGB <-> HSV.
* gtk/gtkcolorseldialog.c:
* tests/testgtk.c:
Use new GtkColorSelection API.
* gtk/gtkhsv.c:
Fix problem selecting colors in triangle when Hue is 330.
Fix some black dots around the HSB triangle.
* gtk/gtkfilesel.c:
return FALSE from the focus_in_event handler to fix focus problems.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (gtk_window_class_init): add signals and binding
......
2001-04-20 Alexander Larsson <alexl@redhat.com>
* gtk/gtkcolorsel.[ch]:
API Change. Take GdkColor arguments instead of gdouble *.
Leave the old gtk_color_selection_set_color for compatibility,
but marked deprecated.
Do correct rounding when converting RGB <-> HSV.
* gtk/gtkcolorseldialog.c:
* tests/testgtk.c:
Use new GtkColorSelection API.
* gtk/gtkhsv.c:
Fix problem selecting colors in triangle when Hue is 330.
Fix some black dots around the HSB triangle.
* gtk/gtkfilesel.c:
return FALSE from the focus_in_event handler to fix focus problems.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (gtk_window_class_init): add signals and binding
......
2001-04-20 Alexander Larsson <alexl@redhat.com>
* gtk/gtkcolorsel.[ch]:
API Change. Take GdkColor arguments instead of gdouble *.
Leave the old gtk_color_selection_set_color for compatibility,
but marked deprecated.
Do correct rounding when converting RGB <-> HSV.
* gtk/gtkcolorseldialog.c:
* tests/testgtk.c:
Use new GtkColorSelection API.
* gtk/gtkhsv.c:
Fix problem selecting colors in triangle when Hue is 330.
Fix some black dots around the HSB triangle.
* gtk/gtkfilesel.c:
return FALSE from the focus_in_event handler to fix focus problems.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (gtk_window_class_init): add signals and binding
......
2001-04-20 Alexander Larsson <alexl@redhat.com>
* gtk/gtkcolorsel.[ch]:
API Change. Take GdkColor arguments instead of gdouble *.
Leave the old gtk_color_selection_set_color for compatibility,
but marked deprecated.
Do correct rounding when converting RGB <-> HSV.
* gtk/gtkcolorseldialog.c:
* tests/testgtk.c:
Use new GtkColorSelection API.
* gtk/gtkhsv.c:
Fix problem selecting colors in triangle when Hue is 330.
Fix some black dots around the HSB triangle.
* gtk/gtkfilesel.c:
return FALSE from the focus_in_event handler to fix focus problems.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkwindow.c (gtk_window_class_init): add signals and binding
......
This diff is collapsed.
......@@ -65,44 +65,51 @@ struct _GtkColorSelectionClass
/* ColorSelection */
GtkType gtk_color_selection_get_type (void) G_GNUC_CONST;
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);
GtkType gtk_color_selection_get_type (void) G_GNUC_CONST;
GtkWidget *gtk_color_selection_new (void);
void gtk_color_selection_set_update_policy (GtkColorSelection *colorsel,
GtkUpdateType policy);
gboolean gtk_color_selection_get_has_opacity_control (GtkColorSelection *colorsel);
void gtk_color_selection_set_has_opacity_control (GtkColorSelection *colorsel,
gboolean use_opacity);
gboolean gtk_color_selection_get_has_palette (GtkColorSelection *colorsel);
void gtk_color_selection_set_has_palette (GtkColorSelection *colorsel,
gboolean use_palette);
void gtk_color_selection_set_current_color (GtkColorSelection *colorsel,
GdkColor *color);
void gtk_color_selection_set_current_alpha (GtkColorSelection *colorsel,
guint16 alpha);
void gtk_color_selection_get_current_color (GtkColorSelection *colorsel,
GdkColor *color);
guint16 gtk_color_selection_get_current_alpha (GtkColorSelection *colorsel);
void gtk_color_selection_set_previous_color (GtkColorSelection *colorsel,
GdkColor *color);
void gtk_color_selection_set_previous_alpha (GtkColorSelection *colorsel,
guint16 alpha);
void gtk_color_selection_get_previous_color (GtkColorSelection *colorsel,
GdkColor *color);
guint16 gtk_color_selection_get_previous_alpha (GtkColorSelection *colorsel);
gint gtk_color_selection_get_palette_size (GtkColorSelection *colorsel);
gboolean gtk_color_selection_get_palette_color (GtkColorSelection *colorsel,
gint index,
GdkColor *color);
void gtk_color_selection_set_palette_color (GtkColorSelection *colorsel,
gint index,
GdkColor *color);
void gtk_color_selection_unset_palette_color (GtkColorSelection *colorsel,
gint index);
gboolean gtk_color_selection_is_adjusting (GtkColorSelection *colorsel);
#ifndef GTK_DISABLE_DEPRECATED
/* Deprecated calls: */
void gtk_color_selection_set_color (GtkColorSelection *colorsel,
gdouble *color);
void gtk_color_selection_get_color (GtkColorSelection *colorsel,
gdouble *color);
#endif /* GTK_DISABLE_DEPRECATED */
#ifdef __cplusplus
}
......
......@@ -89,8 +89,8 @@ gtk_color_selection_dialog_init (GtkColorSelectionDialog *colorseldiag)
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_color_selection_set_has_palette (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
gtk_color_selection_set_has_opacity_control (GTK_COLOR_SELECTION(colorseldiag->colorsel), FALSE);
gtk_container_add (GTK_CONTAINER (frame), colorseldiag->colorsel);
gtk_widget_show (colorseldiag->colorsel);
......
......@@ -572,7 +572,13 @@ static void gtk_file_selection_get_property (GObject *object,
}
}
static gboolean
grab_default (GtkWidget *widget)
{
gtk_widget_grab_default (widget);
return FALSE;
}
static void
gtk_file_selection_init (GtkFileSelection *filesel)
{
......@@ -698,7 +704,7 @@ gtk_file_selection_init (GtkFileSelection *filesel)
gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "insert_text",
(GtkSignalFunc) gtk_file_selection_insert_text, NULL);
gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "focus_in_event",
(GtkSignalFunc) gtk_widget_grab_default,
(GtkSignalFunc) grab_default,
GTK_OBJECT (filesel->ok_button));
gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "activate",
(GtkSignalFunc) gtk_button_clicked,
......
......@@ -686,8 +686,12 @@ compute_sv (GtkHSV *hsv,
{
if (*v > 1.0)
*v = 1.0;
*s = (y - sy - *v * (vy - sy)) / (*v * (hy - vy));
if (fabs (hy - vy) < fabs (hx - vx))
*s = (x - sx - *v * (vx - sx)) / (*v * (hx - vx));
else
*s = (y - sy - *v * (vy - sy)) / (*v * (hy - vy));
if (*s < 0.0)
*s = 0.0;
else if (*s > 1.0)
......@@ -949,7 +953,7 @@ paint_ring (GtkHSV *hsv,
dx = xx + x - center;
dist = dx * dx + dy * dy;
if (dist < (inner * inner) || dist > (outer * outer))
if (dist < ((inner-1) * (inner-1)) || dist > ((outer+1) * (outer+1)))
{
*p++ = 0;
*p++ = 0;
......
......@@ -6066,8 +6066,8 @@ opacity_toggled_cb (GtkWidget *w,
GtkColorSelection *colorsel;
colorsel = GTK_COLOR_SELECTION (cs->colorsel);
gtk_color_selection_set_use_opacity (colorsel,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)));
gtk_color_selection_set_has_opacity_control (colorsel,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)));
}
static void
......@@ -6077,7 +6077,7 @@ palette_toggled_cb (GtkWidget *w,
GtkColorSelection *colorsel;
colorsel = GTK_COLOR_SELECTION (cs->colorsel);
gtk_color_selection_set_use_palette (colorsel,
gtk_color_selection_set_has_palette (colorsel,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment