Only define LUA when lua is actually on the PATH
[notion/jeffpc.git] / ioncore / frame.h
blobc221df152e263ca368e1d41fa1da49a55b1a74a1
1 /*
2 * ion/ioncore/frame.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
7 */
9 #ifndef ION_IONCORE_FRAME_H
10 #define ION_IONCORE_FRAME_H
12 #include <libtu/stringstore.h>
13 #include <libtu/setparam.h>
14 #include <libextl/extl.h>
16 #include "common.h"
17 #include "window.h"
18 #include "attach.h"
19 #include "mplex.h"
20 #include "gr.h"
21 #include "rectangle.h"
22 #include "sizehint.h"
23 #include "frame-tabs-recalc.h"
25 #define FRAME_KEEP_FLAGS 0x0001
26 #define FRAME_SAVED_VERT 0x0008
27 #define FRAME_SAVED_HORIZ 0x0010
28 #define FRAME_SHADED 0x0020
29 #define FRAME_SHADED_TOGGLE 0x0040
30 /*#define FRAME_DEST_EMPTY 0x0100*/
31 #define FRAME_MAXED_VERT 0x0200
32 #define FRAME_MAXED_HORIZ 0x0400
33 #define FRAME_MIN_HORIZ 0x0800
35 /*#define FRAME_SZH_USEMINMAX 0x1000 */
36 /*#define FRAME_FWD_CWIN_RQGEOM 0x2000 */
39 typedef enum{
40 FRAME_MODE_UNKNOWN,
41 FRAME_MODE_TILED,
42 FRAME_MODE_TILED_ALT,
43 FRAME_MODE_FLOATING,
44 FRAME_MODE_TRANSIENT,
45 FRAME_MODE_UNKNOWN_ALT,
46 FRAME_MODE_FLOATING_ALT,
47 FRAME_MODE_TRANSIENT_ALT
48 } WFrameMode;
50 typedef enum{
51 FRAME_BAR_INSIDE,
52 FRAME_BAR_OUTSIDE,
53 FRAME_BAR_SHAPED,
54 FRAME_BAR_NONE
55 } WFrameBarMode;
59 DECLCLASS(WFrame){
60 WMPlex mplex;
62 int flags;
63 WFrameMode mode;
64 WRectangle saved_geom;
66 int tab_dragged_idx;
67 void *quasiact_source;
69 GrBrush *brush;
70 GrBrush *bar_brush;
71 GrStyleSpec baseattr;
72 GrTransparency tr_mode;
73 GrTextElem *titles;
74 int titles_n;
76 /* Bar stuff */
77 WFrameBarMode barmode;
78 int bar_w, bar_h;
79 /* Parameters to calculate tab sizes. */
80 TabCalcParams tabs_params;
84 /* Create/destroy */
85 extern WFrame *create_frame(WWindow *parent, const WFitParams *fp,
86 WFrameMode mode);
87 extern bool frame_init(WFrame *frame, WWindow *parent, const WFitParams *fp,
88 WFrameMode mode);
89 extern void frame_deinit(WFrame *frame);
90 extern bool frame_rqclose(WFrame *frame);
92 /* Mode */
94 extern void frame_set_mode(WFrame *frame, WFrameMode mode);
95 extern WFrameMode frame_mode(WFrame *frame);
97 /* Resize and reparent */
98 extern bool frame_fitrep(WFrame *frame, WWindow *par, const WFitParams *fp);
99 extern void frame_size_hints(WFrame *frame, WSizeHints *hints_ret);
101 /* Focus */
102 extern void frame_activated(WFrame *frame);
103 extern void frame_inactivated(WFrame *frame);
105 /* Tabs */
106 extern int frame_nth_tab_w(WFrame *frame, int n);
107 extern int frame_nth_tab_x(WFrame *frame, int n);
108 extern int frame_tab_at_x(WFrame *frame, int x);
109 extern void frame_update_attr_nth(WFrame *frame, int i);
111 extern bool frame_set_shaded(WFrame *frame, int sp);
112 extern bool frame_is_shaded(WFrame *frame);
113 extern bool frame_set_numbers(WFrame *frame, int sp);
114 extern bool frame_is_numbers(WFrame *frame);
116 extern int frame_default_index(WFrame *frame);
118 /* Misc */
119 extern void frame_managed_notify(WFrame *frame, WRegion *sub, WRegionNotify how);
120 extern bool frame_managed_rqdispose(WFrame *frame, WRegion *reg);
122 extern WPHolder *frame_prepare_manage_transient(WFrame *frame,
123 const WClientWin *transient,
124 const WManageParams *param,
125 int unused);
127 /* Save/load */
128 extern ExtlTab frame_get_configuration(WFrame *frame);
129 extern WRegion *frame_load(WWindow *par, const WFitParams *fp, ExtlTab tab);
130 extern void frame_do_load(WFrame *frame, ExtlTab tab);
132 extern WHook *frame_managed_changed_hook;
134 extern WFrameMode framemode_unalt(WFrameMode mode);
136 #endif /* ION_IONCORE_FRAME_H */