]> git.decadent.org.uk Git - ion3.git/blob - ioncore/sizehint.h
Imported Upstream version 20090110
[ion3.git] / ioncore / sizehint.h
1 /*
2  * ion/ioncore/sizehint.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2009. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_IONCORE_SIZEHINT_H
10 #define ION_IONCORE_SIZEHINT_H
11
12 #include "common.h"
13 #include "region.h"
14
15 INTRSTRUCT(WSizeHints);
16
17 DECLSTRUCT(WSizeHints){
18     uint min_set:1;
19     uint max_set:1;
20     uint inc_set:1;
21     uint base_set:1;
22     uint aspect_set:1;
23     uint no_constrain:1;
24     
25     int min_width, min_height;
26     int max_width, max_height;
27     int width_inc, height_inc;
28     struct {
29         int x;
30         int y;
31     } min_aspect, max_aspect;
32     int base_width, base_height;
33 };
34
35 extern void xsizehints_to_sizehints(const XSizeHints *xh,
36                                     WSizeHints *hints);
37
38 extern void xsizehints_sanity_adjust(XSizeHints *hints);
39
40 extern void sizehints_clear(WSizeHints *hints);
41
42 extern void sizehints_adjust_for(WSizeHints *hints, WRegion *reg);
43
44 extern void sizehints_correct(const WSizeHints *hints, int *wp, int *hp, 
45                               bool min, bool override_no_constrain);
46
47 extern int xgravity_deltax(int gravity, int left, int right);
48 extern int xgravity_deltay(int gravity, int top, int bottom);
49 extern void xgravity_translate(int gravity, WRegion *reg, WRectangle *geom);
50
51 #endif /* ION_IONCORE_SIZEHINT_H */