1 /* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
3 frame_default_plugin.h for the Openbox window manager
4 Copyright (c) 2003-2007 Dana Jansens
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.
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.
16 See the COPYING file for a copy of the GNU General Public License.
18 #ifndef FRAME_CONCEPT_PLUGIN_H_
19 #define FRAME_CONCEPT_PLUGIN_H_
23 #include "render/render.h"
24 #include "openbox/engine_interface.h"
26 ObFrameThemeConfig theme_config;
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
36 struct _ObConceptFrame
41 /* You are free to add what you want here */
46 gboolean max_horz; /* when maxed some decorations are hidden */
47 gboolean max_vert; /* when maxed some decorations are hidden */
49 struct _ObClient *client;
53 Rect client_area; /* the area of the client window */
54 Rect window_area; /* the area of the window with/without decorations */
56 ObFrameButton hover_flag;
57 ObFrameButton press_flag;
63 gint iconify_animation_going;
64 /* These are borders of the frame and its elements */
83 RrAppearance *a_unfocused_title;
84 RrAppearance *a_focused_title;
85 RrAppearance *a_unfocused_label;
86 RrAppearance *a_focused_label;
88 RrAppearance *a_unfocused_handle;
89 RrAppearance *a_focused_handle;
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 */
99 gint title_width; /* width of the titlebar and handle */
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 */
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 */
116 /* the leftmost and rightmost elements in the titlebar */
117 ObFrameContext leftmost;
118 ObFrameContext rightmost;
121 gboolean need_render;
127 GTimeVal iconify_animation_end;
129 ObFrameStaseFlags frame_stase_flags;
133 typedef struct _ObConceptFrame ObConceptFrame;
135 /* Function use for interface */
136 gint init(Display *, gint);
138 gpointer frame_new(struct _ObClient *c);
139 void frame_free(gpointer self);
141 void frame_show(gpointer self);
142 gint frame_hide(gpointer self);
144 void frame_adjust_theme(gpointer self);
145 void frame_adjust_shape(gpointer self);
147 void frame_grab(gpointer self, GHashTable *);
148 void frame_ungrab(gpointer self, GHashTable *);
150 ObFrameContext frame_context(gpointer, Window, gint, gint);
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);
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);
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);
170 void frame_update_layout(gpointer, gboolean, gboolean);
171 void frame_update_skin(gpointer);
173 void frame_set_hover_flag(gpointer, ObFrameButton);
174 void frame_set_press_flag(gpointer, ObFrameButton);
176 Window frame_get_window(gpointer);
178 Strut frame_get_size(gpointer);
180 gint frame_get_decorations(gpointer);
182 gboolean frame_is_visible(gpointer);
183 gboolean frame_is_max_horz(gpointer);
184 gboolean frame_is_max_vert(gpointer);
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);
194 /* Global for frame_concept_render.c only */
195 extern ObFramePlugin plugin;
196 #define OBCONCEPTFRAME(x) ((ObConceptFrame *)(x))
198 #endif /*FRAME_CONCEPT_PLUGIN_H_*/