http://www.tienza.es/crux/src/www.jwz.org/xscreensaver/xscreensaver-5.06.tar.gz
[xscreensaver] / hacks / bumps.h
index 7c249bb00427c1539755a918e35edf07a0f6a5ef..afac1b1c4048539d9b947159e5f7e73545cf82eb 100644 (file)
@@ -30,7 +30,6 @@
 
 #include <math.h>
 #include "screenhack.h"
-#include <X11/Xutil.h>
 
 #ifdef HAVE_XSHM_EXTENSION
 #include "xshm.h"
@@ -51,14 +50,14 @@ typedef unsigned char       BOOL;
 
 
 /* Globals: */
-char *progclass = "Bumps";
 
-char *defaults [] = {
+static const char *bumps_defaults [] = {
   ".background: black",
   ".foreground: white",
   "*color:             random",
   "*colorcount:        64",
   "*delay:             30000",
+  "*duration:  120",
   "*soften:            1",
   "*invert:            FALSE",
 #ifdef __sgi    /* really, HAVE_READ_DISPLAY_EXTENSION */
@@ -70,9 +69,10 @@ char *defaults [] = {
   0
 };
 
-XrmOptionDescRec options [] = {
+static XrmOptionDescRec bumps_options [] = {
   { "-color",          ".color",               XrmoptionSepArg, 0 },
   { "-colorcount",     ".colorcount",  XrmoptionSepArg, 0 },
+  { "-duration",       ".duration",    XrmoptionSepArg, 0 },
   { "-delay",          ".delay",               XrmoptionSepArg, 0 },
   { "-soften",         ".soften",              XrmoptionSepArg, 0 },
   { "-invert",         ".invert",              XrmoptionNoArg, "TRUE" },
@@ -99,18 +99,19 @@ typedef struct
        float nXPos, nYPos;
 } SSpotLight;
 
-void CreateSpotLight( SSpotLight *, uint16_, uint16_ );
 void CreateTables( SSpotLight * );
-void DestroySpotLight( SSpotLight *pSpotLight ) { free( pSpotLight->aLightMap ); }
 
 
 /* The entire program's operation is contained within this structure. */
 typedef struct
 {
        /* XWindows specific variables. */
-       Display *pDisplay;
+       Display *dpy;
        Window Win;
+       Screen *screen;
+        Pixmap source;
        GC GraphicsContext;
+       XColor *xColors;
        uint32_ *aColors;
        XImage *pXImage;
 #ifdef HAVE_XSHM_EXTENSION
@@ -122,17 +123,14 @@ typedef struct
        uint8_ bytesPerPixel;
        uint16_ iWinWidth, iWinHeight;
        uint16_ *aBumpMap;                              /* The actual bump map. */
-
        SSpotLight SpotLight;
-} SBumps;
 
-void CreateBumps( SBumps *, Display *, Window );
-void Execute( SBumps * );
-void DestroyBumps( SBumps * );
+        int delay;
+        int duration;
+        time_t start_time;
 
-void SetPalette( SBumps *, XWindowAttributes * );
-void InitBumpMap( SBumps *, XWindowAttributes * );
-void SoftenBumpMap( SBumps * );
+        async_load_state *img_loader;
+} SBumps;
 
 
 #endif /* _BUMPS_H */