~ubuntu-branches/ubuntu/quantal/xscreensaver/quantal

« back to all changes in this revision

Viewing changes to OSX/XScreenSaverView.m

  • Committer: Bazaar Package Importer
  • Author(s): Ted Gould
  • Date: 2008-08-28 16:15:25 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080828161525-mxga521aoezxjq8h
Tags: 5.07-0ubuntu1
* Upgrade upstream version
* debian/control: Remove suggest xdaliclock as it is no longer
  included
* Remove 10_jwz-screensaver-randr-patch-3.patch as it has been merged
  upstream.
* Add 24_hacks_xsublim_enable.patch as it seems that xsublim was dropped
  from the build files.  There is nothing in the Changelog about it
  so I believe it was accidental.
* Updating the .desktop files from the XML files using gnome-screensaver's
  utility to do so.  Lots of text updates.  Also:
    * Added: abstractile.desktop
    * Added: cwaves.desktop
    * Added: m6502.desktop
    * Added: skytentacles.desktop
    * Removed: xteevee.desktop
* xscreensaver-gl-extra.files: Added skytentacles
* xscreensaver-data-extra.files: Added abstractile, cwaves and m6502
* xscreensaver-data.files: Remove partial abstractile, m6502 and cwaves

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
    { "-choose-random-images",   ".chooseRandomImages",XrmoptionNoArg, "True" },
127
127
    { "-no-choose-random-images",".chooseRandomImages",XrmoptionNoArg, "False"},
128
128
    { "-image-directory",        ".imageDirectory",    XrmoptionSepArg, 0 },
 
129
    { "-fps",                    ".doFPS",             XrmoptionNoArg, "True" },
 
130
    { "-no-fps",                 ".doFPS",             XrmoptionNoArg, "False"},
129
131
    { 0, 0, 0, 0 }
130
132
  };
131
133
  static const char *default_defaults [] = {
 
134
    ".doFPS:              False",
132
135
    ".textMode:           date",
133
136
 // ".textLiteral:        ",
134
137
 // ".textFile:           ",
262
265
 
263
266
    [self lockFocus];       // in case something tries to draw from here
264
267
    [self prepareContext];
 
268
 
 
269
    /* I considered just not even calling the free callback at all...
 
270
       But webcollage-cocoa needs it, to kill the inferior webcollage
 
271
       processes (since the screen saver framework never generates a
 
272
       SIGPIPE for them...)  Instead, I turned off the free call in
 
273
       xlockmore.c, which is where all of the bogus calls are anyway.
 
274
     */
265
275
    xsft->free_cb (xdpy, xwindow, xdata);
266
276
    [self unlockFocus];
267
277
 
286
296
{
287
297
}
288
298
 
 
299
 
 
300
static void
 
301
screenhack_do_fps (Display *dpy, Window w, fps_state *fpst, void *closure)
 
302
{
 
303
  fps_compute (fpst, 0);
 
304
  fps_draw (fpst);
 
305
}
 
306
 
 
307
 
289
308
- (void) animateOneFrame
290
309
{
291
310
  if (!initted_p) {
333
352
      (void *(*) (Display *, Window, void *)) xsft->init_cb;
334
353
    
335
354
    xdata = init_cb (xdpy, xwindow, xsft->setup_arg);
 
355
 
 
356
    if (get_boolean_resource (xdpy, "doFPS", "DoFPS")) {
 
357
      fpst = fps_init (xdpy, xwindow);
 
358
      if (! xsft->fps_cb) xsft->fps_cb = screenhack_do_fps;
 
359
    }
336
360
  }
337
361
 
338
362
  /* I don't understand why we have to do this *every frame*, but we do,
341
365
  if (![self isPreview])
342
366
    [NSCursor setHiddenUntilMouseMoves:YES];
343
367
 
 
368
 
 
369
  if (fpst)
 
370
    {
 
371
      /* This is just a guess, but the -fps code wants to know how long
 
372
         we were sleeping between frames.
 
373
       */
 
374
      unsigned long usecs = 1000000 * [self animationTimeInterval];
 
375
      usecs -= 200;  // caller apparently sleeps for slightly less sometimes...
 
376
      fps_slept (fpst, usecs);
 
377
    }
 
378
 
 
379
 
344
380
  /* It turns out that [ScreenSaverView setAnimationTimeInterval] does nothing.
345
381
     This is bad, because some of the screen hacks want to delay for long 
346
382
     periods (like 5 seconds or a minute!) between frames, and running them
384
420
 
385
421
  // And finally:
386
422
  //
 
423
  NSDisableScreenUpdates();
387
424
  unsigned long delay = xsft->draw_cb (xdpy, xwindow, xdata);
388
 
  
 
425
  if (fpst) xsft->fps_cb (xdpy, xwindow, fpst, xdata);
389
426
  XSync (xdpy, 0);
390
 
  
 
427
  NSEnableScreenUpdates();
 
428
 
391
429
  gettimeofday (&tv, 0);
392
430
  now = tv.tv_sec + (tv.tv_usec / 1000000.0);
393
431
  next_frame_time = now + (delay / 1000000.0);
516
554
    case KeyRelease:
517
555
      {
518
556
        NSString *nss = [e characters];
519
 
        const char *s = [nss cStringUsingEncoding:NSUTF8StringEncoding];
 
557
        const char *s = [nss cStringUsingEncoding:NSISOLatin1StringEncoding];
520
558
        xe.xkey.keycode = (s && *s ? *s : 0);
521
559
        xe.xkey.state = state;
522
560
        break;