win32_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_WIN32_SURFACE_H
00020 #define __CAIROMM_WIN32_SURFACE_H
00021 
00022 #include <cairomm/surface.h>
00023 #include <cairomm/enums.h>
00024 #include <cairo-features.h>
00025 
00026 #ifdef CAIRO_HAS_WIN32_SURFACE
00027 #include <cairo-win32.h>
00028 
00029 // This header is not included by cairomm.h because it requires Windows headers that 
00030 // tend to pollute the namespace with non-prefixed #defines and typedefs.
00031 // You may include it directly if you need to use this API.
00032 
00033 namespace Cairo
00034 {
00035 
00043 class Win32Surface : public Surface
00044 {
00045 public:
00046 
00054   explicit Win32Surface(cairo_surface_t* cobject, bool has_reference = false);
00055   virtual ~Win32Surface();
00056 
00062   HDC get_dc() const;
00063 
00064   //TODO: What does owned mean here? murrayc
00065   //TODO: If this is just a get, shouldn't there be a const version too? murrayc
00075   RefPtr<ImageSurface> get_image();
00076 
00085   static RefPtr<Win32Surface> create(HDC hdc);
00086 
00090   static RefPtr<Win32Surface> create(Format format, int width, int height);
00102   static RefPtr<Win32Surface> create_with_dib(Format format, int width, int height);
00103 
00116   static RefPtr<Win32Surface> create_with_ddb(HDC hdc, Format format, int width, int height);
00117 
00118 };
00119 
00127 class Win32PrintingSurface : public Surface
00128 {
00129 public:
00130   explicit Win32PrintingSurface(cairo_surface_t* cobject, bool has_reference = false);
00131   virtual ~Win32PrintingSurface();
00132 
00146   static RefPtr<Win32PrintingSurface> create(HDC hdc);
00147 };
00148 
00149 } // namespace Cairo
00150 
00151 #endif // CAIRO_HAS_WIN32_SURFACE
00152 #endif //__CAIROMM_WIN32_SURFACE_H
00153 // vim: ts=2 sw=2 et

Generated on Wed Jan 28 03:19:27 2009 for cairomm by  doxygen 1.5.8