src/video/win32/SDL_win32keyboard.c
changeset 4893 b2e434e0553b
parent 4763 518d1679d2d0
child 4894 ac19d74e2a47
     1.1 --- a/src/video/win32/SDL_win32keyboard.c	Sun Sep 19 14:41:18 2010 -0400
     1.2 +++ b/src/video/win32/SDL_win32keyboard.c	Sun Sep 19 16:19:22 2010 -0400
     1.3 @@ -188,6 +188,20 @@
     1.4  
     1.5  }
     1.6  
     1.7 +#ifdef __GNUC__
     1.8 +#undef DEFINE_GUID
     1.9 +#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
    1.10 +DEFINE_GUID(IID_ITfInputProcessorProfileActivationSink,        0x71C6E74E,0x0F28,0x11D8,0xA8,0x2A,0x00,0x06,0x5B,0x84,0x43,0x5C);
    1.11 +DEFINE_GUID(IID_ITfUIElementSink,                              0xEA1EA136,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C);
    1.12 +DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD,                           0x34745C63,0xB2F0,0x4784,0x8B,0x67,0x5E,0x12,0xC8,0x70,0x1A,0x31);
    1.13 +DEFINE_GUID(IID_ITfSource,                                     0x4EA48A35,0x60AE,0x446F,0x8F,0xD6,0xE6,0xA8,0xD8,0x24,0x59,0xF7);
    1.14 +DEFINE_GUID(IID_ITfUIElementMgr,                               0xEA1EA135,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C);
    1.15 +DEFINE_GUID(IID_ITfReadingInformationUIElement,                0xEA1EA139,0x19DF,0x11D7,0xA6,0xD2,0x00,0x06,0x5B,0x84,0x43,0x5C);
    1.16 +DEFINE_GUID(IID_ITfThreadMgr,                                  0xAA80E801,0x2021,0x11D2,0x93,0xE0,0x00,0x60,0xB0,0x67,0xB8,0x6E);
    1.17 +DEFINE_GUID(CLSID_TF_ThreadMgr,                                0x529A9E6B,0x6587,0x4F23,0xAB,0x9E,0x9C,0x7D,0x68,0x3E,0x3C,0x50);
    1.18 +DEFINE_GUID(IID_ITfThreadMgrEx,                                0x3E90ADE3,0x7594,0x4CB0,0xBB,0x58,0x69,0x62,0x8F,0x5F,0x45,0x8C);
    1.19 +#endif
    1.20 +
    1.21  #define LANG_CHT MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL)
    1.22  #define LANG_CHS MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED)
    1.23  
    1.24 @@ -246,7 +260,7 @@
    1.25      videodata->ime_hwnd_main = hwnd;
    1.26      if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) {
    1.27          videodata->ime_com_initialized = SDL_TRUE;
    1.28 -        CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, &videodata->ime_threadmgr);
    1.29 +        CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (LPVOID *)&videodata->ime_threadmgr);
    1.30      }
    1.31      videodata->ime_initialized = SDL_TRUE;
    1.32      videodata->ime_himm32 = LoadLibraryA("imm32.dll");
    1.33 @@ -301,7 +315,7 @@
    1.34  
    1.35      IME_ClearComposition(videodata);
    1.36      if (videodata->ime_hwnd_current == videodata->ime_hwnd_main)
    1.37 -        ImmAssociateContext(videodata->ime_hwnd_current, NULL);
    1.38 +        ImmAssociateContext(videodata->ime_hwnd_current, (HIMC)0);
    1.39  
    1.40      videodata->ime_enabled = SDL_FALSE;
    1.41      UILess_DisableUIUpdates(videodata);
    1.42 @@ -342,7 +356,7 @@
    1.43      WCHAR buffer[16];
    1.44      WCHAR *s = buffer;
    1.45      DWORD len = 0;
    1.46 -    DWORD err = 0;
    1.47 +    INT err = 0;
    1.48      BOOL vertical = FALSE;
    1.49      UINT maxuilen = 0;
    1.50      static OSVERSIONINFOA osversion = {0};
    1.51 @@ -949,7 +963,7 @@
    1.52      TfClientId clientid = 0;
    1.53      SDL_bool result = SDL_FALSE;
    1.54      ITfSource *source = 0;
    1.55 -    if (FAILED(CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, &videodata->ime_threadmgrex)))
    1.56 +    if (FAILED(CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, (LPVOID *)&videodata->ime_threadmgrex)))
    1.57          return SDL_FALSE;
    1.58  
    1.59      if (FAILED(videodata->ime_threadmgrex->lpVtbl->ActivateEx(videodata->ime_threadmgrex, &clientid, TF_TMAE_UIELEMENTENABLEDONLY)))
    1.60 @@ -989,7 +1003,7 @@
    1.61  UILess_ReleaseSinks(SDL_VideoData *videodata)
    1.62  {
    1.63      ITfSource *source = 0;
    1.64 -    if (videodata->ime_threadmgrex && SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, &source))) {
    1.65 +    if (videodata->ime_threadmgrex && SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) {
    1.66          source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie);
    1.67          source->lpVtbl->UnadviseSink(source, videodata->ime_alpnsinkcookie);
    1.68          SAFE_RELEASE(source);