ui.backend.gtk: remove "Input method" menu, because it's for testing only

db4
Anton Gorenko 2010-09-04 23:15:00 +06:00
parent 9dfa0adbfb
commit 6ef16684e5
1 changed files with 10 additions and 30 deletions

View File

@ -1,21 +1,20 @@
! Copyright (C) 2010 Anton Gorenko, Philipp Brüschweiler. ! Copyright (C) 2010 Anton Gorenko, Philipp Brüschweiler.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.accessors alien.c-types alien.data USING: accessors alien.accessors alien.c-types alien.data
alien.strings arrays assocs classes.struct command-line alien.strings arrays assocs classes.struct command-line destructors
destructors gdk.ffi gdk.gl.ffi glib.ffi gobject.ffi gtk.ffi gdk.ffi gdk.gl.ffi glib.ffi gobject.ffi gtk.ffi gtk.gl.ffi io.backend
gtk.gl.ffi io.backend io.backend.unix.multiplexers io.backend.unix.multiplexers io.encodings.utf8 io.thread kernel libc
io.encodings.utf8 io.thread kernel libc literals locals math literals locals math math.bitwise math.order math.vectors namespaces
math.bitwise math.order math.vectors namespaces sequences sequences strings system threads ui ui.backend ui.clipboards
strings system threads ui ui.backend ui.clipboards ui.commands ui.event-loop ui.gadgets ui.gadgets.editors ui.gadgets.private
ui.event-loop ui.gadgets ui.gadgets.editors ui.gadgets.menus ui.gadgets.worlds ui.gestures ui.pixel-formats
ui.gadgets.private ui.gadgets.worlds ui.gestures ui.pixel-formats.private ui.private ;
ui.pixel-formats ui.pixel-formats.private ui.private ;
IN: ui.backend.gtk IN: ui.backend.gtk
SINGLETON: gtk-ui-backend SINGLETON: gtk-ui-backend
TUPLE: handle ; TUPLE: handle ;
TUPLE: window-handle < handle window fullscreen? im-context im-menu ; TUPLE: window-handle < handle window fullscreen? im-context ;
: <window-handle> ( window im-context -- window-handle ) : <window-handle> ( window im-context -- window-handle )
window-handle new window-handle new
@ -398,29 +397,10 @@ M: editor get-cursor-loc&dim
nip [ f gtk_im_context_set_client_window ] nip [ f gtk_im_context_set_client_window ]
[ g_object_unref ] bi ; [ g_object_unref ] bi ;
! for testing only
: com-input-method ( world -- )
find-world handle>> im-menu>> f f f f 0
gtk_get_current_event_time gtk_menu_popup ;
: im-menu ( world -- )
{ com-input-method } show-commands-menu ;
editor "input-method" f {
{ T{ button-down f { S+ C+ } 3 } im-menu }
} define-command-map
! --------
:: configure-im ( win im -- ) :: configure-im ( win im -- )
im win gtk_widget_get_window gtk_im_context_set_client_window im win gtk_widget_get_window gtk_im_context_set_client_window
im f gtk_im_context_set_use_preedit im f gtk_im_context_set_use_preedit
gtk_menu_new :> menu
im menu gtk_im_multicontext_append_menuitems
menu win window handle>> im-menu<<
im "commit" [ on-commit yield ] im "commit" [ on-commit yield ]
GtkIMContext:commit win connect-signal-with-data GtkIMContext:commit win connect-signal-with-data
im "retrieve-surrounding" [ on-retrieve-surrounding yield ] im "retrieve-surrounding" [ on-retrieve-surrounding yield ]