X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fscreenhack.h;h=63222520c25bfa7ae193c7ec7b3db78d38e00a73;hb=f65151994eba80ecabcdac6eef6fa0dde7e2d45b;hp=fb3de4ce92ce3e19e717fd831db839810ee949b3;hpb=6edc84f12f15860a71430c45e8392a5e4ef8203c;p=xscreensaver diff --git a/hacks/screenhack.h b/hacks/screenhack.h index fb3de4ce..63222520 100644 --- a/hacks/screenhack.h +++ b/hacks/screenhack.h @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1992-1995 Jamie Zawinski +/* xscreensaver, Copyright (c) 1992-1997 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 @@ -50,87 +50,51 @@ * AAAAUUUGGGHHH!!!! (server dumps core & falls into the chasm) */ -#ifndef _SCREENHACK_H_ -#define _SCREENHACK_H_ +#ifndef __SCREENHACK_H__ +#define __SCREENHACK_H__ -#if __STDC__ #include + +#include "config.h" + +#ifdef __hpux + /* Which of the ten billion standards does values.h belong to? + What systems always have it? */ +# include #endif +#include + #include #include #include -#include "vroot.h" + +/* M_PI ought to have been defined in math.h, but... */ +#ifndef M_PI +# define M_PI 3.1415926535 +#endif + +#ifndef M_PI_2 +# define M_PI_2 1.5707963267 +#endif + +#include "yarandom.h" +#include "usleep.h" +#include "resources.h" +#include "hsv.h" +#include "colors.h" +#include "grabscreen.h" +#include "visual.h" extern Bool mono_p; extern char *progname; extern char *progclass; extern XrmDatabase db; extern XrmOptionDescRec options []; -extern int options_size; extern char *defaults []; -#if __STDC__ -# if (defined(SVR4) || defined(SYSV)) && !defined(__sgi) -# ifndef random - extern int rand (void); -# define random() rand() -# endif -# ifndef srandom - extern void srand (unsigned int); -# define srandom(i) srand((unsigned int)(i)) -# endif -# else /* !totally-losing-SYSV */ -# ifndef random - extern long random (void); -# endif -# ifndef srandom - extern int srandom (unsigned int); -# endif -# endif /* !totally-losing-SYSV */ -#endif /* __STDC__ */ - -#if __STDC__ -# define P(x)x -#else -# define P(x)() -#endif - -extern void screenhack P((Display*,Window)); - -#define usleep screenhack_usleep - -extern void screenhack_usleep P((unsigned long)); -extern char *get_string_resource P((char*,char*)); -extern Bool get_boolean_resource P((char*,char*)); -extern int get_integer_resource P((char*,char*)); -extern double get_float_resource P((char*,char*)); -extern unsigned int get_pixel_resource P((char*,char*,Display*,Colormap)); -extern unsigned int get_minutes_resource P((char*,char*)); -extern unsigned int get_seconds_resource P((char*,char*)); - -extern Visual *get_visual_resource P((Display *, char *, char *)); -extern int get_visual_depth P((Display *, Visual *)); - -extern void hsv_to_rgb P((int,double,double,unsigned short*, - unsigned short*,unsigned short*)); -extern void rgb_to_hsv P((unsigned short,unsigned short,unsigned short, - int*,double*,double*)); -extern void cycle_hue P((XColor*,int)); - -extern void make_color_ramp P((int h1, double s1, double v1, - int h2, double s2, double v2, - XColor *pixels, int npixels)); - -extern Pixmap grab_screen_image P((Display *dpy, Window window, int root_p)); -extern void copy_default_colormap_contents P((Display *dpy, Colormap to_cmap, - Visual *to_visual)); - -static double _frand_tmp_; -#define frand(f) \ - (_frand_tmp_ = (((double) random()) / \ - (((double) ((unsigned int)~0)) / ((double) (f+f)))), \ - _frand_tmp_ < 0 ? (-_frand_tmp_) : _frand_tmp_) +extern void screenhack (Display*,Window); +extern void screenhack_handle_event (Display*, XEvent*); +extern void screenhack_handle_events (Display*); -#undef P -#endif /* _SCREENHACK_H_ */ +#endif /* __SCREENHACK_H__ */