+2006-04-11 Anders Carlsson <andersca@imendio.com>
+
+ * gdk/gdkinternals.h:
+ * gdk/gdkwindow.c:
+ (_gdk_paintable_get_type):
+ (gdk_window_begin_paint_region):
+ (gdk_window_end_paint):
+ (gdk_window_process_updates):
+ (gdk_window_invalidate_maybe_recurse):
+ Add new GdkPaintable interface which implementation objects can
+ implement in order to override gdk painting functions.
+
2006-04-10 Vladimer Sichinava <vlsichinava@gmail.com>
* configure.in: Added "ka" (Georgian) to ALL_LINGUAS
+2006-04-11 Anders Carlsson <andersca@imendio.com>
+
+ * gdk/gdkinternals.h:
+ * gdk/gdkwindow.c:
+ (_gdk_paintable_get_type):
+ (gdk_window_begin_paint_region):
+ (gdk_window_end_paint):
+ (gdk_window_process_updates):
+ (gdk_window_invalidate_maybe_recurse):
+ Add new GdkPaintable interface which implementation objects can
+ implement in order to override gdk painting functions.
+
2006-04-10 Vladimer Sichinava <vlsichinava@gmail.com>
* configure.in: Added "ka" (Georgian) to ALL_LINGUAS
void _gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
const gchar *sm_client_id);
+#define GDK_TYPE_PAINTABLE (_gdk_paintable_get_type ())
+#define GDK_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_PAINTABLE, GdkPaintable))
+#define GDK_IS_PAINTABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_PAINTABLE))
+#define GDK_PAINTABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_PAINTABLE, GdkPaintableIface))
+
+typedef struct _GdkPaintable GdkPaintable;
+typedef struct _GdkPaintableIface GdkPaintableIface;
+
+struct _GdkPaintableIface
+{
+ GTypeInterface g_iface;
+
+ void (* begin_paint_region) (GdkPaintable *paintable,
+ GdkRegion *region);
+ void (* end_paint) (GdkPaintable *paintable);
+
+ void (* invalidate_maybe_recurse) (GdkPaintable *paintable,
+ GdkRegion *region,
+ gboolean (*child_func) (GdkWindow *, gpointer),
+ gpointer user_data);
+ void (* process_updates) (GdkPaintable *paintable,
+ gboolean update_children);
+};
+
+GType _gdk_paintable_get_type (void) G_GNUC_CONST;
+
/* Implementation types */
GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
G_DEFINE_TYPE (GdkWindowObject, gdk_window_object, GDK_TYPE_DRAWABLE);
+GType
+_gdk_paintable_get_type (void)
+{
+ static GType paintable_type = 0;
+
+ if (!paintable_type)
+ {
+ static const GTypeInfo paintable_info =
+ {
+ sizeof (GdkPaintableIface), /* class_size */
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ };
+
+ paintable_type = g_type_register_static (G_TYPE_INTERFACE,
+ g_intern_static_string ("GdkPaintable"),
+ &paintable_info, 0);
+
+ g_type_interface_add_prerequisite (paintable_type, G_TYPE_OBJECT);
+ }
+
+ return paintable_type;
+}
+
static void
gdk_window_object_init (GdkWindowObject *window)
{
if (GDK_WINDOW_DESTROYED (window))
return;
+ if (GDK_IS_PAINTABLE (private->impl) &&
+ GDK_PAINTABLE_GET_IFACE (private->impl)->begin_paint_region)
+ {
+ GDK_PAINTABLE_GET_IFACE (private->impl)->begin_paint_region (GDK_PAINTABLE (private->impl), region);
+ return;
+ }
+
gdk_region_get_clipbox (region, &clip_box);
paint = g_new (GdkWindowPaint, 1);
if (GDK_WINDOW_DESTROYED (window))
return;
+ if (GDK_IS_PAINTABLE (private->impl) &&
+ GDK_PAINTABLE_GET_IFACE (private->impl)->end_paint)
+ {
+ GDK_PAINTABLE_GET_IFACE (private->impl)->end_paint (GDK_PAINTABLE (private->impl));
+ return;
+ }
+
if (private->paint_stack == NULL)
{
g_warning (G_STRLOC": no preceding call to gdk_window_begin_paint_region(), see documentation");
g_slist_free (displays);
}
+/* Currently it is not possible to override
+ * gdk_window_process_all_updates in the same manner as
+ * gdk_window_process_updates and gdk_window_invalidate_maybe_recurse
+ * by implementing the GdkPaintable interface. If in the future a
+ * backend would need this, the right solution would be to add a
+ * method to GdkDisplay that can be optionally
+ * NULL. gdk_window_process_all_updates can then walk the list of open
+ * displays and call the mehod.
+ */
+
/**
* gdk_window_process_all_updates:
*
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
+ if (GDK_IS_PAINTABLE (private->impl) &&
+ GDK_PAINTABLE_GET_IFACE (private->impl)->process_updates)
+ {
+ GDK_PAINTABLE_GET_IFACE (private->impl)->process_updates (GDK_PAINTABLE (private->impl), update_children);
+ return;
+ }
+
if (private->update_area && !private->update_freeze_count)
{
gdk_window_process_updates_internal (window);
if (private->input_only || !GDK_WINDOW_IS_MAPPED (window))
return;
+ if (GDK_IS_PAINTABLE (private->impl) &&
+ GDK_PAINTABLE_GET_IFACE (private->impl)->invalidate_maybe_recurse)
+ {
+ GDK_PAINTABLE_GET_IFACE (private->impl)->invalidate_maybe_recurse (GDK_PAINTABLE (private->impl), region,
+ child_func, user_data);
+ return;
+ }
+
visible_region = gdk_drawable_get_visible_region (window);
gdk_region_intersect (visible_region, region);