summaryrefslogtreecommitdiff
path: root/cairomm/xlib_surface.h
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@gnome.org>2008-01-30 13:08:28 -0600
committerJonathon Jongsma <jjongsma@gnome.org>2008-01-30 13:08:28 -0600
commit5f5319856b2d44f70b72bbec663c65e82c514d6a (patch)
tree311a3154c494eb0d4b70f7105479e9a4a12fb122 /cairomm/xlib_surface.h
parent2f0c46335a37bc5d78fd1667f73c664df134c952 (diff)
* cairomm/xlib_surface.cc:
* cairomm/xlib_surface.h: add new get_xrender_format() function (new in 1.5.8) and add missing static create_with_xrender_format() function * docs/reference/Doxyfile.in: add CAIRO_HAS_XLIB_XRENDER_SURFACE feature so that new xrender API shows up in docs
Diffstat (limited to 'cairomm/xlib_surface.h')
-rw-r--r--cairomm/xlib_surface.h50
1 files changed, 48 insertions, 2 deletions
diff --git a/cairomm/xlib_surface.h b/cairomm/xlib_surface.h
index cddd880..9a304d2 100644
--- a/cairomm/xlib_surface.h
+++ b/cairomm/xlib_surface.h
@@ -26,8 +26,11 @@
// You may include it directly if you need to use this API.
#ifdef CAIRO_HAS_XLIB_SURFACE
-#include <cairo-xlib.h> //Needed for the X11 "Display" struct (which pollutes the namespace because it has no prefix.)
-#endif
+#include <cairo-xlib.h> // Needed for the X11 "Display" struct (which pollutes the namespace because it has no prefix.)
+#ifdef CAIRO_HAS_XLIB_XRENDER_SURFACE
+#include <cairo-xlib-xrender.h> // xrender-specific API
+#endif // CAIRO_HAS_XLIB_XRENDER_SURFACE
+#endif // CAIRO_HAS_XLIB_SURFACE
namespace Cairo
@@ -137,6 +140,49 @@ public:
/** Get the width in pixels of the X Drawable underlying the surface */
int get_width() const;
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
+ /**
+ * Creates an Xlib surface that draws to the given drawable. The way that
+ * colors are represented in the drawable is specified by the provided picture
+ * format.
+ *
+ * Note: If @drawable is a Window, then the function set_size() must be called
+ * whenever the size of the window changes.
+ *
+ * @param dpy an X Display
+ * @param drawable an X Drawable, (a Pixmap or a Window)
+ * @param screen the X Screen associated with @drawable
+ * @param format the picture format to use for drawing to @drawable. The depth
+ * of @format must match the depth of the drawable.
+ * @param width the current width of @drawable.
+ * @param height the current height of @drawable.
+ *
+ * @return the newly created surface
+ **/
+ static Cairo::RefPtr<Cairo::XlibSurface>
+ create_with_xrender_format (Display *dpy,
+ Drawable drawable,
+ Screen *screen,
+ XRenderPictFormat *format,
+ int width,
+ int height);
+
+ /**
+ * Gets the X Render picture format that @surface uses for rendering with the
+ * X Render extension. If the surface was created by
+ * cairo_xlib_surface_create_with_xrender_format() originally, the return
+ * value is the format passed to that constructor.
+ *
+ * Return value: the XRenderPictFormat* associated with @surface,
+ * or %NULL if the surface is not an xlib surface
+ * or if the X Render extension is not available.
+ *
+ * Since: 1.6
+ **/
+ XRenderPictFormat * get_xrender_format() const;
+
+#endif // CAIRO_HAS_XLIB_XRENDER_SURFACE
+
};
#endif // CAIRO_HAS_XLIB_SURFACE