20130319
[gdash.git] / src / gtk / gtkscreen.hpp
blobf1d78a4b6450de01b160673dad3261c4ea4bc275
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_GTK_GFX
17 #define _GD_GTK_GFX
19 #include "config.h"
21 #include <gtk/gtk.h>
23 #include "gfx/screen.hpp"
25 /**
26 * This is a Screen, which uses a GtkDrawingArea for its canvas.
28 class GTKScreen: public Screen {
29 private:
30 GtkWidget *drawing_area;
31 GdkPixmap *pixmap;
32 GdkGC *gc;
34 GTKScreen(const GTKScreen &); // not impl
35 GTKScreen &operator=(const GTKScreen &); // not impl
37 public:
38 /** Creates a new GTKScreen, using the drawing area given as canvas.
39 * @param drawing_area A GtkDrawingArea.
41 GTKScreen(GtkWidget *drawing_area_);
42 virtual void configure_size();
43 virtual void set_title(char const *title);
45 virtual void fill_rect(int x, int y, int w, int h, const GdColor &c);
47 virtual void blit_full(Pixmap const &src, int dx, int dy, int x, int y, int w, int h) const;
49 virtual void set_clip_rect(int x1, int y1, int w, int h);
50 virtual void remove_clip_rect();
52 virtual void flip();
54 #endif