SVN_SILENT made messages (.desktop file)
[kdeartwork.git] / kscreensaver / xsavers / xlockmore.h
blob8508334ee266b17d34b4ddf0d5086744e864bfdf
1 #ifndef __XLOCK_XLOCK_H__
2 #define __XLOCK_XLOCK_H__
4 /*-
5 * @(#)xlock.h 4.00 97/01/01 xlockmore
7 * xlock.h - external interfaces for new modes and SYSV OS defines.
9 * Copyright (c) 1991 by Patrick J. Naughton.
11 * See xlock.c for copying information.
13 * Revision History:
15 * Changes of David Bagley <bagleyd@bigfoot.com>
16 * 12-May-95: Added defines for SunOS's Adjunct password file
17 * Dale A. Harris <rodmur@ecst.csuchico.edu>
18 * 18-Nov-94: Modified for QNX 4.2 w/ Metrolink X server from Brian Campbell
19 * <brianc@qnx.com>.
20 * 11-Jul-94: added Bool flag: inwindow, which tells xlock to run in a
21 * window from Greg Bowering <greg@cs.adelaide.edu.au>
22 * 11-Jul-94: patch for Solaris SYR4 from Chris P. Ross <cross@eng.umd.edu>
23 * 28-Jun-94: Reorganized shadow stuff
24 * 24-Jun-94: Reorganized
25 * 22-Jun-94: Modified for VMS
26 * <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
27 * 17-Jun-94: patched shadow passwords and bcopy and bzero for SYSV from
28 * <reggers@julian.uwo.ca>
29 * 21-Mar-94: patched the patch for AIXV3 and HP from
30 * <R.K.Lloyd@csc.liv.ac.uk>.
31 * 01-Dec-93: added patch for AIXV3 from
32 * (Tom McConnell, tmcconne@sedona.intel.com) also added a patch
33 * for HP-UX 8.0.
36 #include <X11/Xlib.h>
37 #include <X11/Xutil.h>
38 #include <X11/Xos.h>
39 #include <X11/Xresource.h>
41 #include <config-xsavers.h>
43 /* out of main.cpp */
44 #define MODE_NONE 0
45 #define MODE_INSTALL 1
46 #define MODE_SETUP 2
47 #define MODE_PREVIEW 3
48 #define MODE_TEST 4
51 #ifndef MAXSCREENS
52 #define MAXSCREENS 3
53 #endif
54 #ifndef NUMCOLORS
55 #define NUMCOLORS 64
56 #endif
57 #ifndef MESSAGELINES
58 #define MESSAGELINES 40
59 #endif
60 #define PASSLENGTH 120
61 #define FALLBACK_FONTNAME "fixed"
62 #ifndef DEF_MFONT
63 #define DEF_MFONT "-*-times-*-*-*-*-18-*-*-*-*-*-*-*"
64 #endif
65 #ifndef DEF_PROGRAM /* Try the -o option ;) */
66 #define DEF_PROGRAM "fortune -s"
67 #endif
69 #ifndef DEF_NONE3D
70 #define DEF_NONE3D "Black"
71 #endif
72 #ifndef DEF_RIGHT3D
73 #define DEF_RIGHT3D "Red"
74 #endif
75 #ifndef DEF_LEFT3D
76 #define DEF_LEFT3D "Blue"
77 #endif
78 #ifndef DEF_BOTH3D
79 #define DEF_BOTH3D "Magenta"
80 #endif
82 #ifndef DEF_ICONW
83 #define DEF_ICONW 64 /* Age old default */
84 #endif
85 #ifndef DEF_ICONH
86 #define DEF_ICONH 64
87 #endif
89 #define MINICONW 1 /* Will not see much */
90 #define MINICONH 1
92 #ifndef MAXICONW
93 #define MAXICONW 256 /* Want users to know the screen is locked */
94 #endif
95 #ifndef MAXICONH
96 #define MAXICONH 256 /* by a particular user */
97 #endif
99 #ifndef MIN
100 #define MIN(a,b) (((a)<(b))?(a):(b))
101 #endif
103 #ifndef MAX
104 #define MAX(a,b) (((a)>(b))?(a):(b))
105 #endif
107 #ifndef ABS
108 #define ABS(a) ((a<0)?(-(a)):(a))
109 #endif
111 #include <math.h>
112 #ifndef M_E
113 #define M_E 2.7182818284590452354
114 #endif
115 #ifndef M_PI
116 #define M_PI 3.14159265358979323846
117 #endif
118 #ifndef M_PI_2
119 #define M_PI_2 1.57079632679489661923
120 #endif
121 #if VMS
122 #include <unixlib.h>
123 #endif
124 #include <sys/types.h>
125 #if 0
126 #ifndef uid_t
127 #define uid_t int
128 #endif
129 #ifndef gid_t
130 #define gid_t int
131 #endif
132 #ifndef pid_t
133 #define pid_t int
134 #endif
135 #ifndef size_t
136 #define size_t unsigned
137 #endif
138 #endif
139 #include <unistd.h>
140 #if HAVE_MEMORY_H
141 #include <memory.h>
142 #endif
143 #include <stdio.h>
144 #include <string.h>
145 #include <stdlib.h>
146 #if HAVE_DIRENT_H
147 #ifdef USE_XVMSUTILS
148 #if 0
149 #include "../xvmsutils/unix_types.h"
150 #include "../xvmsutils/dirent.h"
151 #else
152 #include <X11/unix_types.h>
153 #include <X11/dirent.h>
154 #endif
155 #else /* !USE_XVMSUTILS */
156 #include <dirent.h>
157 #endif /* !USE_XVMSUTILS */
158 #else
159 #define dirent direct
160 #define NAMELEN(dirent) (dirent)->d_namelen
161 #if HAVE_SYS_NDIR_H
162 #include <sys/ndir.h>
163 #endif
164 #if HAVE_SYS_DIR_H
165 #include <sys/dir.h>
166 #endif
167 #if HAVE_NDIR_H
168 #include <ndir.h>
169 #endif
170 #endif
171 #ifndef MAXNAMLEN
172 #define MAXNAMLEN 256 /* maximum filename length */
173 #endif
174 #ifndef DIRBUF
175 #define DIRBUF 512 /* buffer size for fs-indep. dirs */
176 #endif
178 typedef struct {
179 GC gc; /* graphics context for animation */
180 int npixels; /* number of valid entries in pixels */
181 Colormap cmap; /* current colormap */
182 unsigned long pixels[NUMCOLORS]; /* pixel values in the colormap */
183 unsigned long bgcol, fgcol; /* background and foreground pixel values */
184 unsigned long rightcol, leftcol; /* 3D color pixel values */
185 unsigned long nonecol, bothcol;
186 } perscreen;
188 #define t_String 0
189 #define t_Float 1
190 #define t_Int 2
191 #define t_Bool 3
193 typedef struct {
194 caddr_t *var;
195 char *name;
196 char *classname;
197 char *def;
198 int type;
199 } argtype;
201 typedef struct {
202 char *opt;
203 char *desc;
204 } OptionStruct;
206 typedef struct {
207 int numopts;
208 XrmOptionDescRec *opts;
209 int numvarsdesc;
210 argtype *vars;
211 OptionStruct *desc;
212 } ModeSpecOpt;
214 /* this must follow definition of ModeSpecOpt */
215 #include "mode.h"
217 #define IS_XBMDONE 1 /* Only need one mono image */
218 #define IS_XBM 2
219 #define IS_XBMFILE 3
220 #define IS_XPM 4
221 #define IS_XPMFILE 5
222 #define IS_RASTERFILE 6
224 extern void getResources(int argc, char **argv);
225 extern unsigned long allocPixel(Display * display, Colormap cmap,
226 char *name, char *def);
227 extern void setColormap(Display * display, Window window, Colormap map,
228 Bool inwindow);
229 extern void reserveColors(ModeInfo * mi, Colormap cmap,
230 unsigned long *blackpix, unsigned long *whitepix);
231 extern void fixColormap(Display * display, Window window,
232 int screen, float saturation,
233 Bool mono, Bool install, Bool inroot, Bool inwindow, Bool verbose);
234 extern int visualClassFromName(char *name);
235 extern void showVisualInfo(XVisualInfo * wantVis);
236 #ifdef USE_GL
237 extern int getVisual(ModeInfo * mi, XVisualInfo * wantVis, int mono);
238 #endif
240 extern unsigned long seconds(void);
241 extern void finish(void);
242 extern void error(char *s1,...);
243 extern void warning(char *s1,...);
245 #ifndef HAVE_STRDUP
246 extern char *strdup(char *);
247 #endif
249 #ifdef MATHF
250 #define SINF(n) sinf(n)
251 #define COSF(n) cosf(n)
252 #define FABSF(n) fabsf(n)
253 #else
254 #define SINF(n) ((float)sin((double)(n)))
255 #define COSF(n) ((float)cos((double)(n)))
256 #define FABSF(n) ((float)fabs((double)(n)))
257 #endif
259 #endif /* __XLOCK_XLOCK_H__ */