[sushi] utils: add an utility to create a foreign window
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi] utils: add an utility to create a foreign window
- Date: Thu, 21 Apr 2011 20:48:37 +0000 (UTC)
commit 4a79d656e65fb2fb82cbbb8bb42235aff625395b
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Apr 21 16:47:11 2011 -0400
utils: add an utility to create a foreign window
The GDK version uses 'Window' which is not introspectable, so we have to
wrap with a guint ourselves
src/libsushi/sushi-utils.c | 20 ++++++++++++++++++++
src/libsushi/sushi-utils.h | 2 ++
2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/src/libsushi/sushi-utils.c b/src/libsushi/sushi-utils.c
index 21c828e..ea5950e 100644
--- a/src/libsushi/sushi-utils.c
+++ b/src/libsushi/sushi-utils.c
@@ -1,5 +1,7 @@
#include "sushi-utils.h"
+#include <gdk/gdkx.h>
+
static void
_cairo_round_rectangle (cairo_t *cr,
gdouble x,
@@ -64,3 +66,21 @@ sushi_create_rounded_background (void)
return retval;
}
+/**
+ * sushi_create_foreign_window:
+ * @xid:
+ * @timestamp: (out):
+ *
+ * Returns: (transfer full): a #GdkWindow
+ */
+GdkWindow *
+sushi_create_foreign_window (guint xid)
+{
+ GdkWindow *retval;
+
+ retval = gdk_x11_window_foreign_new_for_display (gdk_display_get_default (),
+ xid);
+
+ return retval;
+}
+
diff --git a/src/libsushi/sushi-utils.h b/src/libsushi/sushi-utils.h
index ae0e33d..270418f 100644
--- a/src/libsushi/sushi-utils.h
+++ b/src/libsushi/sushi-utils.h
@@ -3,10 +3,12 @@
#include <clutter/clutter.h>
#include <evince-document.h>
+#include <gdk/gdk.h>
G_BEGIN_DECLS
ClutterActor * sushi_create_rounded_background (void);
+GdkWindow * sushi_create_foreign_window (guint xid);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]