]> git.decadent.org.uk Git - ion3.git/blob - ioncore/sizehint.h
4ddfb4172c2ea29793fbba12a3c8ee5caf2c4010
[ion3.git] / ioncore / sizehint.h
1 /*
2  * ion/ioncore/sizehint.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
5  *
6  * Ion is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  */
11
12 #ifndef ION_IONCORE_SIZEHINT_H
13 #define ION_IONCORE_SIZEHINT_H
14
15 #include "common.h"
16 #include "region.h"
17
18 INTRSTRUCT(WSizeHints);
19
20 DECLSTRUCT(WSizeHints){
21     uint min_set:1;
22     uint max_set:1;
23     uint inc_set:1;
24     uint base_set:1;
25     uint aspect_set:1;
26     uint no_constrain:1;
27     
28     int min_width, min_height;
29     int max_width, max_height;
30     int width_inc, height_inc;
31     struct {
32         int x;
33         int y;
34     } min_aspect, max_aspect;
35     int base_width, base_height;
36 };
37
38 extern void xsizehints_to_sizehints(const XSizeHints *xh,
39                                     WSizeHints *hints);
40
41 extern void xsizehints_sanity_adjust(XSizeHints *hints);
42
43 extern void sizehints_clear(WSizeHints *hints);
44
45 extern void sizehints_adjust_for(WSizeHints *hints, WRegion *reg);
46
47 extern void sizehints_correct(const WSizeHints *hints, int *wp, int *hp, 
48                               bool min, bool override_no_constrain);
49
50 extern int xgravity_deltax(int gravity, int left, int right);
51 extern int xgravity_deltay(int gravity, int top, int bottom);
52 extern void xgravity_translate(int gravity, WRegion *reg, WRectangle *geom);
53
54 #endif /* ION_IONCORE_SIZEHINT_H */