/*
Copyright 1990-2003 Sun Microsystems, Inc. All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: The above copyright notice and this
permission notice shall be included in all copies or substantial
portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP OR SUN MICROSYSTEMS, INC. BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE EVEN IF
ADVISED IN ADVANCE OF THE POSSIBILITY OF SUCH DAMAGES.


Except as contained in this notice, the names of The Open Group and/or
Sun Microsystems, Inc. shall not be used in advertising or otherwise to
promote the sale, use or other dealings in this Software without prior
written authorization from The Open Group and/or Sun Microsystems,
Inc., as applicable.


X Window System is a trademark of The Open Group

OSF/1, OSF/Motif and Motif are registered trademarks, and OSF, the OSF
logo, LBX, X Window System, and Xinerama are trademarks of the Open
Group. All other trademarks and registered trademarks mentioned herein
are the property of their respective owners. No right, title or
interest in or to any trademark, service mark, logo or trade name of
Sun Microsystems, Inc. or its licensors is granted.

*/

#ifndef _IM_CM_SO_H
#define _IM_CM_SO_H

#include "GeneType.h"

#define TOO_MANY_SESSION     -1
#define FAILED_ALLOC_MEM     -2
#define QUIT_THIS_IM         -3
#define SWITCH_BEWTEEN_QPSP  -4
#define LABELTYPE_1234567     1

#define MAX_SES_NUM         512

#define IEH_TYPE_KEYSYM   0
#define IEH_TYPE_STRING   1
#define IEH_TYPE_OTHER    3

typedef struct _ImToXSun {
	JINT     nType;
	JWORD    pwPreedit[128];
	JINT     nCaretPos;
	JWORD    pwLookupChoice[8][24];
	JINT     nChoiceNum;
	JWORD    pwCommit[256];
	JWORD    pwStatus[16];
	JINT     nErrorCode;
} ImToXSun;

typedef struct _ImToXSunChar {
	JINT     nType;
	UCHAR    szPreedit[256];
	JINT     nCaretPos;
	UCHAR    szLookupChoice[10][48];
	JINT     nChoiceNum;
	UCHAR    szCommit[512];
	UCHAR    szStatus[32];
	JINT     nErrorCode;
	JINT     nLabelType;
} ImToXSunChar;

#define   IMXSUN_TYPE_NORMAL        0x0000
#define   IMXSUN_TYPE_COMMIT        0x0001
#define   IMXSUN_TYPE_BOUNCEKEY     0x0002
#define   IMXSUN_TYPE_ERROR         0x0004
#define   IMXSUN_TYPE_COMMITSYMBOL  0x0006

#define   SPEC_KEY_SHIFT            0x0001
#define   SPEC_KEY_CAPSLOCK         0x0002		/* ??? Not Certain. MXL */
#define   SPEC_KEY_CONTROL          0x0004
#define   SPEC_KEY_ALT              0x0008
#define   SPEC_KEY_ALTGRAPH         0x0010
#define   SPEC_KEY_COMPOSE          0x0020		/* ??? Not Certain. MXL */
#define   SPEC_KEY_DIAMOND          0x0040
#define   SPEC_KEY_NUMLOCK          0x0080

JSHORT    bShiftIsPressed, bCapsIsPressed, bAltIsPressed, bCtrlIsPressed, 	\
          bMetaIsPressed, bAltGrIsPressed, bCompIsPressed;
UCHAR     szKsStr[20];
JINT      nMinKeycode, nMaxKeycode;
/* static JINT  nNumKeysym = 5; */
JINT      nQpSpFlag[512];

CHAR*     pszLocale;
CHAR      szLocale[30];
JINT	  nGBKMode;

#endif   /* End of _IM_CM_SO_H */


