GDK: Prefix key names with KEY_

The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.

For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.

Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.
This commit is contained in:
Colin Walters
2010-09-08 13:35:51 -04:00
parent 03c19e37af
commit 913cdf3be7
62 changed files with 5503 additions and 3255 deletions

View File

@ -4219,36 +4219,36 @@ gtk_drag_key_cb (GtkWidget *widget,
{
switch (event->keyval)
{
case GDK_Escape:
case GDK_KEY_Escape:
gtk_drag_cancel (info, GTK_DRAG_RESULT_USER_CANCELLED, event->time);
return TRUE;
case GDK_space:
case GDK_Return:
case GDK_ISO_Enter:
case GDK_KP_Enter:
case GDK_KP_Space:
case GDK_KEY_space:
case GDK_KEY_Return:
case GDK_KEY_ISO_Enter:
case GDK_KEY_KP_Enter:
case GDK_KEY_KP_Space:
gtk_drag_end (info, event->time);
gtk_drag_drop (info, event->time);
return TRUE;
case GDK_Up:
case GDK_KP_Up:
case GDK_KEY_Up:
case GDK_KEY_KP_Up:
dy = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_Down:
case GDK_KP_Down:
case GDK_KEY_Down:
case GDK_KEY_KP_Down:
dy = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP;
break;
case GDK_Left:
case GDK_KP_Left:
case GDK_KEY_Left:
case GDK_KEY_KP_Left:
dx = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_Right:
case GDK_KP_Right:
case GDK_KEY_Right:
case GDK_KEY_KP_Right:
dx = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP;
break;
}