]> icculus.org git repositories - dana/openbox.git/blob - engines/concept/plugin.h
Rename ObFramePlugin to ObFrameEngine
[dana/openbox.git] / engines / concept / plugin.h
1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
2
3  frame_default_plugin.h for the Openbox window manager
4  Copyright (c) 2003-2007   Dana Jansens
5
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10
11  This program 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
14  GNU General Public License for more details.
15
16  See the COPYING file for a copy of the GNU General Public License.
17  */
18 #ifndef FRAME_CONCEPT_PLUGIN_H_
19 #define FRAME_CONCEPT_PLUGIN_H_
20
21 #include "config.h"
22
23 #include "render/render.h"
24 #include "openbox/engine_interface.h"
25
26 ObFrameThemeConfig theme_config;
27
28 typedef enum {
29     OB_FRAME_STASE_IS_VISIBLE = 1 << 0,
30     OB_FRAME_STASE_IS_FOCUS = 1 << 1,
31     OB_FRAME_STASE_IS_MAX_VERT = 1 << 2,
32     OB_FRAME_STASE_IS_MAX_HORZ = 1 << 3,
33     OB_FRAME_STASE_IS_SHADED = 1 << 4
34 } ObFrameStaseFlags;
35
36 struct _ObConceptFrame
37 {
38     /* PUBLIC : */
39
40     /* PRIVATE: */
41     /* You are free to add what you want here */
42     Window window;
43
44     gboolean visible;
45
46     gboolean max_horz; /* when maxed some decorations are hidden */
47     gboolean max_vert; /* when maxed some decorations are hidden */
48
49     struct _ObClient *client;
50     guint decorations;
51
52     Strut size;
53     Rect client_area; /* the area of the client window */
54     Rect window_area; /* the area of the window with/without decorations */
55
56     ObFrameButton hover_flag;
57     ObFrameButton press_flag;
58
59     ObStyle style;
60
61     guint functions;
62
63     gint iconify_animation_going;
64     /* These are borders of the frame and its elements */
65
66     Window title;
67
68     Window top;
69     Window bottom;
70     Window left;
71     Window right;
72
73     Window top_left;
74     Window top_right;
75
76     Window bottom_left;
77     Window bottom_right;
78
79     Window background;
80
81     Colormap colormap;
82
83     RrAppearance *a_unfocused_title;
84     RrAppearance *a_focused_title;
85     RrAppearance *a_unfocused_label;
86     RrAppearance *a_focused_label;
87     RrAppearance *a_icon;
88     RrAppearance *a_unfocused_handle;
89     RrAppearance *a_focused_handle;
90
91     gint icon_on; /* if the window icon button is on */
92     gint label_on; /* if the window title is on */
93     gint iconify_on; /* if the window iconify button is on */
94     gint desk_on; /* if the window all-desktops button is on */
95     gint shade_on; /* if the window shade button is on */
96     gint max_on; /* if the window maximize button is on */
97     gint close_on; /* if the window close button is on */
98
99     gint title_width; /* width of the titlebar and handle */
100
101     gint label_width; /* width of the label in the titlebar */
102     gint icon_x; /* x-position of the window icon button */
103     gint label_x; /* x-position of the window title */
104     gint iconify_x; /* x-position of the window iconify button */
105     gint desk_x; /* x-position of the window all-desktops button */
106     gint shade_x; /* x-position of the window shade button */
107     gint max_x; /* x-position of the window maximize button */
108     gint close_x; /* x-position of the window close button */
109
110     gint cbwidth_l; /* client border width */
111     gint cbwidth_t; /* client border width */
112     gint cbwidth_r; /* client border width */
113     gint cbwidth_b; /* client border width */
114     gboolean shaded; /* decorations adjust when shaded */
115
116     /* the leftmost and rightmost elements in the titlebar */
117     ObFrameContext leftmost;
118     ObFrameContext rightmost;
119
120     gboolean focused;
121     gboolean need_render;
122
123     gboolean flashing;
124     gboolean flash_on;
125     GTimeVal flash_end;
126
127     GTimeVal iconify_animation_end;
128
129     ObFrameStaseFlags frame_stase_flags;
130
131 };
132
133 typedef struct _ObConceptFrame ObConceptFrame;
134
135 /* Function use for interface */
136 gint init(Display *, gint);
137
138 gpointer frame_new(struct _ObClient *c);
139 void frame_free(gpointer self);
140
141 void frame_show(gpointer self);
142 gint frame_hide(gpointer self);
143
144 void frame_adjust_theme(gpointer self);
145 void frame_adjust_shape(gpointer self);
146
147 void frame_grab(gpointer self, GHashTable *);
148 void frame_ungrab(gpointer self, GHashTable *);
149
150 ObFrameContext frame_context(gpointer, Window, gint, gint);
151
152 void frame_set_is_visible(gpointer, gboolean);
153 void frame_set_is_focus(gpointer, gboolean);
154 void frame_set_is_max_vert(gpointer, gboolean);
155 void frame_set_is_max_horz(gpointer, gboolean);
156 void frame_set_is_shaded(gpointer, gboolean);
157
158 void frame_flash_start(gpointer self);
159 void frame_flash_stop(gpointer self);
160 void frame_begin_iconify_animation(gpointer self, gboolean iconifying);
161 void frame_end_iconify_animation(gpointer self);
162 gboolean frame_iconify_animating(gpointer _self);
163
164 /* Set the layout wanted by client */
165 /*void frame_update_state(gpointer, ObFrameState);*/
166 /* This give the allowed area for client window */
167 Rect frame_get_window_area(gpointer);
168 void frame_set_client_area(gpointer, Rect);
169 /* Draw the frame */
170 void frame_update_layout(gpointer, gboolean, gboolean);
171 void frame_update_skin(gpointer);
172
173 void frame_set_hover_flag(gpointer, ObFrameButton);
174 void frame_set_press_flag(gpointer, ObFrameButton);
175
176 Window frame_get_window(gpointer);
177
178 Strut frame_get_size(gpointer);
179
180 gint frame_get_decorations(gpointer);
181
182 gboolean frame_is_visible(gpointer);
183 gboolean frame_is_max_horz(gpointer);
184 gboolean frame_is_max_vert(gpointer);
185
186 /* Internal function */
187 void flash_done(gpointer data);
188 gboolean flash_timeout(gpointer data);
189 void set_theme_statics(gpointer self);
190 void free_theme_statics(gpointer self);
191 gboolean frame_animate_iconify(gpointer self);
192 void frame_adjust_cursors(gpointer self);
193
194 /* Global for frame_concept_render.c only */
195 extern ObFramePlugin plugin;
196 #define OBCONCEPTFRAME(x) ((ObConceptFrame *)(x))
197
198 #endif /*FRAME_CONCEPT_PLUGIN_H_*/