• Aucun résultat trouvé

msgT extlnitAttrs

Dans le document PenPofnt GO (Page 36-40)

Initialize the attributes and mask before a msgTextChangeAttrs.

Takes P _TEXT_CHANGE_ATTRS, returns STATUS.

#define msgTextInitAttrs TAMakeMsg(taVersion 3)

26 PENPOINT API REFERENCE

typedef struct TEXT_CHANGE_ATTRS

ATOM tag;

TEXT INDEX first;

TEXT INDEX length;

P UNKNOWN pNewMask;

P UNKNOWN pNewValues;

TEXT_CHANGE_ATTRS, *P_TEXT_CHANGE_ATTRS;

The type of attributes is specified by pArgs->tag. pArgs->pNewValues and pArgs->pNewMask must be set as appropriate to an invocation of msgTextChangeAttrs.

If pArgs->first is textDefaultAttrs, the default attributes are used to initialize pArgs->pNewValues.

Otherwise the attributes in effect at pArgs->first are used. All bits of pArgs->pNewMask are set to O.

stsBadParam Either pArgs->tag or the range was invalid.

< stsOK Some other error occurred. No change has been made to the attributes and mask.

msg TextChangeAttrs

msgTextPrintAttrs

Prints the values of an attribute set and a mask.

Takes P_TEXT_CHANGE_ATTRS, returns stsOK.

tifdef DEBUG

tdefine msgTextPrintAttrs tendif

typedef struct TEXT CHANGE_ATTRS

ATOM tagi

TEXT INDEX first;

TEXT INDEX length;

P UNKNOWN pNewMaski P UNKNOWN pNewValuesi

TAMakeMsg(taVersion, 4)

TEXT_CHANGE_ATTRS, *P_TEXT_CHANGE_ATTRSi

This message takes the same parameters as msgT extChangeAttrs and the pArgs must be filled in the same way. In response to this message, a textData prints out a useful dump of the contents of pArgs.

Internal Use Only: If pArgs-> first is txtPrvAttrs, then pArgs->pNewValues must be in the internal format.

msg TextChangeAttrs

msgTextRead

Inserts Ascii, R1F, etc. at the specified location.

Takes P_TEXT_READ, returns STATUS.

tdefine msgTextRead TBMakeMsg(O) typedef struct TEXT_READ

TEXT INDEX first;

TEXT_READ, *p _TEXT_READi

2,

6, II true 8; II true

or false or false

The textData reads data and inserts the data into itself

(and 5 spare bits) (and 7 spare bits)

Mess(l~e Arguments

Comments

The fields of pArgs are:

TXTDATA.H Messages Defined by Other Classes

first the read text is inserted into the textData starting at this position. After a successful return, pArgs->first is position immediately after the inserted text.

27

input the input source. If pArgs->inputlsObject is true, this field must hold a FILE_HANDLE object. If pArgs->inputlsObject is false, then this field must hold a P _FILE.

embeddedAction Client must set this to textEmbedlnsert. (Other values are for internal use only.) freeAfter If true, then pArgs->input is freed after reading successfully.

inputlsObject describes the type of pArgs->input.

format one of the file types defined in filetype.h, or fileTypeUndefined. If the latter, the textData object attempts to deduce the form at from the contents of the data found in pArgs->input.

The textData reads pArgs->input using the functions defined in stdio.h. Thus, if pArgs->inputlsObject is true, pArgs->input must be an object which supports the stream protocol as used by stdio.

stsReadOnly request refused because object is read only.

stsNoMatch RTF error: first character of input is not II { " or format version> 1 or unrecognized font name.

stsFailed StdioStreamBindO or fseekO failed.

stsBadParam pArgs->format is invalid.

stsFS... see <fs.h>.

stsOK request completed successfully; pArgs->first updated.

msgTextWrite

Outputs the specified span as one of Ascii, R1F, etc.

Takes P_TEXT_WRITE, returns STATUS.

#define msgTextWrite typedef struct TEXT_WRITE

TEXT_INDEX first;

TEXT_INDEX length;

P_UNKNOWN output;

U16 flags;

TAG format;

U8 outputIsObject;

TEXT_WRITE, *P_TEXT_WRITE;

The fields of pArgs are:

TBMakeMsg(l)

II One of the values below (and 13 II spare bits)

first first character of range to be written length length of range to be written

output if null, the textData creates a P _FILE and returns that handle. If non-null, then this field is either an object or a P _FILE, depending on the value of outputlsObject.

flags described below

format one of the file types defined in filetype.h.

outputlsObject If output is non-null and outputlsObject is true, then output is an object. If output is non-null and outputlsObject is false, then output is a P _FILE.

- - - _ ... _

-28 PEN POINT API R~FERENCE Part 6 / Text

M0,$sQ~e At'£jI\UnCt'ifS

Possible values for the flags field of a TEXT_WRITE are:

twExtractEmbedded embedded objects in the specified span are extracted from their parent window.

twTempFile if output is null, then a temporary file is created. (Developer's Note: If you're debugging the behavior of msgTextWrite, you probably don't want to turn this flag on as your file will be deleted before msgTextWrite returns.)

twForUndo add additional information needed for supporting UNDO.

stsBadParam pArgs->format is invalid.

stsFailed StdioStreamBindO failed.

stsFS... see <fs.h>.

stsOK request completed successfully.

msgTextEnumEmbeddedObjects

Enumerates the textData's embedded objects.

Takes P_TEXT_ENUM_EMBEDDED, returns STATUS.

fdefine msgTextEnumEmbeddedObjects typedef struct TEXT_ENUM_EMBEDDED {

TEXT_INDEX first;

TEXT INDEX length;

TMMakeMsg(9)

U16 flags; II One of the values below

U16 max;

U16 count;

P_TEXT_EMBED_OBJECT pItems;

TEXT_ENUM_EMBEDDED, *P_TEXT_ENUM_EMBEDDED;

There are two ways of enumerating the embedded objects:

1) Get all the objects in one send. The textData allocates an array of TEXT_EM BED_OBJECT elemeius and passes it back in pArgs->pltems. You must OSHeapBlockFreeO the array when you are done with it.

TEXT _ENUM_EMBEDDED is used as follows:

first position at which you want to start the enumeration. Use 0 to start at the beginning of the data.

length length of the range you want the enumeration to include. Use inffEXT _INDEX to go to the end of the data.

flags Usually teeDefault. Use teeFloat to get only floating embedded objects. Use teeInline to get only in-line embedded objects.

max Pass in

o.

The object passes back the number of items in the allocated block

count Pass in maxU16. The object passes back the number of items returned (same as max).

pltems Pass in pNull. The object passes back a pointer to the allocated block

2) Get the objects a few at a time. You repeatedly send msgTextEnumEmbeddedObjects re-using the same TEXT_ENUM_EMBEDDED structure. When the message returns stsEndOIData, there are no more objects in the enumeration. You should set the fields ofTEXT_ENUM_EMBEDDED only before the first call. For successive calls you must not modify the fields.

first Same as Case 1.

length Same as Case 1.

flags Same as Case 1.

max number of objects the pltems block can hold.

TXTDATA.H Notifications

count Pass in the same value as max. textData passes back the number of objects returned in block.

May be less than max for the last chunk, and is

°

when no further objects are left to enumerate.

pltems pointer to a block that can hold at least max objects.

stsOK next chunk of objects has been enumerated

29

stsEndOfData no more objects to enumerate. Passed back count is be zero. If pltems was nil and max was 0, then no block has been allocated.

Notifications

I\'\ess£lge ATgurnents

Message Arguments

Dans le document PenPofnt GO (Page 36-40)

Documents relatifs