diff options
author | Kjell Ericson <kjell@haxx.se> | 2003-01-20 09:39:38 +0000 |
---|---|---|
committer | Kjell Ericson <kjell@haxx.se> | 2003-01-20 09:39:38 +0000 |
commit | 0ca9ccbe639de312343ec549c5fbb769c2f52ff3 (patch) | |
tree | 438ddcaf9fe2a1fa6591402def696dbbbf0e1496 /uisimulator | |
parent | a5fdba92e1877926f43e9c89a1de3705e73967bd (diff) | |
download | rockbox-0ca9ccbe639de312343ec549c5fbb769c2f52ff3.tar.gz rockbox-0ca9ccbe639de312343ec549c5fbb769c2f52ff3.zip |
Default window zoom for Recorder simulator is 2.
You can change window zoom with the command line flags "--player_zoom" and "--recorder_zoom". Or you can set the environment variable RECORDER_ZOOM or PLAYER_ZOOM.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3131 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/x11/screenhack.c | 76 | ||||
-rw-r--r-- | uisimulator/x11/uibasic.c | 7 |
2 files changed, 61 insertions, 22 deletions
diff --git a/uisimulator/x11/screenhack.c b/uisimulator/x11/screenhack.c index 37c5d2061a..277e68be62 100644 --- a/uisimulator/x11/screenhack.c +++ b/uisimulator/x11/screenhack.c @@ -84,6 +84,7 @@ static XrmOptionDescRec default_options [] = { static char *default_defaults[] = { ".root: false", +#define GEOMETRY_POSITION 1 "*geometry: " #ifdef HAVE_LCD_BITMAP "120x68" @@ -99,6 +100,7 @@ static char *default_defaults[] = { }; extern Display* dpy; +extern int display_zoom; static XrmOptionDescRec *merged_options; static int merged_options_size; @@ -313,6 +315,64 @@ int main (int argc, char **argv) char version[255]; sprintf(version,"rockboxui %s",ROCKBOXUI_VERSION); +#ifdef HAVE_LCD_BITMAP + display_zoom=2; + { + char *env=getenv("RECORDER_ZOOM"); + if (env) { + display_zoom=atoi(env); + } + } +#else + display_zoom=1; + { + char *env=getenv("PLAYER_ZOOM"); + if (env) { + display_zoom=atoi(env); + } + } +#endif + + if (argc > 1) + { + int x; + for (x=1; x<argc; x++) { + if (!strcmp("--old_lcd", argv[x])) { + having_new_lcd=FALSE; + printf("Using old LCD layout.\n"); + } else if (!strcmp("--recorder_zoom", argv[x])) { + x++; +#ifdef HAVE_LCD_BITMAP + display_zoom=atoi(argv[x]); + printf("Window zoom is %d\n", display_zoom); +#endif + } else if (!strcmp("--player_zoom", argv[x])) { + x++; +#ifndef HAVE_LCD_BITMAP + display_zoom=atoi(argv[x]); + printf("Window zoom is %d\n", display_zoom); +#endif + } else { + printf("rockboxui\n"); + printf("Arguments:\n"); + printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n"); + printf(" --player_zoom \t [Player] window zoom\n"); + printf(" --recorder_zoom \t [Recorder] window zoom\n"); + exit(0); + } + } + } + { + static char geometry[40]; +#ifdef HAVE_LCD_BITMAP + snprintf(geometry, 40, "*geometry: %dx%d", 120*display_zoom, 68*display_zoom); +#else + snprintf(geometry, 40, "*geometry: %dx%d", 280*display_zoom, 132*display_zoom); +#endif + default_defaults[GEOMETRY_POSITION]=geometry; + } + + merge_options (); #ifdef __sgi @@ -345,22 +405,6 @@ int main (int argc, char **argv) XA_WM_DELETE_WINDOW = XInternAtom (dpy, "WM_DELETE_WINDOW", False); - if (argc > 1) - { - int x; - for (x=1; x<argc; x++) { - if (!strcmp("--old_lcd", argv[x])) { - having_new_lcd=FALSE; - printf("Using old LCD layout.\n"); - } else { - printf("rockboxui\n"); - printf("Arguments:\n"); - printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n"); - exit(0); - } - } - } - if (CellsOfScreen (DefaultScreenOfDisplay (dpy)) <= 2) mono_p = True; diff --git a/uisimulator/x11/uibasic.c b/uisimulator/x11/uibasic.c index 051f5a8b6f..82ce39973c 100644 --- a/uisimulator/x11/uibasic.c +++ b/uisimulator/x11/uibasic.c @@ -46,7 +46,7 @@ GC draw_gc; static Colormap cmap; -static int display_zoom=1; +int display_zoom=1; Display *dpy; Window window; @@ -90,11 +90,6 @@ void screen_resized(int width, int height) maxx = width; maxy = height; - display_zoom = maxy/LCD_HEIGHT; - if (maxx/LCD_WIDTH < display_zoom) - display_zoom = maxx/LCD_WIDTH; - if (display_zoom<1) - display_zoom = 1; XSetForeground (dpy, draw_gc, get_pixel_resource ("background", "Background", dpy, cmap)); XFillRectangle(dpy, window, draw_gc, 0, 0, width*display_zoom, height*display_zoom); |