00001
00002
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef META_STACK_H
00042 #define META_STACK_H
00043
00044 #include "screen-private.h"
00045
00050 typedef enum
00051 {
00052 META_LAYER_DESKTOP = 0,
00053 META_LAYER_BOTTOM = 1,
00054 META_LAYER_NORMAL = 2,
00055 META_LAYER_TOP = 4,
00056 META_LAYER_DOCK = 4,
00057 META_LAYER_FULLSCREEN = 5,
00058 META_LAYER_FOCUSED_WINDOW = 6,
00059 META_LAYER_LAST = 7
00060 } MetaStackLayer;
00061
00069 struct _MetaStack
00070 {
00072 MetaScreen *screen;
00073
00078 GArray *windows;
00079
00081 GList *sorted;
00082
00091 GList *added;
00092
00101 GList *removed;
00102
00111 int freeze_count;
00112
00117 GArray *last_root_children_stacked;
00118
00123 gint n_positions;
00124
00126 unsigned int need_resort : 1;
00127
00132 unsigned int need_relayer : 1;
00133
00138 unsigned int need_constrain : 1;
00139 };
00140
00147 MetaStack *meta_stack_new (MetaScreen *screen);
00148
00154 void meta_stack_free (MetaStack *stack);
00155
00163 void meta_stack_add (MetaStack *stack,
00164 MetaWindow *window);
00165
00173 void meta_stack_remove (MetaStack *stack,
00174 MetaWindow *window);
00183 void meta_stack_update_layer (MetaStack *stack,
00184 MetaWindow *window);
00185
00194 void meta_stack_update_transient (MetaStack *stack,
00195 MetaWindow *window);
00196
00204 void meta_stack_raise (MetaStack *stack,
00205 MetaWindow *window);
00212 void meta_stack_lower (MetaStack *stack,
00213 MetaWindow *window);
00214
00225 void meta_stack_freeze (MetaStack *stack);
00226
00234 void meta_stack_thaw (MetaStack *stack);
00235
00243 MetaWindow* meta_stack_get_top (MetaStack *stack);
00244
00252 MetaWindow* meta_stack_get_bottom (MetaStack *stack);
00253
00266 MetaWindow* meta_stack_get_above (MetaStack *stack,
00267 MetaWindow *window,
00268 gboolean only_within_layer);
00269
00282 MetaWindow* meta_stack_get_below (MetaStack *stack,
00283 MetaWindow *window,
00284 gboolean only_within_layer);
00285
00305 MetaWindow* meta_stack_get_default_focus_window (MetaStack *stack,
00306 MetaWorkspace *workspace,
00307 MetaWindow *not_this_one);
00308
00329 MetaWindow* meta_stack_get_default_focus_window_at_point (MetaStack *stack,
00330 MetaWorkspace *workspace,
00331 MetaWindow *not_this_one,
00332 int root_x,
00333 int root_y);
00334
00344 GList* meta_stack_list_windows (MetaStack *stack,
00345 MetaWorkspace *workspace);
00346
00364 int meta_stack_windows_cmp (MetaStack *stack,
00365 MetaWindow *window_a,
00366 MetaWindow *window_b);
00367
00378 void meta_window_set_stack_position (MetaWindow *window,
00379 int position);
00380
00390 GList* meta_stack_get_positions (MetaStack *stack);
00391
00399 void meta_stack_set_positions (MetaStack *stack,
00400 GList *windows);
00401
00402 #endif