ion->notion
[notion/jeffpc.git] / ioncore / stacking.h
blobc1754ae793ba32b79743d5428c27429c0e1d1ea9
1 /*
2 * ion/ioncore/stacking.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
9 #ifndef ION_IONCORE_STACKING_H
10 #define ION_IONCORE_STACKING_H
12 #include "common.h"
13 #include "region.h"
14 #include "sizepolicy.h"
17 #define STACKING_LEVEL_BOTTOM 0
18 #define STACKING_LEVEL_NORMAL 1
19 #define STACKING_LEVEL_ON_TOP 2
20 #define STACKING_LEVEL_MODAL1 1024
22 #define STACKING_IS_HIDDEN(ST) ((ST)->hidden)
23 #define STACKING_IS_PSEUDOMODAL(ST) ((ST)->pseudomodal)
26 DECLSTRUCT(WStacking){
27 WRegion *reg;
28 WStacking *next, *prev;
29 WStacking *above;
30 uint level;
31 WSizePolicy szplcy;
32 WStacking *mgr_next, *mgr_prev;
34 /* flags */
35 uint to_unweave:2;
36 uint hidden:1;
37 uint pseudomodal:1;
39 /* WMPlex stuff */
40 WLListNode *lnode;
44 typedef bool WStackingFilter(WStacking *st, void *data);
45 typedef WStacking *WStackingIterator(void *data);
48 DECLSTRUCT(WStackingIterTmp){
49 WStacking *st;
50 WStackingFilter *filt;
51 void *filt_data;
55 WStacking **window_get_stackingp(WWindow *wwin);
56 WStacking *window_get_stacking(WWindow *wwin);
59 WStacking *create_stacking();
61 void stacking_free(WStacking *st);
63 /* Returns the topmost node with 'above' pointing to st. */
64 WStacking *stacking_unstack(WWindow *par, WStacking *st);
66 void stacking_iter_init(WStackingIterTmp *tmp,
67 WStacking *st,
68 WStackingFilter *filt,
69 void *filt_data);
70 WRegion *stacking_iter(WStackingIterTmp *tmp);
71 WStacking *stacking_iter_nodes(WStackingIterTmp *tmp);
73 void stacking_iter_mgr_init(WStackingIterTmp *tmp,
74 WStacking *st,
75 WStackingFilter *filt,
76 void *filt_data);
77 WRegion *stacking_iter_mgr(WStackingIterTmp *tmp);
78 WStacking *stacking_iter_mgr_nodes(WStackingIterTmp *tmp);
80 void stacking_weave(WStacking **stacking, WStacking **np, bool below);
81 WStacking *stacking_unweave(WStacking **stacking,
82 WStackingFilter *filt, void *filt_data);
84 void stacking_restack(WStacking **stacking, WStacking *st, Window fb_win,
85 WStackingFilter *filt, void *filt_data, bool lower);
87 WStacking *stacking_find_to_focus(WStacking *stacking, WStacking *to_try,
88 WStackingFilter *include_filt,
89 WStackingFilter *approve_filt,
90 void *filt_data);
91 WStacking *stacking_find_to_focus_mapped(WStacking *stacking,
92 WStacking *to_try,
93 WRegion *mgr);
95 uint stacking_min_level(WStacking *stacking,
96 WStackingFilter *include_filt,
97 void *filt_data);
99 uint stacking_min_level_mapped(WStacking *stacking);
101 bool stacking_must_focus(WStacking *stacking, WStacking *st);
103 WStacking *ioncore_find_stacking(WRegion *reg);
104 void stacking_unassoc(WStacking *stacking);
105 bool stacking_assoc(WStacking *stacking, WRegion *reg);
107 #endif /* ION_IONCORE_STACKING_H */