xlib_surface.h

Go to the documentation of this file.
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 
00114   Drawable get_drawable() const;
00115 
00117   const Display* get_display() const;
00119   Display* get_display();
00120 
00122   Screen* get_screen();
00124   const Screen* get_screen() const;
00125 
00127   Visual* get_visual();
00129   const Visual* get_visual() const;
00130 
00132   int get_depth() const;
00133 
00135   int get_height() const;
00136 
00138   int get_width() const;
00139 
00140 };
00141 
00142 #endif // CAIRO_HAS_XLIB_SURFACE
00143 
00144 } // namespace Cairo
00145 
00146 #endif //__CAIROMM_XLIB_SURFACE_H
00147 
00148 // vim: ts=2 sw=2 et

Generated on Tue May 27 16:14:03 2008 for cairomm by  doxygen 1.5.1