home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
d
/
draw237
/
DrawDocs
/
tech
< prev
Wrap
Text File
|
1991-04-17
|
5KB
|
128 lines
DRAW PLUS TECHNICAL DETAILS
© JJM April 1991
This file gives details of the additional data structures used by
Draw Plus. They are defined in terms of C structures. Details of the
standard types and objects can be found in the include file drawftypes.h
supplied with C release 3. Any future changes to these structures will be
backwards compatible with Draw Plus version 2·00.
Extended object tag
This replaces the 4-byte object tag used in standard Draw objects, and
stores the layer information and miscellaneous flags. The default for the
extended information is all zeros, which means that objects and files
without this information are fully compatible with other applications
which produce or use Draw files.
The extended tag is described by the following structure:
typedef unsigned char draw_tagtyp;
typedef unsigned char draw_layer;
typedef unsigned char draw_objflags;
struct draw_extag /* Extended object tag */
{
draw_tagtyp tag; /* Basic object type */
draw_layer layer; /* Drawing layer, 0 to 31 */
draw_objflags flag; /* Object flags */
unsigned char spare; /* For future expansion */
};
The following bits in flag are used at present:
#define flag_NODISPLAY 1 /* Object is never displayed */
#define flag_LOCKED 2 /* Object is locked */
#define flag_HIDDEN 4 /* Object is temporarily hidden */
The NODISPLAY flag is used to mark objects, such as saved settings, used
internally. The HIDDEN flag marks objects that are temporarily invisible,
such as path objects that are in the process of being edited. The LOCKED
flag is set if the object has been locked.
The extended tag replaces the original draw_tagtyp in the object header,
as follows:
struct draw_objhdr /* General object header */
{
draw_extag t; /* Extended tag */
draw_sizetyp size; /* Object size */
draw_bboxtyp bbox; /* Bounding box */
};
Saved settings
Settings, styles, layer and dash pattern information is saved in a number
of objects which are described by the following structure:
struct draw_setstrhdr /* Saved settings object header */
{
draw_extag t; /* Extended tag */
draw_sizetyp size; /* Object size */
draw_bboxtyp bbox; /* Bounding box */
int version; /* Structure version */
int contents; /* What this contains */
};
The settings structure version field is used to detect incompatible or
out-of-date settings; it is currently 4.
The contents field indicates what is stored in this structure. The types
currently defined are:
#define set_USER 1 /* General user settings */
#define set_TEXTSTYLE 2 /* Default text style */
#define set_PATHSTYLE 3 /* Default path style */
#define set_EXTRAS 4 /* Layers and dash patterns */
#define set_EXPAND 5 /* For future expansion */
The data immediately follows this structure. Since the format and content
is subject to change, details are not included here. The object type for
a saved settings object is 101.
Library file
The library file format is very similar to a standard Draw file. The
header is identical, except that the creator string is "Library" rather
than "Draw". The major version number is 2.
The rest of the file contains standard Draw objects described by the
following structures:
struct draw_libstrhdr /* Library object header */
{
draw_extag tag; /* Object tag */
draw_sizetyp size; /* Size (including contained object) */
draw_bboxtyp bbox; /* Copy of object's bounding box */
char name[21]; /* Object name */
time_t time; /* Time last updated */
};
The included object (with its own tag and bounding box) follows
immediately after the header:
struct draw_libstr /* Library object */
{
draw_extag tag; /* Object tag */
draw_sizetyp size; /* Size (including contained object) */
draw_bboxtyp bbox; /* Copy of object's bounding box */
char name[21]; /* Object name */
time_t time; /* Time last updated */
draw_objhdr object; /* Object data */
};
The type time_t is defined in the header file time.h. The object type for
a library object is 100.