diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-0 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-2 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 10 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 10 | ||||
-rw-r--r-- | gdk/gdkgc.c | 33 | ||||
-rw-r--r-- | gdk/gdkgc.h | 3 | ||||
-rw-r--r-- | gdk/gdkwindow.c | 53 | ||||
-rw-r--r-- | gdk/gdkwindow.h | 5 |
11 files changed, 164 insertions, 0 deletions
@@ -1,3 +1,13 @@ +Fri Jul 13 15:33:32 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(), + so that using X functions on a GdkWindow is possible, if + a little hairy. + + * gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip + and ts_origin of a GC, so that external parties can offset/restore + a GC, when using gdk_window_get_internal_paint_info(). + 2001-07-17 Darin Adler <darin@bentspoon.com> * .cvsignore: Ignore the sgml directory made by gtkdoc. diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 83656ef0a3..3fffd552a8 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +Fri Jul 13 15:33:32 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(), + so that using X functions on a GdkWindow is possible, if + a little hairy. + + * gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip + and ts_origin of a GC, so that external parties can offset/restore + a GC, when using gdk_window_get_internal_paint_info(). + 2001-07-17 Darin Adler <darin@bentspoon.com> * .cvsignore: Ignore the sgml directory made by gtkdoc. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 83656ef0a3..3fffd552a8 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Fri Jul 13 15:33:32 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(), + so that using X functions on a GdkWindow is possible, if + a little hairy. + + * gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip + and ts_origin of a GC, so that external parties can offset/restore + a GC, when using gdk_window_get_internal_paint_info(). + 2001-07-17 Darin Adler <darin@bentspoon.com> * .cvsignore: Ignore the sgml directory made by gtkdoc. diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 83656ef0a3..3fffd552a8 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Fri Jul 13 15:33:32 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(), + so that using X functions on a GdkWindow is possible, if + a little hairy. + + * gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip + and ts_origin of a GC, so that external parties can offset/restore + a GC, when using gdk_window_get_internal_paint_info(). + 2001-07-17 Darin Adler <darin@bentspoon.com> * .cvsignore: Ignore the sgml directory made by gtkdoc. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 83656ef0a3..3fffd552a8 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Fri Jul 13 15:33:32 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(), + so that using X functions on a GdkWindow is possible, if + a little hairy. + + * gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip + and ts_origin of a GC, so that external parties can offset/restore + a GC, when using gdk_window_get_internal_paint_info(). + 2001-07-17 Darin Adler <darin@bentspoon.com> * .cvsignore: Ignore the sgml directory made by gtkdoc. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 83656ef0a3..3fffd552a8 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Fri Jul 13 15:33:32 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(), + so that using X functions on a GdkWindow is possible, if + a little hairy. + + * gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip + and ts_origin of a GC, so that external parties can offset/restore + a GC, when using gdk_window_get_internal_paint_info(). + 2001-07-17 Darin Adler <darin@bentspoon.com> * .cvsignore: Ignore the sgml directory made by gtkdoc. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 83656ef0a3..3fffd552a8 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Fri Jul 13 15:33:32 2001 Owen Taylor <otaylor@redhat.com> + + * gdk/gdkwindow.[ch]: Add a function gdk_window_get_internal_paint_info(), + so that using X functions on a GdkWindow is possible, if + a little hairy. + + * gdk/gdkgc.c (gdk_gc_offset): Add a function to offset the clip + and ts_origin of a GC, so that external parties can offset/restore + a GC, when using gdk_window_get_internal_paint_info(). + 2001-07-17 Darin Adler <darin@bentspoon.com> * .cvsignore: Ignore the sgml directory made by gtkdoc. diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c index f87b7b37c1..127a692b19 100644 --- a/gdk/gdkgc.c +++ b/gdk/gdkgc.c @@ -367,6 +367,39 @@ gdk_gc_set_dashes (GdkGC *gc, } /** + * gdk_gc_offset: + * @gc: a #GdkGC + * @x_offset: amount by which to offset the GC in the X direction + * @y_offset: amount by which to offset the GC in the Y direction + * + * Offset attributes such as the clip and tile-stipple origins + * of the GC so that drawing at x - x_offset, y - y_offset with + * the offset GC has the same effect as drawing at x, y with the original + * GC. + **/ +void +gdk_gc_offset (GdkGC *gc, + gint x_offset, + gint y_offset) +{ + if (x_offset != 0 || y_offset != 0) + { + GdkGCValues values; + + values.clip_x_origin = gc->clip_x_origin - x_offset; + values.clip_y_origin = gc->clip_y_origin - y_offset; + values.ts_x_origin = gc->ts_x_origin - x_offset; + values.ts_y_origin = gc->ts_y_origin - y_offset; + + gdk_gc_set_values (gc, &values, + GDK_GC_CLIP_X_ORIGIN | + GDK_GC_CLIP_Y_ORIGIN | + GDK_GC_TS_X_ORIGIN | + GDK_GC_TS_Y_ORIGIN); + } +} + +/** * gdk_gc_set_colormap: * @gc: a #GdkGC * @colormap: a #GdkColormap diff --git a/gdk/gdkgc.h b/gdk/gdkgc.h index b18c7fffb4..e55a41e0ea 100644 --- a/gdk/gdkgc.h +++ b/gdk/gdkgc.h @@ -237,6 +237,9 @@ void gdk_gc_set_dashes (GdkGC *gc, gint dash_offset, gint8 dash_list[], gint n); +void gdk_gc_offset (GdkGC *gc, + gint x_offset, + gint y_offset); void gdk_gc_copy (GdkGC *dst_gc, GdkGC *src_gc); diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 59183b204f..2f82576c03 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -979,6 +979,59 @@ gdk_window_get_offsets (GdkWindow *window, _gdk_windowing_window_get_offsets (window, x_offset, y_offset); } +/** + * gdk_window_get_internal_paint_info: + * @window: a #GdkWindow + * @real_drawable: location to store the drawable to which drawing should be done. + * @x_offset: location to store the X offset between coordinates in @window, and + * the underlying window system primitive coordinates for *@real_drawable. + * @y_offset: location to store the Y offset between coordinates in @window, and + * the underlying window system primitive coordinates for *@real_drawable. + * + * If you bypass the GDK layer and use windowing system primitives to + * draw directly onto a #GdkWindow, then you need to deal with two + * details: there may be an offset between GDK coordinates and windowing + * system coordinates, and GDK may have redirected drawing to a offscreen + * pixmap as the result of a gdk_window_begin_paint_region() calls. + * This function allows retrieving the information you need to compensate + * for these effects. + * + * This function exposes details of the GDK implementation, and is thus + * likely to change in future releases of GDK. + **/ +void +gdk_window_get_internal_paint_info (GdkWindow *window, + GdkDrawable **real_drawable, + gint *x_offset, + gint *y_offset) +{ + gint x_off, y_off; + + GdkWindowObject *private; + + g_return_if_fail (GDK_IS_WINDOW (window)); + + private = (GdkWindowObject *)window; + + if (real_drawable) + { + if (private->paint_stack) + { + GdkWindowPaint *paint = private->paint_stack->data; + *real_drawable = paint->pixmap; + } + else + *real_drawable = window; + } + + gdk_window_get_offsets (window, &x_off, &y_off); + + if (x_offset) + *x_offset = x_off; + if (y_offset) + *y_offset = y_off; +} + #define OFFSET_GC(gc) \ gint x_offset, y_offset; \ gint old_clip_x = gc->clip_x_origin; \ diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h index 6ea64594a4..03263adef8 100644 --- a/gdk/gdkwindow.h +++ b/gdk/gdkwindow.h @@ -507,6 +507,11 @@ void gdk_window_constrain_size (GdkGeometry *geometry, gint *new_width, gint *new_height); +void gdk_window_get_internal_paint_info (GdkWindow *window, + GdkDrawable **real_drawable, + gint *x_offset, + gint *y_offset); + GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); #ifdef __cplusplus |