Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtSvc / DtUtil1 / Wsm.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: Wsm.h /main/5 1996/05/20 16:08:50 drk $
24  *
25  * (c) Copyright 1996 Digital Equipment Corporation.
26  * (c) Copyright 1993,1994,1996 Hewlett-Packard Company.
27  * (c) Copyright 1993,1994,1996 International Business Machines Corp.
28  * (c) Copyright 1993,1994,1996 Sun Microsystems, Inc.
29  * (c) Copyright 1993,1994,1996 Novell, Inc. 
30  * (c) Copyright 1996 FUJITSU LIMITED.
31  * (c) Copyright 1996 Hitachi.
32  */
33
34 #ifndef _Dt_Wsm_h
35 #define _Dt_Wsm_h
36
37 #include <X11/Intrinsic.h>
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43
44 /*
45  * Constants
46  */
47
48 #define DtWSM_REASON_ADD        0
49 #define DtWSM_REASON_DELETE     1
50 #define DtWSM_REASON_BACKDROP   2
51 #define DtWSM_REASON_TITLE      3
52 #define DtWSM_REASON_CURRENT    4
53
54
55 /*
56  * Types
57  */
58
59 /* Workspace property information */
60
61 typedef struct _DtWsmWorkspaceInfo {
62         Atom            workspace;
63         unsigned long   bg;
64         unsigned long   fg;
65         Atom            backdropName;
66         int             colorSetId;
67         char            *pchTitle;
68         Window          *backdropWindows;
69         int             numBackdropWindows;
70 } DtWsmWorkspaceInfo;
71
72
73 /* Workspace modified callback reasons */
74
75 typedef int DtWsmWsReason;
76
77 /* Workspace callback context (opaque) */
78
79 typedef struct _DtWsmCBContext * DtWsmCBContext;
80
81 /* Workspace callback prototype */
82
83 typedef void (*DtWsmWsChangeProc)(
84                 Widget          widget,
85                 Atom            aWs,
86                 XtPointer       client_data);
87
88 /* Workspace modified callback prototype */
89
90 typedef void (*DtWsmWsModifiedProc)(
91                 Widget          widget,
92                 Atom            aWs,
93                 DtWsmWsReason   reason,
94                 XtPointer       client_data);
95
96
97 /*
98  * Functions
99  */
100
101 extern void DtWsmAddWorkspaceFunctions(
102                 Display         *display,
103                  Window         client);
104
105 extern void DtWsmRemoveWorkspaceFunctions(
106                 Display         *display,
107                 Window          client);
108
109 extern int DtWsmGetWorkspaceInfo(
110                 Display         *display,
111                 Window          root,
112                 Atom            aWS,
113                 DtWsmWorkspaceInfo **ppWsInfo);
114
115 extern void DtWsmFreeWorkspaceInfo(
116                 DtWsmWorkspaceInfo *pWsInfo);
117
118 extern int DtWsmGetWorkspaceList(
119                 Display         *display,
120                 Window          root,
121                 Atom            **ppWorkspaceList,
122                 int             *pNumWorkspaces);
123
124 extern int DtWsmGetCurrentWorkspace(
125                 Display         *display,
126                 Window          root,
127                 Atom            *paWorkspace);
128
129 extern DtWsmCBContext DtWsmAddCurrentWorkspaceCallback(
130                 Widget          widget,
131                 DtWsmWsChangeProc ws_change,
132                 XtPointer       client_data);
133
134 extern void DtWsmRemoveWorkspaceCallback(
135                 DtWsmCBContext  pCbCtx);
136
137 extern int DtWsmSetCurrentWorkspace(
138                 Widget          widget,
139                 Atom            aWs);
140
141 extern int DtWsmGetWorkspacesOccupied(
142                 Display         *display,
143                 Window          window,
144                 Atom            **ppaWs,
145                 unsigned long   *pNumWs);
146
147 extern void DtWsmSetWorkspacesOccupied(
148                 Display         *display,
149                 Window          window,
150                 Atom            *pWsHints,
151                 unsigned long   numHints);
152
153 extern void DtWsmOccupyAllWorkspaces(
154                 Display         *display,
155                 Window          window);
156
157 extern DtWsmCBContext DtWsmAddWorkspaceModifiedCallback(
158                 Widget          widget,
159                 DtWsmWsModifiedProc ws_modified,
160                 XtPointer       client_data);
161
162 extern Window DtWsmGetCurrentBackdropWindow(
163                 Display         *display,
164                 Window          root);
165
166 extern int DtWsmSetWorkspaceTitle(
167                 Widget          widget,
168                 Atom            aWs,
169                 char            *title);
170
171 extern int DtWsmChangeBackdrop(
172                 Display         *display,
173                 Window          root,
174                 char            *path,
175                 Pixmap          pixmap);
176
177 extern int DtWsmAddWorkspace(
178                 Widget          widget,
179                 char            *title);
180
181 extern int DtWsmDeleteWorkspace(
182                 Widget          widget,
183                 Atom            aWs);
184
185 #ifdef __cplusplus
186 }
187 #endif
188
189 #endif /* _Dt_Wsm_h */