Re: new function gdk_pixmap_copy
- From: Ron Steinke <rsteinke merilon elfhame net>
- To: gtk-devel-list gnome org
- Subject: Re: new function gdk_pixmap_copy
- Date: Tue, 05 Dec 2000 11:09:41 -0800
Here is a fixed version of the patch I posted last week to add
gdk_pixmap_copy (I forgot to add the function to gdk.def).
Ron Steinke
diff -ur -x *.o -x *.lo -x .libs gtk+-1.3.2.old/gdk/gdk.def gtk+-1.3.2.new/gdk/gdk.def
--- gtk+-1.3.2.old/gdk/gdk.def Mon Dec 4 17:14:01 2000
+++ gtk+-1.3.2.new/gdk/gdk.def Mon Dec 4 17:14:58 2000
@@ -228,6 +228,7 @@
gdk_pixmap_foreign_new
gdk_pixmap_get_type
gdk_pixmap_new
+ gdk_pixmap_copy
gdk_pointer_grab
gdk_pointer_is_grabbed
gdk_pointer_ungrab
diff -ur -x *.o -x *.lo -x .libs gtk+-1.3.2.old/gdk/gdkpixmap.c gtk+-1.3.2.new/gdk/gdkpixmap.c
--- gtk+-1.3.2.old/gdk/gdkpixmap.c Wed Oct 25 15:38:56 2000
+++ gtk+-1.3.2.new/gdk/gdkpixmap.c Mon Dec 4 17:14:27 2000
@@ -112,6 +112,7 @@
gint y,
gint width,
gint height);
+GdkPixmap* gdk_pixmap_copy (GdkPixmap *pixmap);
static GdkVisual* gdk_pixmap_real_get_visual (GdkDrawable *drawable);
@@ -549,5 +550,29 @@
{
return gdk_pixmap_colormap_create_from_xpm_d (window, NULL, mask,
transparent_color, data);
+}
+
+GdkPixmap*
+gdk_pixmap_copy(GdkPixmap *pixmap)
+{
+ GdkPixmap *pixmap_out;
+ GdkGC *gc;
+ gint width, height, depth;
+
+ g_return_val_if_fail(pixmap != NULL, NULL);
+
+ gdk_drawable_get_size(pixmap, &width, &height);
+
+ depth = gdk_drawable_get_depth(pixmap);
+
+ pixmap_out = gdk_pixmap_new(NULL, width, height, depth);
+
+ gc = gdk_gc_new(pixmap);
+
+ gdk_draw_drawable(pixmap_out, gc, pixmap, 0, 0, 0, 0, width, height);
+
+ gdk_gc_unref(gc);
+
+ return pixmap_out;
}
diff -ur -x *.o -x *.lo -x .libs gtk+-1.3.2.old/gdk/gdkpixmap.h gtk+-1.3.2.new/gdk/gdkpixmap.h
--- gtk+-1.3.2.old/gdk/gdkpixmap.h Wed Aug 30 19:04:21 2000
+++ gtk+-1.3.2.new/gdk/gdkpixmap.h Mon Dec 4 17:14:27 2000
@@ -73,6 +73,7 @@
GdkBitmap **mask,
GdkColor *transparent_color,
gchar **data);
+GdkPixmap* gdk_pixmap_copy (GdkPixmap *pixmap);
#ifdef __cplusplus
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]