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>
47 #define MODE_INSTALL 1
49 #define MODE_PREVIEW 3
60 #define MESSAGELINES 40
62 #define PASSLENGTH 120
63 #define FALLBACK_FONTNAME "fixed"
65 #define DEF_MFONT "-*-times-*-*-*-*-18-*-*-*-*-*-*-*"
67 #ifndef DEF_PROGRAM /* Try the -o option ;) */
68 #define DEF_PROGRAM "fortune -s"
72 #define DEF_NONE3D "Black"
75 #define DEF_RIGHT3D "Red"
78 #define DEF_LEFT3D "Blue"
81 #define DEF_BOTH3D "Magenta"
85 #define DEF_ICONW 64 /* Age old default */
91 #define MINICONW 1 /* Will not see much */
95 #define MAXICONW 256 /* Want users to know the screen is locked */
98 #define MAXICONH 256 /* by a particular user */
102 #define MIN(a,b) (((a)<(b))?(a):(b))
106 #define MAX(a,b) (((a)>(b))?(a):(b))
110 #define ABS(a) ((a<0)?(-(a)):(a))
115 #define M_E 2.7182818284590452354
118 #define M_PI 3.14159265358979323846
121 #define M_PI_2 1.57079632679489661923
126 #include <sys/types.h>
138 #define size_t unsigned
151 #include "../xvmsutils/unix_types.h"
152 #include "../xvmsutils/dirent.h"
154 #include <X11/unix_types.h>
155 #include <X11/dirent.h>
157 #else /* !USE_XVMSUTILS */
159 #endif /* !USE_XVMSUTILS */
161 #define dirent direct
162 #define NAMELEN(dirent) (dirent)->d_namelen
164 #include <sys/ndir.h>
174 #define MAXNAMLEN 256 /* maximum filename length */
177 #define DIRBUF 512 /* buffer size for fs-indep. dirs */
181 GC gc
; /* graphics context for animation */
182 int npixels
; /* number of valid entries in pixels */
183 Colormap cmap
; /* current colormap */
184 unsigned long pixels
[NUMCOLORS
]; /* pixel values in the colormap */
185 unsigned long bgcol
, fgcol
; /* background and foreground pixel values */
186 unsigned long rightcol
, leftcol
; /* 3D color pixel values */
187 unsigned long nonecol
, bothcol
;
210 XrmOptionDescRec
*opts
;
216 /* this must follow definition of ModeSpecOpt */
219 #define IS_XBMDONE 1 /* Only need one mono image */
224 #define IS_RASTERFILE 6
226 extern void getResources(int argc
, char **argv
);
227 extern unsigned long allocPixel(Display
* display
, Colormap cmap
,
228 char *name
, char *def
);
229 extern void setColormap(Display
* display
, Window window
, Colormap map
,
231 extern void reserveColors(ModeInfo
* mi
, Colormap cmap
,
232 unsigned long *blackpix
, unsigned long *whitepix
);
233 extern void fixColormap(Display
* display
, Window window
,
234 int screen
, float saturation
,
235 Bool mono
, Bool install
, Bool inroot
, Bool inwindow
, Bool verbose
);
236 extern int visualClassFromName(char *name
);
237 extern void showVisualInfo(XVisualInfo
* wantVis
);
239 extern int getVisual(ModeInfo
* mi
, XVisualInfo
* wantVis
, int mono
);
242 extern unsigned long seconds(void);
243 extern void finish(void);
244 extern void error(char *s1
,...);
245 extern void warning(char *s1
,...);
248 extern char *strdup(char *);
252 #define SINF(n) sinf(n)
253 #define COSF(n) cosf(n)
254 #define FABSF(n) fabsf(n)
256 #define SINF(n) ((float)sin((double)(n)))
257 #define COSF(n) ((float)cos((double)(n)))
258 #define FABSF(n) ((float)fabs((double)(n)))
261 #endif /* __XLOCK_XLOCK_H__ */