|
Packit Service |
2b1f13 |
/*
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
Copyright 1989, 1998 The Open Group
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
Permission to use, copy, modify, distribute, and sell this software and its
|
|
Packit Service |
2b1f13 |
documentation for any purpose is hereby granted without fee, provided that
|
|
Packit Service |
2b1f13 |
the above copyright notice appear in all copies and that both that
|
|
Packit Service |
2b1f13 |
copyright notice and this permission notice appear in supporting
|
|
Packit Service |
2b1f13 |
documentation.
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
The above copyright notice and this permission notice shall be included in
|
|
Packit Service |
2b1f13 |
all copies or substantial portions of the Software.
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
Packit Service |
2b1f13 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
Packit Service |
2b1f13 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
Packit Service |
2b1f13 |
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
Packit Service |
2b1f13 |
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
Packit Service |
2b1f13 |
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
Except as contained in this notice, the name of The Open Group shall not be
|
|
Packit Service |
2b1f13 |
used in advertising or otherwise to promote the sale, use or other dealings
|
|
Packit Service |
2b1f13 |
in this Software without prior written authorization from The Open Group.
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#ifndef _Xct_h
|
|
Packit Service |
2b1f13 |
#define _Xct_h
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#include <X11/Xfuncproto.h>
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctVersion 1
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
typedef unsigned char *XctString;
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
typedef enum {
|
|
Packit Service |
2b1f13 |
XctUnspecified,
|
|
Packit Service |
2b1f13 |
XctLeftToRight,
|
|
Packit Service |
2b1f13 |
XctRightToLeft
|
|
Packit Service |
2b1f13 |
} XctHDirection;
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
typedef unsigned long XctFlags;
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
/* These are bits in XctFlags. */
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctSingleSetSegments 0x0001
|
|
Packit Service |
2b1f13 |
/* This means that returned segments should contain characters from only
|
|
Packit Service |
2b1f13 |
* one set (C0, C1, GL, GR). When this is requested, XctSegment is never
|
|
Packit Service |
2b1f13 |
* returned, instead XctC0Segment, XctC1Segment, XctGlSegment, and
|
|
Packit Service |
2b1f13 |
* XctGRSegment are returned. C0 and C1 segments are always returned as
|
|
Packit Service |
2b1f13 |
* singleton characters.
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctProvideExtensions 0x0002
|
|
Packit Service |
2b1f13 |
/* This means that if the Compound Text string is from a higher version
|
|
Packit Service |
2b1f13 |
* than this code is implemented to, then syntactically correct but unknown
|
|
Packit Service |
2b1f13 |
* control sequences should be returned as XctExtension items. If this
|
|
Packit Service |
2b1f13 |
* flag is not set, and the Compound Text string version indicates that
|
|
Packit Service |
2b1f13 |
* extensions cannot be ignored, then each unknown control sequence will be
|
|
Packit Service |
2b1f13 |
* reported as an XctError.
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctAcceptC0Extensions 0x0004
|
|
Packit Service |
2b1f13 |
/* This means that if the Compound Text string is from a higher version
|
|
Packit Service |
2b1f13 |
* than this code is implemented to, then unknown C0 characters should be
|
|
Packit Service |
2b1f13 |
* treated as if they were legal, and returned as C0 characters (regardless
|
|
Packit Service |
2b1f13 |
* of how XctProvideExtensions is set). If this flag is not set, then all
|
|
Packit Service |
2b1f13 |
* unknown C0 characters are treated according to XctProvideExtensions.
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctAcceptC1Extensions 0x0008
|
|
Packit Service |
2b1f13 |
/* This means that if the Compound Text string is from a higher version
|
|
Packit Service |
2b1f13 |
* than this code is implemented to, then unknown C0 characters should be
|
|
Packit Service |
2b1f13 |
* treated as if they were legal, and returned as C0 characters (regardless
|
|
Packit Service |
2b1f13 |
* of how XctProvideExtensions is set). If this flag is not set, then all
|
|
Packit Service |
2b1f13 |
* unknown C0 characters are treated according to XctProvideExtensions.
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctHideDirection 0x0010
|
|
Packit Service |
2b1f13 |
/* This means that horizontal direction changes should be reported as
|
|
Packit Service |
2b1f13 |
* XctHorizontal items. If this flag is not set, then direction changes are
|
|
Packit Service |
2b1f13 |
* not returned as items, but the current direction is still maintained and
|
|
Packit Service |
2b1f13 |
* reported for other items.
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctFreeString 0x0020
|
|
Packit Service |
2b1f13 |
/* This means that XctFree should free the Compound Text string (that was
|
|
Packit Service |
2b1f13 |
* passed to XctCreate. If this flag is not set, the string is not freed.
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#define XctShiftMultiGRToGL 0x0040
|
|
Packit Service |
2b1f13 |
/* Translate GR segments on-the-fly into GL segments for the GR sets:
|
|
Packit Service |
2b1f13 |
* GB2312.1980-1, JISX0208.1983-1, and KSC5601.1987-1.
|
|
Packit Service |
2b1f13 |
*/
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
/* This is the return type for XctNextItem. */
|
|
Packit Service |
2b1f13 |
typedef enum {
|
|
Packit Service |
2b1f13 |
XctSegment, /* used when XctSingleSetSegments is not requested */
|
|
Packit Service |
2b1f13 |
XctC0Segment, /* used when XctSingleSetSegments is requested */
|
|
Packit Service |
2b1f13 |
XctGLSegment, /* used when XctSingleSetSegments is requested */
|
|
Packit Service |
2b1f13 |
XctC1Segment, /* used when XctSingleSetSegments is requested */
|
|
Packit Service |
2b1f13 |
XctGRSegment, /* used when XctSingleSetSegments is requested */
|
|
Packit Service |
2b1f13 |
XctExtendedSegment, /* an extended segment */
|
|
Packit Service |
2b1f13 |
XctExtension, /* used when XctProvideExtensions is requested */
|
|
Packit Service |
2b1f13 |
XctHorizontal, /* horizontal direction or depth change */
|
|
Packit Service |
2b1f13 |
XctEndOfText, /* end of text string */
|
|
Packit Service |
2b1f13 |
XctError /* syntactic or semantic error */
|
|
Packit Service |
2b1f13 |
} XctResult;
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
typedef struct _XctRec {
|
|
Packit Service |
2b1f13 |
XctString total_string; /* as given to XctCreate */
|
|
Packit Service |
2b1f13 |
int total_length; /* as given to XctCreate */
|
|
Packit Service |
2b1f13 |
XctFlags flags; /* as given to XctCreate */
|
|
Packit Service |
2b1f13 |
int version; /* indicates the version of the CT spec
|
|
Packit Service |
2b1f13 |
* the string was produced from */
|
|
Packit Service |
2b1f13 |
int can_ignore_exts;/* non-zero if ignoring extensions is
|
|
Packit Service |
2b1f13 |
* acceptable, else zero */
|
|
Packit Service |
2b1f13 |
XctString item; /* item returned from XctNextItem */
|
|
Packit Service |
2b1f13 |
unsigned item_length; /* length of item in bytes */
|
|
Packit Service |
2b1f13 |
int char_size; /* number of bytes per character in
|
|
Packit Service |
2b1f13 |
* item, with zero meaning variable */
|
|
Packit Service |
2b1f13 |
char *encoding; /* Encoding name for item */
|
|
Packit Service |
2b1f13 |
XctHDirection horizontal; /* direction of item */
|
|
Packit Service |
2b1f13 |
unsigned horz_depth; /* current direction nesting depth */
|
|
Packit Service |
2b1f13 |
char *GL; /* "{I} F" string for current GL */
|
|
Packit Service |
2b1f13 |
char *GL_encoding; /* Encoding name for current GL */
|
|
Packit Service |
2b1f13 |
int GL_set_size; /* 94 or 96 */
|
|
Packit Service |
2b1f13 |
int GL_char_size; /* number of bytes per GL character */
|
|
Packit Service |
2b1f13 |
char *GR; /* "{I} F" string for current GR */
|
|
Packit Service |
2b1f13 |
char *GR_encoding; /* Encoding name for current GR */
|
|
Packit Service |
2b1f13 |
int GR_set_size; /* 94 or 96 */
|
|
Packit Service |
2b1f13 |
int GR_char_size; /* number of bytes per GR character */
|
|
Packit Service |
2b1f13 |
char *GLGR_encoding; /* Encoding name for current GL+GR,
|
|
Packit Service |
2b1f13 |
* if known */
|
|
Packit Service |
2b1f13 |
struct _XctPriv *priv; /* private to parser, don't peek */
|
|
Packit Service |
2b1f13 |
} *XctData;
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
/* these are the external routines */
|
|
Packit Service |
2b1f13 |
_XFUNCPROTOBEGIN
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
XctData XctCreate
|
|
Packit Service |
2b1f13 |
(
|
|
Packit Service |
2b1f13 |
_Xconst unsigned char *string,
|
|
Packit Service |
2b1f13 |
int length,
|
|
Packit Service |
2b1f13 |
XctFlags flags
|
|
Packit Service |
2b1f13 |
);
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
XctResult XctNextItem
|
|
Packit Service |
2b1f13 |
(
|
|
Packit Service |
2b1f13 |
XctData data
|
|
Packit Service |
2b1f13 |
);
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
void XctFree
|
|
Packit Service |
2b1f13 |
(
|
|
Packit Service |
2b1f13 |
XctData data
|
|
Packit Service |
2b1f13 |
);
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
void XctReset
|
|
Packit Service |
2b1f13 |
(
|
|
Packit Service |
2b1f13 |
XctData data
|
|
Packit Service |
2b1f13 |
);
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
_XFUNCPROTOEND
|
|
Packit Service |
2b1f13 |
|
|
Packit Service |
2b1f13 |
#endif /* _Xct_h */
|