20130313
[gdash.git] / src / gtk / gtkpixmap.hpp
blobcd73068bde0469917b2fc7419ffcc3c802df5925
1 /*
2 * Copyright (c) 2007-2013, Czirkos Zoltan http://code.google.com/p/gdash/
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 #ifndef _GD_GTKPIXMAP
17 #define _GD_GTKPIXMAP
19 #include "config.h"
21 #include <gtk/gtk.h>
22 #include <gdk/gdk.h>
23 #include "gfx/pixmap.hpp"
25 /**
26 * Implementation of the Pixmap interface, using GTK+.
28 class GTKPixmap: public Pixmap {
29 private:
30 GdkDrawable *pixmap;
31 GdkBitmap *mask;
33 public:
34 friend class GTKScreen;
36 GTKPixmap(GdkDrawable *pixmap, GdkBitmap *mask): pixmap(pixmap), mask(mask) {}
38 virtual int get_width() const;
39 virtual int get_height() const;
41 GdkDrawable *get_drawable() const { return pixmap; }
43 virtual ~GTKPixmap();
46 #endif