2 * ion/ioncore/sizepolicy.h
4 * Copyright (c) Tuomo Valkonen 1999-2009.
6 * See the included file LICENSE for details.
9 #ifndef ION_IONCORE_SIZEPOLICY_H
10 #define ION_IONCORE_SIZEPOLICY_H
15 /* Modifiers for some policies */
16 #define SIZEPOLICY_VERT_NONE 0x0000
17 #define SIZEPOLICY_VERT_TOP 0x0100
18 #define SIZEPOLICY_VERT_BOTTOM 0x0200
19 #define SIZEPOLICY_VERT_CENTER 0x0300
20 #define SIZEPOLICY_VERT_MASK 0x0300
22 #define SIZEPOLICY_HORIZ_NONE 0x0000
23 #define SIZEPOLICY_HORIZ_LEFT 0x0400
24 #define SIZEPOLICY_HORIZ_RIGHT 0x0800
25 #define SIZEPOLICY_HORIZ_CENTER 0x0c00
26 #define SIZEPOLICY_HORIZ_MASK 0x0c00
28 #define SIZEPOLICY_SHRUNK 0x1000
31 #define SIZEPOLICY_MASK 0xff
32 #define SIZEPOLICY_DEFAULT 0x00
33 #define SIZEPOLICY_FULL_EXACT 0x01
34 #define SIZEPOLICY_FULL_BOUNDS 0x02
35 #define SIZEPOLICY_FREE 0x03
36 #define SIZEPOLICY_GRAVITY 0x04 /* uses vert/horiz flags */
37 #define SIZEPOLICY_FREE_GLUE 0x05 /* stateful; modifies v/h flags */
38 #define SIZEPOLICY_STRETCH_LEFT 0x06
39 #define SIZEPOLICY_STRETCH_RIGHT 0x07
40 #define SIZEPOLICY_STRETCH_TOP 0x08
41 #define SIZEPOLICY_STRETCH_BOTTOM 0x09
42 #define SIZEPOLICY_UNCONSTRAINED 0x10
43 #define SIZEPOLICY_VISIBILITY_CONSTRAINED 0x11
45 #define SIZEPOLICY_GRAVITY_NORTHWEST (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_LEFT)
46 #define SIZEPOLICY_GRAVITY_NORTH (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_CENTER)
47 #define SIZEPOLICY_GRAVITY_NORTHEAST (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_RIGHT)
48 #define SIZEPOLICY_GRAVITY_WEST (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_CENTER|SIZEPOLICY_HORIZ_LEFT)
49 #define SIZEPOLICY_GRAVITY_CENTER (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_CENTER|SIZEPOLICY_HORIZ_CENTER)
50 #define SIZEPOLICY_GRAVITY_EAST (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_CENTER|SIZEPOLICY_HORIZ_RIGHT)
51 #define SIZEPOLICY_GRAVITY_SOUTHWEST (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_BOTTOM|SIZEPOLICY_HORIZ_LEFT)
52 #define SIZEPOLICY_GRAVITY_SOUTH (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_BOTTOM|SIZEPOLICY_HORIZ_CENTER)
53 #define SIZEPOLICY_GRAVITY_SOUTHEAST (SIZEPOLICY_GRAVITY|SIZEPOLICY_VERT_BOTTOM|SIZEPOLICY_HORIZ_RIGHT)
55 #define SIZEPOLICY_FREE_GLUE__NORTHWEST (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_LEFT)
56 #define SIZEPOLICY_FREE_GLUE__NORTH (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_CENTER)
57 #define SIZEPOLICY_FREE_GLUE__NORTHEAST (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_TOP|SIZEPOLICY_HORIZ_RIGHT)
58 #define SIZEPOLICY_FREE_GLUE__WEST (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_CENTER|SIZEPOLICY_HORIZ_LEFT)
59 #define SIZEPOLICY_FREE_GLUE__CENTER (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_CENTER|SIZEPOLICY_HORIZ_CENTER)
60 #define SIZEPOLICY_FREE_GLUE__EAST (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_CENTER|SIZEPOLICY_HORIZ_RIGHT)
61 #define SIZEPOLICY_FREE_GLUE__SOUTHWEST (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_BOTTOM|SIZEPOLICY_HORIZ_LEFT)
62 #define SIZEPOLICY_FREE_GLUE__SOUTH (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_BOTTOM|SIZEPOLICY_HORIZ_CENTER)
63 #define SIZEPOLICY_FREE_GLUE__SOUTHEAST (SIZEPOLICY_FREE_GLUE|SIZEPOLICY_VERT_BOTTOM|SIZEPOLICY_HORIZ_RIGHT)
65 typedef uint WSizePolicy
;
68 extern void sizepolicy(WSizePolicy
*szplcy
, WRegion
*reg
,
69 const WRectangle
*rq_geom
, int rq_flags
,
73 extern bool string2sizepolicy(const char *szplcy
, WSizePolicy
*value
);
74 extern const char *sizepolicy2string(WSizePolicy szplcy
);
76 #endif /* ION_IONCORE_SIZEPOLICY_H */