From 839776e2e369b337ae69c1bd5c08eb400202e244 Mon Sep 17 00:00:00 2001
From: William Kendrick
Date: Wed, 16 May 2007 01:11:33 +0000
Subject: [PATCH] Mouse cursor can be hidden, useful on touchscreen devices.
---
docs/CHANGES.txt | 5 +++++
docs/OPTIONS.txt | 10 +++++++++-
docs/html/OPTIONS.html | 11 ++++++++++-
src/cursor.c | 10 +++++-----
src/cursor.h | 8 ++++----
src/manpage/tuxpaint.1 | 11 +++++++++--
src/tuxpaint.c | 32 ++++++++++++++++++++++++++------
7 files changed, 68 insertions(+), 19 deletions(-)
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt
index 384ba5c6a..ec5126c4d 100644
--- a/docs/CHANGES.txt
+++ b/docs/CHANGES.txt
@@ -11,6 +11,11 @@ $Id$
2007.May.15 (0.9.17)
+ * Interface Improvements:
+ -----------------------
+ * Mouse cursor can be hidden (e.g., using "--hidecursor"), useful on
+ touchscreen devices like tablet PCs or the Nokia Mameo devices.
+
* Tool Improvements:
------------------
* Input Method Framework, with implementations of Korean (Hangul 2-Bul)
diff --git a/docs/OPTIONS.txt b/docs/OPTIONS.txt
index 342dc52c5..32e59a848 100644
--- a/docs/OPTIONS.txt
+++ b/docs/OPTIONS.txt
@@ -9,7 +9,7 @@
bill@newbreedsoftware.com
http://www.tuxpaint.org/
- May 14, 2007
+ May 15, 2007
--------------------------------------------------------------------------
@@ -243,6 +243,12 @@ Windows Users
In some enviornments, the fancy cursors cause problems. Use this
option to avoid them.
+ hidecursor=yes
+
+ This completely hides the mouse pointer shapes in Tux Paint.
+
+ This is useful for touchscreen devices, such as tablet PCs.
+
nooutlines=yes
In this mode, much simpler outlines and 'rubber-band' lines are
@@ -552,6 +558,7 @@ Windows Users
--nowheelmouse
--nobuttondistinction
--nofancycursors
+ --hidecursor
--nooutlines
--nostamps
--nostampcontrols
@@ -583,6 +590,7 @@ Windows Users
--wheelmouse
--buttondistinction
--fancycursors
+ --showcursor
--outlines
--stamps
--stampcontrols
diff --git a/docs/html/OPTIONS.html b/docs/html/OPTIONS.html
index eb3da3068..8c30cae3d 100644
--- a/docs/html/OPTIONS.html
+++ b/docs/html/OPTIONS.html
@@ -23,7 +23,7 @@ New Breed Software
http://www.tuxpaint.org/
-May 14, 2007
+May 15, 2007
@@ -306,6 +306,13 @@ New Breed Software
Use this option to avoid them.
+ hidecursor=yes
+
+ This completely hides the mouse pointer shapes in Tux Paint.
+
+ This is useful for touchscreen devices, such as tablet PCs.
+
+
nooutlines=yes
In this mode, much simpler outlines and 'rubber-band' lines are
@@ -868,6 +875,7 @@ New Breed Software
--nowheelmouse
--nobuttondistinction
--nofancycursors
+ --hidecursor
--nooutlines
--nostamps
--nostampcontrols
@@ -902,6 +910,7 @@ New Breed Software
--wheelmouse
--buttondistinction
--fancycursors
+ --showcursor
--outlines
--stamps
--stampcontrols
diff --git a/src/cursor.c b/src/cursor.c
index aebf17f06..49979ae4f 100644
--- a/src/cursor.c
+++ b/src/cursor.c
@@ -4,9 +4,9 @@
For Tux Paint
Bitmapped mouse pointer (cursor)
- Copyright (c) 2002-2006 by Bill Kendrick and others
+ Copyright (c) 2002-2007 by Bill Kendrick and others
bill@newbreedsoftware.com
- http://www.newbreedsoftware.com/tuxpaint/
+ http://www.tuxpaint.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
- June 14, 2002 - February 18, 2006
+ June 14, 2002 - May 15, 2007
$Id$
*/
@@ -36,7 +36,7 @@ SDL_Cursor *cursor_hand, *cursor_arrow, *cursor_watch,
*cursor_up, *cursor_down, *cursor_tiny, *cursor_crosshair,
*cursor_brush, *cursor_wand, *cursor_insertion, *cursor_rotate;
-int no_fancy_cursors;
+int no_fancy_cursors, hide_cursor;
void do_setcursor(SDL_Cursor * c)
{
@@ -66,7 +66,7 @@ void do_setcursor(SDL_Cursor * c)
UNUSED(arrow_bits);
UNUSED(arrow_mask_bits);
- if (!no_fancy_cursors)
+ if (!hide_cursor && !no_fancy_cursors)
SDL_SetCursor(c);
}
diff --git a/src/cursor.h b/src/cursor.h
index 2e94ca654..f6ef1e836 100644
--- a/src/cursor.h
+++ b/src/cursor.h
@@ -4,9 +4,9 @@
For Tux Paint
Bitmapped mouse pointer (cursor)
- Copyright (c) 2002-2006 by Bill Kendrick and others
+ Copyright (c) 2002-2007 by Bill Kendrick and others
bill@newbreedsoftware.com
- http://www.newbreedsoftware.com/tuxpaint/
+ http://www.tuxpaint.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
- June 14, 2002 - February 17, 2006
+ June 14, 2002 - May 15, 2007
$Id$
*/
@@ -69,7 +69,7 @@ extern SDL_Cursor *cursor_hand, *cursor_arrow, *cursor_watch,
*cursor_up, *cursor_down, *cursor_tiny, *cursor_crosshair,
*cursor_brush, *cursor_wand, *cursor_insertion, *cursor_rotate;
-extern int no_fancy_cursors;
+extern int no_fancy_cursors, hide_cursor;
void do_setcursor(SDL_Cursor * c);
void free_cursor(SDL_Cursor ** cursor);
diff --git a/src/manpage/tuxpaint.1 b/src/manpage/tuxpaint.1
index 6a627867d..a1debd32d 100644
--- a/src/manpage/tuxpaint.1
+++ b/src/manpage/tuxpaint.1
@@ -1,5 +1,5 @@
-.\" tuxpaint.1 - 2007.05.14
-.TH TUXPAINT 1 "14 May 2006" "0.9.17" "Tux Paint"
+.\" tuxpaint.1 - 2007.05.15
+.TH TUXPAINT 1 "15 May 2007" "0.9.17" "Tux Paint"
.SH NAME
tuxpaint -- A drawing program for young children.
@@ -25,6 +25,7 @@ tuxpaint -- A drawing program for young children.
[\-\-nowheelmouse]
[\-\-nobuttondistinction]
[\-\-nofancycursors]
+[\-\-hidecursor]
[\-\-nooutlines]
[\-\-nostamps]
[\-\-nostampcontrols]
@@ -54,6 +55,7 @@ tuxpaint -- A drawing program for young children.
[\-\-wheelmouse]
[\-\-buttondistinction]
[\-\-fancycursors]
+[\-\-showcursor]
[\-\-outlines]
[\-\-stamps]
[\-\-stampcontrols]
@@ -196,6 +198,11 @@ Disable or enable (default) the 'fancy' mouse pointer shapes in \fITux Paint\fP.
While the shapes are larger, and context sensitive, some environments have
trouble displaying the mouse pointer, and/or leave 'trails' on the screen.
+.TP 8
+.B \-\-hidecursor \-\-showcursor
+Completely hide, or enable (default) the mouse pointer in \fITux Paint\fP.
+This can be useful on touchscreen devices, such as tablet PCs.
+
.TP 8
.B \-\-nooutlines \-\-outlines
In \fInooutlines\fP mode, much simpler outlines and 'rubber-band' lines are
diff --git a/src/tuxpaint.c b/src/tuxpaint.c
index 3796d4707..de0805162 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 - May 14, 2007
+ June 14, 2002 - May 15, 2007
$Id$
*/
@@ -108,6 +108,7 @@
/* Disable fancy cursors in fullscreen mode, to avoid SDL bug: */
/* (This bug is still around, as of SDL 1.2.9, October 2005) */
+/* (Is it still in SDL 1.2.11 in May 2007, though!? -bjk) */
#define LARGE_CURSOR_FULLSCREEN_BUG
// control the color selector
@@ -5315,7 +5316,8 @@ static void show_usage(FILE * f, char *prg)
" %s [--startblank | --startlast ]\n"
" %s [--sound | --nosound] [--quit | --noquit]\n"
" %s [--print | --noprint] [--complexshapes | --simpleshapes]\n"
- " %s [--mixedcase | --uppercase] [--fancycursors | --nofancycursors]\n"
+ " %s [--mixedcase | --uppercase]\n"
+ " %s [--fancycursors | --nofancycursors | --hidecursor ]\n"
" %s [--mouse | --keyboard] [--dontgrab | --grab]\n"
" %s [--noshortcuts | --shortcuts] [--wheelmouse | --nowheelmouse]\n"
" %s [--nobuttondistinction | --buttondistinction ]\n"
@@ -5338,7 +5340,7 @@ static void show_usage(FILE * f, char *prg)
prg, prg,
blank, blank, blank,
blank, blank, blank,
- blank, blank, blank, blank, blank, blank, blank, blank,
+ blank, blank, blank, blank, blank, blank, blank, blank, blank,
#ifdef WIN32
blank,
#endif
@@ -6056,9 +6058,11 @@ static void setup(int argc, char *argv[])
#ifdef NOKIA_770
simple_shapes = 1;
no_fancy_cursors = 1;
+ hide_cursor = 1;
#else
simple_shapes = 0;
no_fancy_cursors = 0;
+ hide_cursor = 0;
#endif
only_uppercase = 0;
promptless_save = SAVE_OVER_PROMPT;
@@ -6317,6 +6321,14 @@ static void setup(int argc, char *argv[])
{
no_fancy_cursors = 0;
}
+ else if (strcmp(argv[i], "--hidecursor") == 0)
+ {
+ hide_cursor = 1;
+ }
+ else if (strcmp(argv[i], "--showcursor") == 0)
+ {
+ hide_cursor = 0;
+ }
else if (strcmp(argv[i], "--saveover") == 0)
{
promptless_save = SAVE_OVER_ALWAYS;
@@ -6883,9 +6895,8 @@ static void setup(int argc, char *argv[])
#endif
SDL_WM_SetCaption("Tux Paint", "Tux Paint");
-#ifdef NOKIA_770
- SDL_ShowCursor (SDL_DISABLE);
-#endif
+ if (hide_cursor)
+ SDL_ShowCursor (SDL_DISABLE);
/* Deal with 'native' screen size option */
@@ -15410,6 +15421,15 @@ static void parse_options(FILE * fi)
{
no_fancy_cursors = 0;
}
+ else if (strcmp(str, "hidecursor=yes") == 0)
+ {
+ hide_cursor = 1;
+ }
+ else if (strcmp(str, "hidecursor=no") == 0 ||
+ strcmp(str, "showcursor=yes") == 0)
+ {
+ hide_cursor = 0;
+ }
else if (strcmp(str, "uppercase=yes") == 0)
{
only_uppercase = 1;