Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtcreate / cmnrtns.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: cmnrtns.h /main/5 1995/11/01 16:11:28 rswiston $ */
24 #include <Dt/IconFile.h>
25 /***************************************************************************/
26 /*                                                                         */
27 /*  cmnrtns.h                                                              */
28 /*                                                                         */
29 /***************************************************************************/
30
31 #ifndef _CMNRTNS_H_INCLUDED
32 #define _CMNRTNS_H_INCLUDED
33
34 #ifndef STORAGECLASS
35 #ifdef  NOEXTERN
36 #define STORAGECLASS
37 #else
38 #define STORAGECLASS extern
39 #endif
40 #endif
41
42 /***************************************************************************/
43 /*                                                                         */
44 /*  Macro Declarations                                                     */
45 /*                                                                         */
46 /***************************************************************************/
47 #define SET_ICONGADGET_ICON_AND_EXT(widIconGadget,pszIconFileName, pszBuffer) {\
48           sprintf(pszBuffer, "%s%s", pszIconFileName, bShowPixmaps ? PIXMAP_EXT : BITMAP_EXT); \
49           XtVaSetValues (widIconGadget,                                     \
50                          XmNimageName, "",                                  \
51                          NULL);                                             \
52         /*printf("setting icon to = '%s'\n", pszBuffer);*/                  \
53           XtVaSetValues (widIconGadget,                                     \
54                          XmNimageName, pszBuffer,                           \
55                          NULL);                                             \
56 }
57
58 #define SET_ICONGADGET_ICON(widIconGadget,pszIconFileName) {                \
59           /*printf("setting icon to = '%s'\n", pszIconFileName);*/          \
60           XtVaSetValues (widIconGadget,                                     \
61                          XmNimageName, "",                                  \
62                          NULL);                                             \
63           XtVaSetValues (widIconGadget,                                     \
64                          XmNimageName, pszIconFileName,                     \
65                          NULL);                                             \
66 }
67
68 #define FIND_ICONGADGET_ICON(pszIcon,pszFile,size) {                        \
69           pszFile = (char *)NULL;                                           \
70           pszFile = _DtGetIconFileName(XtScreen(CreateActionAppShell),       \
71                                       NULL,                                 \
72                                       pszIcon,                              \
73                                       NULL,                                 \
74                                       size);                                \
75 }
76
77 #define CHANGE_ICONGADGET_ICON(widIconGadget,buffer,name,size,type) {       \
78           sprintf(buffer, "%s.%s.%s", name, size, type);                    \
79           if (check_file_exists(buffer)) {                                  \
80             SET_ICONGADGET_ICON(widIconGadget, buffer);                     \
81           } else {                                                          \
82             SET_ICONGADGET_ICON(widIconGadget, "");                         \
83           }                                                                 \
84 }
85
86 #define SET_TOGGLEBUTTON(widToggleButton,bState) {                          \
87           XtVaSetValues (widToggleButton,                                   \
88                          XmNset, bState,                                    \
89                          NULL);                                             \
90 }
91
92 /***************************************************************************/
93 /*                                                                         */
94 /*  Prototypes for functions                                               */
95 /*                                                                         */
96 /***************************************************************************/
97
98 ushort WriteDefinitionFile(char *, ActionData *);
99 ushort WriteActionFile(ActionData *);
100 void   Change_IconGadget_IconType(Widget, char *);
101 void   load_icons (Widget wid, XtPointer client_data,
102                    XmFileSelectionBoxCallbackStruct *cbs);
103 void   GetWidgetTextString(Widget, char **);
104 void   PutWidgetTextString (Widget wid, char *pszText);
105 char * GetCoreName(char *pszFullName);
106 char **GetIconSearchPathList(void);
107 void   FreeIconSearchPathList(char **);
108 void   TurnOnHourGlassAllWindows();
109 void   TurnOffHourGlassAllWindows();
110 char * ReplaceSpaces(char *pszName);
111 void   SetIconData(Widget, char *, enum icon_size_range);
112 char * GetCorrectIconType(char *);
113 char * CreateMaskName(char *);
114 IconData * GetIconDataFromWid(Widget);
115
116
117 #endif /* _CMNRTNS_H_INCLUDED */