[gtk+/wip/meson: 120/136] Remove gdkkeysyms-compat.h



commit a2a8f9ca17a888442006f8396416637688235d7c
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Apr 18 18:31:27 2017 +0100

    Remove gdkkeysyms-compat.h
    
    The compatibility header was needed after GTK+ 3.0 renamed the key
    symbols from `GDK_*` to `GDK_KEY_*` to avoid collisions.

 gdk/Makefile.am                 |   12 +-
 gdk/gdkkeysyms-compat.h         | 2301 ---------------------------------------
 gdk/gdkkeysyms-update.pl        |   31 +-
 gdk/makefile.msc                |    1 -
 gdk/meson.build                 |    2 +-
 modules/input/gtkimcontextime.c |    8 +-
 6 files changed, 12 insertions(+), 2343 deletions(-)
---
diff --git a/gdk/Makefile.am b/gdk/Makefile.am
index 2a5b051..ed2ba8d 100644
--- a/gdk/Makefile.am
+++ b/gdk/Makefile.am
@@ -75,7 +75,6 @@ gdk_public_h_sources =                                \
        gdkglcontext.h                          \
        gdkkeys.h                               \
        gdkkeysyms.h                            \
-       gdkkeysyms-compat.h                     \
        gdkmain.h                               \
        gdkmonitor.h                            \
        gdkpango.h                              \
@@ -224,11 +223,12 @@ endif
 
 if HAVE_INTROSPECTION
 
-introspection_files =          \
-       $(filter-out gdkkeysyms-compat.h, $(gdk_h_sources))     \
-       $(gdk_c_sources)        \
-        gdkenumtypes.c         \
-        gdkenumtypes.h
+introspection_files = \
+       $(gdk_h_sources) \
+       $(gdk_c_sources) \
+        gdkenumtypes.c \
+        gdkenumtypes.h \
+       $()
 
 Gdk-noinst-4.0.gir: libgdk-4.la Makefile
 Gdk_noinst_4_0_gir_SCANNERFLAGS =      \
