convolve.c dodgeburn.c pressing Shift now disables (and resets) the tool

* convolve.c
        * dodgeburn.c
        * eraser.c: pressing Shift now disables (and resets) the tool toggle
        and switches to line mode so the Ctrl key is free for constraints.

--Sven
This commit is contained in:
Sven Neumann
1999-11-20 00:30:41 +00:00
parent d24462044a
commit 80a0b2dd53
13 changed files with 315 additions and 124 deletions

View File

@ -1,3 +1,10 @@
Sat Nov 20 01:27:12 MET 1999 Sven Neumann <sven@gimp.org>
* convolve.c
* dodgeburn.c
* eraser.c: pressing Shift now disables (and resets) the tool toggle
and switches to line mode so the Ctrl key is free for constraints.
Thu Nov 18 18:52:38 MET 1999 Sven Neumann <sven@gimp.org> Thu Nov 18 18:52:38 MET 1999 Sven Neumann <sven@gimp.org>
* app/blend.c: implemented another way to restrict the angle * app/blend.c: implemented another way to restrict the angle

View File

@ -205,21 +205,41 @@ convolve_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (convolve_options->type)
{ {
case BLUR_CONVOLVE: switch (convolve_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE); {
break; case BLUR_CONVOLVE:
case SHARPEN_CONVOLVE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE); break;
break; case SHARPEN_CONVOLVE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (convolve_options->type)
{
case BLUR_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
break;
case SHARPEN_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -288,21 +288,41 @@ dodgeburn_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (dodgeburn_options->type)
{ {
case BURN: switch (dodgeburn_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE); {
break; case BURN:
case DODGE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE); break;
break; case DODGE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (dodgeburn_options->type)
{
case BURN:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
break;
case DODGE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -133,12 +133,18 @@ eraser_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
case GDK_Shift_R:
if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
case GDK_Control_L: case GDK_Control_R: case GDK_Control_L:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase); case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
} }
} }

View File

@ -205,21 +205,41 @@ convolve_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (convolve_options->type)
{ {
case BLUR_CONVOLVE: switch (convolve_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE); {
break; case BLUR_CONVOLVE:
case SHARPEN_CONVOLVE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE); break;
break; case SHARPEN_CONVOLVE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (convolve_options->type)
{
case BLUR_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
break;
case SHARPEN_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -288,21 +288,41 @@ dodgeburn_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (dodgeburn_options->type)
{ {
case BURN: switch (dodgeburn_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE); {
break; case BURN:
case DODGE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE); break;
break; case DODGE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (dodgeburn_options->type)
{
case BURN:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
break;
case DODGE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -133,12 +133,18 @@ eraser_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
case GDK_Shift_R:
if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
case GDK_Control_L: case GDK_Control_R: case GDK_Control_L:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase); case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
} }
} }

View File

@ -205,21 +205,41 @@ convolve_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (convolve_options->type)
{ {
case BLUR_CONVOLVE: switch (convolve_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE); {
break; case BLUR_CONVOLVE:
case SHARPEN_CONVOLVE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE); break;
break; case SHARPEN_CONVOLVE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (convolve_options->type)
{
case BLUR_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
break;
case SHARPEN_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -288,21 +288,41 @@ dodgeburn_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (dodgeburn_options->type)
{ {
case BURN: switch (dodgeburn_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE); {
break; case BURN:
case DODGE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE); break;
break; case DODGE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (dodgeburn_options->type)
{
case BURN:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
break;
case DODGE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -133,12 +133,18 @@ eraser_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
case GDK_Shift_R:
if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
case GDK_Control_L: case GDK_Control_R: case GDK_Control_L:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase); case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
} }
} }

View File

@ -205,21 +205,41 @@ convolve_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (convolve_options->type)
{ {
case BLUR_CONVOLVE: switch (convolve_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE); {
break; case BLUR_CONVOLVE:
case SHARPEN_CONVOLVE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE); break;
break; case SHARPEN_CONVOLVE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (convolve_options->type)
{
case BLUR_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[SHARPEN_CONVOLVE]), TRUE);
break;
case SHARPEN_CONVOLVE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (convolve_options->type_w[BLUR_CONVOLVE]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -288,21 +288,41 @@ dodgeburn_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
break; case GDK_Shift_R:
case GDK_Control_L: case GDK_Control_R: if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
switch (dodgeburn_options->type)
{ {
case BURN: switch (dodgeburn_options->type)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE); {
break; case BURN:
case DODGE: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE); break;
break; case DODGE:
default: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break; break;
default:
break;
}
}
break;
case GDK_Control_L:
case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
{
switch (dodgeburn_options->type)
{
case BURN:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[DODGE]), TRUE);
break;
case DODGE:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dodgeburn_options->type_w[BURN]), TRUE);
break;
default:
break;
}
} }
break; break;
} }

View File

@ -133,12 +133,18 @@ eraser_modifier_key_func (Tool *tool,
{ {
switch (kevent->keyval) switch (kevent->keyval)
{ {
case GDK_Alt_L: case GDK_Alt_R: case GDK_Alt_L:
case GDK_Alt_R:
break; break;
case GDK_Shift_L: case GDK_Shift_R: case GDK_Shift_L:
case GDK_Shift_R:
if (kevent->state & GDK_CONTROL_MASK) /* reset tool toggle */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
case GDK_Control_L: case GDK_Control_R: case GDK_Control_L:
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase); case GDK_Control_R:
if ( !(kevent->state & GDK_SHIFT_MASK) ) /* shift enables line draw mode */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (eraser_options->anti_erase_w), ! eraser_options->anti_erase);
break; break;
} }
} }