home *** CD-ROM | disk | FTP | other *** search
-
- /* HEADER FILE *****************************************************
- * WTAPI.H - Platform-specific Writing Tools API declarations
- *******************************************************************
- * Copyright (C) 1994 WordPerfect Corp., All Rights Reserved
- *******************************************************************/
- #ifndef WTAPI_H
- #define WTAPI_H
-
- #include <wtdef.h>
- #include <Xm/Xm.h>
-
- /*** Definitions used for sending command messages ***/
- /*** We can use the same routines as the query ***/
- /*** messages with the return message information ***/
- /*** zeroed out. ***/
- #define wtcClSend(comm,inmsgid,inmsg,inmsgsize,inbuf,inbufsize) \
- wtqClSend(comm,inmsgid,inmsg,inmsgsize,inbuf,inbufsize, \
- WTC_NOMESSAGE, NULL, 0, NULL, 0)
-
- #define wtcTlSend(comm,inmsgid,inmsg,inmsgsize,inbuf,inbufsize) \
- wtqTlSend(comm,inmsgid,inmsg,inmsgsize,inbuf,inbufsize, \
- WTC_NOMESSAGE, NULL, 0, NULL, 0)
-
- /*** Types and Structures ***/
- typedef struct {
- int read; /* file descriptor to read from */
- int write; /* file descriptor to write to */
- } WTPIPE;
-
- typedef struct {
- char *client; /* client id string */
- char *tool; /* tool id string */
- WTPIPE cl_pipe; /* client's read/write file descriptors */
- WTPIPE tl_pipe; /* tool's read/write file descriptors */
- XtInputId inputid; /* id of XtInputCallbackProc */
- Widget toplevel; /* widget of own toplevel shell */
- Window window; /* window id of communication partner */
- } WTCOMMDATA, *WTCOMM; /* platform specific communication */
-
- typedef unsigned char WTBUF, *WTBUFP;/* Pointer for Writing Tool information buffers */
- typedef unsigned WTSIZE, *WTSIZEP; /* size (unsigned) WTAPI values */
- typedef int WTCOUNT, *WTCOUNTP; /* counted (signed) WTAPI values */
-
- typedef unsigned short WTACTION; /* writing tool action */
- typedef unsigned short WTDAMODE; /* writing tool data storage modes */
- typedef unsigned short WTINFO; /* writing tool reactivation info */
- typedef unsigned long WTTEXT; /* writing tool text types */
- typedef unsigned long WTUNIT; /* writing tool text units */
-
- typedef struct { /* WTLANG structure */
- unsigned char script; /* script of text */
- unsigned char language; /* language of text */
- unsigned short region; /* region (dialect) of text */
- } WTLANG, *WTLANGP;
-
- /*** Message Structures ***/
- typedef struct { /* WTC_RQINIT message */
- WTMSGID msgid; /* WTC_RQINIT */
- WTBOOL newdoc; /* new document or window? */
- WTSIZE size; /* size of document path name */
- } WTCRQINIT, *WTCRQINITP;
-
- typedef struct { /* WTC_INIT message */
- WTMSGID msgid; /* WTC_INIT */
- WTMODE mode; /* desired mode of execution */
- int version; /* API version number */
- Window windowClient; /* Client's window id */
- } WTCINIT, *WTCINITP;
-
- typedef struct { /* WTQ_INFOBLOCK message */
- WTMSGID msgid; /* WTQ_INFOBLOCK */
- WTTOOL tooltype; /* type of writing tool */
- WTTEXT suptext; /* supported text modes */
- WTTEXT preftext; /* preferred text mode */
- int version; /* API version number */
- WTBOOL cleanTxt; /* support clean text? */
- WTBOOL resume; /* resume a query? */
- WTSIZE size; /* maximum size of a block */
- } WTQINFOBLOCK, *WTQINFOBLOCKP;
-
- typedef struct { /* WTR_INFOBLOCK message */
- WTMSGID msgid; /* WTR_INFOBLOCK */
- WTSTATUS status; /* return status from client */
- WTTEXT textmode; /* mode of representing text */
- WTDAMODE tdamode; /* supported tool data area modes */
- WTLANG userlang; /* user interface language */
- WTLANG textlang; /* default text language */
- WTBOOL hastext; /* the client has default text */
- int service; /* writing tool service requested */
- WTSIZE mysize; /* maximum size block to the client */
- WTBOOL complete; /* is text request complete? */
- WTSIZE winsize; /* size of window name text */
- } WTRINFOBLOCK, *WTRINFOBLOCKP;
-
- typedef struct { /* WTQ_UNITINFO message */
- WTMSGID msgid; /* WTQ_UNITINFO */
- } WTQUNITINFO, *WTQUNITINFOP;
-
- typedef struct { /* WTR_UNITINFO message */
- WTMSGID msgid; /* WTR_UNITINFO */
- WTSTATUS status; /* return status from client */
- WTUNIT supunit; /* supported text units */
- WTUNIT curunit; /* current text units */
- WTUNIT defunit; /* default text unit */
- WTSIZE size; /* size of client-defined unit text */
- } WTRUNITINFO, *WTRUNITINFOP;
-
- typedef struct { /* WTQ_READTOOLDATA message */
- WTMSGID msgid; /* WTQ_READTOOLDATA */
- int company; /* company ID of this block */
- int product; /* product/version of block */
- WTDAMODE tdamode; /* tool data area mode */
- WTBOOL resume; /* resume the current query */
- WTSIZE size; /* maximum size of a block */
- } WTQREADTOOLDATA, *WTQREADTOOLDATAP;
-
- typedef struct { /* WTR_READTOOLDATA message */
- WTMSGID msgid; /* WTR_READTOOLDATA */
- WTSTATUS status; /* return status from client */
- WTBOOL complete; /* is request now complete? */
- WTSIZE size; /* size of data returned */
- } WTRREADTOOLDATA, *WTRREADTOOLDATAP;
-
- typedef struct { /* WTQ_WRITETOOLDATA message */
- WTMSGID msgid; /* WTQ_WRITETOOLDATA */
- int company; /* company ID */
- int product; /* product/version info */
- WTDAMODE tdamode; /* tool data area mode */
- WTBOOL append; /* should the data be appended? */
- WTSIZE size; /* size of data to write */
- } WTQWRITETOOLDATA, *WTQWRITETOOLDATAP;
-
- typedef struct { /* WTR_WRITETOOLDATA message */
- WTMSGID msgid; /* WTR_WRITETOOLDATA */
- WTSTATUS status; /* return status from client */
- WTSIZE size; /* actual size of data written */
- } WTRWRITETOOLDATA, *WTRWRITETOOLDATAP;
-
- typedef struct { /* WTQ_TEXTBLOCK message */
- WTMSGID msgid; /* WTQ_TEXTBLOCK */
- WTUNIT fromunit; /* start at beginning of unit */
- WTPOS frompos; /* REL/ABS starting position */
- WTCOUNT fromloc; /* current, back/forward ... */
- WTUNIT tounit; /* end at end of unit */
- WTPOS topos; /* REL/ABS ending position */
- WTCOUNT toloc; /* current, back/forward ... */
- WTTBQTYPE qtype; /* type of query */
- WTBOOL containers; /* return sub-containers? */
- WTBOOL tracking; /* Track user's changes? */
- WTSIZE size; /* maximum size of a block */
- Window windowTool; /* Tool's window id */
- } WTQTEXTBLOCK, *WTQTEXTBLOCKP;
-
- typedef struct { /* WTQ_NEXTTEXTBLOCK message */
- WTMSGID msgid; /* WTQ_NEXTTEXTBLOCK */
- WTSIZE size; /* maximum size of a block */
- } WTQNEXTTEXTBLOCK, *WTQNEXTTEXTBLOCKP;
-
- typedef struct { /* WTR_TEXTBLOCK message */
- WTMSGID msgid; /* WTR_TEXTBLOCK */
- WTSTATUS status; /* return status from client */
- WTSIZE blocknum; /* the id number of this block */
- WTLANG language; /* language of this text block */
- WTCOUNT depth; /* relative block container depth */
- WTENDBLOCK endblock; /* cause of end of text block */
- WTSIZE size; /* size of text block */
- } WTRTEXTBLOCK, *WTRTEXTBLOCKP;
-
- typedef struct { /* WTQ_READTEXTOBJECT message */
- WTMSGID msgid; /* WTQ_READTEXTOBJECT */
- WTCOUNT idnumber; /* id of object to read */
- WTBOOL resume; /* resume the current query */
- WTSIZE size; /* maximum size of a block */
- } WTQREADTEXTOBJECT, *WTQREADTEXTOBJECTP;
-
- typedef struct { /* WTR_READTEXTOBJECT message */
- WTMSGID msgid; /* WTR_READTEXTOBJECT */
- WTSTATUS status; /* return status from client */
- WTBOOL complete; /* is request now complete? */
- WTSIZE size; /* size of data returned */
- } WTRREADTEXTOBJECT, *WTRREADTEXTOBJECTP;
-
- typedef struct { /* WTQ_WRITETEXTOBJECT message */
- WTMSGID msgid; /* WTQ_WRITETEXTOBJECT */
- WTCOUNT idnumber; /* id of object to write */
- WTBOOL append; /* should the data be appended? */
- WTSIZE size; /* size of data to write */
- } WTQWRITETEXTOBJECT, *WTQWRITETEXTOBJECTP;
-
- typedef struct { /* WTR_WRITETEXTOBJECT message */
- WTMSGID msgid; /* WTR_WRITETEXTOBJECT */
- WTSTATUS status; /* return status from client */
- WTSIZE size; /* actual size of data written */
- } WTRWRITETEXTOBJECT, *WTRWRITETEXTOBJECTP;
-
- typedef struct { /* WTQ_GOTO message */
- WTMSGID msgid; /* WTQ_GOTO */
- WTPOS blockpos; /* REL/ABS block number */
- WTCOUNT blocknum; /* block number */
- WTPOS offsetpos; /* REL/ABS offset in block */
- WTCOUNT offsetloc; /* offset in block */
- } WTQGOTO, *WTQGOTOP;
-
- typedef struct { /* WTR_GOTO message */
- WTMSGID msgid; /* WTR_GOTO */
- WTSTATUS status; /* return status from client */
- WTCOUNT count; /* count of API bytes moved */
- WTSIZE block; /* new cursor block position */
- WTSIZE offset; /* new cursor offset in block */
- } WTRGOTO, *WTRGOTOP;
-
- typedef struct { /* WTQ_HILITE message */
- WTMSGID msgid; /* WTQ_HILITE */
- WTCOUNT count; /* count of bytes to highlight */
- } WTQHILITE, *WTQHILITEP;
-
- typedef struct { /* WTR_HILITE message */
- WTMSGID msgid; /* WTR_HILITE */
- WTSTATUS status; /* return status from client */
- WTCOUNT count; /* count of bytes highlighted */
- } WTRHILITE, *WTRHILITEP;
-
- typedef struct { /* WTQ_DEHILITE message */
- WTMSGID msgid; /* WTQ_DEHILITE */
- WTCOUNT count; /* count of bytes to dehilite */
- } WTQDEHILITE, *WTQDEHILITEP;
-
- typedef struct { /* WTR_DEHILITE message */
- WTMSGID msgid; /* WTR_DEHILITE */
- WTSTATUS status; /* return status from client */
- WTCOUNT count; /* count of bytes dehilited */
- } WTRDEHILITE, *WTRDEHILITEP;
-
- typedef struct { /* WTQ_REPLACE message */
- WTMSGID msgid; /* WTQ_REPLACE */
- WTLANG language; /* language of this replacement */
- WTCOUNT depth; /* relative depth of this replacement */
- WTCOUNT count; /* count of bytes to remove */
- WTBOOL newblock; /* put this text in its own block? */
- WTSIZE size; /* size of replacement buffer */
- } WTQREPLACE, *WTQREPLACEP;
-
- typedef struct { /* WTQ_UNDOREPLACE message */
- WTMSGID msgid; /* WTQ_UNDOREPLACE */
- } WTQUNDOREPLACE, *WTQUNDOREPLACEP;
-
- typedef struct { /* WTR_REPLACE message */
- WTMSGID msgid; /* WTR_REPLACE */
- WTSTATUS status; /* return status from client */
- WTCOUNT count; /* count of bytes removed */
- WTSIZE size; /* actual replacement buffer size */
- WTSIZE block; /* new cursor block position */
- WTSIZE offset; /* new cursor offset in block */
- } WTRREPLACE, *WTRREPLACEP;
-
- typedef struct { /* WTC_RQCLACTIVE message */
- WTMSGID msgid; /* WTC_RQCLACTIVE */
- } WTCRQCLACTIVE, *WTCRQCLACTIVEP;
-
- typedef struct { /* WTC_CLACTIVE message */
- WTMSGID msgid; /* WTC_CLACTIVE */
- WTACTION action; /* desired writing tool action */
- } WTCCLACTIVE, *WTCCLACTIVEP;
-
- typedef struct { /* WTC_CLINACTIVE message */
- WTMSGID msgid; /* WTC_INCLACTIVE */
- WTACTION action; /* desired writing tool action */
- } WTCCLINACTIVE, *WTCCLINACTIVEP;
-
- typedef struct { /* WTC_TLINACTIVE message */
- WTMSGID msgid; /* WTC_TLINACTIVE */
- WTACTION action; /* desired writing tool action */
- } WTCTLINACTIVE, *WTCTLINACTIVEP;
-
- typedef struct { /* WTQ_TLACTIVE message */
- WTMSGID msgid; /* WTQ_TLACTIVE */
- } WTQTLACTIVE, *WTQTLACTIVEP;
-
- typedef struct { /* WTR_TLACTIVE message */
- WTMSGID msgid; /* WTR_TLACTIVE */
- WTSTATUS status; /* return status from client */
- WTCOUNT modified; /* number of blocks modified */
- WTCOUNT cursor; /* new client cursor position */
- WTINFO newinfo; /* need new client information? */
- } WTRTLACTIVE, *WTRTLACTIVEP;
-
- typedef struct { /* WTC_RQTLTERM message */
- WTMSGID msgid; /* WTC_RQTLTERM */
- } WTCRQTLTERM, *WTCRQTLTERMP;
-
- typedef struct { /* WTC_TLTERM message */
- WTMSGID msgid; /* WTC_TLTERM */
- } WTCTLTERM, *WTCTLTERMP;
-
-
- /*** Function Prototypes ***/
-
- WTSTATUS wtqClSend(WTCOMM, WTMSGID, WTBUFP, WTSIZE, WTBUFP, WTSIZE,
- WTMSGID, WTBUFP, WTSIZE, WTBUFP, WTSIZE);
-
- WTSTATUS wtqTlSend(WTCOMM, WTMSGID, WTBUFP, WTSIZE, WTBUFP, WTSIZE,
- WTMSGID, WTBUFP, WTSIZE, WTBUFP, WTSIZE);
-
- WTSTATUS wtClReceive(WTCOMM, WTMSGID, WTBUFP, WTBUFP, WTBUFP, WTBUFP, WTSIZEP);
-
- WTSTATUS wtTlReceive(WTCOMM, WTMSGID, WTBUFP, WTBUFP, WTBUFP, WTBUFP, WTSIZEP);
-
- #endif /* WTAPI_H */
-