1 /***************************************************************************** 2 * 3 * Authors: Michel Eyckmans (MCE) & Stefan De Troch (SDT) 4 * 5 * Content: This file is part of version 2.x of xautolock. It takes care 6 * of most OS dependencies, and defines the program's default 7 * settings. 8 * 9 * Please send bug reports etc. to eyckmans@imec.be. 10 * 11 * -------------------------------------------------------------------------- 12 * 13 * Copyright 1990, 1992-1999, 2001-2002, 2004, 2007 by Stefan De Troch and 14 * Michel Eyckmans. 15 * 16 * Versions 2.0 and above of xautolock are available under version 2 of the 17 * GNU GPL. Earlier versions are available under other conditions. For more 18 * information, see the License file. 19 * 20 *****************************************************************************/ 21 22 #ifndef __config_h 23 #define __config_h 24 25 #if defined(hpux) || defined (__hpux) 26 #ifndef _HPUX_SOURCE 27 #define _HPUX_SOURCE 28 #endif /* _HPUX_SOURCE */ 29 #endif /* hpux || __hpux */ 30 31 #include <stdio.h> 32 #include <string.h> 33 #include <stdlib.h> 34 #include <time.h> 35 #include <signal.h> 36 #include <ctype.h> 37 #include <sys/types.h> 38 39 #ifndef VMS 40 #include <pwd.h> 41 #include <sys/wait.h> 42 #endif /* VMS */ 43 44 #ifdef VMS 45 #define HasVFork 46 #include <descrip.h> 47 #include <clidef.h> 48 #include <lib$routines.h> 49 #include <ssdef.h> 50 #include <ssdef.h> 51 #include <processes.h> 52 #include <unixio.h> /* Needed for close () */ 53 #include <unixlib.h> /* Needed for getpid () */ 54 #endif /* VMS */ 55 56 #include <X11/Xos.h> 57 #include <X11/Xlib.h> 58 #include <X11/Xutil.h> 59 #include <X11/Xatom.h> 60 #include <X11/Xresource.h> 61 62 #ifdef HasXidle 63 #include "xidle.h" 64 #endif /* HasXidle */ 65 66 #ifdef HasScreenSaver 67 #include <X11/extensions/scrnsaver.h> 68 #endif /* HasScreenSaver */ 69 70 #ifndef HasVFork 71 #define vfork fork 72 #endif /* HasVFork */ 73 74 #define SECURE False /* default -secure setting */ 75 #define BELL_PERCENT 40 /* as is says */ 76 77 #define MIN_LOCK_MINS 1 /* minimum number of minutes 78 before firing up the locker */ 79 #define LOCK_MINS 10 /* default ... */ 80 #define MAX_LOCK_MINS 60 /* maximum ... */ 81 82 #define MIN_KILL_MINS 10 /* minimum number of minutes 83 before firing up the killer */ 84 #define KILL_MINS 20 /* default ... */ 85 #define MAX_KILL_MINS 120 /* maximum ... */ 86 87 #define CREATION_DELAY 30 /* should be > 10 and 88 < min(45,(MIN_LOCK_MINS*30)) */ 89 #define CORNER_SIZE 10 /* size in pixels of the 90 force-lock areas */ 91 #define CORNER_DELAY 5 /* number of seconds to wait 92 before forcing a lock */ 93 94 #ifdef VMS 95 #define SLOW_VMS_DELAY 15 /* explained in VMS.NOTES file */ 96 #endif /* VMS */ 97 98 #ifdef VMS 99 #define LOCKER "mcr sys$system:decw$pausesession" 100 /* default locker command */ 101 #else /* VMS */ 102 #define LOCKER "xlock" /* default locker command (avoid 103 the -allowRoot option!) */ 104 #endif /* VMS */ 105 #define NOTIFIER "" /* default notifier command */ 106 #define KILLER "" /* default killer command */ 107 108 #define DUMMY_RES_CLASS "_xAx_" /* some X versions don't like a 0 109 class name, and implementing real 110 classes isn't worth it */ 111 #define APPLIC_CLASS "Xautolock" /* application class */ 112 113 114 #ifdef VMS 115 116 #if defined (VAX) && defined (vaxc) 117 typedef long pid_t; 118 #endif /* VAX && vaxc */ 119 120 /* 121 * Different versions of the DEC C compiler for OpenVMS Alpha define 122 * pid_t in different ways. Later versions define either __PID_T (v5.2) 123 * or __DEV_T (V5.0) when pid_t is already typedef'ed. DEC C V1.3 did 124 * neither, so typedef if those aren't defined. 125 */ 126 #if defined (__DECC) && defined (__alpha) \ 127 && !defined (____PID_T) && !defined (__DEV_T) 128 typedef long pid_t; 129 #endif /* __DECC && __alpha && !____PID_T && !__DEV_T */ 130 131 #endif /* VMS */ 132 133 #endif /* __config_h */ 134