Use GtkIMContext instead of ClutterIMContext

Add StIMText, which is a drop-in replacement for ClutterIMText but
uses GtkIMContext instead of ClutterIMContext.

StIMText doesn't have preedit support (would need ClutterText
changes), so isn't going to be useful for complicated input methods,
but is good enough to get dead keys and similar working.

entry.js: Simple test case of StEntry
gnome-shell.modules: Remove clutter-imcontext module

https://bugzilla.gnome.org/show_bug.cgi?id=597471
This commit is contained in:
Owen W. Taylor
2009-10-05 16:33:19 -04:00
parent 4bdd40911f
commit 53fbabe2ca
8 changed files with 584 additions and 11 deletions

View File

@ -6,6 +6,7 @@ TEST_JS = \
interactive/box-layout.js \
interactive/calendar.js \
interactive/css-fonts.js \
interactive/entry.js \
interactive/inline-style.js \
interactive/scrolling.js \
interactive/table.js \

View File

@ -0,0 +1,32 @@
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
const Clutter = imports.gi.Clutter;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
const St = imports.gi.St;
const Calendar = imports.ui.calendar;
const UI = imports.testcommon.ui;
Gtk.init(null, null);
UI.init();
let stage = Clutter.Stage.get_default();
stage.width = stage.height = 400;
stage.show();
let vbox = new St.BoxLayout({ vertical: true,
width: stage.width,
height: stage.height,
style: 'padding: 10px; spacing: 10px; font: 15px sans-serif;' });
stage.add_actor(vbox);
let entry = new St.Entry({ style: 'border: 1px solid black;' });
vbox.add(entry,
{ expand: true,
y_fill: false, y_align: St.Align.MIDDLE });
entry.grab_key_focus();
stage.show();
Clutter.main();
stage.destroy();