diff --git a/gdk/gdkkeysyms-update.pl b/gdk/gdkkeysyms-update.pl
index a255a04..7bf9314 100755
--- a/gdk/gdkkeysyms-update.pl
+++ b/gdk/gdkkeysyms-update.pl
@@ -56,9 +56,6 @@ die "Could not open file keysymdef.h: $!\n" unless open(IN_KEYSYMDEF, "<:utf8",
 # Output: gtk+/gdk/gdkkeysyms.h
 die "Could not open file gdkkeysyms.h: $!\n" unless open(OUT_GDKKEYSYMS, ">:utf8", "gdkkeysyms.h");
 
-# Output: gtk+/gdk/gdkkeysyms-compat.h
-die "Could not open file gdkkeysyms-compat.h: $!\n" unless open(OUT_GDKKEYSYMS_COMPAT, ">:utf8", 
"gdkkeysyms-compat.h");
-
 my $LICENSE_HEADER= <<EOF;
 /* GDK - The GIMP Drawing Kit
  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
@@ -81,7 +78,6 @@ my $LICENSE_HEADER= <<EOF;
 EOF
 
 print OUT_GDKKEYSYMS $LICENSE_HEADER;
-print OUT_GDKKEYSYMS_COMPAT $LICENSE_HEADER;
 
 print OUT_GDKKEYSYMS<<EOF;
 
@@ -106,20 +102,6 @@ print OUT_GDKKEYSYMS<<EOF;
 
 EOF
 
-print OUT_GDKKEYSYMS_COMPAT<<EOF;
-/*
- * Compatibility version of gdkkeysyms.h.
- *
- * In GTK3, keysyms changed to have a KEY_ prefix.  This is a compatibility header
- * your application can include to gain access to the old names as well.  Consider
- * porting to the new names instead.
- */
-
-#ifndef __GDK_KEYSYMS_COMPAT_H__
-#define __GDK_KEYSYMS_COMPAT_H__
-
-EOF
-
 while (<IN_KEYSYMDEF>)
 {
        next if ( ! /^#define / );
@@ -136,11 +118,8 @@ while (<IN_KEYSYMDEF>)
        my $element = $keysymelements[1];
        my $binding = $element;
        $binding =~ s/^XK_/GDK_KEY_/g;
-       my $compat_binding = $element;
-       $compat_binding =~ s/^XK_/GDK_/g;
 
        printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $binding, hex($keysymelements[2]);
-       printf OUT_GDKKEYSYMS_COMPAT "#define %s 0x%03x\n", $compat_binding, hex($keysymelements[2]);
 }
 
 close IN_KEYSYMDEF;
@@ -178,11 +157,8 @@ while (<IN_XF86KEYSYM>)
        my $element = $keysymelements[1];
        my $binding = $element;
        $binding =~ s/^XF86XK_/GDK_KEY_/g;
-       my $compat_binding = $element;
-       $compat_binding =~ s/^XF86XK_/GDK_/g;
 
        printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $binding, hex($keysymelements[2]);
-       printf OUT_GDKKEYSYMS_COMPAT "#define %s 0x%03x\n", $compat_binding, hex($keysymelements[2]);
 }
 
 close IN_XF86KEYSYM;
@@ -193,9 +169,4 @@ print OUT_GDKKEYSYMS<<EOF;
 #endif /* __GDK_KEYSYMS_H__ */
 EOF
 
-print OUT_GDKKEYSYMS_COMPAT<<EOF;
-
-#endif /* __GDK_KEYSYMS_COMPAT_H__ */
-EOF
-
-printf "We just finished converting keysymdef.h to gdkkeysyms.h and gdkkeysyms-compat.h\nThank you\n";
+printf "We just finished converting keysymdef.h to gdkkeysyms.h\nThank you\n";
diff --git a/gdk/makefile.msc b/gdk/makefile.msc
index ec5d6a9..890a517 100644
--- a/gdk/makefile.msc
+++ b/gdk/makefile.msc
@@ -101,7 +101,6 @@ gdk_public_h_sources =                              \
        gdkevents.h                             \
        gdkkeys.h                               \
        gdkkeysyms.h                            \
-       gdkkeysyms-compat.h                     \
        gdkmain.h                               \
        gdkpango.h                              \
        gdkpixbuf.h                             \
diff --git a/gdk/meson.build b/gdk/meson.build
index 5196dfc..05fc2af 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -74,7 +74,7 @@ gdk_public_headers = files([
   'gdkvisual.h',
   'gdkwindow.h',
 ])
-install_headers(gdk_public_headers + [ 'gdkkeysyms-compat.h' ], subdir: 'gtk-4.0/gdk/')
+install_headers(gdk_public_headers, subdir: 'gtk-4.0/gdk/')
 
 gdk_sources = gdk_public_sources
 
diff --git a/modules/input/gtkimcontextime.c b/modules/input/gtkimcontextime.c
index d76f180..b020b73 100644
--- a/modules/input/gtkimcontextime.c
+++ b/modules/input/gtkimcontextime.c
@@ -31,7 +31,7 @@
 
 #include "imm-extra.h"
 
-#include "gdk/gdkkeysyms-compat.h"
+#include "gdk/gdkkeysyms.h"
 #include "gdk/win32/gdkwin32.h"
 #include "gdk/gdkkeysyms.h"
 
@@ -51,7 +51,7 @@
 /* #define BUFSIZE 4096 */
 
 #define IS_DEAD_KEY(k) \
-    ((k) >= GDK_dead_grave && (k) <= (GDK_dead_dasia+1))
+    ((k) >= GDK_KEY_dead_grave && (k) <= (GDK_KEY_dead_dasia+1))
 
 #define FREE_PREEDIT_BUFFER(ctx) \
 {                                \
@@ -311,7 +311,7 @@ _gtk_im_context_ime_dead_key_unichar (guint    keyval,
   switch (keyval)
     {
 #define CASE(keysym, unicode, spacing_unicode) \
-      case GDK_dead_##keysym: return (spacing) ? spacing_unicode : unicode;
+      case GDK_KEY_dead_##keysym: return (spacing) ? spacing_unicode : unicode;
 
       CASE (grave, 0x0300, 0x0060);
       CASE (acute, 0x0301, 0x00b4);
@@ -388,7 +388,7 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
   if (!GDK_IS_WINDOW (context_ime->client_window))
     return FALSE;
 
-  if (event->keyval == GDK_space &&
+  if (event->keyval == GDK_KEY_space &&
       context_ime->priv->dead_key_keyval != 0)
     {
       c = _gtk_im_context_ime_dead_key_unichar (context_ime->priv->dead_key_keyval, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]