From b5cb7a13524384cc8bd7e9fbda2719b2ea3d499f Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Thu, 3 Sep 2009 20:58:23 +0200 Subject: [PATCH] UIM_Init --- host.c | 4 ++++ uim.c | 25 +++++++++++++++++++++++-- uim_dp.h | 4 ++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/host.c b/host.c index f01795af..dd324c74 100644 --- a/host.c +++ b/host.c @@ -965,6 +965,7 @@ qboolean sys_nostdout = false; extern void Render_Init(void); extern void Mathlib_Init(void); extern void FS_Init(void); +extern void UIM_Init(void); extern void FS_Shutdown(void); extern void PR_Cmd_Init(void); extern void COM_Init_Commands(void); @@ -1048,6 +1049,9 @@ static void Host_Init (void) // initialize filesystem (including fs_basedir, fs_gamedir, -game, scr_screenshot_name) FS_Init(); + // initialize UIM + UIM_Init(); + NetConn_Init(); Curl_Init(); //PR_Init(); diff --git a/uim.c b/uim.c index 91c9e97f..25a33b29 100644 --- a/uim.c +++ b/uim.c @@ -11,8 +11,9 @@ CVars introduced with the UIM extension ================================================================================ */ -cvar_t im_method = {CVAR_SAVE, "im_method", "anthy", "which input method to use if uim is supported and active"}; cvar_t im_enabled = {CVAR_SAVE, "im_enabled", "0", "use UIM input"}; +cvar_t im_method = {CVAR_SAVE, "im_method", "anthy", "which input method to use if uim is supported and active"}; +cvar_t im_language = {CVAR_SAVE, "im_language", "ja", "which language should be used for the input editor (en for english, ja for japanese, etc.)"}; /* ================================================================================ @@ -78,7 +79,7 @@ static dllfunction_t uimfuncs[] = {"uim_press_key", (void **) &quim_press_key}, {"uim_release_key", (void **) &quim_release_key}, {"uim_iconv", (void **) &quim_iconv}, - + {NULL, NULL} }; @@ -135,3 +136,23 @@ qboolean UIM_OpenLibrary (void) return false; return true; } + + +/* +==================== +UIM_Init + +Load UIM support and register commands / cvars +==================== +*/ +void UIM_Init(void) +{ + // register the cvars in any case so they're at least saved, + // after all, they're for the user + + Cvar_RegisterVariable(&im_method); + Cvar_RegisterVariable(&im_language); + Cvar_RegisterVariable(&im_enabled); + + UIM_OpenLibrary(); +} diff --git a/uim_dp.h b/uim_dp.h index 1633ee30..bab67f68 100644 --- a/uim_dp.h +++ b/uim_dp.h @@ -295,7 +295,7 @@ enum UKey { UKey_Other = 0x10000 }; - + enum UKeyModifier { UMod_Shift = 1, UMod_Control = 2, @@ -306,7 +306,7 @@ enum UKeyModifier { UMod_Super = 64, UMod_Hyper = 128 }; - + enum UPreeditAttr { UPreeditAttr_None = 0, UPreeditAttr_UnderLine = 1, -- 2.39.2