From 8b1010d671b1ad8ffe16d28f4b7d85493c285319 Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Fri, 26 Oct 2007 21:58:36 +0000 Subject: [PATCH] All stamps can be forced to start at a particular size Use the "--stampsize=..." command-line option or "stampsize=..." config. file setting. Use "default" to allow Tux Paint to decide. --- docs/CHANGES.txt | 9 ++++++++- docs/OPTIONS.txt | 15 ++++++++++++++- docs/html/OPTIONS.html | 16 +++++++++++++++- src/tuxpaint.c | 34 +++++++++++++++++++++++++++++++--- 4 files changed, 68 insertions(+), 6 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 19f1c43dc..70e033435 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -9,7 +9,7 @@ http://www.tuxpaint.org/ $Id$ -2007.October.25 (0.9.18) +2007.October.26 (0.9.18) * Interface Improvements: ----------------------- * Improved 'New' and 'Open' interface: @@ -43,6 +43,13 @@ $Id$ (Useful if kids are told to add their name to a picture when they're done, right before printing, but they forget to hit [Enter].) + * All stamps can be forced to start at a particular size + (on a scale of 0-10, corresponding to their minimum and maximum size, + which depends on the size of the stamp, and the size of the canvas). + Use the "--stampsize=..." command-line option or "stampsize=..." config. + file setting. Use "default" to allow Tux Paint to decide (its standard + behavior). + * Documentation Improvements: --------------------------- * Improved --usage output. diff --git a/docs/OPTIONS.txt b/docs/OPTIONS.txt index c9ca2463d..caf91a5ff 100644 --- a/docs/OPTIONS.txt +++ b/docs/OPTIONS.txt @@ -9,7 +9,7 @@ bill@newbreedsoftware.com http://www.tuxpaint.org/ - October 23, 2007 + October 26, 2007 -------------------------------------------------------------------------- @@ -324,6 +324,17 @@ Windows Users This can be useful for people who prefer things right-to-left, rather than left-to-right. + stampsize=SIZE + + Use this option to force Tux Paint to set the starting size of + all stamps. The SIZE value should be between 0 (smallest) and 10 + (largest). The size is relative to the available sizes of the + stamp, which depends on the stamp itself, and Tux Paint's + current canvas size. + + Specifc "default" to let Tux Paint decide (it's standard + behavior). + keyboard=yes This allows the keyboard arrow keys to be used to control the @@ -669,6 +680,7 @@ Windows Users --nostampcontrols --sysfonts --mirrorstamps + --stampsize=SIZE --keyboard --savedir DIRECTORY --datadir DIRECTORY @@ -707,6 +719,7 @@ Windows Users --stampcontrols --nosysfonts --dontmirrorstamps + --stampsize=default --mouse --saveoverask --save diff --git a/docs/html/OPTIONS.html b/docs/html/OPTIONS.html index ce952fad0..73f655184 100644 --- a/docs/html/OPTIONS.html +++ b/docs/html/OPTIONS.html @@ -23,7 +23,7 @@ New Breed Software

http://www.tuxpaint.org/

-

October 23, 2007

+

October 26, 2007

@@ -407,6 +407,18 @@ New Breed Software

rather than left-to-right.

+
stampsize=SIZE
+
+

Use this option to force Tux Paint to set the starting size of + all stamps. The SIZE value should be between 0 (smallest) + and 10 (largest). The size is relative to the available sizes of the + stamp, which depends on the stamp itself, and Tux Paint's current + canvas size.

+ +

Specifc "default" to let Tux Paint decide + (it's standard behavior).

+
+
keyboard=yes

This allows the keyboard arrow keys to be used @@ -1016,6 +1028,7 @@ New Breed Software

--nostampcontrols
--sysfonts
--mirrorstamps
+ --stampsize=SIZE
--keyboard
--savedir DIRECTORY
--datadir DIRECTORY
@@ -1057,6 +1070,7 @@ New Breed Software

--stampcontrols
--nosysfonts
--dontmirrorstamps
+ --stampsize=default
--mouse
--saveoverask
--save
diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 6c850227c..c4d2b0827 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - October 25, 2007 + June 14, 2002 - October 26, 2007 $Id$ */ @@ -846,7 +846,8 @@ 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, rotate_orientation, button_down; + start_blank, autosave_on_quit, rotate_orientation, button_down, + stamp_size_override; static int want_alt_printcommand; static int starter_mirrored, starter_flipped, starter_personal; static Uint8 canvas_color_r, canvas_color_g, canvas_color_b; @@ -4930,6 +4931,7 @@ static void show_usage(FILE * f, char *prg) " %s [--sysfonts | --nosysfonts]\n" " %s [--nostampcontrols | --stampcontrols]\n" " %s [--mirrorstamps | --dontmirrorstamps]\n" + " %s [--stampsize=[0-10] | --stampsize=default]\n" " %s [--saveoverask | --saveover | --saveovernew]\n" " %s [--nosave | --save]\n" " %s [--autosave | --noautosave]\n" @@ -4963,7 +4965,7 @@ static void show_usage(FILE * f, char *prg) #if !defined(WIN32) && !defined(__APPLE__) && !defined(__BEOS__) blank, #endif - blank, blank, blank, blank); + blank, blank, blank, blank, blank); free(blank); } @@ -5234,6 +5236,11 @@ static void loadstamp_finisher(stamp_type * sd, unsigned w, unsigned h, sd->min = lower; sd->size = mid; sd->max = upper; + + if (stamp_size_override != -1) + { + sd->size = (((upper - lower) * stamp_size_override) / 10) + lower; + } } @@ -6063,6 +6070,7 @@ static void setup(int argc, char *argv[]) no_fancy_cursors = 0; hide_cursor = 0; #endif + stamp_size_override = -1; only_uppercase = 0; promptless_save = SAVE_OVER_PROMPT; autosave_on_quit = 0; @@ -6594,6 +6602,16 @@ static void setup(int argc, char *argv[]) exit(1); } } + else if (strcmp(argv[i], "--stampsize=default") == 0) + { + stamp_size_override = -1; + } + else if (strstr(argv[i], "--stampsize=") == argv[i]) + { + stamp_size_override = atoi(argv[i] + 12); + if (stamp_size_override > 10) + stamp_size_override = 10; + } else if (strcmp(argv[i], "--record") == 0 || strcmp(argv[i], "--playback") == 0) { @@ -15503,6 +15521,16 @@ static void parse_options(FILE * fi) { mirrorstamps = 0; } + else if (strcmp(str, "stampsize=default") == 0) + { + stamp_size_override = -1; + } + else if (strstr(str, "stampsize=") == str) + { + stamp_size_override = atoi(str + 10); + if (stamp_size_override > 10) + stamp_size_override = 10; + } else if (strcmp(str, "noshortcuts=yes") == 0) { noshortcuts = 1;