diff --git a/project/jni/application/hid-pc-keyboard/src b/project/jni/application/hid-pc-keyboard/src index ff2b6721c..d8a578f39 160000 --- a/project/jni/application/hid-pc-keyboard/src +++ b/project/jni/application/hid-pc-keyboard/src @@ -1 +1 @@ -Subproject commit ff2b6721c355bf09940dffdad796296c92062557 +Subproject commit d8a578f3925e65c59f03fae88e8e05e973532300 diff --git a/project/jni/application/openarena/vm b/project/jni/application/openarena/vm index 84aef6f60..8142bcd29 160000 --- a/project/jni/application/openarena/vm +++ b/project/jni/application/openarena/vm @@ -1 +1 @@ -Subproject commit 84aef6f6037066be7627a3d29ca7ba0305abf3c6 +Subproject commit 8142bcd294356bcee119a7b27d829cbb4843d879 diff --git a/project/jni/application/xserver/AndroidAppSettings.cfg b/project/jni/application/xserver/AndroidAppSettings.cfg index a6c6738c9..cb080f772 100644 --- a/project/jni/application/xserver/AndroidAppSettings.cfg +++ b/project/jni/application/xserver/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="XServer XSDL" AppFullName=x.org.server # Application version code (integer) -AppVersionCode=11138 +AppVersionCode=11139 # Application user-visible version name (string) -AppVersionName="1.11.38" +AppVersionName="1.11.39" # 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 diff --git a/project/jni/application/xserver/AndroidBuild.sh b/project/jni/application/xserver/AndroidBuild.sh index 60f4797ca..3bb34b4f3 100755 --- a/project/jni/application/xserver/AndroidBuild.sh +++ b/project/jni/application/xserver/AndroidBuild.sh @@ -13,9 +13,9 @@ PACKAGE_NAME=`grep AppFullName AndroidAppSettings.cfg | sed 's/.*=//'` } || exit 1 ../setEnvironment-$1.sh sh -c '\ -$CC $CFLAGS -c main.c -o main-'"$1.o" || exit 1 +$CC $CFLAGS -Werror=format -c main.c -o main-'"$1.o" || exit 1 ../setEnvironment-$1.sh sh -c '\ -$CC $CFLAGS -c gfx.c -o gfx-'"$1.o" || exit 1 +$CC $CFLAGS -Werror=format -c gfx.c -o gfx-'"$1.o" || exit 1 [ -e ../../../lib ] || ln -s libs ../../../lib diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index 5ea68ee90..37d37ba0e 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -394,7 +394,7 @@ void XSDL_unpackFiles(int _freeSpaceRequiredMb) SDL_JoystickClose(j0); } -void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH) +void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH, int * builtinKeyboard, int * ctrlAltShiftKeys) { int x = 0, y = 0, i, ii; SDL_Event event; @@ -406,6 +406,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i int vertical = SDL_ListModes(NULL, 0)[0]->w < SDL_ListModes(NULL, 0)[0]->h; char cfgpath[PATH_MAX]; FILE * cfgfile; + int okay = 0; if( vertical ) { @@ -459,7 +460,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i cfgfile = fopen(cfgpath, "r"); if( cfgfile ) { - fscanf(cfgfile, "%d %d %d %d", &savedRes, &savedDpi, &customX, &customY); + fscanf(cfgfile, "%d %d %d %d %d %d", &savedRes, &savedDpi, &customX, &customY, builtinKeyboard, ctrlAltShiftKeys); fclose(cfgfile); } sprintf(custom, "%dx%d", customX, customY); @@ -482,7 +483,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i } } SDL_FillRect(SDL_GetVideoSurface(), NULL, 0); - y = VID_Y/3; + y = VID_Y/4; renderString("Tap the screen to change", vertical ? VID_Y / 2 : VID_X/2, y); y += 30; renderString("display resolution and font scale (DPI)", vertical ? VID_Y / 2 : VID_X/2, y); @@ -493,6 +494,9 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i y += 30; sprintf(buf, "Font scale: %s", fontsStr[savedDpi]); renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y); + y += 30; + sprintf(buf, "Keyboard: %s", *builtinKeyboard == 0 ? "System" : *builtinKeyboard == 1 ? "Builtin QWERTY" : "System + Builtin"); + renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y); y += 40; sprintf(buf, "Starting in %d seconds", counter / 1000 + 1); renderString(buf, vertical ? VID_Y / 2 : VID_X/2, y); @@ -668,6 +672,58 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i *displayW = *displayW / fontsVal[dpi]; *displayH = *displayH / fontsVal[dpi]; + okay = !config; + while ( !okay ) + { + while (SDL_PollEvent(&event)) + { + switch (event.type) + { + case SDL_KEYDOWN: + if (event.key.keysym.sym == SDLK_HELP) + return; + break; + case SDL_MOUSEBUTTONUP: + { + //SDL_GetMouseState(&x, &y); + if( vertical ) + { + int z = x; + x = y; + y = z; + } + if( y > 0 && y < VID_Y * 2 / 6 ) + *builtinKeyboard = (*builtinKeyboard + 1) % 3; + if( y > VID_Y * 2 / 6 && y < VID_Y * 4 / 6 ) + *ctrlAltShiftKeys = !*ctrlAltShiftKeys; + if( y > VID_Y * 4 / 6 && y < VID_Y * 6 / 6 ) + okay = 1; + __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); + + char buf[100]; + + sprintf(buf, "Keyboard: %s", *builtinKeyboard == 0 ? "System" : *builtinKeyboard == 1 ? "Builtin QWERTY" : "System + Builtin"); + renderString(buf, VID_X/2, VID_Y * 1 / 6); + + sprintf(buf, "Separate Ctrl/Alt/Shift keys: %s", *ctrlAltShiftKeys == 0 ? "No" : "Yes"); + renderString(buf, VID_X/2, VID_Y * 3 / 6); + + sprintf(buf, "Okay"); + renderString(buf, VID_X/2, VID_Y * 5 / 6); + + SDL_Delay(100); + SDL_Flip(SDL_GetVideoSurface()); + } + SDL_JoystickClose(j0); if( config ) @@ -675,7 +731,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i cfgfile = fopen(cfgpath, "w"); if( cfgfile ) { - fprintf(cfgfile, "%d %d %d %d\n", res, dpi, customX, customY); + fprintf(cfgfile, "%d %d %d %d %d %d\n", res, dpi, customX, customY, *builtinKeyboard, *ctrlAltShiftKeys); fclose(cfgfile); } } @@ -687,7 +743,7 @@ void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, i struct ifconf ifc; struct ifreq ifr[20]; SDL_Surface * surf; - int y = resolutionH * 1 / 3; + int y = resolutionH * 1 / 6; char msg[128]; if (resolutionH > resolutionW) @@ -756,6 +812,13 @@ void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, i sprintf (msg, "in your SSH client"); renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + y += resolutionH * 20 / VID_Y; + sprintf (msg, "If you run Linux in chroot on this device, run:"); + renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + y += resolutionH * 15 / VID_Y; + sprintf (msg, "export DISPLAY=:0 PULSE_SERVER=tcp:127.0.0.1:4712"); + renderStringScaled(msg, 12 * resolutionH / VID_Y, resolutionW/2, y, 255, 255, 255, surf); + SDL_SaveBMP(surf, "background.bmp"); SDL_FreeSurface(surf); } diff --git a/project/jni/application/xserver/gfx.h b/project/jni/application/xserver/gfx.h index e2f4f91c8..9fc48723a 100644 --- a/project/jni/application/xserver/gfx.h +++ b/project/jni/application/xserver/gfx.h @@ -6,7 +6,7 @@ enum { VID_X = 480, VID_Y = 320 }; void XSDL_initSDL(); void XSDL_deinitSDL(); void XSDL_unpackFiles(int freeSpaceRequiredMb); -void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH); +void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, int * displayH, int * builtinKeyboard, int * ctrlAltShiftKeys); void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, int resolutionH); void XSDL_showServerLaunchErrorMessage(); diff --git a/project/jni/application/xserver/main.c b/project/jni/application/xserver/main.c index 4f468033e..9c8d7b05d 100644 --- a/project/jni/application/xserver/main.c +++ b/project/jni/application/xserver/main.c @@ -48,6 +48,7 @@ int main( int argc, char* argv[] ) int screenResOverride = 0; int screenButtons = 0; int warnDiskSpaceMb = 0; + int builtinKeyboard = 0; int resolutionW = atoi(getenv("DISPLAY_RESOLUTION_WIDTH")); int resolutionH = atoi(getenv("DISPLAY_RESOLUTION_HEIGHT")); @@ -118,7 +119,7 @@ int main( int argc, char* argv[] ) if( !screenResOverride ) { - XSDL_showConfigMenu(&resolutionW, &displayW, &resolutionH, &displayH); + XSDL_showConfigMenu(&resolutionW, &displayW, &resolutionH, &displayH, &builtinKeyboard, &screenButtons); sprintf( screenres, "%d/%dx%d/%dx%d", resolutionW, displayW, resolutionH, displayH, SDL_GetVideoInfo()->vfmt->BitsPerPixel ); } @@ -149,6 +150,12 @@ int main( int argc, char* argv[] ) SDL_ANDROID_SetScreenKeyboardButtonShown(SDL_ANDROID_SCREENKEYBOARD_BUTTON_2, 0); } + { + char s[16]; + sprintf(s, "%d", builtinKeyboard); + setenv("XSDL_BUILTIN_KEYBOARD", s, 1); + } + __android_log_print(ANDROID_LOG_INFO, "XSDL", "XSDL video resolution %s, args:", screenres); for( i = 0; i < argnum; i++ ) __android_log_print(ANDROID_LOG_INFO, "XSDL", "> %s", args[i]); diff --git a/project/jni/application/xserver/xserver b/project/jni/application/xserver/xserver index 006833ad9..a710794bc 160000 --- a/project/jni/application/xserver/xserver +++ b/project/jni/application/xserver/xserver @@ -1 +1 @@ -Subproject commit 006833ad955368f3e0ad7ced1250824babeeb115 +Subproject commit a710794bcbef76293fa34f18f3cbed321788a12a