1 /* Glide - a cairo based GTK+ engine
2  * Copyright (C) 2006 Andrew Johnson <acjgenius@earthlink.net>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17  *
18  * Project contact: <gnome-themes-list@gnome.org>
19  *
20  */
21 
22 
23 #include <math.h>
24 
25 GE_INTERNAL void
26 ge_blend_color(const CairoColor *color1, const CairoColor *color2, CairoColor *composite);
27 
28 typedef enum {
29 	GLIDE_BEVEL_STYLE_SMOOTH = 1,
30 
31 	GLIDE_BEVEL_STYLE_SMOOTHER,
32 
33 	GLIDE_BEVEL_STYLE_THINICE,
34 
35 	GLIDE_BEVEL_STYLE_REDMOND,
36 
37 	GLIDE_BEVEL_STYLE_FLAT,
38 
39 	GLIDE_BEVEL_STYLE_NONE,
40 
41 	/* Default */
42 	GLIDE_BEVEL_STYLE_DEFAULT = GLIDE_BEVEL_STYLE_SMOOTHER
43 } GlideBevelStyle;
44 
45 typedef enum {
46 	GLIDE_BORDER_TYPE_IN,
47 	GLIDE_BORDER_TYPE_OUT,
48 	GLIDE_BORDER_TYPE_ETCHED,
49 	GLIDE_BORDER_TYPE_ENGRAVED,
50 	GLIDE_BORDER_TYPE_NONE
51 } GlideBorderType;
52 
53 typedef enum {
54 	GLIDE_SIDE_TOP,
55 	GLIDE_SIDE_LEFT,
56 	GLIDE_SIDE_RIGHT,
57 	GLIDE_SIDE_BOTTOM,
58 	GLIDE_SIDE_NONE
59 } GlideSide;
60 
61 GE_INTERNAL void do_glide_draw_border_with_gap(cairo_t *canvas,
62 					CairoColor *base,
63 					GlideBevelStyle bevel_style,
64 					GlideBorderType border_type,
65 					gint x,
66 					gint y,
67 					gint width,
68 					gint height,
69 					GlideSide gap_side,
70 					gint gap_pos,
71 					gint gap_size);
72 
73 GE_INTERNAL void do_glide_draw_border(cairo_t *canvas,
74                               CairoColor *base,
75                               GlideBevelStyle bevel_style,
76                               GlideBorderType border_type,
77                               gint x,
78                               gint y,
79                               gint width,
80                               gint height);
81 
82 typedef enum {
83 	GLIDE_CHECK_INCONSISTENT,
84 	GLIDE_CHECK_ON,
85 	GLIDE_CHECK_OFF
86 } GlideCheckState;
87 
88 GE_INTERNAL void do_glide_draw_check (cairo_t *cr,
89                             CairoColor *color,
90                             gint x,
91                             gint y,
92                             gint width,
93                             gint height);
94 
95 GE_INTERNAL void
96 do_glide_draw_round_option(cairo_t *canvas,
97 				CairoColor *base,
98 				CairoColor *fill_color,
99 				CairoColor *check_color,
100         	                GlideBevelStyle bevel_style,
101                 	        GlideBorderType border_type,
102 				GlideCheckState check_state,
103 				gint x,
104 				gint y,
105 				gint width,
106 				gint height);
107 
108 GE_INTERNAL void
109 do_glide_draw_simple_circle (cairo_t *canvas,
110                      	  		CairoColor * tl,
111                        			CairoColor * br,
112 					gint center_x,
113 					gint center_y,
114 					gint radius);
115 
116 GE_INTERNAL void do_glide_draw_arrow (cairo_t *cr,
117                             CairoColor *color,
118                             GtkArrowType arrow_type,
119                             gboolean fill,
120                             gint x,
121                             gint y,
122                             gint width,
123                             gint height);
124 
125 GE_INTERNAL void do_glide_draw_line(cairo_t *cr,
126                           CairoColor * dark,
127                           CairoColor * light,
128                           GdkRectangle * area,
129                           gint start,
130                           gint end,
131                           gint base,
132                           gboolean horizontal);
133 
134 GE_INTERNAL void
135 do_glide_draw_grip (cairo_t *canvas,
136 			CairoColor * light,
137 			CairoColor * dark,
138 			gint x,
139 			gint y,
140 			gint width,
141 			gint height,
142 			gboolean vertical);
143 
144 GE_INTERNAL void glide_gtk2_engine_hack_menu_shell_setup(GtkWidget *widget);
145