dtcm: Coverity 88353
[oweals/cde.git] / cde / programs / dtwm / WmOL.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 libraries 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 /* 
24  * (c) Copyright 1989 Sun Microsystems, Inc.
25  * (c) Copyright 1993 HEWLETT-PACKARD COMPANY 
26  * ALL RIGHTS RESERVED 
27  */ 
28
29 #ifndef _WM_OL_H
30 #define _WM_OL_H
31 #ifndef NO_OL_COMPAT
32
33 /*
34  * Property Names 
35  */
36 #define OL_WIN_ATTR             "_OL_WIN_ATTR"
37 #define OL_DECOR_ADD            "_OL_DECOR_ADD"
38 #define OL_DECOR_DEL            "_OL_DECOR_DEL"
39
40 /*
41  * Decoration atoms
42  */
43 #define OL_DECOR_RESIZE         "_OL_DECOR_RESIZE"
44 #define OL_DECOR_FOOTER         "_OL_DECOR_FOOTER"
45 #define OL_DECOR_HEADER         "_OL_DECOR_HEADER"
46 #define OL_DECOR_PIN            "_OL_DECOR_PIN"
47 #define OL_DECOR_CLOSE          "_OL_DECOR_CLOSE"
48 #define OL_DECOR_ICON_NAME      "_OL_DECOR_ICON_NAME"
49 #define OL_PIN_IN               "_OL_PIN_IN"
50 #define OL_PIN_OUT              "_OL_PIN_OUT"
51
52 /*
53  * Window types
54  */
55 #define OL_WT_BASE              "_OL_WT_BASE"
56 #define OL_WT_CMD               "_OL_WT_CMD"
57 #define OL_WT_NOTICE            "_OL_WT_NOTICE"
58 #define OL_WT_HELP              "_OL_WT_HELP"
59 #define OL_WT_OTHER             "_OL_WT_OTHER"
60
61 /*
62  * Menu Types
63  */
64 #define OL_MENU_LIMITED         "_OL_MENU_LIMITED"
65 #define OL_MENU_FULL            "_OL_MENU_FULL"
66
67 /*
68  * Structure of Open Look window attribute property
69  */
70 typedef struct _OLWinAttr {
71     unsigned long       flags;
72     Atom                win_type;
73     Atom                menu_type;
74     unsigned long       pin_initial_state;
75     unsigned long       cancel;
76 } OLWinAttr;
77 #define OLWINATTRLENGTH (sizeof(OLWinAttr)/sizeof(unsigned long))
78
79 typedef struct _old_OLWinAttr {
80     Atom                win_type;
81     Atom                menu_type;
82     unsigned long       pin_initial_state;
83 } old_OLWinAttr;
84 #define OLDOLWINATTRLENGTH (sizeof(old_OLWinAttr)/sizeof(unsigned long))
85
86 /* pin states */
87 #define PIN_OUT         0
88 #define PIN_IN          1
89
90 /*
91  * Values for flags in OLWinAttr
92  */
93 #define WA_WINTYPE      (1<<0)
94 #define WA_MENUTYPE     (1<<1)
95 #define WA_PINSTATE     (1<<2)
96 #define WA_CANCEL       (1<<3)
97
98 #define ENTIRE_CONTENTS         (10000000L)
99
100 /*
101  * Bit Flags for OL Window Decoration
102  */
103 #define OLDecorHeader           (1L<<0)
104 #define OLDecorFooter           (1L<<1)
105 #define OLDecorPushPin          (1L<<2)
106 #define OLDecorCloseButton      (1L<<3)
107 #define OLDecorResizable        (1L<<4)
108 #define OLDecorIconName         (1L<<5)
109 #define OLDecorWarpToPin        (1L<<6)
110
111 /*
112  * Public Functions
113  */
114 extern Boolean HasOpenLookHints( ClientData *pCD );
115 extern OLWinAttr * GetOLWinAttr( ClientData *pCD );
116 extern Boolean GetOLDecorFlags(ClientData *pCD, Atom property,
117         unsigned long *pDecor);
118 extern void InitOLCompat(void);
119 extern void ProcessOLDecoration(ClientData *pCD);
120
121
122
123 /*
124  * Macros (public pseudo-functions)
125  */
126 #define GetOLDecorAdd(pcd,ptr) (GetOLDecorFlags(pcd,wmGD.xa_OL_DECOR_ADD,ptr))
127 #define GetOLDecorDel(pcd,ptr) (GetOLDecorFlags(pcd,wmGD.xa_OL_DECOR_DEL,ptr))
128
129
130 #endif /* NO_OL_COMPAT */
131 /* Do not add anything after the following #endif */
132 #endif /* _WM_OL_H */