00001 /* Copyright (C) 2005 The cairomm Development Team 00002 * 00003 * This library is free software; you can redistribute it and/or 00004 * modify it under the terms of the GNU Library General Public 00005 * License as published by the Free Software Foundation; either 00006 * version 2 of the License, or (at your option) any later version. 00007 * 00008 * This library is distributed in the hope that it will be useful, 00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * Library General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU Library General Public 00014 * License along with this library; if not, write to the Free Software 00015 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00016 * 02110-1301, USA. 00017 */ 00018 00019 #ifndef __CAIROMM_XLIB_SURFACE_H 00020 #define __CAIROMM_XLIB_SURFACE_H 00021 00022 #include <cairomm/surface.h> 00023 00024 // This header is not included by cairomm.h because it requires X headers that 00025 // tend to pollute the namespace with non-prefixed #defines and typedefs. 00026 // You may include it directly if you need to use this API. 00027 00028 #ifdef CAIRO_HAS_XLIB_SURFACE 00029 #include <cairo-xlib.h> //Needed for the X11 "Display" struct (which pollutes the namespace because it has no prefix.) 00030 #endif 00031 00032 00033 namespace Cairo 00034 { 00035 00036 #ifdef CAIRO_HAS_XLIB_SURFACE 00037 00045 class XlibSurface : public Surface 00046 { 00047 public: 00048 00056 explicit XlibSurface(cairo_surface_t* cobject, bool has_reference = false); 00057 virtual ~XlibSurface(); 00058 00074 static RefPtr<XlibSurface> create(Display *dpy, Drawable drawable, Visual *visual, int width, int height); 00075 00086 static RefPtr<XlibSurface> create(Display *dpy, Pixmap bitmap, Screen *screen, int width, int height); 00087 00100 void set_size(int width, int height); 00101 00111 void set_drawable(Drawable drawable, int width, int height); 00112 00113 }; 00114 00115 #endif // CAIRO_HAS_XLIB_SURFACE 00116 00117 } // namespace Cairo 00118 00119 #endif //__CAIROMM_XLIB_SURFACE_H 00120 00121 // vim: ts=2 sw=2 et