]> Pileus Git - ~andy/gtk/blob - gtk/gtkthemingbackgroundprivate.h
themingbackground: make it based on GtkStyleContext
[~andy/gtk] / gtk / gtkthemingbackgroundprivate.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2011 Red Hat, Inc.
3  * 
4  * Author: Cosimo Cecchi <cosimoc@gnome.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser 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  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21
22 #ifndef __GTK_THEMING_BACKGROUND_PRIVATE_H__
23 #define __GTK_THEMING_BACKGROUND_PRIVATE_H__
24
25 #include <glib-object.h>
26 #include <cairo.h>
27
28 #include "gtkcssimageprivate.h"
29 #include "gtkstylecontextprivate.h"
30 #include "gtkroundedboxprivate.h"
31 #include "gtkshadowprivate.h"
32
33 G_BEGIN_DECLS
34
35 typedef struct _GtkThemingBackground GtkThemingBackground;
36
37 struct _GtkThemingBackground {
38   GtkStyleContext *context;
39
40   cairo_rectangle_t paint_area;
41   cairo_rectangle_t image_rect;
42
43   GtkJunctionSides junction;
44   GtkCssImage *image;
45
46   GtkRoundedBox padding_box;
47   GtkRoundedBox clip_box;
48
49   GtkStateFlags flags;
50   GtkBorder border;
51   GtkBorder padding;
52   GdkRGBA bg_color;
53 };
54
55 void _gtk_theming_background_init (GtkThemingBackground *bg,
56                                    GtkThemingEngine     *engine,
57                                    gdouble               x,
58                                    gdouble               y,
59                                    gdouble               width,
60                                    gdouble               height,
61                                    GtkJunctionSides      junction);
62
63 void _gtk_theming_background_init_from_context (GtkThemingBackground *bg,
64                                                 GtkStyleContext      *context,
65                                                 gdouble               x,
66                                                 gdouble               y,
67                                                 gdouble               width,
68                                                 gdouble               height,
69                                                 GtkJunctionSides      junction);
70
71 void _gtk_theming_background_render (GtkThemingBackground *bg,
72                                      cairo_t              *cr);
73
74 gboolean _gtk_theming_background_has_background_image (GtkThemingBackground *bg);
75
76 G_END_DECLS
77
78 #endif /* __GTK_THEMING_BACKGROUND_PRIVATE_H__ */