mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
Build with GSEAL_ENABLE
This commit is contained in:
parent
8cee9c66a7
commit
11039a0436
2 changed files with 31 additions and 19 deletions
|
@ -203,17 +203,23 @@ static void
|
||||||
select_area_expose (GtkWidget *widget,
|
select_area_expose (GtkWidget *widget,
|
||||||
GdkEventExpose *event)
|
GdkEventExpose *event)
|
||||||
{
|
{
|
||||||
GtkStyle *style = gtk_widget_get_style (widget);
|
GtkStyle *style = gtk_widget_get_style (widget);
|
||||||
gdouble width = widget->allocation.width;
|
GtkAllocation allocation;
|
||||||
gdouble height = widget->allocation.height;
|
gdouble dx;
|
||||||
gdouble dx = 1.0 / width;
|
gdouble dy;
|
||||||
gdouble dy = 1.0 / height;
|
guchar *buf = g_alloca (3 * event->area.width * event->area.height);
|
||||||
guchar *buf = g_alloca (3 * event->area.width * event->area.height);
|
guchar *dest = buf;
|
||||||
guchar *dest = buf;
|
gdouble y;
|
||||||
gdouble y;
|
gint i, j;
|
||||||
gint i, j;
|
|
||||||
|
|
||||||
for (j = 0, y = event->area.y / height; j < event->area.height; j++, y += dy)
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|
||||||
|
dx = 1.0 / allocation.width;
|
||||||
|
dy = 1.0 / allocation.height;
|
||||||
|
|
||||||
|
for (j = 0, y = event->area.y / allocation.height;
|
||||||
|
j < event->area.height;
|
||||||
|
j++, y += dy)
|
||||||
{
|
{
|
||||||
guchar *d = dest;
|
guchar *d = dest;
|
||||||
|
|
||||||
|
@ -246,7 +252,7 @@ select_area_expose (GtkWidget *widget,
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_draw_rgb_image_dithalign (gtk_widget_get_window (widget),
|
gdk_draw_rgb_image_dithalign (gtk_widget_get_window (widget),
|
||||||
style->fg_gc[widget->state],
|
style->fg_gc[gtk_widget_get_state (widget)],
|
||||||
event->area.x, event->area.y,
|
event->area.x, event->area.y,
|
||||||
event->area.width, event->area.height,
|
event->area.width, event->area.height,
|
||||||
GDK_RGB_DITHER_MAX,
|
GDK_RGB_DITHER_MAX,
|
||||||
|
@ -310,10 +316,13 @@ button_press_event (GtkWidget *widget,
|
||||||
GdkEventButton *event,
|
GdkEventButton *event,
|
||||||
ColorselWater *water)
|
ColorselWater *water)
|
||||||
{
|
{
|
||||||
gboolean erase;
|
GtkAllocation allocation;
|
||||||
|
gboolean erase;
|
||||||
|
|
||||||
water->last_x = event->x / widget->allocation.width;
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
water->last_y = event->y / widget->allocation.height;
|
|
||||||
|
water->last_x = event->x / allocation.width;
|
||||||
|
water->last_y = event->y / allocation.height;
|
||||||
|
|
||||||
erase = (event->button != 1);
|
erase = (event->button != 1);
|
||||||
/* FIXME: (event->source == GDK_SOURCE_ERASER) */
|
/* FIXME: (event->source == GDK_SOURCE_ERASER) */
|
||||||
|
@ -333,11 +342,14 @@ motion_notify_event (GtkWidget *widget,
|
||||||
GdkEventMotion *event,
|
GdkEventMotion *event,
|
||||||
ColorselWater *water)
|
ColorselWater *water)
|
||||||
{
|
{
|
||||||
|
GtkAllocation allocation;
|
||||||
GdkTimeCoord **coords;
|
GdkTimeCoord **coords;
|
||||||
gint nevents;
|
gint nevents;
|
||||||
gint i;
|
gint i;
|
||||||
gboolean erase;
|
gboolean erase;
|
||||||
|
|
||||||
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|
||||||
if (event->state & (GDK_BUTTON1_MASK |
|
if (event->state & (GDK_BUTTON1_MASK |
|
||||||
GDK_BUTTON2_MASK |
|
GDK_BUTTON2_MASK |
|
||||||
GDK_BUTTON3_MASK |
|
GDK_BUTTON3_MASK |
|
||||||
|
@ -376,8 +388,8 @@ motion_notify_event (GtkWidget *widget,
|
||||||
GDK_AXIS_PRESSURE, &pressure);
|
GDK_AXIS_PRESSURE, &pressure);
|
||||||
|
|
||||||
draw_brush (water, widget, erase,
|
draw_brush (water, widget, erase,
|
||||||
x / widget->allocation.width,
|
x / allocation.width,
|
||||||
y / widget->allocation.height, pressure);
|
y / allocation.height, pressure);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free (coords);
|
g_free (coords);
|
||||||
|
@ -389,8 +401,8 @@ motion_notify_event (GtkWidget *widget,
|
||||||
gdk_event_get_axis ((GdkEvent *) event, GDK_AXIS_PRESSURE, &pressure);
|
gdk_event_get_axis ((GdkEvent *) event, GDK_AXIS_PRESSURE, &pressure);
|
||||||
|
|
||||||
draw_brush (water, widget, erase,
|
draw_brush (water, widget, erase,
|
||||||
event->x / widget->allocation.width,
|
event->x / allocation.width,
|
||||||
event->y / widget->allocation.height, pressure);
|
event->y / allocation.height, pressure);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -426,7 +426,7 @@ cdisplay_lcms_get_screen (CdisplayLcms *lcms,
|
||||||
|
|
||||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
||||||
|
|
||||||
if (GTK_IS_WIDGET (managed) && GTK_WIDGET_DRAWABLE (managed))
|
if (GTK_IS_WIDGET (managed) && gtk_widget_is_drawable (GTK_WIDGET (managed)))
|
||||||
{
|
{
|
||||||
GtkWidget *widget = GTK_WIDGET (managed);
|
GtkWidget *widget = GTK_WIDGET (managed);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue