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 00015 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00016 */ 00017 00018 #ifndef __CAIROMM_XLIB_SURFACE_H 00019 #define __CAIROMM_XLIB_SURFACE_H 00020 00021 #include <cairomm/surface.h> 00022 00023 // This header is not included by cairomm.h because it requires X headers that 00024 // tend to pollute the namespace with non-prefixed #defines and typedefs. 00025 // You may include it directly if you need to use this API. 00026 00027 #ifdef CAIRO_HAS_XLIB_SURFACE 00028 #include <cairo-xlib.h> //Needed for the X11 "Display" struct (which pollutes the namespace because it has no prefix.) 00029 #endif 00030 00031 00032 namespace Cairo 00033 { 00034 00035 #ifdef CAIRO_HAS_XLIB_SURFACE 00036 00044 class XlibSurface : public Surface 00045 { 00046 public: 00047 00055 explicit XlibSurface(cairo_surface_t* cobject, bool has_reference = false); 00056 virtual ~XlibSurface(); 00057 00073 static RefPtr<XlibSurface> create(Display *dpy, Drawable drawable, Visual *visual, int width, int height); 00074 00085 static RefPtr<XlibSurface> create(Display *dpy, Pixmap bitmap, Screen *screen, int width, int height); 00086 00099 void set_size(int width, int height); 00100 00110 void set_drawable(Drawable drawable, int width, int height); 00111 00112 }; 00113 00114 #endif // CAIRO_HAS_XLIB_SURFACE 00115 00116 } // namespace Cairo 00117 00118 #endif //__CAIROMM_XLIB_SURFACE_H