Refactor wxGTK IM-related code to allow future modifications.

No real changes, just make it possible to use a different IM than the one
allocated in wxWindow for input handling. This will be used in the upcoming
changes to wxTextEntry and the related classes.

See #3158.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73693 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-03-21 22:37:01 +00:00
parent 819638a71f
commit afa9873106
2 changed files with 62 additions and 40 deletions

View File

@@ -24,6 +24,9 @@
// some additional data needed for key events processing
struct wxGtkIMData;
typedef struct _GdkEventKey GdkEventKey;
typedef struct _GtkIMContext GtkIMContext;
WX_DEFINE_EXPORTED_ARRAY_PTR(GdkWindow *, wxArrayGdkWindows);
extern "C"
@@ -272,7 +275,28 @@ public:
void GTKDisableFocusOutEvent();
void GTKEnableFocusOutEvent();
wxGtkIMData *m_imData;
// Input method support
// The IM context used for generic, i.e. non-native, windows.
//
// It might be a good idea to avoid allocating it unless key events from
// this window are really needed but currently we do it unconditionally.
//
// For native widgets (i.e. those for which IsOfStandardClass() returns
// true) it is NULL.
GtkIMContext* m_imContext;
// Pointer to the event being currently processed by the IME or NULL if not
// inside key handling.
GdkEventKey* m_imKeyEvent;
// This method generalizes gtk_im_context_filter_keypress(): for the
// generic windows it does just that but it's overridden by the classes
// wrapping native widgets that use IM themselves and so provide specific
// methods for accessing it such gtk_entry_im_context_filter_keypress().
virtual int GTKIMFilterKeypress(GdkEventKey* event) const;
// indices for the arrays below
enum ScrollDir { ScrollDir_Horz, ScrollDir_Vert, ScrollDir_Max };