[ create a new paste ] login | about

Link: http://codepad.org/jQNl3NNH    [ raw code | output | fork ]

C, pasted on Jan 2:
/*
 * Input Method Manager (IMM) additional declarations and definitions.
 * Created by Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>.
 */
#ifndef _IMMADD_
#define _IMMADD_

#ifdef __cplusplus
extern "C" {
#endif

/************************************************************************
 * additional private declarations/definitions for IMM                  *
 ************************************************************************/
#define NULLIMC ((HIMC)NULL)

typedef struct tagCOMPOSITIONSTRING {
	DWORD dwSize;
	DWORD dwCompReadAttrLen;
	DWORD dwCompReadAttrOffset;
	DWORD dwCompReadClauseLen;
	DWORD dwCompReadClauseOffset;
	DWORD dwCompReadStrLen;
	DWORD dwCompReadStrOffset;
	DWORD dwCompAttrLen;
	DWORD dwCompAttrOffset;
	DWORD dwCompClauseLen;
	DWORD dwCompClauseOffset;
	DWORD dwCompStrLen;
	DWORD dwCompStrOffset;
	DWORD dwCursorPos;
	DWORD dwDeltaStart;
	DWORD dwResultReadClauseLen;
	DWORD dwResultReadClauseOffset;
	DWORD dwResultReadStrLen;
	DWORD dwResultReadStrOffset;
	DWORD dwResultClauseLen;
	DWORD dwResultClauseOffset;
	DWORD dwResultStrLen;
	DWORD dwResultStrOffset;
	DWORD dwPrivateSize;
	DWORD dwPrivateOffset;
} COMPOSITIONSTRING, *PCOMPOSITIONSTRING, FAR *LPCOMPOSITIONSTRING;

typedef struct tagGUIDELINE {
	DWORD dwSize;
	DWORD dwLevel;
	DWORD dwIndex;
	DWORD dwStrLen;
	DWORD dwStrOffset;
	DWORD dwPrivateSize;
	DWORD dwPrivateOffset;
} GUIDELINE, *PGUIDELINE, FAR *LPGUIDELINE;

typedef struct tagCANDIDATEINFO {
	DWORD dwSize;
	DWORD dwCount;
	DWORD dwOffset[32];
	DWORD dwPrivateSize;
	DWORD dwPrivateOffset;
} CANDIDATEINFO, *PCANDIDATEINFO, FAR *LPCANDIDATEINFO;

typedef struct tagINPUTCONTEXT {
	HWND hWnd;
	BOOL fOpen;
	POINT ptStatusWndPos;
	POINT ptSoftKbdPos;
	DWORD fdwConversion;
	DWORD fdwSentence;
	union {
	 LOGFONTA A;
	 LOGFONTW W;
	} lfFont;
	COMPOSITIONFORM cfCompForm;
	CANDIDATEFORM cfCandForm[4];
	HIMCC hCompStr;
	HIMCC hCandInfo;
	HIMCC hGuideLine;
	HIMCC hPrivate;
	DWORD dwNumMsgBuf;
	HIMCC hMsgBuf;
	DWORD fdwInit;
	DWORD dwReserve[3];
} INPUTCONTEXT, *PINPUTCONTEXT, FAR *LPINPUTCONTEXT;

typedef struct tagIMEINFO {
	DWORD dwPrivateDataSize;
	DWORD fdwProperty;
	DWORD fdwConversionCaps;
	DWORD fdwSentenceCaps;
	DWORD fdwUICaps;
	DWORD fdwSCSCaps;
	DWORD fdwSelectCaps;
} IMEINFO, *PIMEINFO, FAR *LPIMEINFO;

typedef struct tagSOFTKBDDATA {
	UINT uCount;
	WORD wCode[1][256];
} SOFTKBDDATA, *PSOFTKBDDATA, FAR * LPSOFTKBDDATA;

BOOL WINAPI ImmGetHotKey(DWORD, LPUINT, LPUINT, LPHKL);
BOOL WINAPI ImmSetHotKey(DWORD, UINT, UINT, HKL);

BOOL WINAPI ImmGenerateMessage(HIMC);

#if(WINVER >= 0x040A)
LRESULT WINAPI ImmRequestMessageA(HIMC, WPARAM, LPARAM);
LRESULT WINAPI ImmRequestMessageW(HIMC, WPARAM, LPARAM);
#ifdef UNICODE
#define ImmRequestMessage ImmRequestMessageW
#else
#define ImmRequestMessage ImmRequestMessageA
#endif
#endif /* WINVER >= 0x040A */

HWND WINAPI ImmCreateSoftKeyboard(UINT, HWND, INT, INT);
BOOL WINAPI ImmDestroySoftKeyboard(HWND);
BOOL WINAPI ImmShowSoftKeyboard(HWND, INT);

LPINPUTCONTEXT WINAPI ImmLockIMC(HIMC);
BOOL WINAPI ImmUnlockIMC(HIMC);
DWORD WINAPI ImmGetIMCLockCount(HIMC);

HIMCC WINAPI ImmCreateIMCC(DWORD);
HIMCC WINAPI ImmDestroyIMCC(HIMCC);
LPVOID WINAPI ImmLockIMCC(HIMCC);
BOOL WINAPI ImmUnlockIMCC(HIMCC);
DWORD WINAPI ImmGetIMCCLockCount(HIMCC);
HIMCC WINAPI ImmReSizeIMCC(HIMCC, DWORD);
DWORD WINAPI ImmGetIMCCSize(HIMCC);

#define IMMGWL_IMC 0
#define IMMGWL_PRIVATE (sizeof(LONG))

#define IMC_SETCONVERSIONMODE 0x0002
#define IMC_SETSENTENCEMODE 0x0004
#define IMC_SETOPENSTATUS 0x0006

#define IMC_GETSOFTKBDFONT 0x0011
#define IMC_SETSOFTKBDFONT 0x0012
#define IMC_GETSOFTKBDPOS 0x0013
#define IMC_SETSOFTKBDPOS 0x0014
#define IMC_GETSOFTKBDSUBTYPE 0x0015
#define IMC_SETSOFTKBDSUBTYPE 0x0016
#define IMC_SETSOFTKBDDATA 0x0018

#define NI_CONTEXTUPDATED 0x0003

#define IME_SYSINFO_WINLOGON 0x0001

#define GCS_COMP (GCS_COMPSTR|GCS_COMPATTR|GCS_COMPCLAUSE)
#define GCS_COMPREAD (GCS_COMPREADSTR|GCS_COMPREADATTR|GCS_COMPREADCLAUSE)

#define GCS_RESULT (GCS_RESULTSTR|GCS_RESULTCLAUSE)
#define GCS_RESULTREAD (GCS_RESULTREADSTR|GCS_RESULTREADCLAUSE)

#define INIT_STATUSWNDPOS 0x00000001
#define INIT_CONVERSION 0x00000002
#define INIT_SENTENCE 0x00000004
#define INIT_LOGFONT 0x00000008
#define INIT_COMPFORM 0x00000010
#define INIT_SOFTKBDPOS 0x00000020

#define IME_PROP_END_UNLOAD 0x0001
#define IME_PROP_KBD_CHAR_FIRST 0x0002
#define IME_PROP_IGNORE_UPKEYS 0x0004
#define IME_PROP_NEED_ALTKEY 0x0008
#define IME_PROP_NO_KEYS_ON_CLOSE	0x0010
#define IME_PROP_COMPLETE_ON_UNSELECT 0x00100000

#define UI_CAP_SOFTKBD 0x00010000

#define IMN_SOFTKBDDESTROYED 0x0011

/************************************************************************
 * additional public declarations/definitions for IMM                   *
 * FIXME: Could you add this to MinGW's <imm.h> ?                       *
 ************************************************************************/

UINT WINAPI ImmGetVirtualKey(HWND);

#if (WINVER >= 0x040A)
BOOL WINAPI ImmAssociateContextEx(HWND, HIMC, DWORD);
#endif /* (WINVER >= 0x040A) */

#define IME_HOTKEY_PRIVATE_FIRST 0x200
#define IME_ITHOTKEY_RECONVERTSTRING 0x203
#define IME_HOTKEY_PRIVATE_LAST 0x21F

#define IMEVER_0310 0x0003000A
#define IMEVER_0400 0x00040000

#define SCS_CAP_SETRECONVERTSTRING 0x00000004
#define SCS_SETRECONVERTSTRING 0x00010000
#define SCS_QUERYRECONVERTSTRING 0x00020000

#define IME_SMODE_CONVERSATION 0x0010

#define IME_CAND_UNKNOWN 0x0000
#define IME_CAND_READ 0x0001
#define IME_CAND_CODE 0x0002
#define IME_CAND_MEANING 0x0003
#define IME_CAND_RADICAL 0x0004
#define IME_CAND_STROKE 0x0005

#if (WINVER >= 0x040A)
#define IMR_COMPOSITIONWINDOW 0x0001
#define IMR_CANDIDATEWINDOW 0x0002
#define IMR_COMPOSITIONFONT 0x0003
#define IMR_CONFIRMRECONVERTSTRING 0x0005
#define IMR_DOCUMENTFEED 0x0007
#endif

#define IME_ESC_PRIVATE_HOTKEY 0x100a
#define IME_ESC_GETHELPFILENAME 0x100b

#define SOFTKEYBOARD_TYPE_T1 0x0001
#define SOFTKEYBOARD_TYPE_C1 0x0002

#ifdef __cplusplus
}
#endif

#endif // _IMMADD_


Output:
Line 18: error: expected specifier-qualifier-list before 'DWORD'
Line 43: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 46: error: expected specifier-qualifier-list before 'DWORD'
Line 53: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 56: error: expected specifier-qualifier-list before 'DWORD'
Line 61: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 64: error: expected specifier-qualifier-list before 'HWND'
Line 84: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 87: error: expected specifier-qualifier-list before 'DWORD'
Line 94: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 97: error: expected specifier-qualifier-list before 'UINT'
Line 99: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 102: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 104: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 116: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 117: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 118: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 120: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 121: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 122: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 124: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 125: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 126: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 127: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 128: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 129: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 130: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'
Line 180: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'WINAPI'


Create a new paste based on this one


Comments: