diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-03-26 10:59:39 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-03-26 10:59:39 +0000 |
commit | 319d1f3406f200e08cac3d76c90d6b62dfda25e9 (patch) | |
tree | be4f8a0cb013615b1a510a5dadfc3d071447f813 /uisimulator/uibasic.c | |
parent | d20e6eee0e483582a40968bff25108c3ed855195 (diff) | |
download | rockbox-319d1f3406f200e08cac3d76c90d6b62dfda25e9.tar.gz rockbox-319d1f3406f200e08cac3d76c90d6b62dfda25e9.zip |
lcd_update() works for X11 now...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/uibasic.c')
-rw-r--r-- | uisimulator/uibasic.c | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/uisimulator/uibasic.c b/uisimulator/uibasic.c index 4ea453c82e..74b09f7e9a 100644 --- a/uisimulator/uibasic.c +++ b/uisimulator/uibasic.c | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | /* -- -- */ | 42 | /* -- -- */ |
43 | 43 | ||
44 | static GC draw_gc, erase_gc; | 44 | GC draw_gc, erase_gc; |
45 | static Colormap cmap; | 45 | static Colormap cmap; |
46 | static XColor color_track, color_car; | 46 | static XColor color_track, color_car; |
47 | 47 | ||
@@ -163,6 +163,27 @@ void drawline(int color, int x1, int y1, int x2, int y2) | |||
163 | (int)(y2*track_zoom)); | 163 | (int)(y2*track_zoom)); |
164 | } | 164 | } |
165 | 165 | ||
166 | void drawdot(int color, int x, int y) | ||
167 | { | ||
168 | if (color==0) { | ||
169 | XSetForeground(dpy, draw_gc, | ||
170 | get_pixel_resource("background", "Background", dpy, cmap)); | ||
171 | } | ||
172 | else | ||
173 | XSetForeground(dpy, draw_gc, | ||
174 | get_pixel_resource("foreground", "Foreground", dpy, cmap)); | ||
175 | |||
176 | XDrawPoint(dpy, window, draw_gc, x, y); | ||
177 | } | ||
178 | |||
179 | void drawdots(XPoint *points, int count) | ||
180 | { | ||
181 | XSetForeground(dpy, draw_gc, | ||
182 | get_pixel_resource("foreground", "Foreground", dpy, cmap)); | ||
183 | |||
184 | XDrawPoints(dpy, window, draw_gc, points, count, CoordModeOrigin); | ||
185 | } | ||
186 | |||
166 | void drawtext(int color, int x, int y, char *text) | 187 | void drawtext(int color, int x, int y, char *text) |
167 | { | 188 | { |
168 | if (color==0) { | 189 | if (color==0) { |
@@ -199,11 +220,10 @@ screenhack (Display *the_dpy, Window the_window) | |||
199 | 220 | ||
200 | init_window(); | 221 | init_window(); |
201 | 222 | ||
202 | drawtext(1, 20, 20, PROGNAME); | ||
203 | drawline(1, 0, 0, 40, 50); | ||
204 | |||
205 | Logf("Rockbox will kill ya!"); | 223 | Logf("Rockbox will kill ya!"); |
206 | 224 | ||
225 | lcd_string( PROGNAME, 0); | ||
226 | |||
207 | while (1) { | 227 | while (1) { |
208 | /* deal with input here */ | 228 | /* deal with input here */ |
209 | 229 | ||
@@ -214,7 +234,18 @@ screenhack (Display *the_dpy, Window the_window) | |||
214 | 234 | ||
215 | void screen_redraw() | 235 | void screen_redraw() |
216 | { | 236 | { |
217 | /* does nothing yet */ | 237 | int y, x; |
218 | drawtext(1, 20, 20, PROGNAME); | 238 | |
219 | drawline(1, 0, 0, 40, 50); | 239 | lcd_update(); |
240 | |||
241 | #if 0 | ||
242 | /* does nothing "real" yet */ | ||
243 | /* drawtext(1, 20, 20, PROGNAME);*/ | ||
244 | |||
245 | for(y=0; y< 112; y++) | ||
246 | for(x=0; x<64; x++) | ||
247 | drawdot(1, x+16, y+16); | ||
248 | /* drawline(1, 0, 0, 40, 50); */ | ||
249 | #endif | ||
220 | } | 250 | } |
251 | |||