chiark / gitweb /
Imported Upstream version 1.0.0
[e16] / src / borders.h
1 /*
2  * Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
3  * Copyright (C) 2004-2008 Kim Woelders
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to
7  * deal in the Software without restriction, including without limitation the
8  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9  * sell copies of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies of the Software, its documentation and marketing & publicity
14  * materials, and acknowledgment shall be given in the documentation, materials
15  * and software packages that this Software was used.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _BORDERS_H_
25 #define _BORDERS_H_
26
27 #include <X11/Xlib.h>
28 #include "eimage.h"
29 #include "etypes.h"
30
31 typedef struct {
32    int                 min, max;
33 } WinLimit;
34
35 typedef struct {
36    int                 originbox;
37    struct {
38       int                 percent;
39       int                 absolute;
40    } x                , y;
41 } WinPoint;
42
43 typedef struct {
44    WinLimit            width, height;
45    WinPoint            topleft, bottomright;
46 } Geometry;
47
48 typedef struct {
49    Geometry            geom;
50    ImageClass         *iclass;
51    ActionClass        *aclass;
52    TextClass          *tclass;
53    ECursor            *ec;
54    signed char         ontop;
55    int                 flags;
56    char                keep_for_shade;
57 } WinPart;
58
59 struct _border {
60    char               *name;
61    char               *group_border_name;
62    EImageBorder        border;
63    int                 num_winparts;
64    WinPart            *part;
65    char                changes_shape;
66    char                shadedir;
67    char                throwaway;
68    unsigned int        ref_count;
69    ActionClass        *aclass;
70 };
71
72 struct _ewinbit {
73    EWin               *ewin;    /* Belongs to */
74    Win                 win;
75    int                 x, y, w, h;
76    int                 cx, cy, cw, ch;
77    int                 state;
78    char                expose;
79    char                left;
80    ImageState         *is;
81    TextState          *ts;
82 };
83
84 /* borders.c */
85 Border             *BorderFind(const char *name);
86 const char         *BorderGetName(const Border * b);
87 int                 BorderConfigLoad(FILE * fs);
88 void                EwinBorderSelect(EWin * ewin);
89 void                EwinBorderDetach(EWin * ewin);
90 void                EwinBorderSetTo(EWin * ewin, const Border * b);
91 void                EwinBorderDraw(EWin * ewin, int do_shape, int do_paint);
92 void                EwinBorderCalcSizes(EWin * ewin, int propagate);
93 void                EwinBorderMinShadeSize(EWin * ewin, int *mw, int *mh);
94 void                EwinBorderUpdateInfo(EWin * ewin);
95 void                EwinBorderChange(EWin * ewin, const Border * b, int normal);
96 void                EwinBorderSetInitially(EWin * ewin, const char *name);
97 int                 BorderWinpartIndex(EWin * ewin, Win win);
98 void                BorderCheckState(EWin * ewin, XEvent * ev);
99 Border             *BorderCreateFiller(int left, int right, int top,
100                                        int bottom);
101 void                BordersForeach(void (*func) (Border * b, void *data),
102                                    void *data);
103 Border            **BordersGetList(int *pnum);
104
105 #endif /* _BORDERS_H_ */