diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-02-20 12:16:39 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-20 12:16:39 +0000 |
commit | af93691b53f38784efce0b93fe7644c44a7e382e (patch) | |
tree | 74e8f31e222aed907e80c4dc5b0bded5f7400537 /src/gui_xim.c | |
parent | 997b8a015cd39141866e953651d55c705275cbd6 (diff) |
patch 9.0.1330: handling new value of an option has a long "else if" chainv9.0.1330
Problem: Handling new value of an option has a long "else if" chain.
Solution: Use a function pointer. (Yegappan Lakshmanan, closes #12015)
Diffstat (limited to 'src/gui_xim.c')
-rw-r--r-- | src/gui_xim.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui_xim.c b/src/gui_xim.c index 86273b5c3d..0d7b56e56b 100644 --- a/src/gui_xim.c +++ b/src/gui_xim.c @@ -13,6 +13,18 @@ #include "vim.h" +#if !defined(GTK_CHECK_VERSION) +# define GTK_CHECK_VERSION(a, b, c) 0 +#endif +#if !defined(FEAT_GUI_GTK) && defined(PROTO) +typedef int GtkWidget; +typedef int GtkIMContext; +typedef int gchar; +typedef int gpointer; +typedef int PangoAttrIterator; +typedef int GdkEventKey; +#endif + #if defined(FEAT_GUI_GTK) && defined(FEAT_XIM) # if GTK_CHECK_VERSION(3,0,0) # include <gdk/gdkkeysyms-compat.h> @@ -74,7 +86,7 @@ static callback_T imaf_cb; // 'imactivatefunc' callback function static callback_T imsf_cb; // 'imstatusfunc' callback function char * -set_imactivatefunc_option(void) +did_set_imactivatefunc(optset_T *args UNUSED) { if (option_set_callback_func(p_imaf, &imaf_cb) == FAIL) return e_invalid_argument; @@ -83,7 +95,7 @@ set_imactivatefunc_option(void) } char * -set_imstatusfunc_option(void) +did_set_imstatusfunc(optset_T *args UNUSED) { if (option_set_callback_func(p_imsf, &imsf_cb) == FAIL) return e_invalid_argument; |