projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.38.tar.gz
[xscreensaver]
/
hacks
/
xlyap.c
diff --git
a/hacks/xlyap.c
b/hacks/xlyap.c
index 02587f00b37d12dd7d1ccac1f1b360e17b16f69d..cbd493794c194c607ba172dcaa13cfef1f684b1d 100644
(file)
--- a/
hacks/xlyap.c
+++ b/
hacks/xlyap.c
@@
-43,7
+43,7
@@
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
-#ifndef HAVE_
COCOA
+#ifndef HAVE_
JWXYZ
# include <X11/cursorfont.h>
#endif
# include <X11/cursorfont.h>
#endif
@@
-78,6
+78,9
@@
static const char *xlyap_defaults [] = {
"*delay: 10000",
"*linger: 5",
"*colors: 200",
"*delay: 10000",
"*linger: 5",
"*colors: 200",
+#ifdef HAVE_MOBILE
+ "*ignoreRotation: True",
+#endif
0
};
0
};
@@
-158,7
+161,7
@@
typedef struct {
#endif
typedef struct {
#endif
typedef struct {
-# ifndef HAVE_
COCOA
+# ifndef HAVE_
JWXYZ
Cursor band_cursor;
# endif
double p_min, p_max, q_min, q_max;
Cursor band_cursor;
# endif
double p_min, p_max, q_min, q_max;
@@
-178,8
+181,8
@@
typedef double (*PFD)(double,double);
/*#define BACKING_PIXMAP*/
struct state {
/*#define BACKING_PIXMAP*/
struct state {
- int screen;
Display *dpy;
Display *dpy;
+ Screen *screen;
Visual *visual;
Colormap cmap;
Visual *visual;
Colormap cmap;
@@
-552,15
+555,15
@@
init_color(struct state *st)
{
int i;
if (st->ncolors)
{
int i;
if (st->ncolors)
- free_colors (st->
dpy
, st->cmap, st->colors, st->ncolors);
+ free_colors (st->
screen
, st->cmap, st->colors, st->ncolors);
st->ncolors = st->maxcolor;
st->ncolors = st->maxcolor;
- make_smooth_colormap(st->
dpy
, st->visual, st->cmap,
+ make_smooth_colormap(st->
screen
, st->visual, st->cmap,
st->colors, &st->ncolors, True, NULL, True);
for (i = 0; i < st->maxcolor; i++) {
if (! st->Data_GC[i]) {
XGCValues gcv;
st->colors, &st->ncolors, True, NULL, True);
for (i = 0; i < st->maxcolor; i++) {
if (! st->Data_GC[i]) {
XGCValues gcv;
- gcv.background = BlackPixel
(st->dpy,
st->screen);
+ gcv.background = BlackPixel
OfScreen(
st->screen);
st->Data_GC[i] = XCreateGC(st->dpy, st->canvas, GCBackground, &gcv);
}
XSetForeground(st->dpy, st->Data_GC[i],
st->Data_GC[i] = XCreateGC(st->dpy, st->canvas, GCBackground, &gcv);
}
XSetForeground(st->dpy, st->Data_GC[i],
@@
-824,7
+827,7
@@
Getkey(struct state *st, XKeyEvent *event)
unsigned char key;
int i;
if (XLookupString(event, (char *)&key, sizeof(key), (KeySym *)0,
unsigned char key;
int i;
if (XLookupString(event, (char *)&key, sizeof(key), (KeySym *)0,
- (XComposeStatus *) 0) > 0)
+ (XComposeStatus *) 0) > 0)
{
if (st->reset_countdown)
st->reset_countdown = st->linger;
if (st->reset_countdown)
st->reset_countdown = st->linger;
@@
-953,6
+956,7
@@
Getkey(struct state *st, XKeyEvent *event)
case 'H': print_help(st); return True;
default: return False;
}
case 'H': print_help(st); return True;
default: return False;
}
+ }
return False;
}
return False;
}
@@
-1782,6
+1786,7
@@
xlyap_init (Display *d, Window window)
st->width = xgwa.width;
st->height = xgwa.height;
st->visual = xgwa.visual;
st->width = xgwa.width;
st->height = xgwa.height;
st->visual = xgwa.visual;
+ st->screen = xgwa.screen;
st->cmap = xgwa.colormap;
do_defaults(st);
st->cmap = xgwa.colormap;
do_defaults(st);
@@
-1799,14
+1804,13
@@
xlyap_init (Display *d, Window window)
if (builtin >= 0)
do_preset (st, builtin);
if (builtin >= 0)
do_preset (st, builtin);
- st->screen = DefaultScreen(st->dpy);
- st->background = BlackPixel(st->dpy, st->screen);
+ st->background = BlackPixelOfScreen(st->screen);
setupmem(st);
init_data(st);
if (!mono_p)
st->foreground = st->startcolor;
else
setupmem(st);
init_data(st);
if (!mono_p)
st->foreground = st->startcolor;
else
- st->foreground = WhitePixel
(st->dpy,
st->screen);
+ st->foreground = WhitePixel
OfScreen(
st->screen);
/*
* Create the window to display the Lyapunov exponents
/*
* Create the window to display the Lyapunov exponents
@@
-1874,11
+1878,13
@@
static Bool
xlyap_event (Display *dpy, Window window, void *closure, XEvent *event)
{
struct state *st = (struct state *) closure;
xlyap_event (Display *dpy, Window window, void *closure, XEvent *event)
{
struct state *st = (struct state *) closure;
+
switch(event->type)
{
case KeyPress:
switch(event->type)
{
case KeyPress:
- return Getkey(st, &event->xkey);
- return True;
+ if (Getkey(st, &event->xkey))
+ return True;
+ break;
#if 0
case ButtonPress:
StartRubberBand(st, &st->rubber_data, event);
#if 0
case ButtonPress:
StartRubberBand(st, &st->rubber_data, event);
@@
-1893,6
+1899,13
@@
xlyap_event (Display *dpy, Window window, void *closure, XEvent *event)
default:
break;
}
default:
break;
}
+
+ if (screenhack_event_helper (dpy, window, event))
+ {
+ Clear(st);
+ return True;
+ }
+
return False;
}
return False;
}