This was added a few years ago, as a way to have _no_ im context
at all. But it didn't actually work. Make it work, and streamline
the handling of none by moving it all to gtkimmodule.c.
As part of this, add context to the translated names of all
im modules we ship.
We add a custom im module for broadway that calls some broadway
specific APIs to show/hide the keyboard on focus in/out. We then forward this
to the browser, and on the ipad we focus an input field to activate
the keyboard.
GTK+ tries to automatically assign the best input module based on the
'system locale'. In the specific case of the IME input method, it will
be the default for the whole GTK+ application if the system locale is
either Japanese (ja), Korean (ko) or Chinese (zh). Other defaults are
equally applicable, e.g. if system locale is Catalan (ca), the special
'Cedilla' input module is chosen.
System locale can be changed (e.g. Win7) through the following sequence
(reboot required):
Control Panel
Region and Language
Administrative
Language for non-Unicode Programs
Change system locale...
The problem with this behaviour is that changing the 'default input
language' (e.g. from English to Japanese+IME) doesn't affect the GTK+
application. Therefore, I can have an English system locale (where GTK+
will choose Simple IM by default) but then have Japanese+IME as input
language.
Default input language can be changed (e.g. Win7) through the following
sequence (no reboot required):
System locale can be changed (e.g. Win7) through:
Control Panel
Region and Language
Keyboards and Languages
Keyboards and other input languages
Change keyboards...
Default input language can also be changed using the language bar directly.
So, instead of using the system-wide default locale to decide which input
method to use as default, better use the input language specified by the
user, which may be the same as the system-wide default locale, or different.
Following the previous example, with an English system locale and a
Japanese+IME input language, the default input method will now be IME
instead of Simple, which is closer to what's expected by the user.
This change only affects the application during startup; i.e. if the user
changes the input language while the application is running, we wouldn't be
changing the default input method to use. We could do this processing the
WM_INPUTLANGCHANGE messages, though.
https://bugzilla.gnome.org/show_bug.cgi?id=700428
With multiple GDK backends in the process, we run into problems where
we try to use the Wayland im module on X, which crashes. This commit
adds a quick backend filter that removes the wayland, xim and ime
input methods from consideration unless the corresponding GDK backend
is in use.
This code is called early on, without a window, and then later on
with a window. Currently, it returns different results for these
cases when the setting contains a value. That leads to pointless
construction and destruction of im contexts. Instead, just look
at the settings of the default screen. In practice, there is only
one screen, ever.
Move the remaining struct definition into gtkimcontextinfo.h and include
that header in gtk.h. gtkimmodule.h is now an empty header. We should
probably deprecate it somehow.
This is also necessary so headers used in gtk .c files don't include
gtk.h which in turn includes all the deprecated headers which we want to
avoid so we can include them with deprecation warnings turned off.
Make includes not rely on gtkimmodule.h including gtk.h. This will be
important once we remove gtkimmodule from the include files.
That way, we can achieve not pulling deprecated headers automatically.
- add gtkmodulesprivate.h and move stuff there from gtkprivate.h
- add gtkprivate.c and move stuff there from gtkmain.c
- add gtkwin32.c and move stuff there from gtkmain.c
- don't redefine GTK_DATADIR and friends in gtkprivate.h
- have _gtk_get_datadir() and friends on all platforms
- remove the horrid hacks where gtkprivate.h can't be included,
or must be included later due to redefinition of the compile-time
directories
Add a function to obtain the effective context id, and reset the slave
only when the effective context id is different from the current context
id, when setting a client window and on focus in. This might fix
bug 593868 and bug 567124.
setting up the im context before the widget is realized, just
reset it when the client window is set.
* gtk/gtkimmulticontext.c: Reset the slave when a client window
is set.
* gtk/gtkimmodule.c
* gtk/gtktextview.c: Revert changes for bug 567124.
svn path=/trunk/; revision=22214
* gtk/gtktextview.c: Don't set up im stuff if the widget
is not realized.
* gtk/gtkimmodule.c: Assert that we have a window.
svn path=/trunk/; revision=22193
* gtk/gtkimcontext.h: Add public/private markers.
* gtk/gtkimcontext.c: Add section documentation which explains how
to add a new input method module to GTK+. Document the signals and
virtual functions of GtkIMContextClass.
* gtk/gtkimmodule.c: Document struct GtkIMContextInfo.
* docs/reference/gtk/gtk-sections.txt: Add GtkIMContextClass and
GtkIMContextInfo to section GtkIMContext.
* docs/reference/gtk/Makefile.am (IGNORE_HFILES): Remove
gtkimmodule.h from the list in order to pick up GtkIMContextInfo.
* docs/reference/gtk/tmpl/gtkimcontext.sgml: Remove file from
repository since all the hand-edited content has been migrated to
source file comments.
svn path=/trunk/; revision=21870
2008-06-30 Cody Russell <bratsche@gnome.org>
* Practically everything changed.
Change all references of GIMP Toolkit (and variations of it)
to GTK+ Toolkit, showing no mercy at all to our beloved
ancestry. (#540529)
svn path=/trunk/; revision=20709
2008-04-25 Michael Natterer <mitch@imendio.com>
* gtk/gtkprintcontext.h: include <pango/pango.h> instead of
<pango/pango-layout.h>.
* gtk/gtkiconfactory.c
* gtk/gtkimmodule.c
* gtk/gtkmain.c
* gtk/gtkmodules.c
* gtk/queryimmodules.c: remove inclusion of single files from
pango, none of them was actually needed.
* modules/input/gtkimcontextime.c: include <pango/pango.h> instead of
<pango/pango-utils.h>.
svn path=/trunk/; revision=20042
2008-03-18 Tor Lillqvist <tml@novell.com>
Bug 99192 - Add --with-include-input-modules
* configure.in: Add --with-included-immodules switch. Handled in a
similar way as the --with-included-loaders switch. For each input
method module foo: Collect the list of input modules to be built
into libgtk into INCLUDED_IMMODULE_OBJ. Collect a list of
-DINCLUDE_IM_foo definitions into INCLUDED_IMMODULE_DEFINE.
Define Automake conditionals INCLUDE_IM_FOO.
* modules/input/Makefile.am: For modules to be included in libgtk,
build a static library.
* modules/input/im*.c: Use MODULE_ENTRY macros much like in
gdk-pixbuf to get unique names for the functions called by libgtk
in the included case. Use G_MODULE_EXPORT in the non-included case
so that we don't unnecessarily export unneeded random global
symbols on Windows.
* gtk/Makefile.am: Build the included modules and link them into libgtk.
* gtk/gtkimmodule.c: Handle the built-in modules. Remove
copy/paste leftover mentions of "themes" in comments.
svn path=/trunk/; revision=19896
2007-12-17 Matthias Clasen <mclasen@redhat.com>
* gtk/gtksettings.c: Add a gtk-im-module GTK setting
* gdk/win32/gdkproperty-win32.c:
* gdk/x11/gdksettings.c: ...and back it by a Gtk/IMModule X setting.
* gtk/gtkimmodule.[hc]:
* gtk/gtkimmulticontext.[hc]: When determining the default context,
look at the gtk-im-module setting, and listen for changes to the
setting. (#502446, Akira Tagoh)
svn path=/trunk/; revision=19195
2007-01-17 Tor Lillqvist <tml@novell.com>
Proper fix for #396175:
* gtk/gtkimmulticontext.c: Revert change by Hans Breuer below: Do
include gtkprivate.h. On Win32 we do want to use the redefinition
of GTK_LOCALEDIR as a call to the function _gtk_get_localedir().
* gtk/gtkimmodule.c: Instead, correct the prefix also on
simple_context_info.domain_dirname. Do the prefix corrections
always on Win32, not just when GTK_LIBDIR is defined. i.e., until
now they were done only in the autoconfiscated gcc builds. Hans
needs to make sure GTK_LIBDIR and GTK_LOCALEDIR are defined also
in MSVC builds now.
(correct_localedir_prefix): New function, like
correct_libdir_prefix(), but for GTK_LOCALEDIR.
(_gtk_im_module_list): Call correct_localedir_prefix() on
simple_context_info.domain_dirname.
svn path=/trunk/; revision=17161
2005-09-01 Matthias Clasen <mclasen@redhat.com>
* gdk/*.c: Intern some more strings.
* gtk/gtkintl.h:
* gtk/*.c: Define an I_() macro and use it instead of the
bulky g_intern_static_string().
2005-08-31 Matthias Clasen <mclasen@redhat.com>
* gdk/Makefile.am:
* gtk/Makefile.am: Intern type names in code generated by
glib-mkenums, too.
* gtk/*.c:
* gdk/x11/*.c:
* gdk/*.c: Intern type names before registering the type to avoid
unnecessary copies.
2005-03-20 Matthias Clasen <mclasen@redhat.com>
Make PLT-reduction work with gcc4, and don't include
everything in gdkalias.h:
* gtk/grk.symbols: Group symbols by header and source file.
* gtk/makegtkalias.pl: Protect definitions by the same
preprocessor symbols used to guard the headers. Move
the alias declarations to a separate file which is
produced when calling makegtkalias.pl -def
* gdk/Makefile.am (gtkaliasdef.c): Add a rule to generate
this file.
* gtk/*.c: Include gtkalias.h after the other headers,
include gtkaliasdef.c at the bottom.
* gtk/*.h: Small cleanups.