1 #ifndef __XLOCK_XLOCK_H__
2 #define __XLOCK_XLOCK_H__
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.
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
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
37 #include <X11/Xutil.h>
39 #include <X11/Xresource.h>
41 #include <config-xsavers.h>
45 #define MODE_INSTALL 1
47 #define MODE_PREVIEW 3
58 #define MESSAGELINES 40
60 #define PASSLENGTH 120
61 #define FALLBACK_FONTNAME "fixed"
63 #define DEF_MFONT "-*-times-*-*-*-*-18-*-*-*-*-*-*-*"
65 #ifndef DEF_PROGRAM /* Try the -o option ;) */
66 #define DEF_PROGRAM "fortune -s"
70 #define DEF_NONE3D "Black"
73 #define DEF_RIGHT3D "Red"
76 #define DEF_LEFT3D "Blue"
79 #define DEF_BOTH3D "Magenta"
83 #define DEF_ICONW 64 /* Age old default */
89 #define MINICONW 1 /* Will not see much */
93 #define MAXICONW 256 /* Want users to know the screen is locked */
96 #define MAXICONH 256 /* by a particular user */
100 #define MIN(a,b) (((a)<(b))?(a):(b))
104 #define MAX(a,b) (((a)>(b))?(a):(b))
108 #define ABS(a) ((a<0)?(-(a)):(a))
113 #define M_E 2.7182818284590452354
116 #define M_PI 3.14159265358979323846
119 #define M_PI_2 1.57079632679489661923
124 #include <sys/types.h>
136 #define size_t unsigned
149 #include "../xvmsutils/unix_types.h"
150 #include "../xvmsutils/dirent.h"
152 #include <X11/unix_types.h>
153 #include <X11/dirent.h>
155 #else /* !USE_XVMSUTILS */
157 #endif /* !USE_XVMSUTILS */
159 #define dirent direct
160 #define NAMELEN(dirent) (dirent)->d_namelen
162 #include <sys/ndir.h>
172 #define MAXNAMLEN 256 /* maximum filename length */
175 #define DIRBUF 512 /* buffer size for fs-indep. dirs */
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
;
208 XrmOptionDescRec
*opts
;
214 /* this must follow definition of ModeSpecOpt */
217 #define IS_XBMDONE 1 /* Only need one mono image */
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
,
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
);
237 extern int getVisual(ModeInfo
* mi
, XVisualInfo
* wantVis
, int mono
);
240 extern unsigned long seconds(void);
241 extern void finish(void);
242 extern void error(char *s1
,...);
243 extern void warning(char *s1
,...);
246 extern char *strdup(char *);
250 #define SINF(n) sinf(n)
251 #define COSF(n) cosf(n)
252 #define FABSF(n) fabsf(n)
254 #define SINF(n) ((float)sin((double)(n)))
255 #define COSF(n) ((float)cos((double)(n)))
256 #define FABSF(n) ((float)fabs((double)(n)))
259 #endif /* __XLOCK_XLOCK_H__ */