Commit 5ef2b855 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

change the cursor with the tool (bug #90519).

2005-07-26  Sven Neumann  <sven@gimp.org>

	* plug-ins/ifscompose/ifscompose.c: change the cursor with the tool
	(bug #90519).
parent 18943eba
2005-07-26 Sven Neumann <sven@gimp.org>
* plug-ins/ifscompose/ifscompose.c: change the cursor with the tool
(bug #90519).
2005-07-26 Sven Neumann <sven@gimp.org> 2005-07-26 Sven Neumann <sven@gimp.org>
* tools/gimp-remote.c: fixed signedness warnings. * tools/gimp-remote.c: fixed signedness warnings.
......
...@@ -274,9 +274,10 @@ static void ifs_compose_response (GtkWidget *widget, ...@@ -274,9 +274,10 @@ static void ifs_compose_response (GtkWidget *widget,
* Some static variables * Some static variables
*/ */
static IfsDialog *ifsD = NULL; static IfsDialog *ifsD = NULL;
static IfsOptionsDialog *ifsOptD = NULL; static IfsOptionsDialog *ifsOptD = NULL;
static IfsDesignArea *ifsDesign = NULL; static IfsDesignArea *ifsDesign = NULL;
static AffElement **elements = NULL; static AffElement **elements = NULL;
static gint *element_selected = NULL; static gint *element_selected = NULL;
...@@ -692,28 +693,32 @@ ifs_compose_color_page (void) ...@@ -692,28 +693,32 @@ ifs_compose_color_page (void)
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (ifsD->full_button)); group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (ifsD->full_button));
gtk_widget_show (ifsD->full_button); gtk_widget_show (ifsD->full_button);
gimp_rgb_set (&color, 1.0, 0.0, 0.0); gimp_rgb_parse_name (&color, "red", -1);
gimp_rgb_set_alpha (&color, 1.0);
ifsD->red_cmap = color_map_create (_("IFS Fractal: Red"), &color, ifsD->red_cmap = color_map_create (_("IFS Fractal: Red"), &color,
&ifsD->current_vals.red_color, FALSE); &ifsD->current_vals.red_color, FALSE);
gtk_table_attach (GTK_TABLE (table), ifsD->red_cmap->hbox, 1, 2, 2, 3, gtk_table_attach (GTK_TABLE (table), ifsD->red_cmap->hbox, 1, 2, 2, 3,
GTK_FILL, GTK_FILL, 0, 0); GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (ifsD->red_cmap->hbox); gtk_widget_show (ifsD->red_cmap->hbox);
gimp_rgb_set (&color, 0.0, 1.0, 0.0); gimp_rgb_parse_name (&color, "green", -1);
gimp_rgb_set_alpha (&color, 1.0);
ifsD->green_cmap = color_map_create (_("IFS Fractal: Green"), &color, ifsD->green_cmap = color_map_create (_("IFS Fractal: Green"), &color,
&ifsD->current_vals.green_color, FALSE); &ifsD->current_vals.green_color, FALSE);
gtk_table_attach (GTK_TABLE (table), ifsD->green_cmap->hbox, 2, 3, 2, 3, gtk_table_attach (GTK_TABLE (table), ifsD->green_cmap->hbox, 2, 3, 2, 3,
GTK_FILL, GTK_FILL, 0, 0); GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (ifsD->green_cmap->hbox); gtk_widget_show (ifsD->green_cmap->hbox);
gimp_rgb_set (&color, 0.0, 0.0, 1.0); gimp_rgb_parse_name (&color, "blue", -1);
gimp_rgb_set_alpha (&color, 1.0);
ifsD->blue_cmap = color_map_create (_("IFS Fractal: Blue"), &color, ifsD->blue_cmap = color_map_create (_("IFS Fractal: Blue"), &color,
&ifsD->current_vals.blue_color, FALSE); &ifsD->current_vals.blue_color, FALSE);
gtk_table_attach (GTK_TABLE (table), ifsD->blue_cmap->hbox, 3, 4, 2, 3, gtk_table_attach (GTK_TABLE (table), ifsD->blue_cmap->hbox, 3, 4, 2, 3,
GTK_FILL, GTK_FILL, 0, 0); GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (ifsD->blue_cmap->hbox); gtk_widget_show (ifsD->blue_cmap->hbox);
gimp_rgb_set (&color, 0.0, 0.0, 0.0); gimp_rgb_parse_name (&color, "black", -1);
gimp_rgb_set_alpha (&color, 1.0);
ifsD->black_cmap = color_map_create (_("IFS Fractal: Black"), &color, ifsD->black_cmap = color_map_create (_("IFS Fractal: Black"), &color,
&ifsD->current_vals.black_color, FALSE); &ifsD->current_vals.black_color, FALSE);
gtk_table_attach (GTK_TABLE (table), ifsD->black_cmap->hbox, 4, 5, 2, 3, gtk_table_attach (GTK_TABLE (table), ifsD->black_cmap->hbox, 4, 5, 2, 3,
...@@ -1488,9 +1493,16 @@ set_current_element (gint index) ...@@ -1488,9 +1493,16 @@ set_current_element (gint index)
static void static void
design_area_realize (GtkWidget *widget) design_area_realize (GtkWidget *widget)
{ {
GdkDisplay *display = gtk_widget_get_display (widget); const gint cursors[3] =
GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_CROSSHAIR); {
GDK_FLEUR, /* OP_TRANSLATE */
GDK_EXCHANGE, /* OP_ROTATE */
GDK_CROSSHAIR /* OP_SHEAR */
};
GdkDisplay *display = gtk_widget_get_display (widget);
GdkCursor *cursor = gdk_cursor_new_for_display (display,
cursors[ifsDesign->op]);
gdk_window_set_cursor (widget->window, cursor); gdk_window_set_cursor (widget->window, cursor);
gdk_cursor_unref (cursor); gdk_cursor_unref (cursor);
} }
...@@ -2181,7 +2193,7 @@ value_pair_scale_callback (GtkAdjustment *adjustment, ...@@ -2181,7 +2193,7 @@ value_pair_scale_callback (GtkAdjustment *adjustment,
} }
if (changed) if (changed)
val_changed_update (); val_changed_update ();
} }
static void static void
...@@ -2190,6 +2202,10 @@ design_op_update_callback (GtkRadioAction *action, ...@@ -2190,6 +2202,10 @@ design_op_update_callback (GtkRadioAction *action,
gpointer data) gpointer data)
{ {
ifsDesign->op = gtk_radio_action_get_current_value (action); ifsDesign->op = gtk_radio_action_get_current_value (action);
/* cursor switch */
if (GTK_WIDGET_REALIZED (ifsDesign->area))
design_area_realize (ifsDesign->area);
} }
static void static void
......
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