diff --git a/project/jni/application/hid-pc-keyboard/src b/project/jni/application/hid-pc-keyboard/src index 339868eb6..03b399e44 160000 --- a/project/jni/application/hid-pc-keyboard/src +++ b/project/jni/application/hid-pc-keyboard/src @@ -1 +1 @@ -Subproject commit 339868eb6a13dd984af6f9dfdc8b1ed6990a77c5 +Subproject commit 03b399e447692b8b05d52e96c2c9340940a91b04 diff --git a/project/jni/application/xserver-gimp/AndroidAppSettings.cfg b/project/jni/application/xserver-gimp/AndroidAppSettings.cfg index 0ca593098..0631da656 100644 --- a/project/jni/application/xserver-gimp/AndroidAppSettings.cfg +++ b/project/jni/application/xserver-gimp/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="GIMP Inkscape" AppFullName=org.gimp.inkscape # Application version code (integer) -AppVersionCode=28207 +AppVersionCode=28208 # Application user-visible version name (string) -AppVersionName="2.8.2.07" +AppVersionName="2.8.2.08" # Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...' # If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu @@ -106,7 +106,7 @@ ShowMouseCursor=n GenerateSubframeTouchEvents=n # Force relative (laptop) mouse movement mode, useful when both on-screen keyboard and mouse are needed (y) or (n) -ForceRelativeMouseMode=n +ForceRelativeMouseMode=y # Application needs arrow keys (y) or (n), will show on-screen dpad/joystick (y) or (n) AppNeedsArrowKeys=n diff --git a/project/jni/application/xserver-gimp/java.diff b/project/jni/application/xserver-gimp/java.diff deleted file mode 120000 index fa31c8759..000000000 --- a/project/jni/application/xserver-gimp/java.diff +++ /dev/null @@ -1 +0,0 @@ -../xserver/java.diff \ No newline at end of file diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index b4cdada85..562a8732e 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -194,6 +194,8 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i int res = -1, dpi = -1; char native[32] = "0x0"; int vertical = SDL_ListModes(NULL, 0)[0]->w < SDL_ListModes(NULL, 0)[0]->h; + char cfgpath[PATH_MAX]; + FILE * cfgfile; if( vertical ) { @@ -226,10 +228,64 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i 0.7f, 0.6f, 0.5f, 0.4f, 0.3f, 0.2f, 0.15f, 0.1f }; - const float fontPtToMm = 0.3528f; sprintf(native, "%dx%d native", resVal[0][0], resVal[0][1]); + int savedRes = 0; + int savedDpi = 8; + + sprintf(cfgpath, "%s/.xsdl.cfg", getenv("SECURE_STORAGE_DIR")); + cfgfile = fopen(cfgpath, "r"); + if( cfgfile ) + { + fscanf(cfgfile, "%d %d", &savedRes, &savedDpi); + fclose(cfgfile); + } + + int counter = 3000, config = 0; + Uint32 curtime = SDL_GetTicks(); + while ( counter > 0 && !config ) + { + while (SDL_PollEvent(&event)) + { + switch (event.type) + { + case SDL_KEYDOWN: + if (event.key.keysym.sym == SDLK_HELP) + counter = 0; + break; + case SDL_MOUSEBUTTONUP: + config = 1; + break; + } + } + SDL_FillRect(SDL_GetVideoSurface(), NULL, 0); + y = VID_Y/3; + renderString("Tap screen to change resolution and font scale", VID_X/2, y); + char buf[100]; + y += 30; + sprintf(buf, "Resolution: %s", resStr[savedRes]); + renderString(buf, VID_X/2, y); + y += 30; + sprintf(buf, "Font scale: %s", fontsStr[savedDpi]); + renderString(buf, VID_X/2, y); + y += 40; + sprintf(buf, "Starting in %d seconds", counter / 1000 + 1); + renderString(buf, VID_X/2, y); + SDL_Delay(100); + SDL_Flip(SDL_GetVideoSurface()); + counter -= SDL_GetTicks() - curtime; + curtime = SDL_GetTicks(); + } + + if( !config ) + { + res = savedRes; + dpi = savedDpi; + } + + SDL_Joystick * j0 = SDL_JoystickOpen(0); + while ( res < 0 ) { while (SDL_PollEvent(&event)) @@ -237,12 +293,12 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i switch (event.type) { case SDL_KEYDOWN: - if (event.key.keysym.sym == SDLK_UNDO) - return; + if (event.key.keysym.sym == SDLK_HELP) + return; break; case SDL_MOUSEBUTTONUP: { - SDL_GetMouseState(&x, &y); + //SDL_GetMouseState(&x, &y); if( vertical ) { int z = x; @@ -252,10 +308,17 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i i = (y / (VID_Y/2)); ii = (x / (VID_X/4)); res = i * 4 + ii; + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d res %d\n", x, y, res); } break; + case SDL_JOYBALLMOTION: + x = event.jball.xrel; + y = event.jball.yrel; + break; } } + + //__android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d\n", x, y, res); SDL_FillRect(SDL_GetVideoSurface(), NULL, 0); renderString("Select display resolution", VID_X/2, VID_Y/2); for(i = 0; i < 2; i++) @@ -266,9 +329,9 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i else renderString(resStr[i*4+ii], VID_X/8 + (ii*VID_X/4), VID_Y/4 + (i*VID_Y/2)); } - SDL_GetMouseState(&x, &y); - renderString("X", x, y); - SDL_Delay(150); + //SDL_GetMouseState(&x, &y); + //renderString("X", x, y); + SDL_Delay(100); SDL_Flip(SDL_GetVideoSurface()); } if( vertical ) @@ -288,12 +351,12 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i switch (event.type) { case SDL_KEYDOWN: - if (event.key.keysym.sym == SDLK_UNDO) - return; + if (event.key.keysym.sym == SDLK_HELP) + return; break; case SDL_MOUSEBUTTONUP: { - SDL_GetMouseState(&x, &y); + //SDL_GetMouseState(&x, &y); if( vertical ) { int z = x; @@ -303,8 +366,13 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i i = (y / (VID_Y/4)); ii = (x / (VID_X/4)); dpi = i * 4 + ii; + __android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d dpi %d\n", x, y, res); } break; + case SDL_JOYBALLMOTION: + x = event.jball.xrel; + y = event.jball.yrel; + break; } } SDL_FillRect(SDL_GetVideoSurface(), NULL, 0); @@ -318,13 +386,25 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i else renderStringScaled(fontsStr[i*4+ii], scale, VID_X/8 + (ii*VID_X/4), VID_Y/8 + (i*VID_Y/4), 255, 255, 255, SDL_GetVideoSurface()); } - SDL_GetMouseState(&x, &y); - renderString("X", x, y); - SDL_Delay(150); + //SDL_GetMouseState(&x, &y); + //renderString("X", x, y); + SDL_Delay(100); SDL_Flip(SDL_GetVideoSurface()); } *displayW = *displayW / fontsVal[dpi]; *displayH = *displayH / fontsVal[dpi]; + + SDL_JoystickClose(j0); + + if( config ) + { + cfgfile = fopen(cfgpath, "w"); + if( cfgfile ) + { + fprintf(cfgfile, "%d %d\n", res, dpi); + fclose(cfgfile); + } + } } void XSDL_generateBackground(const char * port, int showHelp) @@ -393,7 +473,7 @@ void XSDL_generateBackground(const char * port, int showHelp) sprintf (msg, "To tunnel X over SSH, forward port %d", atoi(port+1) + 6000); renderStringColor(msg, VID_X/2, y, 255, 255, 255, surf); y += 15; - sprintf (msg, "in your SSH client", port + 6000); + sprintf (msg, "in your SSH client"); renderStringColor(msg, VID_X/2, y, 255, 255, 255, surf); SDL_SaveBMP(surf, "background.bmp"); @@ -432,7 +512,7 @@ void showErrorMessage(const char *msg) switch (event.type) { case SDL_KEYDOWN: - if (event.key.keysym.sym == SDLK_UNDO) + if (event.key.keysym.sym == SDLK_HELP) return; break; } @@ -442,7 +522,7 @@ void showErrorMessage(const char *msg) void XSDL_initSDL() { - SDL_Init(SDL_INIT_VIDEO); + SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK); __android_log_print(ANDROID_LOG_INFO, "XSDL", "Current video mode: %d %d", SDL_ListModes(NULL, 0)[0]->w, SDL_ListModes(NULL, 0)[0]->h); diff --git a/project/jni/application/xserver/xserver b/project/jni/application/xserver/xserver index ac301b383..b5ebbebd7 160000 --- a/project/jni/application/xserver/xserver +++ b/project/jni/application/xserver/xserver @@ -1 +1 @@ -Subproject commit ac301b383ab45e0118e9446c275a05adcee51e77 +Subproject commit b5ebbebd7a5eda2f9648ab36601fcd434316af29