00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __CAIROMM_XLIB_SURFACE_H
00020 #define __CAIROMM_XLIB_SURFACE_H
00021
00022 #include <cairomm/surface.h>
00023
00024
00025
00026
00027
00028 #ifdef CAIRO_HAS_XLIB_SURFACE
00029 #include <cairo-xlib.h>
00030 #ifdef CAIRO_HAS_XLIB_XRENDER_SURFACE
00031 #include <cairo-xlib-xrender.h>
00032 #endif // CAIRO_HAS_XLIB_XRENDER_SURFACE
00033 #endif // CAIRO_HAS_XLIB_SURFACE
00034
00035
00036 namespace Cairo
00037 {
00038
00039 #ifdef CAIRO_HAS_XLIB_SURFACE
00040
00048 class XlibSurface : public Surface
00049 {
00050 public:
00051
00059 explicit XlibSurface(cairo_surface_t* cobject, bool has_reference = false);
00060 virtual ~XlibSurface();
00061
00077 static RefPtr<XlibSurface> create(Display* dpy, Drawable drawable, Visual* visual, int width, int height);
00078
00089 static RefPtr<XlibSurface> create(Display *dpy, Pixmap bitmap, Screen *screen, int width, int height);
00090
00103 void set_size(int width, int height);
00104
00114 void set_drawable(Drawable drawable, int width, int height);
00115
00117 Drawable get_drawable() const;
00118
00120 const Display* get_display() const;
00122 Display* get_display();
00123
00125 Screen* get_screen();
00127 const Screen* get_screen() const;
00128
00130 Visual* get_visual();
00132 const Visual* get_visual() const;
00133
00135 int get_depth() const;
00136
00138 int get_height() const;
00139
00141 int get_width() const;
00142
00143 #if CAIRO_HAS_XLIB_XRENDER_SURFACE
00144
00162 static Cairo::RefPtr<Cairo::XlibSurface>
00163 create_with_xrender_format (Display *dpy,
00164 Drawable drawable,
00165 Screen *screen,
00166 XRenderPictFormat *format,
00167 int width,
00168 int height);
00169
00182 XRenderPictFormat * get_xrender_format() const;
00183
00184 #endif // CAIRO_HAS_XLIB_XRENDER_SURFACE
00185
00186 };
00187
00188 #endif // CAIRO_HAS_XLIB_SURFACE
00189
00190 }
00191
00192 #endif //__CAIROMM_XLIB_SURFACE_H
00193
00194