X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fgltext.c;h=3dd7922489892af444c8bb1a72e88083ed5f9999;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hp=64934cb8986992322e97065a2b5ad8aa7854acea;hpb=9c9d475ff889ed8be02e8ce8c17da28b93278fca;p=xscreensaver diff --git a/hacks/glx/gltext.c b/hacks/glx/gltext.c index 64934cb8..3dd79224 100644 --- a/hacks/glx/gltext.c +++ b/hacks/glx/gltext.c @@ -1,4 +1,4 @@ -/* gltext, Copyright (c) 2001, 2002, 2003, 2004 Jamie Zawinski +/* gltext, Copyright (c) 2001-2005 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -25,7 +25,7 @@ extern XtAppContext app; #define DEF_SPIN "XYZ" #define DEF_WANDER "True" -#define DEFAULTS "*delay: 10000 \n" \ +#define DEFAULTS "*delay: 20000 \n" \ "*showFPS: False \n" \ "*wireframe: False \n" \ "*spin: " DEF_SPIN "\n" \ @@ -54,6 +54,10 @@ extern XtAppContext app; #include #include +#ifdef HAVE_LOCALE_H +# include +#endif /* HAVE_LOCALE_H */ + #ifdef USE_GL /* whole file */ #ifdef HAVE_UNAME @@ -248,7 +252,7 @@ text_handle_event (ModeInfo *mi, XEvent *event) text_configuration *tp = &tps[MI_SCREEN(mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { tp->button_down_p = True; gltrackball_start (tp->trackball, @@ -257,11 +261,19 @@ text_handle_event (ModeInfo *mi, XEvent *event) return True; } else if (event->xany.type == ButtonRelease && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { tp->button_down_p = False; return True; } + else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) + { + gltrackball_mousewheel (tp->trackball, event->xbutton.button, 10, + !!event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && tp->button_down_p) { @@ -281,6 +293,10 @@ init_text (ModeInfo *mi) text_configuration *tp; int i; +# ifdef HAVE_SETLOCALE + setlocale (LC_TIME, ""); /* for strftime() calls */ +# endif + if (!tps) { tps = (text_configuration *) calloc (MI_NUM_SCREENS(mi), sizeof (text_configuration)); @@ -301,9 +317,9 @@ init_text (ModeInfo *mi) { Bool spinx=False, spiny=False, spinz=False; - double spin_speed = 1.0; - double wander_speed = 0.05; - double spin_accel = 1.0; + double spin_speed = 0.5; + double wander_speed = 0.02; + double spin_accel = 0.5; char *s = do_spin; while (*s) @@ -388,7 +404,7 @@ fill_character (GLUTstrokeFont font, int c, Bool wire) ly = coord->y; } } - return (int) (ch->right + tube_width/2); + return (int) (ch->right + tube_width); } return 0; }