SDL  2.0
SDL_ime.c File Reference
#include "SDL_ime.h"
#include "SDL_ibus.h"
#include "SDL_fcitx.h"
+ Include dependency graph for SDL_ime.c:

Go to the source code of this file.

Typedefs

typedef SDL_bool(* _SDL_IME_Init )()
typedef void(* _SDL_IME_Quit )()
typedef void(* _SDL_IME_SetFocus )(SDL_bool)
typedef void(* _SDL_IME_Reset )()
typedef SDL_bool(* _SDL_IME_ProcessKeyEvent )(Uint32, Uint32)
typedef void(* _SDL_IME_UpdateTextRect )(SDL_Rect *)
typedef void(* _SDL_IME_PumpEvents )()

Functions

static void InitIME ()
SDL_bool SDL_IME_Init (void)
void SDL_IME_Quit (void)
void SDL_IME_SetFocus (SDL_bool focused)
void SDL_IME_Reset (void)
SDL_bool SDL_IME_ProcessKeyEvent (Uint32 keysym, Uint32 keycode)
void SDL_IME_UpdateTextRect (SDL_Rect *rect)
void SDL_IME_PumpEvents ()

Variables

static _SDL_IME_Init SDL_IME_Init_Real = NULL
static _SDL_IME_Quit SDL_IME_Quit_Real = NULL
static _SDL_IME_SetFocus SDL_IME_SetFocus_Real = NULL
static _SDL_IME_Reset SDL_IME_Reset_Real = NULL
static _SDL_IME_ProcessKeyEvent SDL_IME_ProcessKeyEvent_Real = NULL
static _SDL_IME_UpdateTextRect SDL_IME_UpdateTextRect_Real = NULL
static _SDL_IME_PumpEvents SDL_IME_PumpEvents_Real = NULL

Typedef Documentation

typedef SDL_bool(* _SDL_IME_Init)()

Definition at line 26 of file SDL_ime.c.

typedef SDL_bool(* _SDL_IME_ProcessKeyEvent)(Uint32, Uint32)

Definition at line 30 of file SDL_ime.c.

typedef void(* _SDL_IME_PumpEvents)()

Definition at line 32 of file SDL_ime.c.

typedef void(* _SDL_IME_Quit)()

Definition at line 27 of file SDL_ime.c.

typedef void(* _SDL_IME_Reset)()

Definition at line 29 of file SDL_ime.c.

typedef void(* _SDL_IME_SetFocus)(SDL_bool)

Definition at line 28 of file SDL_ime.c.

typedef void(* _SDL_IME_UpdateTextRect)(SDL_Rect *)

Definition at line 31 of file SDL_ime.c.

Function Documentation

static void InitIME ( )
static

Definition at line 43 of file SDL_ime.c.

References NULL, SDL_FALSE, SDL_Fcitx_Init(), SDL_Fcitx_ProcessKeyEvent(), SDL_Fcitx_PumpEvents(), SDL_Fcitx_Quit(), SDL_Fcitx_Reset(), SDL_Fcitx_SetFocus(), SDL_Fcitx_UpdateTextRect(), SDL_getenv, SDL_IME_Init_Real, SDL_IME_ProcessKeyEvent_Real, SDL_IME_PumpEvents_Real, SDL_IME_Quit_Real, SDL_IME_Reset_Real, SDL_IME_SetFocus_Real, SDL_IME_UpdateTextRect_Real, SDL_strcmp, SDL_strstr, and SDL_TRUE.

Referenced by SDL_IME_Init().

{
static SDL_bool inited = SDL_FALSE;
#ifdef HAVE_FCITX_FRONTEND_H
const char *im_module = SDL_getenv("SDL_IM_MODULE");
const char *xmodifiers = SDL_getenv("XMODIFIERS");
#endif
if (inited == SDL_TRUE)
return;
inited = SDL_TRUE;
/* See if fcitx IME support is being requested */
#ifdef HAVE_FCITX_FRONTEND_H
((im_module && SDL_strcmp(im_module, "fcitx") == 0) ||
(!im_module && xmodifiers && SDL_strstr(xmodifiers, "@im=fcitx") != NULL))) {
}
#endif /* HAVE_FCITX_FRONTEND_H */
/* default to IBus */
#ifdef HAVE_IBUS_IBUS_H
SDL_IME_Init_Real = SDL_IBus_Init;
SDL_IME_Quit_Real = SDL_IBus_Quit;
SDL_IME_SetFocus_Real = SDL_IBus_SetFocus;
SDL_IME_Reset_Real = SDL_IBus_Reset;
SDL_IME_ProcessKeyEvent_Real = SDL_IBus_ProcessKeyEvent;
SDL_IME_UpdateTextRect_Real = SDL_IBus_UpdateTextRect;
SDL_IME_PumpEvents_Real = SDL_IBus_PumpEvents;
}
#endif /* HAVE_IBUS_IBUS_H */
}
SDL_bool SDL_IME_ProcessKeyEvent ( Uint32  keysym,
Uint32  keycode 
)

Definition at line 130 of file SDL_ime.c.

References SDL_FALSE, and SDL_IME_ProcessKeyEvent_Real.

{
return SDL_IME_ProcessKeyEvent_Real(keysym, keycode);
return SDL_FALSE;
}
void SDL_IME_PumpEvents ( void  )

Definition at line 146 of file SDL_ime.c.

References SDL_IME_PumpEvents_Real.

void SDL_IME_Quit ( void  )

Definition at line 109 of file SDL_ime.c.

References SDL_IME_Quit_Real.

void SDL_IME_Reset ( void  )

Definition at line 123 of file SDL_ime.c.

References SDL_IME_Reset_Real.

void SDL_IME_SetFocus ( SDL_bool  focused)

Definition at line 116 of file SDL_ime.c.

References SDL_IME_SetFocus_Real.

void SDL_IME_UpdateTextRect ( SDL_Rect rect)

Definition at line 139 of file SDL_ime.c.

References SDL_IME_UpdateTextRect_Real.

Variable Documentation

_SDL_IME_Init SDL_IME_Init_Real = NULL
static

Definition at line 34 of file SDL_ime.c.

Referenced by InitIME(), and SDL_IME_Init().

_SDL_IME_ProcessKeyEvent SDL_IME_ProcessKeyEvent_Real = NULL
static

Definition at line 38 of file SDL_ime.c.

Referenced by InitIME(), SDL_IME_Init(), and SDL_IME_ProcessKeyEvent().

_SDL_IME_PumpEvents SDL_IME_PumpEvents_Real = NULL
static

Definition at line 40 of file SDL_ime.c.

Referenced by InitIME(), SDL_IME_Init(), and SDL_IME_PumpEvents().

_SDL_IME_Quit SDL_IME_Quit_Real = NULL
static

Definition at line 35 of file SDL_ime.c.

Referenced by InitIME(), SDL_IME_Init(), and SDL_IME_Quit().

_SDL_IME_Reset SDL_IME_Reset_Real = NULL
static

Definition at line 37 of file SDL_ime.c.

Referenced by InitIME(), SDL_IME_Init(), and SDL_IME_Reset().

_SDL_IME_SetFocus SDL_IME_SetFocus_Real = NULL
static

Definition at line 36 of file SDL_ime.c.

Referenced by InitIME(), SDL_IME_Init(), and SDL_IME_SetFocus().

_SDL_IME_UpdateTextRect SDL_IME_UpdateTextRect_Real = NULL
static

Definition at line 39 of file SDL_ime.c.

Referenced by InitIME(), SDL_IME_Init(), and SDL_IME_UpdateTextRect().