diff options
| -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 37c5d20..277e68b 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 051f5a8..82ce399 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); |