1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* This file is part of the GtkHTML library.
3  *
4  * Copyright (C) 2000 Helix Code, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB.  If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef _HTMLGDKPAINTER_H
23 #define _HTMLGDKPAINTER_H
24 
25 #include <gtk/gtk.h>
26 #include "htmlpainter.h"
27 #include "htmlfontmanager.h"
28 
29 #define HTML_TYPE_GDK_PAINTER                 (html_gdk_painter_get_type ())
30 #define HTML_GDK_PAINTER(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), HTML_TYPE_GDK_PAINTER, HTMLGdkPainter))
31 #define HTML_GDK_PAINTER_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), HTML_TYPE_GDK_PAINTER, HTMLGdkPainterClass))
32 #define HTML_IS_GDK_PAINTER(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HTML_TYPE_GDK_PAINTER))
33 #define HTML_IS_GDK_PAINTER_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), HTML_TYPE_GDK_PAINTER))
34 
35 struct _HTMLGdkPainter {
36 	HTMLPainter base;
37 	GtkWidget *widget;
38 
39 	/* GdkWindow to draw on */
40 	GdkWindow *window;
41 	cairo_t *cr;
42 
43 	/* For the double-buffering system.  */
44 	gboolean double_buffer;
45 	cairo_surface_t *surface;
46 	gint x1, y1, x2, y2;
47 	GdkColor background;
48 	gboolean set_background;
49 	gboolean do_clear;
50 
51 	/* Colors used for shading.  */
52 	GdkColor dark;
53 	GdkColor light;
54 	GdkColor black;
55 };
56 
57 struct _HTMLGdkPainterClass {
58 	HTMLPainterClass base;
59 };
60 
61 GType              html_gdk_painter_get_type                         (void);
62 HTMLPainter       *html_gdk_painter_new                              (GtkWidget             *widget,
63 								      gboolean               double_buffer);
64 void               html_gdk_painter_realize                          (HTMLGdkPainter        *painter,
65 								      GdkWindow             *window);
66 void               html_gdk_painter_unrealize                        (HTMLGdkPainter        *painter);
67 gboolean           html_gdk_painter_realized                         (HTMLGdkPainter        *painter);
68 
69 #endif /* _HTMLGDKPAINTER_H */
70