Commit Graph

86 Commits

Author SHA1 Message Date
Peter Bloomfield
86cd5c04bd gtkimmodule: make match_backend() query
…the wayland registry.

Wnen _gtk_im_module_get_default_context_id calls
match_backend (context_id) and the default GdkDisplay
is wayland, match_backend() should return TRUE only if
gdk_wayland_display_query_registry (display, "gtk_text_input_manager")
returns TRUE.
2018-03-12 17:46:57 -04:00
Matthias Clasen
e0771a54a2 Avoid warnings
When generating introspection data, we instantiate types without
calling gtk_init, so make sure that extension points are registered
before the type is trying to implement them.
2018-03-09 02:13:13 -05:00
Matthias Clasen
15cc20e7b5 Always include platform immodules
No need to load these as gio modules, we just include
them in libgtk.
2018-02-24 21:34:40 -05:00
Matthias Clasen
29bcc38ae6 Convert immodules to use an extension point
Add an extension point called gtk-im-module, which requires
the type GtkIMContext. Simplify the loading by using GIO
infrastructure. Drop the locale filtering for now, I don't
think it is really necessary nowadays.

Convert existing platform modules to gio modules.
Sill to do: Drop the conditional build machinery.
Either always include them, or never.
2018-02-24 21:34:40 -05:00
Matthias Clasen
bfc81767ba Drop no-longer existing im modules
This was just dead code. The actual modules have already
been removed.
2018-02-19 18:38:20 -05:00
Carlos Garnacho
21e9fe4f55 modules: Add wayland IM implementation
This IM context implementation goes through the gtk-text-input protocol,
leaving up to the compositor the actual interaction with IM engines.
2018-02-13 15:47:57 +01:00
Matthias Clasen
297889e080 immodule: Avoid GdkScreen api
Another place where it is not needed.
2017-10-30 19:27:36 -04:00
Rico Tzschichholz
8abf05e194 gtk: Update path references from gtk-3.0 to gtk-4.0 2016-10-23 20:22:38 +02:00
Emmanuele Bassi
857d241e22 Remove redundant variable declaration
The inner `var` declaration is shadowing the outer one.
2016-10-17 11:52:00 +01:00
Benjamin Otte
361d322bfb immodules: Move path code out of gtkrc 2016-10-16 18:17:21 +02:00
Matthias Clasen
6994fe03ee Split off copied pango utils in their own source
This will make it easier to use them in more than one place.
2016-03-26 18:12:16 -04:00
Benjamin Otte
1d980192fa immodule: Stop gcc from complaining 2016-02-11 03:44:47 +01:00
Benjamin Otte
be6f65a08e immodule: Use correct sign for function prototype 2016-02-03 22:53:22 +01:00
Руслан Ижбулатов
91bb91dbb9 Fix to compile for C libraries with no flockfile
Also use MS variant of flockfile, if available
(requires MSVCRT compatible with MSVCR90 or newer).
2015-12-30 21:57:29 +00:00
Matthias Clasen
9950764f12 Drop deprecated pango-utils api
Copy the few parsing functions we need.
2015-12-29 08:09:23 -05:00
Matthias Clasen
d92a02f7a4 im module: Remvoe an unneeded variable
The G_DEFINE_TYPE macros automate the parent_class handling.
2015-09-06 17:11:34 -04:00
Benjamin Otte
c6219c913f immodule: Remove unused parameter 2015-08-20 14:42:04 +02:00
Matthias Clasen
9f24b54786 Code cleanup
Use g_slist_free_full more consistently. This commit just converts
the obvious cases where g_slist_forall is directly followed by
g_slist_free.
2015-07-31 22:23:35 -04:00
Benjamin Otte
9df707da22 gtk: Add deprecation guards for newest pango deprecations 2015-05-28 16:54:03 +02:00
Matthias Clasen
b0b38c106d Make gtk-im-context-none work
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.
2015-02-23 22:06:02 -05:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
William Jon McCann
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
Alexander Larsson
4226f97d54 broadway: Support ipad on-screen keyboard
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.
2013-11-13 12:23:06 +01:00
Aleksander Morgado
90de3c4fc0 win32: use the input locale to decide the default input method
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
2013-08-31 14:28:10 -04:00
Matthias Clasen
ea715a49e4 Deal with platform-specific im modules
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.
2013-08-11 15:42:19 -04:00
Matthias Clasen
f4a138c7bd GtkIMModule: Use default screen when determining context id
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.
2013-08-11 15:38:25 -04:00
Cosimo Cecchi
018a425562 immodule: fix a GCC warning 2013-02-18 19:38:21 -05:00
Changwoo Ryu
658e7c4535 immodule: Fix context ID lookup on module with multiple contexts
https://bugzilla.gnome.org/show_bug.cgi?id=690247
2013-02-16 10:04:47 +09:00
Benjamin Otte
23907e1d53 build: Remove now-unused GTK_DISABLE_DEPRECATED undefs 2012-05-01 03:13:01 +02:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Benjamin Otte
f9c664c69b immodule: Disable deprecations before including deprecated header 2011-11-08 21:14:05 +01:00
Benjamin Otte
e1f4bd6495 gtk: Empty gtkimmodule.h
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.
2011-11-08 21:14:05 +01:00
Benjamin Otte
c2da143aa6 immodule: Move private functions to a private header 2011-11-08 21:14:05 +01:00
Benjamin Otte
bd97127e6c immodule: Fix includes
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.
2011-11-08 21:14:05 +01:00
Akira TAGOH
4d7e47ddd0 Allow fallback for input method modules
Accept a :-separated list of module names in GTK_IM_MODULE and
the corresponding setting, to deal a bit better with broken
situations.

