mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 21:55:10 -05:00
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
This commit is contained in:
parent
a5fdba92e1
commit
0ca9ccbe63
2 changed files with 61 additions and 22 deletions
|
|
@ -84,6 +84,7 @@ static XrmOptionDescRec default_options [] = {
|
||||||
|
|
||||||
static char *default_defaults[] = {
|
static char *default_defaults[] = {
|
||||||
".root: false",
|
".root: false",
|
||||||
|
#define GEOMETRY_POSITION 1
|
||||||
"*geometry: "
|
"*geometry: "
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
"120x68"
|
"120x68"
|
||||||
|
|
@ -99,6 +100,7 @@ static char *default_defaults[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Display* dpy;
|
extern Display* dpy;
|
||||||
|
extern int display_zoom;
|
||||||
|
|
||||||
static XrmOptionDescRec *merged_options;
|
static XrmOptionDescRec *merged_options;
|
||||||
static int merged_options_size;
|
static int merged_options_size;
|
||||||
|
|
@ -313,6 +315,64 @@ int main (int argc, char **argv)
|
||||||
char version[255];
|
char version[255];
|
||||||
|
|
||||||
sprintf(version,"rockboxui %s",ROCKBOXUI_VERSION);
|
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 ();
|
merge_options ();
|
||||||
|
|
||||||
#ifdef __sgi
|
#ifdef __sgi
|
||||||
|
|
@ -345,22 +405,6 @@ int main (int argc, char **argv)
|
||||||
XA_WM_DELETE_WINDOW = XInternAtom (dpy, "WM_DELETE_WINDOW", False);
|
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)
|
if (CellsOfScreen (DefaultScreenOfDisplay (dpy)) <= 2)
|
||||||
mono_p = True;
|
mono_p = True;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
GC draw_gc;
|
GC draw_gc;
|
||||||
static Colormap cmap;
|
static Colormap cmap;
|
||||||
|
|
||||||
static int display_zoom=1;
|
int display_zoom=1;
|
||||||
|
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
Window window;
|
Window window;
|
||||||
|
|
@ -90,11 +90,6 @@ void screen_resized(int width, int height)
|
||||||
maxx = width;
|
maxx = width;
|
||||||
maxy = height;
|
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",
|
XSetForeground (dpy, draw_gc, get_pixel_resource ("background", "Background",
|
||||||
dpy, cmap));
|
dpy, cmap));
|
||||||
XFillRectangle(dpy, window, draw_gc, 0, 0, width*display_zoom, height*display_zoom);
|
XFillRectangle(dpy, window, draw_gc, 0, 0, width*display_zoom, height*display_zoom);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue