X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fstonerview.c;h=a92b6c5737f475226440d770e8f2e9e74f5a3e5c;hb=50be9bb40dc60130c99ffa568e6677779904ff70;hp=2aa5e129a5883cadaf3e8ebab0b5ae63065e6004;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/glx/stonerview.c b/hacks/glx/stonerview.c index 2aa5e129..a92b6c57 100644 --- a/hacks/glx/stonerview.c +++ b/hacks/glx/stonerview.c @@ -35,6 +35,8 @@ #include "stonerview.h" #include "gltrackball.h" +#define DEF_TRANSPARENT "True" + typedef struct { GLXContext *glx_context; stonerview_state *st; @@ -44,7 +46,19 @@ typedef struct { static stonerview_configuration *bps = NULL; -ENTRYPOINT ModeSpecOpt stonerview_opts = {0, NULL, 0, NULL, NULL}; +static Bool transparent_p; + + +static XrmOptionDescRec opts[] = { + { "-transparent", ".transparent", XrmoptionNoArg, "True" }, + { "+transparent", ".transparent", XrmoptionNoArg, "False" }, +}; + +static argtype vars[] = { + {&transparent_p, "transparent", "Transparent", DEF_TRANSPARENT, t_Bool}, +}; + +ENTRYPOINT ModeSpecOpt stonerview_opts = {countof(opts), opts, countof(vars), vars, NULL}; ENTRYPOINT void @@ -74,8 +88,6 @@ init_stonerview (ModeInfo *mi) fprintf(stderr, "%s: out of memory\n", progname); exit(1); } - - bp = &bps[MI_SCREEN(mi)]; } bp = &bps[MI_SCREEN(mi)]; @@ -83,7 +95,7 @@ init_stonerview (ModeInfo *mi) bp->glx_context = init_GL(mi); bp->trackball = gltrackball_init (); - bp->st = init_view(MI_IS_WIREFRAME(mi)); + bp->st = init_view(MI_IS_WIREFRAME(mi), transparent_p); init_move(bp->st); reshape_stonerview (mi, MI_WIDTH(mi), MI_HEIGHT(mi)); @@ -149,7 +161,9 @@ stonerview_handle_event (ModeInfo *mi, XEvent *event) } else if (event->xany.type == ButtonPress && (event->xbutton.button == Button4 || - event->xbutton.button == Button5)) + event->xbutton.button == Button5 || + event->xbutton.button == Button6 || + event->xbutton.button == Button7)) { gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10, !!event->xbutton.state);