3 # Updates http://cvs.gnome.org/viewcvs/gtk%2B/gdk/gdkkeysyms.h from upstream (X.org 6.9/7.0),
4 # OLD OLD -----from http://cvs.freedesktop.org/xorg/xc/include/keysymdef.h------ OLD OLD
5 # from http://webcvs.freedesktop.org/*checkout*/xorg/proto/X11/keysymdef.h
7 # Author : Simos Xenitellis <simos at gnome dot org>.
10 # Input : http://webcvs.freedesktop.org/xorg/proto/X11/keysymdef.h
11 # Output : http://cvs.gnome.org/viewcvs/gtk%2B/gdk/gdkkeysyms.h
13 # Notes : It downloads keysymdef.h from the Internet if not found locally
14 # Notes : and creates an updated gdkkeysyms.h
18 # Used for reading the keysymdef symbols.
21 if ( ! -f "keysymdef.h" )
23 print "Trying to download keysymdef.h from\n";
24 print "http://webcvs.freedesktop.org/xorg/proto/X11/keysymdef.h: ";
25 die "Unable to download keysymdef.h from http://webcvs.freedesktop.org/xorg/proto/X11/keysymdef.h\n"
26 unless system("wget -q \"http://webcvs.freedesktop.org/*checkout*/xorg/proto/X11/keysymdef.h\"") == 0;
31 print "We are using existing keysymdef.h found in this directory.\n";
32 print "It is assume that you took care and it is a recent version\n";
33 print "as found at http://webcvs.freedesktop.org/*checkout*/xorg/proto/X11/keysymdef.h\n\n";
37 if ( -f "gdkkeysyms.h" )
39 print "There is already a gdkkeysyms.h file in this directory. We are not overwriting it.\n";
40 print "Please move it in order to run this script.\n";
44 # Source: http://cvs.freedesktop.org/xorg/xc/include/keysymdef.h
45 die "Could not open file keysymdef.h: $!\n" unless open(IN_KEYSYMDEF, "<:utf8", "keysymdef.h");
47 # Output: gtk+/gdk/gdkkeysyms.h
48 die "Could not open file gdkkeysyms.h: $!\n" unless open(OUT_GDKKEYSYMS, ">:utf8", "gdkkeysyms.h");
50 print OUT_GDKKEYSYMS<<EOF;
51 /* GDK - The GIMP Drawing Kit
52 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
53 * Copyright (C) 2005 GNOME Foundation
55 * This library is free software; you can redistribute it and/or
56 * modify it under the terms of the GNU Lesser General Public
57 * License as published by the Free Software Foundation; either
58 * version 2 of the License, or (at your option) any later version.
60 * This library is distributed in the hope that it will be useful,
61 * but WITHOUT ANY WARRANTY; without even the implied warranty of
62 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
63 * Lesser General Public License for more details.
65 * You should have received a copy of the GNU Lesser General Public
66 * License along with this library; if not, write to the
67 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
68 * Boston, MA 02111-1307, USA.
72 * File auto-generated from script gdkkeysyms-update.pl
73 * using the input file
74 * http://cvs.freedesktop.org/xorg/xc/include/keysymdef.h
78 * Modified by the GTK+ Team and others 1997-2001. See the AUTHORS
79 * file for a list of people on the GTK+ Team. See the ChangeLog
80 * files for a list of changes. These files are distributed with
81 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
84 #ifndef __GDK_KEYSYMS_H__
85 #define __GDK_KEYSYMS_H__
91 while (<IN_KEYSYMDEF>)
93 next if ( ! /^#define / );
95 @keysymelements = split(/\s+/);
96 die "Internal error, no \@keysymelements: $_\n" unless @keysymelements;
98 $_ = $keysymelements[1];
99 die "Internal error, was expecting \"XC_*\", found: $_\n" if ( ! /^XK_/ );
101 $_ = $keysymelements[2];
102 die "Internal error, was expecting \"0x*\", found: $_\n" if ( ! /^0x/ );
104 $keysymelements[1] =~ s/^XK_/GDK_/g;
106 printf OUT_GDKKEYSYMS "#define %s 0x%03x\n", $keysymelements[1], hex($keysymelements[2]);
109 #$gdksyms{"0"} = "0000";
114 print OUT_GDKKEYSYMS<<EOF;
116 #endif /* __GDK_KEYSYMS_H__ */
119 printf "We just finished converting keysymdef.h to gdkkeysyms.h\n";