/* demo-Xm.c --- implements the interactive demo-mode and options dialogs.
- * xscreensaver, Copyright (c) 1993-1999 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1993-2001 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
# ifndef XmNtextField /* Lesstif 0.89.4 bug */
# undef HAVE_XMCOMBOBOX
# endif
+# if (XmVersion < 2001) /* Lesstif has two personalities these days */
+# undef HAVE_XMCOMBOBOX
+# endif
#endif /* HAVE_XMCOMBOBOX */
#include "version.h"
*s2 = 0;
s2 += 2;
- sprintf (buf, "%s\n%s\n\n"
- "For updates, check http://www.jwz.org/xscreensaver/",
+ sprintf (buf, "%s\n%s\n"
+ "\n"
+ "This is the Motif version of \"xscreensaver-demo\". The Motif\n"
+ "version is no longer maintained. Please use the GTK version\n"
+ "instead, which has many more features.\n"
+ "\n"
+ "For xscreensaver updates, check http://www.jwz.org/xscreensaver/",
s, s2);
free (s);
}
-static char *
-make_pretty_name (const char *shell_command)
-{
- char *s = strdup (shell_command);
- char *s2;
- char res_name[255];
-
- for (s2 = s; *s2; s2++) /* truncate at first whitespace */
- if (isspace (*s2))
- {
- *s2 = 0;
- break;
- }
-
- s2 = strrchr (s, '/'); /* if pathname, take last component */
- if (s2)
- {
- s2 = strdup (s2+1);
- free (s);
- s = s2;
- }
-
- if (strlen (s) > 50) /* 51 is hereby defined as "unreasonable" */
- s[50] = 0;
-
- sprintf (res_name, "hacks.%s.name", s); /* resource? */
- s2 = get_string_resource (res_name, res_name);
- if (s2)
- return s2;
-
- for (s2 = s; *s2; s2++) /* if it has any capitals, return it */
- if (*s2 >= 'A' && *s2 <= 'Z')
- return s;
-
- if (s[0] >= 'a' && s[0] <= 'z') /* else cap it */
- s[0] -= 'a'-'A';
- if (s[0] == 'X' && s[1] >= 'a' && s[1] <= 'z') /* (magic leading X) */
- s[1] -= 'a'-'A';
- return s;
-}
-
-
/* Finds the number of the last hack to run, and makes that item be
selected by default.
*/
{
char *pretty_name = (h[0]->name
? strdup (h[0]->name)
- : make_pretty_name (h[0]->command));
+ : make_hack_name (h[0]->command));
XmString xmstr = XmStringCreate (pretty_name, XmSTRING_DEFAULT_CHARSET);
XmListAddItem (list, xmstr, 0);
}
}
+#ifdef HAVE_XF86VMODE_GAMMA
+ found_any_writable_cells = True; /* if we can gamma fade, go for it */
+#endif
+
XtVaSetValues (name_to_widget (top, "fadeSecondsLabel"), XtNsensitive,
found_any_writable_cells, 0);
XtVaSetValues (name_to_widget (top, "fadeTicksLabel"), XtNsensitive,
char *prog_name = strdup (hack->command);
char *pretty_name = (hack->name
? strdup (hack->name)
- : make_pretty_name (hack->command));
+ : make_hack_name (hack->command));
char doc_name[255], doc_class[255];
char *s, *s2;
}
else
{
+# if 0
static int doc_installed = 0;
if (doc_installed == 0)
{
"To fix this problem, delete that file, or "
"install a current version (either will work.)");
else
- doc_string = strdup ("");
+# endif /* 0 */
+ doc_string = strdup (
+ "\n"
+ "This is the Motif version of \"xscreensaver-demo\". The Motif "
+ "version is no longer maintained. Please use the GTK version "
+ "instead, which has many more features."
+ "\n\n"
+ "If you were running the GTK version, there would be a preview "
+ "of this screen saver mode displayed here, along with graphical "
+ "configuration options.");
}
return doc_string;
char *pretty_name = (hack
? (hack->name
? strdup (hack->name)
- : make_pretty_name (hack->command))
+ : make_hack_name (hack->command))
: 0);
char *doc_string = hack ? get_hack_blurb (hack) : 0;
demo_ehandler (Display *dpy, XErrorEvent *error)
{
fprintf (stderr, "\nX error in %s:\n", progname);
- if (XmuPrintDefaultErrorMessage (dpy, error, stderr))
- exit (-1);
- else
- fprintf (stderr, " (nonfatal.)\n");
+ XmuPrintDefaultErrorMessage (dpy, error, stderr);
+ exit (-1);
return 0;
}