4 #include "screenhackI.h"
5 #include "xlockmoreI.h"
7 extern struct xscreensaver_function_table *xscreensaver_function_table;
9 extern const char *progname;
10 extern const char *progclass;
13 static int sproingies_count = 8;
14 static double superquadrics_speed = 5.0;
15 static int stonerview_delay = 20000;
16 static char *hilbert_mode;
17 static Bool stonerview_transparent = False;
19 // TODO: fill in what is not here
20 Bool get_boolean_resource(Display * dpy, char *name, char *class)
24 if (strcmp(progname, "hilbert") == 0) {
26 if (strcmp(name, "spin") == 0 && strcmp(class, "Spin") == 0) {
28 } else if (strcmp(name, "wireframe") == 0
29 && strcmp(class, "Boolean") == 0) {
31 } else if (strcmp(name, "wander") == 0
32 && strcmp(class, "Wander") == 0) {
35 } else if (strcmp(progname, "stonerview") == 0) {
36 if (strcmp(name, "use3d") == 0 && strcmp(class, "Boolean") == 0) {
38 } else if (strcmp(name, "transparent") == 0
39 && strcmp(class, "Transparent") == 0) {
40 b = stonerview_transparent;
41 } else if (strcmp(name, "wireframe") == 0
42 && strcmp(class, "Boolean") == 0) {
44 } else if (strcmp(name, "doFPS") == 0
45 && strcmp(class, "DoFPS") == 0) {
48 } else if (strcmp(progname, "superquadrics") == 0) {
49 if (strcmp(name, "wireframe") == 0
50 && strcmp(class, "Boolean") == 0) {
53 } else if (strcmp(progname, "sproingies") == 0) {
54 if (strcmp(name, "wireframe") == 0
55 && strcmp(class, "Boolean") == 0) {
63 // TODO: fill in what is not here
64 char *get_string_resource(Display * dpy, char *name, char *class)
68 if (strcmp(progname, "hilbert") == 0) {
69 if (strcmp(name, "mode") == 0 && strcmp(class, "Mode") == 0) {
70 implement = malloc(8 * sizeof(char));
71 strcpy(implement, hilbert_mode);
72 } else if (strcmp(name, "ends") == 0 && strcmp(class, "Ends") == 0) {
73 implement = malloc(5 * sizeof(char));
74 strcpy(implement, "open");
87 // TODO: fill in what is not here
88 int get_integer_resource(Display * dpy, char *name, char *class)
91 if (strcmp(progname, "sproingies") == 0) {
92 if (strcmp(name, "count") == 0 && strcmp(class, "Int") == 0) {
93 return sproingies_count;
95 } else if (strcmp(progname, "superquadrics") == 0) {
97 if (strcmp(name, "count") == 0 && strcmp(class, "Int") == 0) {
99 } else if (strcmp(name, "cycles") == 0
100 && strcmp(class, "Int") == 0) {
102 } else if (strcmp(name, "delay") == 0
103 && strcmp(class, "Usecs") == 0) {
107 } else if (strcmp(progname, "hilbert") == 0) {
108 if (strcmp(name, "delay") == 0 && strcmp(class, "Usecs") == 0) {
111 if (strcmp(name, "maxDepth") == 0
112 && strcmp(class, "MaxDepth") == 0) {
113 // too deep is too much for less powerful Android phones
122 // TODO: fill in what is not here
123 double get_float_resource(Display * dpy, char *name, char *class)
126 if (strcmp(progname, "superquadrics") == 0) {
127 if (strcmp(name, "spinspeed") == 0
128 && strcmp(class, "Spinspeed") == 0) {
129 return superquadrics_speed;
131 } else if (strcmp(progname, "hilbert") == 0) {
132 if (strcmp(name, "speed") == 0 && strcmp(class, "Speed") == 0) {
134 } else if (strcmp(name, "thickness") == 0
135 && strcmp(class, "Thickness") == 0) {
142 void setSproingiesCount(int c)
144 sproingies_count = c;
147 void setStonerviewTransparency(int c)
150 stonerview_transparent = True;
152 stonerview_transparent = False;
156 void setHilbertMode(char *mode)
159 hilbert_mode = malloc(8 * sizeof(char));
161 if (strcmp(mode, "3d") == 0) {
162 strcpy(hilbert_mode, "3d");
164 if (strcmp(mode, "2d") == 0) {
165 strcpy(hilbert_mode, "2d");
167 strcpy(hilbert_mode, "random");
172 void setSuperquadricsSpeed(double sq_speed)
174 superquadrics_speed = sq_speed;