~cyphermox/ubuntu/precise/xscreensaver/merge-5.15-2

« back to all changes in this revision

Viewing changes to hacks/apple2-main.c

  • Committer: Mathieu Trudel-Lapierre
  • Date: 2011-12-21 15:57:35 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: mathieu@canonical.com-20111221155735-m43kxy7824n1p36y
Merging shared upstream rev into target branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* xscreensaver, Copyright (c) 1998-2010 Jamie Zawinski <jwz@jwz.org>
 
1
/* xscreensaver, Copyright (c) 1998-2011 Jamie Zawinski <jwz@jwz.org>
2
2
 *
3
3
 * Permission to use, copy, modify, distribute, and sell this software and its
4
4
 * documentation for any purpose is hereby granted without fee, provided that
833
833
  mine->input_available_p = True;
834
834
}
835
835
 
 
836
/* The structure of closure linkage throughout this code is so amazingly
 
837
   baroque that I can't get to the 'struct state' from where I need it. */
 
838
static const char *global_program;
 
839
static Bool global_fast_p;
 
840
 
 
841
 
836
842
static void
837
843
launch_text_generator (struct terminal_controller_data *mine)
838
844
{
839
845
  XtAppContext app = XtDisplayToApplicationContext (mine->dpy);
840
846
  char buf[255];
841
 
  char *oprogram = get_string_resource (mine->dpy, "program", "Program");
 
847
  char *oprogram = strdup (global_program);
842
848
  char *program = (char *) malloc (strlen (oprogram) + 10);
843
849
 
844
850
  strcpy (program, "( ");
1478
1484
                                                 "Boolean");
1479
1485
  mine->swap_bs_del_p    = get_boolean_resource (mine->dpy, "swapBSDEL", 
1480
1486
                                                 "Boolean");
1481
 
  mine->fast_p           = get_boolean_resource (mine->dpy, "fast", "Boolean");
 
1487
  mine->fast_p           = global_fast_p;
1482
1488
 
1483
1489
  switch(*stepno) {
1484
1490
 
1907
1913
  basic_controller
1908
1914
};
1909
1915
 
1910
 
 
1911
 
 
1912
1916
struct state {
1913
1917
  int duration;
1914
1918
  Bool random_p;
1945
1949
    }
1946
1950
  if (s) free (s);
1947
1951
 
 
1952
  global_program = get_string_resource (dpy, "program", "Program");
 
1953
  global_fast_p = get_boolean_resource (dpy, "fast", "Boolean");
 
1954
 
 
1955
 
 
1956
  /* Kludge for MacOS standalone mode: see OSX/SaverRunner.m. */
 
1957
  {
 
1958
    const char *s = getenv ("XSCREENSAVER_STANDALONE");
 
1959
    if (s && *s && strcmp(s, "0"))
 
1960
      {
 
1961
        st->controller = terminal_controller;
 
1962
        st->random_p   = False;
 
1963
        global_program = getenv ("SHELL");
 
1964
        global_fast_p  = True;
 
1965
      }
 
1966
  }
 
1967
 
 
1968
 
1948
1969
  if (! st->random_p) {
1949
1970
    if (st->controller == terminal_controller ||
1950
1971
        st->controller == slideshow_controller)