http://se.aminet.net/pub/X11/ftp.x.org/contrib/vms/xscreensaver-124.zip
[xscreensaver] / driver / demo.c
old mode 100644 (file)
new mode 100755 (executable)
index ec95724..3391622
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1993 Jamie Zawinski <jwz@lucid.com>
+/* xscreensaver, Copyright (c) 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 "xscreensaver.h"
 #include <stdio.h>
 
-extern Time timeout, cycle, lock_timeout, passwd_timeout;
+extern Time timeout, cycle, lock_timeout;
+#ifndef NO_LOCKING
+extern Time passwd_timeout;
+#endif
 extern int fade_seconds, fade_ticks;
 extern Bool verbose_p, install_cmap_p, fade_p, unfade_p;
 extern Bool lock_p, locking_disabled_p;
@@ -31,6 +34,9 @@ extern Bool lock_p, locking_disabled_p;
 static void demo_mode_hack P((char *));
 static void demo_mode_done P((void));
 
+static void focus_fuckus P((Widget dialog));
+static void text_cb P((Widget button, XtPointer, XtPointer));
+
 extern void demo_mode_restart_process ();
 
 extern Widget demo_dialog;
@@ -182,7 +188,7 @@ pop_up_dialog_box (dialog, form, where)
      It's important that the screensaver dialogs not get decorated or
      otherwise reparented by the window manager, because they need to be
      children of the *real* root window, not the WM's virtual root, in
-     order for us to guarentee tha they are visible above the screensaver
+     order for us to guarentee that they are visible above the screensaver
      window itself.
    */
   Arg av [100];
@@ -220,7 +226,7 @@ pop_up_dialog_box (dialog, form, where)
   XtSetArg (av [ac], XtNoverrideRedirect, True); ac++;
   XtSetArg (av [ac], XmNdefaultPosition, False); ac++;
   /* I wonder whether this does anything useful? */
-/* XtSetArg (av [ac], XmNdialogStyle, XmDIALOG_SYSTEM_MODAL); ac++; */
+  /*  XtSetArg (av [ac], XmNdialogStyle, XmDIALOG_SYSTEM_MODAL); ac++; */
   XtSetValues (dialog, av, ac);
   XtSetValues (form, av, ac);
   XtManageChild (form);
@@ -238,7 +244,6 @@ make_screenhack_dialog (parent, hacks)
   Arg av[10];
   int ac;
   char *label;
-  Dimension max_w = 0;
   XmString xm_label = 0;
   XmString new_xm_label;
 
@@ -259,16 +264,16 @@ make_screenhack_dialog (parent, hacks)
   XtFree (label);
 
   XtAddCallback (demo_list, XmNbrowseSelectionCallback, select_cb,
-                hacks);
+                (XtPointer) hacks);
   XtAddCallback (demo_list, XmNdefaultActionCallback, select_cb,
-                hacks);
+                (XtPointer) hacks);
 
   XtAddCallback (text_line, XmNactivateCallback, text_cb, 0);
   XtAddCallback (next, XmNactivateCallback, next_cb, 0);
   XtAddCallback (prev, XmNactivateCallback, prev_cb, 0);
   XtAddCallback (done, XmNactivateCallback, done_cb, 0);
   XtAddCallback (restart, XmNactivateCallback, restart_cb, 0);
-  XtAddCallback (edit, XmNactivateCallback, edit_cb, parent);
+  XtAddCallback (edit, XmNactivateCallback, edit_cb, (XtPointer) parent);
 
   for (; *hacks; hacks++)
     {
@@ -386,7 +391,9 @@ res_done_cb (button, client_data, call_data)
   timeout = res.timeout * 1000;
   cycle = res.cycle * 1000;
   lock_timeout = res.lock_time * 1000;
+#ifndef NO_LOCKING
   passwd_timeout = res.passwd_time * 1000;
+#endif
   fade_seconds = res.secs;
   fade_ticks = res.ticks;
   verbose_p = res.verb;
@@ -410,7 +417,8 @@ make_resources_dialog (parent)
   XtAddCallback (res_cancel, XmNactivateCallback, res_cancel_cb, 0);
 
 #define CB(widget,type,slot) \
-       XtAddCallback ((widget), XmNvalueChangedCallback, (type), (slot))
+       XtAddCallback ((widget), XmNvalueChangedCallback, (type), \
+                      (XtPointer) (slot))
   CB (timeout_text,    res_min_cb,  &res.timeout);
   CB (cycle_text,      res_min_cb,  &res.cycle);
   CB (fade_text,       res_sec_cb,  &res.secs);
@@ -481,7 +489,9 @@ pop_resources_dialog ()
   res.timeout = timeout / 1000;
   res.cycle = cycle / 1000;
   res.lock_time = lock_timeout / 1000;
+#ifndef NO_LOCKING
   res.passwd_time = passwd_timeout / 1000;
+#endif
   res.secs = fade_seconds;
   res.ticks = fade_ticks;
   res.verb = verbose_p;