https://bugzilla.gnome.org/show_bug.cgi?id=603559
2011-11-05 01:48:59 -04:00
Michael Natterer
5c4f2ef0c1 gtk: move _gtk_modules_has_mixed_deps() to gtkmodlesprivate.h
and remove gtkmainprivate.h completely.
2011-10-23 13:57:07 +02:00
Michael Natterer
2688ccdbc4 gtk: clean up the private horror
- 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
2011-10-22 23:53:55 +02:00
Matthias Clasen
f1a9c3efff Remove unused includes
Nothing is using gtkrc.h functionality any more.
2011-06-16 23:33:43 -04:00
Matthias Clasen
b123bc41fd Move docs for gtkmain inline
At the same time, introduce a gtkmainprivate.h header
and various other cleanups.

Based on a patch by Tadej Borovšak.
https://bugzilla.gnome.org/show_bug.cgi?id=617471
2011-01-04 17:32:12 -05:00
Benjamin Otte
a7e6d6c4b4 gtk: Avoid GdkDrawable usage, including needless casts 2010-12-02 20:21:02 +01:00
Benjamin Otte
9f47be2216 gtk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual 2010-09-26 15:11:33 +02:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Javier Jardón
21f6e1841a Fix compilation warning: Use G_GNUC_UNUSED macro
add_builtin_module() is only used into #define block of code
2009-11-09 21:49:47 +01:00
Matthias Clasen
1c0ecc0380 Rework the way IM contexts are set
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.
2009-09-04 18:09:44 -04:00
Matthias Clasen
b9905c8fb5 Revert changes for bug 567124. Instead of trying to avoid
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
2009-01-25 03:38:27 +00:00
Matthias Clasen
280eeb02e1 Don't set up im stuff if the widget is not realized.
* 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
2009-01-23 06:04:05 +00:00
Matthias Clasen
3c906f8616 Doc fixes
2008-12-28  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkimmodule.c:
        * gtk/gtkseparatortoolitem.c: Doc fixes

        * gtk/gtkfontsel.c: Merge docs inline.


svn path=/trunk/; revision=21957
2008-12-29 00:07:32 +00:00
Daniel Elstner
0bf3652e1d Bug 563994 – Input method module interface not documented
* 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-12-11 11:38:59 +00:00
Christian Persch
df619a1370 Bug 552668 – format not a string literal and no format arguments in
gtkimmodule

svn path=/trunk/; revision=21416
2008-09-17 19:56:19 +00:00