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

« back to all changes in this revision

Viewing changes to hacks/deluxe.c

  • 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:
1
 
/* xscreensaver, Copyright (c) 1999-2006 Jamie Zawinski <jwz@jwz.org>
 
1
/* xscreensaver, Copyright (c) 1999-2008 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
120
120
  int s = (t->size + t->thickness) / 2;
121
121
  XPoint points[3];
122
122
 
123
 
  points[0].x = 0;        points[0].y = t->y - s;
124
 
  points[1].x = t->x - s; points[1].y = t->y - s;
125
 
  points[2].x = t->x - s; points[2].y = 0;
126
 
  XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
127
 
 
128
 
  points[0].x = 0;        points[0].y = t->y + s;
129
 
  points[1].x = t->x - s; points[1].y = t->y + s;
130
 
  points[2].x = t->x - s; points[2].y = t->max_size;
131
 
  XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
132
 
 
133
 
  points[0].x = t->x + s;    points[0].y = 0;
134
 
  points[1].x = t->x + s;    points[1].y = t->y - s;
135
 
  points[2].x = t->max_size; points[2].y = t->y - s;
136
 
  XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
137
 
 
138
 
  points[0].x = t->x + s;    points[0].y = t->max_size;
139
 
  points[1].x = t->x + s;    points[1].y = t->y + s;
140
 
  points[2].x = t->max_size; points[2].y = t->y + s;
141
 
  XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
 
123
  if (t->y > s)
 
124
    {
 
125
      points[0].x = 0;        points[0].y = t->y - s;
 
126
      points[1].x = t->x - s; points[1].y = t->y - s;
 
127
      points[2].x = t->x - s; points[2].y = 0;
 
128
      XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
 
129
 
 
130
      points[0].x = t->x + s;    points[0].y = 0;
 
131
      points[1].x = t->x + s;    points[1].y = t->y - s;
 
132
      points[2].x = t->max_size; points[2].y = t->y - s;
 
133
      XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
 
134
    }
 
135
 
 
136
  if (t->x > s)
 
137
    {
 
138
      points[0].x = 0;        points[0].y = t->y + s;
 
139
      points[1].x = t->x - s; points[1].y = t->y + s;
 
140
      points[2].x = t->x - s; points[2].y = t->max_size;
 
141
      XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
 
142
 
 
143
      points[0].x = t->x + s;    points[0].y = t->max_size;
 
144
      points[1].x = t->x + s;    points[1].y = t->y + s;
 
145
      points[2].x = t->max_size; points[2].y = t->y + s;
 
146
      XDrawLines (st->dpy, w, t->gc, points, countof(points), CoordModeOrigin);
 
147
    }
142
148
}
143
149
 
144
150
 
159
165
  t->speed += (((random() % t->speed) / 2) - (t->speed / 2));
160
166
  if (t->speed > 0) t->speed = -t->speed;
161
167
 
162
 
  if (random() % 4)
163
 
    t->size = t->max_size;
164
 
  else
165
 
    t->size = t->thickness, t->speed = -t->speed;
166
 
 
167
168
  flags = GCForeground;
168
169
# ifndef HAVE_COCOA
169
170
  if (st->transparent_p)
208
209
  default: abort(); break;
209
210
  }
210
211
 
 
212
  if (t->draw == draw_circle) 
 
213
    t->max_size *= 1.5;
 
214
 
 
215
  if (random() % 4)
 
216
    t->size = t->max_size;
 
217
  else
 
218
    t->size = t->thickness, t->speed = -t->speed;
 
219
 
211
220
  return t;
212
221
}
213
222
 
411
420
static const char *deluxe_defaults [] = {
412
421
  ".background:         black",
413
422
  ".foreground:         white",
414
 
  "*delay:              5000",
 
423
  "*delay:              10000",
415
424
  "*count:              5",
416
425
  "*thickness:          50",
417
426
  "*speed:              15",