chiark / gitweb /
Imported Debian patch 1.0.0-6
[e16] / src / desktops.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 _DESKTOPS_H_
25 #define _DESKTOPS_H_
26
27 #include "eobj.h"
28 #include "etypes.h"
29
30 #define USE_BG_WIN_ON_ALL_DESKS 0
31
32 #define DESK_BG_REFRESH         1
33 #define DESK_BG_FREE            2
34 #define DESK_BG_TIMEOUT         3
35 #define DESK_BG_RECONFIGURE_ALL 4
36
37 struct _desk {
38    EObj                o;
39    unsigned int        num;
40    char                viewable;
41    char                visible;
42    Button             *tag;
43    int                 current_area_x;
44    int                 current_area_y;
45    struct {
46       Background         *bg;
47       EObj               *o;
48 #if USE_COMPOSITE
49       EObj               *o_bg;
50 #endif
51       Pixmap              pmap;
52       Pixmap              pmap_set;
53       unsigned long       pixel;
54       unsigned int        seq_no;
55    } bg;
56    struct {
57       int                 dirty;
58       EObj               *latest;
59       char                update_client_list;
60    } stack;
61 };
62
63 /* desktops.c */
64 Desk               *DeskGet(unsigned int desk);
65 Desk               *DeskGetRelative(Desk * dsk, int inc);
66 void                DeskGetArea(const Desk * dsk, int *ax, int *ay);
67 void                DeskSetArea(Desk * dsk, int ax, int ay);
68 void                DeskSetDirtyStack(Desk * dsk, EObj * eo);
69 void                DeskGoto(Desk * dsk);
70 void                DeskGotoNum(unsigned int desk);
71 void                DeskRestack(Desk * dsk);
72 EObj               *DeskGetBackgroundObj(const Desk * dsk);
73 Pixmap              DeskGetBackgroundPixmap(const Desk * dsk);
74
75 Background         *DeskBackgroundGet(const Desk * dsk);
76 void                DeskBackgroundSet(Desk * dsk, Background * bg);
77
78 void                DesksBackgroundRefresh(Background * bg, int what);
79
80 void                DeskCurrentGetArea(int *ax, int *ay);
81 void                DeskCurrentGotoArea(int ax, int ay);
82 void                DeskCurrentMoveAreaBy(int ax, int ay);
83
84 void                DeskGotoByEwin(EWin * ewin);
85
86 unsigned int        DesksGetNumber(void);
87 Desk               *DesksGetCurrent(void);
88 Desk               *DesktopAt(int x, int y);
89 unsigned int        DesksGetCurrentNum(void);
90 void                DesksSetCurrent(Desk * dsk);
91 void                DesksGetAreaSize(int *aw, int *ah);
92
93 void                DesksFixArea(int *ax, int *ay);
94
95 #endif /* _DESKTOPS_H_ */