Back to index

kdeartwork  4.3.2
xlock.h
Go to the documentation of this file.
00001 #ifndef __XLOCK_H__
00002 #define __XLOCK_H__
00003 
00004 /*-
00005  * @(#)xlock.h       3.3 95/09/24 xlockmore 
00006  *
00007  * xlock.h - external interfaces for new modes and SYSV OS defines.
00008  *
00009  * Copyright (c) 1991 by Patrick J. Naughton.
00010  *
00011  * See xlock.c for copying information.
00012  *
00013  * Revision History:
00014  *
00015  * Changes of David Bagley <bagleyd@source.asset.com>
00016  * 12-May-95: Added defines for SunOS's Adjunct password file
00017  *            Dale A. Harris <rodmur@ecst.csuchico.edu>
00018  * 18-Nov-94: Modified for QNX 4.2 w/ Metrolink X server from Brian Campbell
00019  *            <brianc@qnx.com>.
00020  * 11-Jul-94: added Bool flag: inwindow, which tells xlock to run in a
00021  *            window from Greg Bowering <greg@cs.adelaide.edu.au>
00022  * 11-Jul-94: patch for Solaris SYR4 from Chris P. Ross <cross@eng.umd.edu>
00023  * 28-Jun-94: Reorganized shadow stuff
00024  * 24-Jun-94: Reorganized
00025  * 22-Jun-94: Modified for VMS
00026  *            <Anthony.D.Clarke@Support.Hatfield.Raytheon.bae.eurokom.ie>
00027  * 17-Jun-94: patched shadow passwords and bcopy and bzero for SYSV from
00028  *            <reggers@julian.uwo.ca>
00029  * 21-Mar-94: patched the patch for AIXV3 and HP from
00030  *            <R.K.Lloyd@csc.liv.ac.uk>.
00031  * 01-Dec-93: added patch for AIXV3 from
00032  *            (Tom McConnell, tmcconne@sedona.intel.com) also added a patch
00033  *            for HP-UX 8.0.
00034  *
00035  */
00036 
00037 #include <qapplication.h> // hack for qt-1.2
00038 #include <X11/Xlib.h>
00039 #include <X11/Xutil.h>
00040 #include <X11/Xos.h>
00041 #include <X11/Xresource.h>
00042 
00043 // added for kscreensaver
00044 void initXLock( GC gc );
00045 
00046 
00047 #define MAXSCREENS        1
00048 #define NUMCOLORS         64
00049 #ifndef KERBEROS
00050 #define PASSLENGTH        64
00051 #else
00052 #define PASSLENGTH        120
00053 #endif
00054 #define FALLBACK_FONTNAME "fixed"
00055 #ifndef DEF_MFONT
00056 #define DEF_MFONT "-*-times-*-*-*-*-18-*-*-*-*-*-*-*"
00057 #endif
00058 #ifndef DEF_PROGRAM  /* Try the -o option ;) */
00059 #define DEF_PROGRAM "fortune -s"
00060 #endif
00061 
00062 #define ICONW             64
00063 #define ICONH             64
00064 
00065 #ifndef min
00066 #define min(a,b) ((a)<(b)?(a):(b))
00067 #endif
00068 
00069 #if defined VMS || defined __QNX__
00070 #ifdef VMS
00071 /*#define VMS_PLAY*/
00072 #include <unixlib.h>
00073 #endif
00074 #endif
00075 
00076 #include <math.h>
00077 
00078 #ifndef M_E
00079 #define M_E    2.7182818284590452354
00080 #endif
00081 #ifndef M_PI
00082 #define M_PI   3.14159265358979323846
00083 #endif
00084 #ifndef M_PI_2
00085 #define M_PI_2 1.57079632679489661923
00086 #endif
00087 
00088 #if !defined (news1800) && !defined (sun386)
00089 #include <stdlib.h>
00090 #if !defined (apollo) && !defined (VMS)
00091 #include <unistd.h>
00092 #include <memory.h>
00093 #endif
00094 #endif
00095 #include <stdio.h>
00096 #include <string.h>
00097  
00098 typedef struct {
00099   GC            gc;                /* graphics context for animation */
00100   int           npixels;           /* number of valid entries in pixels */
00101   Colormap      cmap;              /* current colormap */
00102   unsigned long pixels[NUMCOLORS]; /* pixel values in the colormap */
00103   unsigned long bgcol, fgcol;      /* background and foreground pixel values */
00104 } perscreen;
00105 
00106 /* This stuff moved here from resource.c for the mode-specific options. */
00107 #define t_String        0
00108 #define t_Float         1
00109 #define t_Int           2
00110 #define t_Bool          3
00111 
00112 typedef struct {
00113     caddr_t    *var;
00114     char       *name;
00115     char       *arg_class;
00116     char       *def;
00117     int         type;
00118 } argtype;
00119 
00120 typedef struct {
00121     char       *opt;
00122     char       *desc;
00123 } OptionStruct;
00124 
00125 typedef struct {
00126     int              numopts;
00127     XrmOptionDescRec *opts;
00128     argtype          *vars;
00129     OptionStruct     *desc;
00130 } ModeSpecOpt;
00131 /* End moved from resource.c */
00132 
00133 extern perscreen Scr[MAXSCREENS];
00134 extern Display *dsp;
00135 extern int  screen;
00136 
00137 extern char  *ProgramName;
00138 extern char  *fontname;
00139 extern char  *background;
00140 extern char  *foreground;
00141 extern char  *text_name;
00142 extern char  *text_pass;
00143 extern char  *text_info;
00144 extern char  *text_valid;
00145 extern char  *text_invalid;
00146 extern char  *geometry;
00147 extern float saturation;
00148 extern int   nicelevel;
00149 extern int   delay;
00150 extern int   batchcount;
00151 extern int   cycles;
00152 extern int   timeout;
00153 extern int   lockdelay;
00154 #if defined(HAS_RPLAY) || defined(VMS_PLAY)
00155 extern char  *locksound;
00156 extern char  *infosound;
00157 extern char  *validsound;
00158 /*extern char  *invalidsound;*/
00159 #endif
00160 #ifdef AUTO_LOGOUT
00161 extern int   forceLogout;
00162 #endif
00163 #ifdef LOGOUT_BUTTON
00164 extern int   enable_button;
00165 extern char  *logoutButtonLabel;
00166 extern char  *logoutButtonHelp;
00167 extern char  *logoutFailedString;
00168 #endif
00169 extern Bool  usefirst;
00170 extern Bool  mono;
00171 extern Bool  nolock;
00172 extern Bool  allowroot;
00173 extern Bool  enablesaver;
00174 extern Bool  allowaccess;
00175 extern Bool  grabmouse;
00176 extern Bool  echokeys;
00177 extern Bool  verbose;
00178 extern Bool  inwindow;
00179 extern Bool  inroot;
00180 extern Bool  timeelapsed;
00181 extern Bool  install;
00182 extern int   onepause;
00183 
00184 /* For modes with text, marquee & nose */
00185 extern char *program;
00186 extern char *messagesfile;
00187 extern char *messagefile;
00188 extern char *message;
00189 extern char *mfont;
00190 
00191 extern void  (*callback) ();
00192 extern void  (*init) ();
00193 
00194 extern void GetResources();
00195 extern void set_colormap();
00196 extern void fix_colormap();
00197 #ifdef __STDC__
00198 extern void error(char *, ...);
00199 #else
00200 extern void error();
00201 #endif
00202 extern void alarm_ctl();
00203 extern long seconds();
00204 
00205 /* For modes with text, marquee & nose */
00206 extern XFontStruct *get_font();
00207 extern char *get_words();
00208 extern void init_words();
00209 extern int is_ribbon();
00210 
00211 #ifdef LESS_THAN_AIX3_2
00212 #undef NULL
00213 #define NULL 0
00214 #endif /* LESS_THAN_AIX3_2 */
00215 
00216 #ifdef VMS
00217 #define OLD_EVENT_LOOP
00218 #endif
00219 
00220 #if defined(__STDC__) && (defined(__hpux) && defined(_PA_RISC1_1))
00221 #define MATHF
00222 #endif
00223 #ifdef MATHF
00224 #define SINF(n) sinf(n)
00225 #define COSF(n) cosf(n)
00226 #define FABSF(n) fabsf(n)
00227 #else
00228 #define SINF(n) ((float)sin((double)(n)))
00229 #define COSF(n) ((float)cos((double)(n)))
00230 #define FABSF(n) ((float)fabs((double)(n)))
00231 #endif
00232 
00233 #endif /* __XLOCK_H__ */