diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 6ca95e63a..7084eeb27 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -22,6 +22,14 @@ $Id$ it no longer shows 'success' pop-up that must be dismissed.) (Addresses SourceForge RFE #1680500) + * Screen size can be rotated using the "--orient=portrait" command-line + option or "orient=portait" configuration file setting. This swaps + the width and height values used for window or screen size. + (e.g., "tuxpaint --fullscreen --1024x786 --orient=portrait" will + run Tux Paint in 768x1024 mode.) Useful for tablet PCs. + Note: override previously-set option with "--orient=landscape" or + "orient=landscape". + * Tool Improvements: ------------------ * Input Method Framework, with implementations of Korean (Hangul 2-Bul) diff --git a/docs/OPTIONS.txt b/docs/OPTIONS.txt index 4a7c880fa..265f9bc4d 100644 --- a/docs/OPTIONS.txt +++ b/docs/OPTIONS.txt @@ -93,6 +93,12 @@ Windows Users * 768x1024 * 1600x1200 + orient=portrait + + Swaps the width/height options given to Tux Paint, useful for + rotating the window on portait displays, such as a tablet PC + that's in tablet orientation. + native=yes When running Tux Paint in fullscreen mode, this assumes the @@ -549,6 +555,7 @@ Windows Users --fullscreen --WIDTHxHEIGHT + --orient=portrait --native --startblank --nosound @@ -583,6 +590,7 @@ Windows Users --windowed --800x600 + --orient=landscape --startlast --sound --quit diff --git a/docs/html/OPTIONS.html b/docs/html/OPTIONS.html index c747d9586..213718495 100644 --- a/docs/html/OPTIONS.html +++ b/docs/html/OPTIONS.html @@ -131,6 +131,13 @@ New Breed Software

+
orient=portrait
+
+

Swaps the width/height options given to Tux Paint, useful for + rotating the window on portait displays, such as a tablet PC that's + in tablet orientation. +

+
native=yes

When running Tux Paint in fullscreen mode, this @@ -867,6 +874,7 @@ New Breed Software

--fullscreen
--WIDTHxHEIGHT
+ --orient=portrait
--native
--startblank
--nosound
@@ -904,6 +912,7 @@ New Breed Software

--windowed
--800x600
+ --orient=landscape
--startlast
--sound
--quit
diff --git a/src/tuxpaint.c b/src/tuxpaint.c index ccd0f2a57..403e78d01 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -808,7 +808,7 @@ static int fullscreen, native_screensize, disable_quit, simple_shapes, no_button_distinction, mirrorstamps, disable_stamp_controls, disable_save, ok_to_use_lockfile, alt_print_command_default, scrolling = 0, - start_blank, autosave_on_quit; + start_blank, autosave_on_quit, rotate_orientation; static int want_alt_printcommand; static int starter_mirrored, starter_flipped, starter_personal; static int recording, playing; @@ -5312,7 +5312,7 @@ static void show_usage(FILE * f, char *prg) "Usage: %s {--usage | --help | --version | --copying}\n" "\n" " %s [--windowed | --fullscreen]\n" - " %s [--WIDTHxHEIGHT | --native]\n" + " %s [--WIDTHxHEIGHT | --native] [--orient=ORIENTATION]\n" " %s [--startblank | --startlast ]\n" " %s [--sound | --nosound] [--quit | --noquit]\n" " %s [--print | --noprint] [--complexshapes | --simpleshapes]\n" @@ -6050,6 +6050,7 @@ static void setup(int argc, char *argv[]) fullscreen = 0; #endif native_screensize = 0; + rotate_orientation = 0; noshortcuts = 0; dont_do_xor = 0; keymouse = 0; @@ -6283,6 +6284,14 @@ static void setup(int argc, char *argv[]) { native_screensize = 1; } + else if (strcmp(argv[i], "--orient=portrait") == 0) + { + rotate_orientation = 1; + } + else if (strcmp(argv[i], "--orient=landscape") == 0) + { + rotate_orientation = 0; + } else if (strcmp(argv[i], "--nooutlines") == 0) { dont_do_xor = 1; @@ -6909,6 +6918,23 @@ static void setup(int argc, char *argv[]) SDL_ShowCursor (SDL_DISABLE); + /* Deal with orientation rotation option */ + + if (rotate_orientation) + { + if (native_screensize && fullscreen) + { + fprintf(stderr, "Warning: Asking for native screen size overrides request to rotate orientation.\n"); + } + else + { + int tmp; + tmp = WINDOW_WIDTH; + WINDOW_WIDTH = WINDOW_HEIGHT; + WINDOW_HEIGHT = tmp; + } + } + /* Deal with 'native' screen size option */ if (native_screensize)