http://se.aminet.net/pub/X11/ftp.x.org/contrib/vms/xscreensaver-124.zip
[xscreensaver] / driver / windows.c
old mode 100644 (file)
new mode 100755 (executable)
index fb459ac..763a941
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1991-1993 Jamie Zawinski <jwz@lucid.com>
+/* xscreensaver, Copyright (c) 1991-1993 Jamie Zawinski <jwz@mcom.com>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
  */
 
 #include <stdio.h>
+
+#ifdef VMS
+typedef char * caddr_t;
+#endif
+
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
 #include <X11/Xos.h>
+#ifndef VMS
 #include <X11/Xmu/SysUtil.h>
+#else
+#include "sys$common:[decw$include.xmu]SysUtil.h"
+#endif
 
 #include <signal.h>            /* for the signal names */
 
 #include "xscreensaver.h"
 
 #if __STDC__
+#ifndef __DECC
 extern int kill (pid_t, int);          /* signal() is in sys/signal.h... */
+#else
+extern int kill (int, int);
+#endif
 #endif /* __STDC__ */
 
 extern Bool lock_p, demo_mode_p;
@@ -57,7 +70,7 @@ static Window real_vroot, real_vroot_value;
                GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime)
 
 void
-grab_keyboard_and_mouse ()
+grab_keyboard_and_mouse P((void))
 {
   Status status;
   XSync (dpy, False);
@@ -85,7 +98,7 @@ grab_keyboard_and_mouse ()
 }
 
 void
-ungrab_keyboard_and_mouse ()
+ungrab_keyboard_and_mouse P((void))
 {
   XUngrabPointer (dpy, CurrentTime);
   XUngrabKeyboard (dpy, CurrentTime);
@@ -167,8 +180,12 @@ ERROR!  You must not include vroot.h in this file.
 #endif
 
 static void
+#if __STDC__
+store_vroot_property (Window win, Window value)
+#else
 store_vroot_property (win, value)
      Window win, value;
+#endif
 {
 #if 0
   printf ("%s: storing XA_VROOT = 0x%x (%s) = 0x%x (%s)\n", progname, 
@@ -186,8 +203,12 @@ store_vroot_property (win, value)
 }
 
 static void
+#if __STDC__
+remove_vroot_property (Window win)
+#else
 remove_vroot_property (win)
      Window win;
+#endif
 {
 #if 0
   printf ("%s: removing XA_VROOT from 0x%x (%s)\n", progname, win, 
@@ -200,7 +221,7 @@ remove_vroot_property (win)
 
 
 static void
-kill_xsetroot_data ()
+kill_xsetroot_data P((void))
 {
   Atom type;
   int format;
@@ -246,7 +267,7 @@ kill_xsetroot_data ()
 static void handle_signals P((Bool on_p));
 
 static void
-save_real_vroot ()
+save_real_vroot P((void))
 {
   int i;
   Window root = RootWindowOfScreen (screen);
@@ -299,7 +320,7 @@ save_real_vroot ()
 }
 
 static Bool
-restore_real_vroot_1 ()
+restore_real_vroot_1 P((void))
 {
   if (verbose_p && real_vroot)
     printf ("%s: restoring __SWM_VROOT property on the real vroot (0x%x).\n",
@@ -349,10 +370,14 @@ restore_real_vroot_handler (sig)
 
 
 static void
+#if __STDC__
+catch_signal (int sig, char *signame, Bool on_p)
+#else
 catch_signal (sig, signame, on_p)
      int sig;
      char *signame;
      Bool on_p;
+#endif
 {
   if (! on_p)
     signal (sig, SIG_DFL);
@@ -386,14 +411,18 @@ handle_signals (on_p)
   catch_signal (SIGILL,  "SIGILL",  on_p);
   catch_signal (SIGTRAP, "SIGTRAP", on_p);
   catch_signal (SIGIOT,  "SIGIOT",  on_p);
+#ifndef VMS
   catch_signal (SIGABRT, "SIGABRT", on_p);
+#endif
 #ifdef SIGEMT
   catch_signal (SIGEMT,  "SIGEMT",  on_p);
 #endif
   catch_signal (SIGFPE,  "SIGFPE",  on_p);
   catch_signal (SIGBUS,  "SIGBUS",  on_p);
   catch_signal (SIGSEGV, "SIGSEGV", on_p);
+#ifdef SIGSYS
   catch_signal (SIGSYS,  "SIGSYS",  on_p);
+#endif
   catch_signal (SIGTERM, "SIGTERM", on_p);
 #ifdef SIGXCPU
   catch_signal (SIGXCPU, "SIGXCPU", on_p);
@@ -410,7 +439,7 @@ handle_signals (on_p)
 /* Managing the actual screensaver window */
 
 void
-initialize_screensaver_window ()
+initialize_screensaver_window P((void))
 {
   /* This resets the screensaver window as fully as possible, since there's
      no way of knowing what some random client may have done to us in the