1 /* $Id: pixmap.hg,v 1.5 2004/03/10 01:17:36 murrayc Exp $ */
3 /* Copyright (C) 1998-2002 The gtkmm Development Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <gdkmm/drawable.h>
21 #include <gdkmm/color.h>
22 #include <gdkmm/colormap.h>
23 #include <gdkmm/types.h>
26 _PINCLUDE(gdkmm/private/drawable_p.h)
28 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 //Custom stuct prototypes, because they aren't what the code-generator expects:
31 typedef struct _GdkDrawable GdkPixmap;
32 typedef struct _GdkPixmapClass GdkPixmapClass;
34 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42 /** Pixmaps are offscreen drawables. They can be drawn upon with the standard drawing primitives, then copied to another
43 * drawable (such as a Gdk::Window) with Gdk::Drawable::draw_drawable(). The depth of a pixmap is the number of bits per
45 * Bitmaps are simply pixmaps with a depth of 1. (That is, they are monochrome bitmaps - each pixel can be either on or off).
47 class Pixmap : public Gdk::Drawable
49 // GdkPixmap is a typedef to GdkDrawable, but it's actually a GdkPixmapObject.
50 _CLASS_GOBJECT(Pixmap,GdkPixmap,GDK_PIXMAP,Gdk::Drawable,GdkDrawable,GdkPixmapObject)
51 _CUSTOM_WRAP_NEW // see wrap_new() implementation in pixmap.ccg
57 Pixmap(const Glib::RefPtr<Drawable>& drawable, int width, int height, int depth = -1);
59 /// Initialize a Pixmap from data.
60 Pixmap(const Glib::RefPtr<Drawable>& drawable,
61 const char* data, int width, int height, int depth,
62 const Color& fg, const Color& bg);
64 Pixmap(const Glib::RefPtr<Display>& display, NativeWindow anid);
68 _WRAP_CREATE(const Glib::RefPtr<Drawable>& drawable, int width, int height, int depth = -1)
69 _WRAP_CREATE(const Glib::RefPtr<Drawable>& drawable, const char* data, int width, int height, int depth, const Color& fg, const Color& bg)
71 _WRAP_CREATE(const Glib::RefPtr<Display>& display, NativeWindow anid)
72 _IGNORE(gdk_pixmap_foreign_new_for_display)
74 static Glib::RefPtr<Pixmap> create_from_data(const Glib::RefPtr<const Drawable>& drawable,
75 const char* data, int width, int height, int depth,
76 const Color& fg, const Color& bg);
78 /// Create a Pixmap from a xpm file.
79 static Glib::RefPtr<Pixmap> create_from_xpm(const Glib::RefPtr<const Drawable>& drawable,
80 const Color& transparent_color,
81 const std::string& filename);
83 // Create a Pixmap from a xpm file.
84 static Glib::RefPtr<Pixmap> create_from_xpm(const Glib::RefPtr<const Drawable>& drawable,
85 Glib::RefPtr<Bitmap>& mask,
86 const Color& transparent_color,
87 const std::string& filename);
89 /// Create a Pixmap from a xpm file with colormap.
90 static Glib::RefPtr<Pixmap> create_from_xpm(const Glib::RefPtr<const Drawable>& drawable,
91 const Glib::RefPtr<Colormap>& colormap,
92 Glib::RefPtr<Bitmap>& mask,
93 const Color& transparent_color,
94 const std::string& filename);
96 static Glib::RefPtr<Pixmap> create_from_xpm(const Glib::RefPtr<const Drawable>& drawable,
97 Glib::RefPtr<Bitmap>& mask,
98 const Color& transparent_color,
99 const char* const* data);
101 static Glib::RefPtr<Pixmap> create_from_xpm(const Glib::RefPtr<const Drawable>& drawable,
102 const Glib::RefPtr<Colormap>& colormap,
103 Glib::RefPtr<Bitmap>& mask,
104 const Color& transparent_color,
105 const char* const* data);
107 static Glib::RefPtr<Pixmap> create_from_xpm(const Glib::RefPtr<Colormap>& colormap,
108 Glib::RefPtr<Bitmap>& mask,
109 const Color& transparent_color,
110 const char* const* data);
112 static Glib::RefPtr<Pixmap> create_from_xpm(const Glib::RefPtr<Colormap>& colormap,
113 Glib::RefPtr<Bitmap>& mask,
114 const char* const* data);