diff options
author | Bastien Nocera <hadess@hadess.net> | 2009-09-09 18:01:43 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2009-09-09 18:45:28 +0100 |
commit | 11898088a1ac30eff17e7f24dd906aba476ae384 (patch) | |
tree | bbe1310485d32a431c682d030f64a0888c19d20e /gdk/gdkkeysyms-update.pl | |
parent | 3dd459caea597abc776b3052353372938748bbe4 (diff) | |
download | gtk+-11898088a1ac30eff17e7f24dd906aba476ae384.tar.gz |
BugĀ 594668 - Add new Xorg keysyms
Add support for XF86keysym.h to gdkkeysyms-update.pl and
update the generated gdkkeysyms.h file for the latest sources.
Diffstat (limited to 'gdk/gdkkeysyms-update.pl')
-rwxr-xr-x | gdk/gdkkeysyms-update.pl | 61 |
1 files changed, 55 insertions, 6 deletions
diff --git a/gdk/gdkkeysyms-update.pl b/gdk/gdkkeysyms-update.pl index 4f59fd2b79..62d05daffd 100755 --- a/gdk/gdkkeysyms-update.pl +++ b/gdk/gdkkeysyms-update.pl @@ -1,13 +1,15 @@ #!/usr/bin/env perl -# Updates http://svn.gnome.org/viewcvs/gtk%2B/trunk/gdk/gdkkeysyms.h?view=log from upstream (X.org 7.x), +# Updates http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h from upstream (X.org 7.x), # from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h # # Author : Simos Xenitellis <simos at gnome dot org>. +# Authos : Bastien Nocera <hadess@hadess.net> # Version : 1.2 # # Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h -# Output : http://svn.gnome.org/svn/gtk+/trunk/gdk/gdkkeysyms.h +# Input : http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h +# Output : http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms.h # # Notes : It downloads keysymdef.h from the Internet, if not found locally, # Notes : and creates an updated gdkkeysyms.h @@ -33,6 +35,20 @@ else print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h\n\n"; } +if ( ! -f "XF86keysym.h" ) +{ + print "Trying to download XF86keysym.h from\n"; + print "http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n"; + die "Unable to download keysymdef.h from http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\n" + unless system("wget -c -O XF86keysym.h \"http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h\"") == 0; + print " done.\n\n"; +} +else +{ + print "We are using existing XF86keysym.h found in this directory.\n"; + print "It is assumed that you took care and it is a recent version\n"; + print "as found at http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h\n\n"; +} if ( -f "gdkkeysyms.h" ) { @@ -41,7 +57,7 @@ if ( -f "gdkkeysyms.h" ) die "Exiting...\n\n"; } -# Source: http://cvs.freedesktop.org/xorg/xc/include/keysymdef.h +# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=keysymdef.h die "Could not open file keysymdef.h: $!\n" unless open(IN_KEYSYMDEF, "<:utf8", "keysymdef.h"); # Output: gtk+/gdk/gdkkeysyms.h @@ -50,7 +66,7 @@ die "Could not open file gdkkeysyms.h: $!\n" unless open(OUT_GDKKEYSYMS, ">:utf8 print OUT_GDKKEYSYMS<<EOF; /* GDK - The GIMP Drawing Kit * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * Copyright (C) 2005, 2006, 2007 GNOME Foundation + * Copyright (C) 2005, 2006, 2007, 2009 GNOME Foundation * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -69,9 +85,11 @@ print OUT_GDKKEYSYMS<<EOF; */ /* - * File auto-generated from script http://svn.gnome.org/viewcvs/gtk%2B/trunk/gdk/gdkkeysyms-update.pl + * File auto-generated from script http://git.gnome.org/cgit/gtk+/tree/gdk/gdkkeysyms-update.pl * using the input file * http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=keysymdef.h + * and + * http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob_plain;f=XF86keysym.h */ /* @@ -106,9 +124,40 @@ while (<IN_KEYSYMDEF>) printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $keysymelements[1], hex($keysymelements[2]); } +close IN_KEYSYMDEF; + #$gdksyms{"0"} = "0000"; -close IN_KEYSYMDEF; +# Source: http://gitweb.freedesktop.org/?p=xorg/proto/x11proto.git;a=blob;f=XF86keysym.h +die "Could not open file XF86keysym.h: $!\n" unless open(IN_XF86KEYSYM, "<:utf8", "XF86keysym.h"); + +while (<IN_XF86KEYSYM>) +{ + next if ( ! /^#define / ); + + @keysymelements = split(/\s+/); + die "Internal error, no \@keysymelements: $_\n" unless @keysymelements; + + $_ = $keysymelements[1]; + die "Internal error, was expecting \"XF86XK_*\", found: $_\n" if ( ! /^XF86XK_/ ); + + # Work-around https://bugs.freedesktop.org/show_bug.cgi?id=11193 + if ($_ eq "XF86XK_XF86BackForward") { + $keysymelements[1] = "XF86XK_AudioForward"; + } + + # Ignore XF86XK_Q + next if ( $_ eq "XF86XK_Q"); + + $_ = $keysymelements[2]; + die "Internal error, was expecting \"0x*\", found: $_\n" if ( ! /^0x/ ); + + $keysymelements[1] =~ s/^XF86XK_/GDK_/g; + + printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $keysymelements[1], hex($keysymelements[2]); +} + +close IN_XF86KEYSYM; print OUT_GDKKEYSYMS<<EOF; |