Use accessors instead of widget->window and adjustment->value

This commit is contained in:
Michael Natterer 2009-10-10 11:32:29 +02:00
parent 9f77899bf1
commit 0458da1832
3 changed files with 23 additions and 16 deletions

View File

@ -1783,7 +1783,7 @@ function_graph_expose (GtkWidget *widget,
} }
} }
gdk_draw_rgb_image (widget->window, style->black_gc, gdk_draw_rgb_image (gtk_widget_get_window (widget), style->black_gc,
0, 0, 256, 256, 0, 0, 256, 256,
GDK_RGB_DITHER_NORMAL, GDK_RGB_DITHER_NORMAL,
buffer, buffer,
@ -1791,7 +1791,7 @@ function_graph_expose (GtkWidget *widget,
g_free (buffer); g_free (buffer);
gdk_draw_line (widget->window, style->white_gc, 0,255, 255, 0); gdk_draw_line (gtk_widget_get_window (widget), style->white_gc, 0,255, 255, 0);
y = 255 * CLAMP (logistic_function (param, 0, param->power), y = 255 * CLAMP (logistic_function (param, 0, param->power),
0, 1.0); 0, 1.0);
@ -1801,7 +1801,7 @@ function_graph_expose (GtkWidget *widget,
/* curve */ /* curve */
y = 255 * CLAMP (logistic_function (param, x/(gdouble)255, param->power), y = 255 * CLAMP (logistic_function (param, x/(gdouble)255, param->power),
0, 1.0); 0, 1.0);
gdk_draw_line (widget->window, style->black_gc, gdk_draw_line (gtk_widget_get_window (widget), style->black_gc,
x, 255-last_y, x, 255-y); x, 255-last_y, x, 255-y);
} }
return TRUE; return TRUE;

View File

@ -635,7 +635,11 @@ scale_callback (GtkAdjustment *adj,
if (GIMP_IS_COLOR_BUTTON (object)) if (GIMP_IS_COLOR_BUTTON (object))
{ {
if (color == &xargs.threshold && lock_threshold == TRUE) if (color == &xargs.threshold && lock_threshold == TRUE)
gimp_rgb_set (color, adj->value, adj->value, adj->value); {
gdouble value = gtk_adjustment_get_value (adj);
gimp_rgb_set (color, value, value, value);
}
gimp_color_button_set_color (GIMP_COLOR_BUTTON (object), color); gimp_color_button_set_color (GIMP_COLOR_BUTTON (object), color);
} }

View File

@ -1516,7 +1516,8 @@ bender_update (BenderDialog *cd,
if (update & UP_PREVIEW) if (update & UP_PREVIEW)
{ {
gdk_window_set_cursor (GTK_WIDGET (cd->shell)->window, cd->cursor_busy); gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (cd->shell)),
cd->cursor_busy);
gdk_flush (); gdk_flush ();
if (cd->preview_layer_id2 >= 0) if (cd->preview_layer_id2 >= 0)
@ -1528,7 +1529,8 @@ bender_update (BenderDialog *cd,
if (update & UP_DRAW) if (update & UP_DRAW)
gtk_widget_queue_draw (cd->pv_widget); gtk_widget_queue_draw (cd->pv_widget);
gdk_window_set_cursor (GTK_WIDGET (cd->shell)->window, NULL); gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (cd->shell)),
NULL);
} }
if (update & UP_PREVIEW_EXPOSE) if (update & UP_PREVIEW_EXPOSE)
{ {
@ -1592,7 +1594,8 @@ bender_update (BenderDialog *cd,
RADIUS * 2, RADIUS * 2, 0, 23040); RADIUS * 2, RADIUS * 2, 0, 23040);
} }
} }
gdk_draw_drawable (cd->graph->window, graph_style->black_gc, cd->pixmap, gdk_draw_drawable (gtk_widget_get_window (cd->graph),
graph_style->black_gc, cd->pixmap,
0, 0, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2); 0, 0, 0, 0, GRAPH_WIDTH + RADIUS * 2, GRAPH_HEIGHT + RADIUS * 2);
} }
} }
@ -1790,12 +1793,12 @@ bender_rotate_adj_callback (GtkAdjustment *adjustment,
{ {
BenderDialog *cd = client_data; BenderDialog *cd = client_data;
if (adjustment->value != cd->rotation) if (gtk_adjustment_get_value (adjustment) != cd->rotation)
{ {
cd->rotation = adjustment->value; cd->rotation = gtk_adjustment_get_value (adjustment);
if (cd->preview) if (cd->preview)
bender_update (cd, UP_PREVIEW | UP_DRAW); bender_update (cd, UP_PREVIEW | UP_DRAW);
} }
} }
static void static void
@ -2144,7 +2147,7 @@ bender_graph_events (GtkWidget *widget,
closest_point = 0; closest_point = 0;
/* get the pointer position */ /* get the pointer position */
gdk_window_get_pointer (cd->graph->window, &tx, &ty, NULL); gdk_window_get_pointer (gtk_widget_get_window (cd->graph), &tx, &ty, NULL);
x = CLAMP ((tx - RADIUS), 0, 255); x = CLAMP ((tx - RADIUS), 0, 255);
y = CLAMP ((ty - RADIUS), 0, 255); y = CLAMP ((ty - RADIUS), 0, 255);
@ -2165,7 +2168,7 @@ bender_graph_events (GtkWidget *widget,
{ {
case GDK_EXPOSE: case GDK_EXPOSE:
if (cd->pixmap == NULL) if (cd->pixmap == NULL)
cd->pixmap = gdk_pixmap_new (cd->graph->window, cd->pixmap = gdk_pixmap_new (gtk_widget_get_window (cd->graph),
GRAPH_WIDTH + RADIUS * 2, GRAPH_WIDTH + RADIUS * 2,
GRAPH_HEIGHT + RADIUS * 2, -1); GRAPH_HEIGHT + RADIUS * 2, -1);
@ -2301,7 +2304,7 @@ bender_graph_events (GtkWidget *widget,
if (new_type != cursor_type) if (new_type != cursor_type)
{ {
cursor_type = new_type; cursor_type = new_type;
/* change_win_cursor (cd->graph->window, cursor_type); */ /* change_win_cursor (gtk_widget_get_window (cd->graph), cursor_type); */
} }
break; break;