2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 /* $XConsortium: Srv.h /main/6 1996/09/25 08:32:34 barstow $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
26 * (c) Copyright 1993, 1994 International Business Machines Corp. *
27 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
28 * (c) Copyright 1993, 1994 Novell, Inc. *
30 /*************************************<+>*************************************
31 *****************************************************************************
35 ** Project: HP DT Style Manager (part of the session manager)
41 *******************************************************************
42 ** (c) Copyright Hewlett-Packard Company, 1990. All rights are
43 ** reserved. Copying or other reproduction of this program
44 ** except for archival purposes is prohibited without prior
45 ** written consent of Hewlett-Packard Company.
46 ********************************************************************
50 *****************************************************************************
51 *************************************<+>*************************************/
52 /* Standard C headers */
56 #include <sys/types.h>
64 #include <Dt/UserMsg.h>
67 #include <Xm/ColorObjP.h>
71 #define NUM_OF_COLORS 8
72 #define MAX_NUM_SCREENS 6
74 /* defines for foreground colors */
79 #define PALETTE_SUFFIX ".dp"
81 #define B_O_W "BlackWhite"
82 #define W_ONLY "White"
83 #define W_O_B "WhiteBlack"
84 #define B_ONLY "Black"
87 * macro to get message catalog strings
89 #ifndef NO_MESSAGE_CATALOG
91 # define _CLIENT_CAT_NAME "dtsession.cat"
93 # define _CLIENT_CAT_NAME "dtsession"
94 # endif /* __ultrix */
95 extern char *_DtGetMessage(char *filename, int set, int n, char *s);
96 # define GETMESSAGE(set, number, string)\
97 (_DtGetMessage(_CLIENT_CAT_NAME, set, number, string))
99 # define GETMESSAGE(set, number, string)\
103 /*******************************************************************************
104 * Color Palette data structures
106 ******************************************************************************/
109 ** Define a colorset as foreground, background, topshadow, bottomshadow
110 ** and selectcolor (also known as arm color).
112 typedef struct _colorset {
120 typedef struct _hsv {
127 ** Structure which stores the palettes for the customizer
129 typedef struct _palette {
133 ColorSet color[XmCO_MAX_NUM_COLORS];
135 short defaultInactive;
136 short defaultPrimary;
137 short defaultSecondary;
140 unsigned long converted_len;
141 struct _palette *prev;
142 struct _palette *next;
145 /****** Global Variables ********/
148 int TypeOfMonitor[MAX_NUM_SCREENS];
149 int FgColor[MAX_NUM_SCREENS];
150 Bool UsePixmaps[MAX_NUM_SCREENS];
151 Bool DynamicColor[MAX_NUM_SCREENS];
153 Atom XA_CUSTOMIZE[MAX_NUM_SCREENS];
155 Atom XA_PALETTE_NAME;
156 Atom XA_TYPE_MONITOR;
158 struct _palette *pCurrentPalette[MAX_NUM_SCREENS];
160 extern ColorSrv colorSrv; /* defined in SrvPalette.c */
162 #define MAX_STR_LEN 128
165 * Wrappers for system calls
167 #define SRV_MALLOC(SIZE) XtMalloc(SIZE)
168 #define SRV_REALLOC(PTR, SIZE) XtRealloc(PTR, SIZE)
169 #define SRV_FREE(PTR) XtFree(PTR)
170 #define SRV_EXIT(STATUS) exit(status)