"Paint" magic tool can now be one-click or -with-preview, to support
mouse accessibility mode (which introduced issues with tools like 'Flower' and 'Fold' (which show previews) and 'Ripples' (which doesn't involve any dragging)).
This commit is contained in:
parent
868cba5794
commit
0aed8a5a86
6 changed files with 44 additions and 14 deletions
4
Makefile
4
Makefile
|
|
@ -4,14 +4,14 @@
|
|||
# bill@newbreedsoftware.com
|
||||
# http://www.tuxpaint.org/
|
||||
|
||||
# June 14, 2002 - January 11, 2011
|
||||
# June 14, 2002 - April 26, 2011
|
||||
|
||||
|
||||
# The version number, for release:
|
||||
|
||||
VER_VERSION:=0.9.22
|
||||
VER_DATE:=$(shell date +"%Y-%m-%d")
|
||||
MAGIC_API_VERSION:=0x00000002
|
||||
MAGIC_API_VERSION:=0x00000003
|
||||
|
||||
# Need to know the OS
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,16 @@ $Id$
|
|||
keyboard layouts.
|
||||
* Who wrote this, so we can credit!?!?
|
||||
|
||||
* Magic Tool Improvememnts:
|
||||
--------------------------
|
||||
* Magic tools can register themselves as paint with one click
|
||||
(versus click/drag/release): MODE_ONECLICK. (e.g., "Ripples")
|
||||
Utilized by mouse-accessibility feature.
|
||||
|
||||
* Magic tools can register themsevles as paint-with-a-preview:
|
||||
MODE_PAINT_WITH_PREVIEW. (e.g., "Flower")
|
||||
Utilized by mouse-accessibility feature.
|
||||
|
||||
* Other Improvements:
|
||||
-------------------
|
||||
* Quicker prompt window pop-up animation.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
Last updated: July 8, 2008
|
||||
Last updated: April 26, 2011
|
||||
$Id$
|
||||
*/
|
||||
|
||||
|
|
@ -604,5 +604,5 @@ void flower_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas
|
|||
|
||||
int flower_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
return(MODE_PAINT_WITH_PREVIEW);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -483,5 +483,5 @@ void fold_switchout(magic_api * api, int which, int mode, SDL_Surface * canvas)
|
|||
|
||||
int fold_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
return(MODE_PAINT_WITH_PREVIEW);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -187,5 +187,5 @@ void ripples_switchout(magic_api * api, int which, int mode, SDL_Surface * canva
|
|||
|
||||
int ripples_modes(magic_api * api, int which)
|
||||
{
|
||||
return(MODE_PAINT);
|
||||
return(MODE_ONECLICK);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
(See COPYING.txt)
|
||||
|
||||
June 14, 2002 - April 18, 2011
|
||||
June 14, 2002 - April 26, 2011
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -3848,6 +3848,22 @@ static void mainloop(void)
|
|||
draw_magic();
|
||||
update_screen_rect(&r_toolopt);
|
||||
}
|
||||
else if (which == 0 && magics[cur_magic].avail_modes & MODE_PAINT_WITH_PREVIEW)
|
||||
{
|
||||
magic_switchout(canvas);
|
||||
magics[cur_magic].mode = MODE_PAINT_WITH_PREVIEW;
|
||||
magic_switchin(canvas);
|
||||
draw_magic();
|
||||
update_screen_rect(&r_toolopt);
|
||||
}
|
||||
else if (which == 0 && magics[cur_magic].avail_modes & MODE_ONECLICK)
|
||||
{
|
||||
magic_switchout(canvas);
|
||||
magics[cur_magic].mode = MODE_ONECLICK;
|
||||
magic_switchin(canvas);
|
||||
draw_magic();
|
||||
update_screen_rect(&r_toolopt);
|
||||
}
|
||||
/* FIXME: Sfx */
|
||||
}
|
||||
else if (cur_tool == TOOL_TEXT)
|
||||
|
|
@ -4523,7 +4539,7 @@ static void mainloop(void)
|
|||
|
||||
if (mouseaccessibility)
|
||||
{
|
||||
if (magics[cur_magic].mode != MODE_FULLSCREEN) /* FIXME: Some non-fullscreen tools are also click-only (not click-and-drag), so we need another magic MODE_ type -bjk 2011.04.26 */
|
||||
if (magics[cur_magic].mode != MODE_FULLSCREEN && magics[cur_magic].mode != MODE_ONECLICK) /* Note: some non-fullscreen tools are also click-only (not click-and-drag) -bjk 2011.04.26 */
|
||||
emulate_button_pressed = !emulate_button_pressed;
|
||||
}
|
||||
}
|
||||
|
|
@ -4988,7 +5004,7 @@ static void mainloop(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (cur_tool == TOOL_MAGIC && magics[cur_magic].mode == MODE_PAINT)
|
||||
else if (cur_tool == TOOL_MAGIC && (magics[cur_magic].mode == MODE_PAINT || magics[cur_magic].mode == MODE_ONECLICK || magics[cur_magic].mode == MODE_PAINT_WITH_PREVIEW))
|
||||
{
|
||||
if(!mouseaccessibility || (mouseaccessibility && !emulate_button_pressed))
|
||||
{
|
||||
|
|
@ -5305,7 +5321,7 @@ static void mainloop(void)
|
|||
SDL_Flip(screen);
|
||||
}
|
||||
}
|
||||
else if (cur_tool == TOOL_MAGIC && magics[cur_magic].mode == MODE_PAINT)
|
||||
else if (cur_tool == TOOL_MAGIC && (magics[cur_magic].mode == MODE_PAINT || magics[cur_magic].mode == MODE_ONECLICK || magics[cur_magic].mode == MODE_PAINT_WITH_PREVIEW))
|
||||
{
|
||||
int undo_ctr;
|
||||
SDL_Surface * last;
|
||||
|
|
@ -8049,9 +8065,9 @@ static void draw_magic(void)
|
|||
|
||||
/* Show paint button: */
|
||||
|
||||
if (magics[cur_magic].mode == MODE_PAINT)
|
||||
if (magics[cur_magic].mode == MODE_PAINT || magics[cur_magic].mode == MODE_ONECLICK || magics[cur_magic].mode == MODE_PAINT_WITH_PREVIEW)
|
||||
button_color = img_btn_down; /* Active */
|
||||
else if (magics[cur_magic].avail_modes & MODE_PAINT)
|
||||
else if (magics[cur_magic].avail_modes & MODE_PAINT || magics[cur_magic].avail_modes & MODE_ONECLICK || magics[cur_magic].avail_modes & MODE_PAINT_WITH_PREVIEW)
|
||||
button_color = img_btn_up; /* Available, but not active */
|
||||
else
|
||||
button_color = img_btn_off; /* Unavailable */
|
||||
|
|
@ -17613,6 +17629,10 @@ static void load_magic_plugins(void)
|
|||
magics[num_magics].colors = magic_funcs[num_plugin_files].requires_colors(magic_api_struct, i);
|
||||
if (magics[num_magics].avail_modes & MODE_PAINT)
|
||||
magics[num_magics].mode = MODE_PAINT;
|
||||
else if (magics[num_magics].avail_modes & MODE_ONECLICK)
|
||||
magics[num_magics].mode = MODE_ONECLICK;
|
||||
else if (magics[num_magics].avail_modes & MODE_PAINT_WITH_PREVIEW)
|
||||
magics[num_magics].mode = MODE_PAINT_WITH_PREVIEW;
|
||||
else
|
||||
magics[num_magics].mode = MODE_FULLSCREEN;
|
||||
|
||||
|
|
@ -19487,7 +19507,7 @@ static void magic_switchout(SDL_Surface * last)
|
|||
canvas, last);
|
||||
update_canvas(0, 0, canvas->w, canvas->h);
|
||||
|
||||
if (was_clicking) {
|
||||
if (was_clicking && magics[cur_magic].mode == MODE_PAINT_WITH_PREVIEW) {
|
||||
/* Clean up preview! */
|
||||
do_undo();
|
||||
tool_avail[TOOL_REDO] = 0; /* Don't let them 'redo' to get preview back */
|
||||
|
|
@ -19517,7 +19537,7 @@ static void magic_switchin(SDL_Surface * last)
|
|||
|
||||
static int magic_modeint(int mode)
|
||||
{
|
||||
if (mode == MODE_PAINT)
|
||||
if (mode == MODE_PAINT || mode == MODE_ONECLICK || mode == MODE_PAINT_WITH_PREVIEW)
|
||||
return 0;
|
||||
else if (mode == MODE_FULLSCREEN)
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue