Commit 4d6c5099 authored by Takao Fujiwara's avatar Takao Fujiwara Committed by Matthias Clasen

GtkIMContextSimple: Update compose table

This adds Multi_key + f + i, as well as other sequences,
mainly Greek.

https://bugzilla.gnome.org/show_bug.cgi?id=710510
parent 4b42526e
...@@ -21,7 +21,7 @@ import sys ...@@ -21,7 +21,7 @@ import sys
import getopt import getopt
# We grab files off the web, left and right. # We grab files off the web, left and right.
URL_COMPOSE = 'http://gitweb.freedesktop.org/?p=xorg/lib/libX11.git;a=blob_plain;f=nls/en_US.UTF-8/Compose.pre' URL_COMPOSE = 'http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre'
URL_KEYSYMSTXT = "http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt" URL_KEYSYMSTXT = "http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt"
URL_GDKKEYSYMSH = "http://git.gnome.org/browse/gtk%2B/plain/gdk/gdkkeysyms.h" URL_GDKKEYSYMSH = "http://git.gnome.org/browse/gtk%2B/plain/gdk/gdkkeysyms.h"
URL_UNICODEDATATXT = 'http://www.unicode.org/Public/6.0.0/ucd/UnicodeData.txt' URL_UNICODEDATATXT = 'http://www.unicode.org/Public/6.0.0/ucd/UnicodeData.txt'
...@@ -52,13 +52,13 @@ headerfile_start = """/* GTK - The GIMP Tool Kit ...@@ -52,13 +52,13 @@ headerfile_start = """/* GTK - The GIMP Tool Kit
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see see <http://www.gnu.org/licenses/>. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* /*
* File auto-generated from script found at http://bugzilla.gnome.org/show_bug.cgi?id=321896 * File auto-generated from script found at http://bugzilla.gnome.org/show_bug.cgi?id=321896
* using the input files * using the input files
* Input : http://gitweb.freedesktop.org/?p=xorg/lib/libX11.git;a=blob_plain;f=nls/en_US.UTF-8/Compose.pre * Input : http://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre
* Input : http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt * Input : http://www.cl.cam.ac.uk/~mgk25/ucs/keysyms.txt
* Input : http://www.unicode.org/Public/UNIDATA/UnicodeData.txt * Input : http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
* *
...@@ -375,6 +375,7 @@ def process_keysymstxt(): ...@@ -375,6 +375,7 @@ def process_keysymstxt():
keysymdb['ninesubscript'] = 0x2089 keysymdb['ninesubscript'] = 0x2089
keysymdb['dead_doublegrave'] = 0x030F keysymdb['dead_doublegrave'] = 0x030F
keysymdb['dead_invertedbreve'] = 0x0311 keysymdb['dead_invertedbreve'] = 0x0311
keysymdb['dead_greek'] = 0xfe8c
return keysymdb return keysymdb
...@@ -499,18 +500,18 @@ for line in xorg_compose_sequences_raw: ...@@ -499,18 +500,18 @@ for line in xorg_compose_sequences_raw:
continue continue
#line = line[:-1] #line = line[:-1]
components = split(':', line) components = split(':', line, 1)
if len(components) != 2: if len(components) != 2:
print "Invalid line %(linenum_compose)d in %(filename)s: No sequence\ print "Invalid line %(linenum_compose)d in %(filename)s: No sequence\
/value pair found" % { "linenum_compose": linenum_compose, "filename": filename_compose } /value pair found" % { "linenum_compose": linenum_compose, "filename": filename_compose }
exit(-1) exit(-1)
(seq, val ) = split(':', line) (seq, val ) = split(':', line, 1)
seq = seq.strip() seq = seq.strip()
val = val.strip() val = val.strip()
raw_sequence = findall('\w+', seq) raw_sequence = findall('\w+', seq)
values = split('\s+', val) values = split('\s+', val)
unichar_temp = split('"', values[0]) unichar_temp = split('"', values[0])
unichar = unichar_temp[1] unichar_utf8 = unichar_temp[1]
if len(values) == 1: if len(values) == 1:
continue continue
codepointstr = values[1] codepointstr = values[1]
...@@ -527,10 +528,8 @@ for line in xorg_compose_sequences_raw: ...@@ -527,10 +528,8 @@ for line in xorg_compose_sequences_raw:
#print raw_sequence, codepointstr #print raw_sequence, codepointstr
codepoint = keysymunicodedatabase[codepointstr] codepoint = keysymunicodedatabase[codepointstr]
else: else:
print unichar = unicode(unichar_utf8, 'utf-8')
print "Invalid codepoint at line %(linenum_compose)d in %(filename)s:\ codepoint = ord(unichar)
%(line)s" % { "linenum_compose": linenum_compose, "filename": filename_compose, "line": line }
exit(-1)
sequence = rename_combining(raw_sequence) sequence = rename_combining(raw_sequence)
reject_this = False reject_this = False
for i in sequence: for i in sequence:
...@@ -773,6 +772,16 @@ def convert_UnotationToHex(arg): ...@@ -773,6 +772,16 @@ def convert_UnotationToHex(arg):
def addprefix_GDK(arg): def addprefix_GDK(arg):
if match('^0x', arg): if match('^0x', arg):
return '%(arg)s, ' % { 'arg': arg } return '%(arg)s, ' % { 'arg': arg }
elif match('^U[0-9A-F][0-9A-F][0-9A-F][0-9A-F]$', arg.upper()):
keysym = ''
for k, c in keysymunicodedatabase.items():
if c == keysymvalue(arg):
keysym = k
break
if keysym != '':
return 'GDK_KEY_%(arg)s, ' % { 'arg': keysym }
else:
return '0x%(arg)04X, ' % { 'arg': keysymvalue(arg) }
else: else:
return 'GDK_KEY_%(arg)s, ' % { 'arg': arg } return 'GDK_KEY_%(arg)s, ' % { 'arg': arg }
......
...@@ -80,7 +80,7 @@ struct _GtkComposeTableCompact ...@@ -80,7 +80,7 @@ struct _GtkComposeTableCompact
static const GtkComposeTableCompact gtk_compose_table_compact = { static const GtkComposeTableCompact gtk_compose_table_compact = {
gtk_compose_seqs_compact, gtk_compose_seqs_compact,
5, 5,
24, 25,
6 6
}; };
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment