Commit 6fe8e7ee authored by Sven Neumann's avatar Sven Neumann

unref gdk_pixmaps and gdk_bitmaps

cosmetics


--Sven
parent 5afe8314
Tue Feb 8 18:19:29 CET 2000 Sven Neumann <sven@gimp.org>
* app/gimpdnd.c: When dragging a layer, show it in its full size
instead of taking the image_size into account. The offset that was
shown is lost during the drag, so it doesn't make sense to show it.
* app/devices.c
* app/gradient.c
* app/info_window.c
* app/interface.c
* app/nav_window.c
* app/ops_buttons.c: stop leaking pixmaps all over the place.
We might consider to make some pixmaps static and reuse them.
* app/undo_history.c: purely cosmetic
2000-02-08 Michael Natterer <mitch@gimp.org>
* libgimp/gimpfileselection.[ch]
......@@ -19,9 +35,9 @@ Tue Feb 8 14:59:43 CET 2000 Sven Neumann <sven@gimp.org>
* libgimp/gimpexport.c: Be more intelligent when dealing with invisible
layers. Export should now always save what you see. Unless there is no
visible layer at all, then we save the active layer. Export doesn't call
gimp_merge_visible_layers any more if less than two layers are visible.
Fixes bug #5701.
visible layer at all, then we save the active layer. Export doesn't
call gimp_merge_visible_layers any more if less than two layers are
visible. Fixes bug #5701.
Tue Feb 8 13:12:26 CET 2000 Sven Neumann <sven@gimp.org>
......
......@@ -735,6 +735,7 @@ void
device_status_create (void)
{
DeviceInfo *device_info;
GdkPixmap *pixmap;
GtkWidget *label;
GList *list;
gint i;
......@@ -813,9 +814,11 @@ device_status_create (void)
/* the tool */
deviceD->eventboxes[i] = gtk_event_box_new();
deviceD->tools[i] =
gtk_pixmap_new (create_tool_pixmap (deviceD->table, RECT_SELECT),
NULL);
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_drag_source_set (deviceD->eventboxes[i],
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
tool_target_table, n_tool_targets,
......@@ -981,6 +984,7 @@ device_status_update_current (void)
void
device_status_update (guint32 deviceid)
{
GdkPixmap *pixmap;
GdkDeviceInfo *gdk_info;
DeviceInfo *device_info;
guchar buffer[CELL_SIZE*3];
......@@ -1018,11 +1022,10 @@ device_status_update (guint32 deviceid)
{
gtk_widget_show (deviceD->frames[i]);
gtk_pixmap_set
(GTK_PIXMAP (deviceD->tools[i]),
create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context)),
NULL);
pixmap = create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context));
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_widget_draw (deviceD->tools[i], NULL);
gtk_widget_show (deviceD->tools[i]);
......
......@@ -207,6 +207,8 @@ info_window_image_preview_book (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
dropper_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_table_attach (GTK_TABLE (table2), pixmapwid, 0, 2, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......
......@@ -505,12 +505,16 @@ create_pixmap_widget (GdkWindow *parent,
gint width,
gint height)
{
GtkWidget *widget;
GdkPixmap *pixmap;
GdkBitmap *mask;
pixmap = create_pixmap (parent, &mask, data, width, height);
return gtk_pixmap_new (pixmap, mask);
widget = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
return (widget);
}
void
......@@ -846,6 +850,7 @@ create_display_shell (GDisplay* gdisp,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff), TRUE);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
/* Draw pixmaps - note: you must realize the parent prior to doing the
rest! */
{
......@@ -861,6 +866,9 @@ create_display_shell (GDisplay* gdisp,
qmasksel_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
gtk_widget_show (pixmap);
......@@ -868,6 +876,9 @@ create_display_shell (GDisplay* gdisp,
&style->bg[GTK_STATE_NORMAL],
qmasknosel_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
gtk_widget_show (pixmap);
......@@ -876,6 +887,9 @@ create_display_shell (GDisplay* gdisp,
&style->bg[GTK_STATE_NORMAL],
navbutton_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
gtk_widget_show (pixmap);
}
......
......@@ -505,12 +505,16 @@ create_pixmap_widget (GdkWindow *parent,
gint width,
gint height)
{
GtkWidget *widget;
GdkPixmap *pixmap;
GdkBitmap *mask;
pixmap = create_pixmap (parent, &mask, data, width, height);
return gtk_pixmap_new (pixmap, mask);
widget = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
return (widget);
}
void
......@@ -846,6 +850,7 @@ create_display_shell (GDisplay* gdisp,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff), TRUE);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
/* Draw pixmaps - note: you must realize the parent prior to doing the
rest! */
{
......@@ -861,6 +866,9 @@ create_display_shell (GDisplay* gdisp,
qmasksel_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
gtk_widget_show (pixmap);
......@@ -868,6 +876,9 @@ create_display_shell (GDisplay* gdisp,
&style->bg[GTK_STATE_NORMAL],
qmasknosel_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
gtk_widget_show (pixmap);
......@@ -876,6 +887,9 @@ create_display_shell (GDisplay* gdisp,
&style->bg[GTK_STATE_NORMAL],
navbutton_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
gtk_widget_show (pixmap);
}
......
......@@ -1096,6 +1096,9 @@ nav_create_button_area (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......@@ -1137,6 +1140,9 @@ nav_create_button_area (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......
......@@ -1096,6 +1096,9 @@ nav_create_button_area (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......@@ -1137,6 +1140,9 @@ nav_create_button_area (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......
......@@ -1047,7 +1047,6 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget,
gboolean drag_connected;
GImage *gimage;
TempBuf *tmpbuf;
gint bpp;
gint x, y;
......@@ -1058,60 +1057,28 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget,
gint width;
gint height;
gdouble ratio;
gint offx, offy;
if (! preview_size)
return;
gimage = gimp_drawable_gimage (drawable);
if (gimage->width > gimage->height)
ratio = (gdouble) DRAG_PREVIEW_SIZE / (gdouble) gimage->width;
if (gimp_drawable_width (drawable) > gimp_drawable_height (drawable))
ratio = (gdouble) DRAG_PREVIEW_SIZE /
(gdouble) (gimp_drawable_width (drawable));
else
ratio = (gdouble) DRAG_PREVIEW_SIZE / (gdouble) gimage->height;
ratio = (gdouble) DRAG_PREVIEW_SIZE /
(gdouble) (gimp_drawable_height (drawable));
width = (gint) (ratio * gimage->width);
height = (gint) (ratio * gimage->height);
width = (gint) (ratio * gimp_drawable_width (drawable));
height = (gint) (ratio * gimp_drawable_height (drawable));
if (width < 1)
width = 1;
if (height < 1)
height = 1;
gimp_drawable_offsets (drawable, &offx, &offy);
offx = (int) (ratio * offx);
offy = (int) (ratio * offy);
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
gtk_preview_size (GTK_PREVIEW (preview), width, height);
even = g_new (guchar, width * 3);
for (x = 0; x < width; x++)
{
even[x * 3] = 255;
even[x * 3 + 1] = 255;
even[x * 3 + 2] = 255;
}
for (y = 0; y < height; y++)
{
gtk_preview_draw_row (GTK_PREVIEW (preview), even,
0, y, width);
}
g_free (even);
/* readjust for actual layer size */
width = (gint) (ratio * gimp_drawable_width (drawable));
height = (gint) (ratio * gimp_drawable_height (drawable));
if (width < 1)
width = 1;
if (height < 1)
height = 1;
if (GIMP_IS_LAYER (drawable))
{
tmpbuf = layer_preview (GIMP_LAYER (drawable), width, height);
......@@ -1195,12 +1162,12 @@ gimp_dnd_set_drawable_preview_icon (GtkWidget *widget,
if ((y / GIMP_CHECK_SIZE_SM) & 1)
{
gtk_preview_draw_row (GTK_PREVIEW (preview), odd,
offx, y + offy, width);
0, y, width);
}
else
{
gtk_preview_draw_row (GTK_PREVIEW (preview), even,
offx, y + offy, width);
0, y, width);
}
src += width * bpp;
}
......
......@@ -945,6 +945,9 @@ gradient_editor_create (void)
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......@@ -960,6 +963,9 @@ gradient_editor_create (void)
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......
......@@ -945,6 +945,9 @@ gradient_editor_create (void)
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......@@ -960,6 +963,9 @@ gradient_editor_create (void)
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......
......@@ -735,6 +735,7 @@ void
device_status_create (void)
{
DeviceInfo *device_info;
GdkPixmap *pixmap;
GtkWidget *label;
GList *list;
gint i;
......@@ -813,9 +814,11 @@ device_status_create (void)
/* the tool */
deviceD->eventboxes[i] = gtk_event_box_new();
deviceD->tools[i] =
gtk_pixmap_new (create_tool_pixmap (deviceD->table, RECT_SELECT),
NULL);
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_drag_source_set (deviceD->eventboxes[i],
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
tool_target_table, n_tool_targets,
......@@ -981,6 +984,7 @@ device_status_update_current (void)
void
device_status_update (guint32 deviceid)
{
GdkPixmap *pixmap;
GdkDeviceInfo *gdk_info;
DeviceInfo *device_info;
guchar buffer[CELL_SIZE*3];
......@@ -1018,11 +1022,10 @@ device_status_update (guint32 deviceid)
{
gtk_widget_show (deviceD->frames[i]);
gtk_pixmap_set
(GTK_PIXMAP (deviceD->tools[i]),
create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context)),
NULL);
pixmap = create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context));
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_widget_draw (deviceD->tools[i], NULL);
gtk_widget_show (deviceD->tools[i]);
......
......@@ -945,6 +945,9 @@ gradient_editor_create (void)
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......@@ -960,6 +963,9 @@ gradient_editor_create (void)
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......
......@@ -207,6 +207,8 @@ info_window_image_preview_book (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
dropper_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_table_attach (GTK_TABLE (table2), pixmapwid, 0, 2, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......
......@@ -735,6 +735,7 @@ void
device_status_create (void)
{
DeviceInfo *device_info;
GdkPixmap *pixmap;
GtkWidget *label;
GList *list;
gint i;
......@@ -813,9 +814,11 @@ device_status_create (void)
/* the tool */
deviceD->eventboxes[i] = gtk_event_box_new();
deviceD->tools[i] =
gtk_pixmap_new (create_tool_pixmap (deviceD->table, RECT_SELECT),
NULL);
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_drag_source_set (deviceD->eventboxes[i],
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
tool_target_table, n_tool_targets,
......@@ -981,6 +984,7 @@ device_status_update_current (void)
void
device_status_update (guint32 deviceid)
{
GdkPixmap *pixmap;
GdkDeviceInfo *gdk_info;
DeviceInfo *device_info;
guchar buffer[CELL_SIZE*3];
......@@ -1018,11 +1022,10 @@ device_status_update (guint32 deviceid)
{
gtk_widget_show (deviceD->frames[i]);
gtk_pixmap_set
(GTK_PIXMAP (deviceD->tools[i]),
create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context)),
NULL);
pixmap = create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context));
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_widget_draw (deviceD->tools[i], NULL);
gtk_widget_show (deviceD->tools[i]);
......
......@@ -207,6 +207,8 @@ info_window_image_preview_book (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
dropper_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_table_attach (GTK_TABLE (table2), pixmapwid, 0, 2, 0, 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
......
......@@ -505,12 +505,16 @@ create_pixmap_widget (GdkWindow *parent,
gint width,
gint height)
{
GtkWidget *widget;
GdkPixmap *pixmap;
GdkBitmap *mask;
pixmap = create_pixmap (parent, &mask, data, width, height);
return gtk_pixmap_new (pixmap, mask);
widget = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
return (widget);
}
void
......@@ -846,6 +850,7 @@ create_display_shell (GDisplay* gdisp,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gdisp->qmaskoff), TRUE);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskon), 15, 15);
gtk_widget_set_usize (GTK_WIDGET (gdisp->qmaskoff), 15, 15);
/* Draw pixmaps - note: you must realize the parent prior to doing the
rest! */
{
......@@ -861,6 +866,9 @@ create_display_shell (GDisplay* gdisp,
qmasksel_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (gdisp->qmaskon), pixmap);
gtk_widget_show (pixmap);
......@@ -868,6 +876,9 @@ create_display_shell (GDisplay* gdisp,
&style->bg[GTK_STATE_NORMAL],
qmasknosel_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (gdisp->qmaskoff), pixmap);
gtk_widget_show (pixmap);
......@@ -876,6 +887,9 @@ create_display_shell (GDisplay* gdisp,
&style->bg[GTK_STATE_NORMAL],
navbutton_xpm);
pixmap = gtk_pixmap_new (pxmp, mask);
gdk_pixmap_unref (pxmp);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (navhbox), pixmap);
gtk_widget_show (pixmap);
}
......
......@@ -1096,6 +1096,9 @@ nav_create_button_area (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
zoom_out_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......@@ -1137,6 +1140,9 @@ nav_create_button_area (InfoDialog *info_win)
&style->bg[GTK_STATE_NORMAL],
zoom_in_xpm);
pixmapwid = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
gtk_container_add (GTK_CONTAINER (button), pixmapwid);
gtk_widget_show (pixmapwid);
gtk_widget_show (button);
......
......@@ -53,6 +53,8 @@ ops_button_box_new (GtkWidget *parent,
&style->bg[GTK_STATE_NORMAL],
ops_button->xpm_data);
pixmap_widget = gtk_pixmap_new (pixmap, mask);
gdk_pixmap_unref (pixmap);
gdk_bitmap_unref (mask);
switch (ops_type)
{
......
......@@ -408,7 +408,7 @@ smudge_motion (PaintCore *paint_core,
if (!drawable_has_alpha (drawable))
add_alpha_region (&tempPR, &destPR);
else
copy_region(&tempPR, &destPR);
copy_region (&tempPR, &destPR);
opacity = 255 * gimp_context_get_opacity (NULL);
if (pressure_options->opacity)
......
......@@ -408,7 +408,7 @@ smudge_motion (PaintCore *paint_core,
if (!drawable_has_alpha (drawable))
add_alpha_region (&tempPR, &destPR);
else
copy_region(&tempPR, &destPR);
copy_region (&tempPR, &destPR);
opacity = 255 * gimp_context_get_opacity (NULL);
if (pressure_options->opacity)
......
......@@ -408,7 +408,7 @@ smudge_motion (PaintCore *paint_core,
if (!drawable_has_alpha (drawable))
add_alpha_region (&tempPR, &destPR);
else
copy_region(&tempPR, &destPR);
copy_region (&tempPR, &destPR);
opacity = 255 * gimp_context_get_opacity (NULL);
if (pressure_options->opacity)
......
......@@ -408,7 +408,7 @@ smudge_motion (PaintCore *paint_core,
if (!drawable_has_alpha (drawable))
add_alpha_region (&tempPR, &destPR);
else
copy_region(&tempPR, &destPR);
copy_region (&tempPR, &destPR);
opacity = 255 * gimp_context_get_opacity (NULL);
if (pressure_options->opacity)
......
......@@ -273,10 +273,10 @@ undo_history_set_pixmap_idle (gpointer data)
height = (gint)(((gdouble)height * (gdouble)width ) /(gdouble) idle->gimage->width + 0.5);
}
utype = undo_get_undo_top_type(idle->gimage);
utype = undo_get_undo_top_type (idle->gimage);
if((utype != MASK_UNDO && utype != QMASK_UNDO) ||
(mbuf = mask_render_preview(idle->gimage,&width,&height)) == NULL)
(mbuf = mask_render_preview (idle->gimage,&width,&height)) == NULL)
{
buf = gimp_image_construct_composite_preview (idle->gimage, width, height);
bpp = buf->bytes;
......@@ -291,7 +291,7 @@ undo_history_set_pixmap_idle (gpointer data)
pixmap = gdk_pixmap_new (GTK_WIDGET (idle->clist)->window, width+2, height+2, -1);
gdk_draw_rectangle (pixmap,
GTK_WIDGET (idle->clist)->style->bg_gc[GTK_STATE_NORMAL],
GTK_WIDGET (idle->clist)->style->black_gc,
TRUE,
0, 0,
width + 2, height + 2);
......@@ -780,13 +780,13 @@ undo_history_new (GImage *gimage)
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_usize (GTK_WIDGET (scrolled_win),
160 + st->preview_size,
4 * (MAX (st->preview_size, 16) + 4));
4 * (MAX (st->preview_size, 16) + 6));
/* clist of undo actions */
st->clist = gtk_clist_new (3);
gtk_clist_set_selection_mode (GTK_CLIST (st->clist), GTK_SELECTION_BROWSE);
gtk_clist_set_reorderable (GTK_CLIST (st->clist), FALSE);
gtk_clist_set_row_height (GTK_CLIST (st->clist), MAX (st->preview_size, 16) + 2);
gtk_clist_set_row_height (GTK_CLIST (st->clist), MAX (st->preview_size, 16) + 4);
gtk_clist_set_column_width (GTK_CLIST (st->clist), 0, st->preview_size + 2);
gtk_clist_set_column_width (GTK_CLIST (st->clist), 1, 18);
gtk_clist_set_column_min_width (GTK_CLIST (st->clist), 2, 64);
......@@ -867,6 +867,7 @@ undo_history_new (GImage *gimage)
gtk_container_add (GTK_CONTAINER (abox), hbox2);
pixmapwid = gtk_pixmap_new (undo_pixmap, undo_mask);
gtk_box_pack_start (GTK_BOX (hbox2), pixmapwid, FALSE, FALSE, 0);
gtk_widget_show (pixmapwid);
......@@ -892,6 +893,7 @@ undo_history_new (GImage *gimage)
gtk_container_add (GTK_CONTAINER (abox), hbox2);
pixmapwid = gtk_pixmap_new (redo_pixmap, redo_mask);
gtk_box_pack_start (GTK_BOX (hbox2), pixmapwid, FALSE, FALSE, 0);
gtk_widget_show (pixmapwid);
......
......@@ -735,6 +735,7 @@ void
device_status_create (void)
{
DeviceInfo *device_info;
GdkPixmap *pixmap;
GtkWidget *label;
GList *list;
gint i;
......@@ -813,9 +814,11 @@ device_status_create (void)
/* the tool */
deviceD->eventboxes[i] = gtk_event_box_new();
deviceD->tools[i] =
gtk_pixmap_new (create_tool_pixmap (deviceD->table, RECT_SELECT),
NULL);
pixmap = create_tool_pixmap (deviceD->table, RECT_SELECT);
deviceD->tools[i] = gtk_pixmap_new (pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_drag_source_set (deviceD->eventboxes[i],
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
tool_target_table, n_tool_targets,
......@@ -981,6 +984,7 @@ device_status_update_current (void)
void
device_status_update (guint32 deviceid)
{
GdkPixmap *pixmap;
GdkDeviceInfo *gdk_info;
DeviceInfo *device_info;
guchar buffer[CELL_SIZE*3];
......@@ -1018,11 +1022,10 @@ device_status_update (guint32 deviceid)
{
gtk_widget_show (deviceD->frames[i]);
gtk_pixmap_set
(GTK_PIXMAP (deviceD->tools[i]),
create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context)),
NULL);
pixmap = create_tool_pixmap (deviceD->table,
gimp_context_get_tool (device_info->context));
gtk_pixmap_set (GTK_PIXMAP (deviceD->tools[i]), pixmap, NULL);
gdk_pixmap_unref (pixmap);
gtk_widget_draw (deviceD->tools[i], NULL);
gtk_widget_show (deviceD->tools[i]);
......
......@@ -735,6 +735,7 @@ void
device_status_create (void)
{
DeviceInfo *device_info;
GdkPixmap *pixmap;