|
This document is Copyright The HyperMedia Group, 1990. You may copy and redistribute it freely, provided you do so only in its entirety, including this section. The names Hypermedia Interchange File Format and HIFF are trademarks of The HyperMedia Group. You can obtain a royalty-free license to use these trademarks by certifying that your product is fully compatible with published HIFF standards. (See Contacts information below.)
The products, algorithms, and techniques developed by The HyperMedia Group and its licensees for writing and reading HIFF files are proprietary and may be used only by those who have purchased or licensed them fromThe HyperMedia Group or its authorized resellers or relicensors.
The HyperMedia Group
HIFF Specification
5900 Hollis Street, Suite O
Emeryville, CA 94608
AppleLink, Connect, MCI: HMG
Once a document has been exported to HIFF form, the resulting HIFF file can, in theory, be imported into any number of target environments that have an importer available.
HIFF files are presently specified to be in readable (and, optionally, editable) text format , limited to the printable ASCII character set to maximize their transportability among environments.
Wherever possible, HIFF derives its terms for object types, properties and property values from existing hypermedia environments. In choosing terms for HIFF, the general rule of thumb was to adopt the term used in the earliest generally available product that incorporated a particular object type property or value. For example, while the terms card (usedby HyperCard from Apple Computer, Inc., and SuperCard from Silicon Beach Software, Inc.) and page (used by HyperPAD from Brightbill-Roberts, Inc. and ToolBook from Asymetrix Corp.) both refer to approximately the same object type, HIFF documents exported from all these environments would use card as the standard term for that object type. It is the responsibility of HIFF importers to map terms appropriately for their environment.
Scripting languages - Object scripts are presently exported unchanged from their native form in their creator environment. It is the responsibility of a HIFF importer to identify the source scripting language and version of a HIFF file, and either to employ its own cross-compiler for translating scripts to its environment, or to "comment out" any imported scripts that it cannot identify as executable in its environment.
Graphics - Rather than defining its own interchange format for graphics, HIFF relies on exisiting standardized graphics formats that can be incorporated within the HIFF framework, such as the Macintosh PICT format and the Windows bitmap format. Any graphic object in a HIFF file is required to have a property that specifies the format in which its image is encoded. It is the responsibility of a HIFF importer to provide or be able to access tools to interpret any standardized formats that the interpreter supports.
Externals - Machine-specific extensions to a hypermedia application may be exported as unmodified binary data if a user desires. Importers, however, are not expected to translate them or install them into the target environment. An importer may include facilities for mapping calls to externals from a source environment to comparable externals or native features in its target environment.
Resources - Data structures for information that are defined not by a hypermedia application but by the operating environment in which it exists, such as fonts, cursors and sounds, are either omitted or (generally at user option) exported in their native form into a HIFF file. It is the responsibility of an importer to determine if exported resources are relevant in its environment, and if so, to provide the capability to install them. As with externals (which are a special instance of the general category resources), an importer may include facilities for mapping uses of resources from a source environment to comparable resources or alternative structures in its target environment.
Audio-visual data - Video images and motion sequences, analog audio or digitized audio stored in other than a standard resource format, external device control capabilities (other than by standard script calls to an input or outport port where supported by a source environment), and event time sequence information (e.g. SMPTE time code) are presently beyond the scope of HIFF.
The newline character(s) is/are represented here as <CR> or the word newline, and understood to mean either <CR> or <CR><LF>.This is a single line of HIFF information too long to be shown here on one line. Its continuation lines are indented. This is a second line of HIFF text
The standard extension for a HIFF file in DOS and OS/2 environments is .HIF, though HIFF importers should also automatically recognize files with the extension .TXT. The standard filetype in the Macintosh environments (and any other using similar filetype conventions) is HIFF, though HIFF importers should also automatically recognize files of filetype TEXT. There is no specified file creator for HIFF files.
A HIFF file uses only the standard ASCII printable character set, and the standard control codes for <CR>, <LF> and <TAB>. All other control codes and characters are represented in "escaped" format as detailed below, and interpreted according to the file's character_set property. Newline characters are significant structure information within a HIFF file, however HIFF importers are insensitive to whether <CR>, <LF>, <CR><LF> or <LF><CR> is used to delimit lines, so long as their usage is consistent throughout a file. Line delimiters may be translated freely to conform to a particular environment's convention for convenience in reading and editing the file with a text editor.
Information that has no meaningful text representation is encoded in hexadecimal form, two characters per byte , with 16 bytes per line followed by a newline. The final line may contain fewer than 16 bytes, and is concluded with a newline. HIFF does not add any length or error-correction information to the raw data. Here is an example of the format:
000001000300050009f8100820084008A HIFF file begins with a header, followed by descriptions of zero or more objects, and concluded with the \end_HIFF control word. A minimal HIFF file would be:
2008100809f805000300010000000000
0007000a
HIFF (tm)
HyperMedia Interchange File Format -- TM, The HyperMedia Group
\HIFF_version {1.0}
\end_HIFF
If scripts of objects exist in both text and compiled forms, it is the text form that is exported to the HIFF file.
The characters \, {, and } are defined, sometimes in conjunction with a newline, as special characters used to indicate the start and grouping of control words and symbols, object and property declarations, and property values. Where these characters appear in the data for other than their special HIFF purposes, they are respresented in "escaped" form as defined below.
The {, and } characters are used to indicate a group, which may be either data comprising a property value, or properties associated with an object. Structures or collections of objects larger than one object are not presently grouped by HIFF.
Defined HIFF words are case-insensitive. Thus \end_HIFF is equivalent to \end_hiff or \end_Hiff.
Blank lines (i.e. lines containing only a newline character) are not significant within HIFF except when contained within a property value. They may be included as desired to enhance readability, or omitted.
| Character | Escaped character/ |
| Any below ASCII 32, except <CR>, <LF> or <TAB> | \'nn - where nn = the hex ASCII value 00 > 1f, left-padded with a zero if needed, e.g. \'02 or \'1c |
| Any above ASCII 127 | \'nn - where nn = the hex ASCII value 7f > ff e.g. \'80 or \'a5 |
| \ | \\ |
| { | \{ |
| } | \} |
HIFF (tm)
followed by a newline.
The second nonblank line of a HIFF file must be
HyperMedia Interchange File Format -- TM, The HyperMedia Group
followed by a newline.
The third nonblank line of a HIFF file must contain the control word \HIFF_version and a value. The value for files conforming to this version of the specification is 1.0, thus:
\HIFF_version {1.0}
Following this header, the next nonblank line begins the object descriptions.
| Control word | Meaning / Defined values |
| \HIFF_version | Version of the HIFF specification to which a file conforms; currently 1.0 |
| \end_HIFF | End of a HIFF file; no significant data beyond this line |
Once the first object at a given level has been described, all objects belonging that object (such as all card buttons or card fields belonging to a particular card) are described before any further descriptions of objects at the given level. This pattern is recursive for each level of objects being described. An example of such a structure is:
document background 1 non-card object 1 of background 1 card 1 of background 1 object 1 of card 1 of background 1 object 2 of card 1 of background 1 . . . object n of card 1 of background 1 card 2 of background 1 object 1 of card 2 of background 1 object 2 of card 2 of background 1 . . . object n of card 2 of background 1 . . . card n of background 1 background 2 . . . end-of-document
Objects belonging to lower hierarchical levels are assumed by HIFF to belong to the immediately-preceding higher-level object capable of "owning" an object of the type being described.
At a given level, all objects of a particular object type are described in sequence before any other object types at that level are described. The sequence used is whatever sequence the source application interprets the objects to be in. The order in which object types are described at a given hierarchical level may be arbitrary.
Thus, objects are grouped by their sequence in the HIFF file , which reflects the source document's implicit hierarchy. No additional punctuation or formatting is used, for example, to make explicit a grouping of objects that all reside on a particular card or background.
Default hierarchy: A HIFF file is assumed to have the following object hierarchy if no object_hierarchy property is included in the file:
file resources parent_file_information backgrounds background objects cards card objects
| Object | Meaning and notes |
| \file | The entire hypermedia document as defined by the creator application. |
| \parent_file | Any other document, by the same creator, known to be in the message inheritance path of the current document. In HyperCard 1.x, the "Home" stack. Note that resource chains are beyond the scope of the parent_file object. |
| \resType resource | A resource, of type resType, whose data structure is wholly incorporated in the current document. HIFF does not distinguish between resources stored in a separate resource fork of the file (e.g. HyperCard) and those not so separated (e.g. SuperCard). HIFF considers each type of resource as a separate object type, declared by placing a backslash in front of the type name used by the source environment (e.g. \ICON) This object type is followed by a space and the keyword resource to distinguish such objects from non-resource objects with an identical name (e.g. MENU). |
| \menu | Reserved for future definition. |
| \menu_item | Reserved for future definition. |
| \window | The screen window within which an associated group of backgrounds and cards is displayed. |
| \background | An object of defined area which may contain other objects that appear as common elements in one or more card instances of the background. |
| \background_graphic | A graphic image object attached to a background. One property must define the form used to enclode the image (e.g. \macpict to represent a Macintosh PICT format image). |
| \background_button | An object whose primary purpose is the intiation of some action, attached to a background. |
| \background_field | An object whose primary purpose is to contain, display, and/or allow the entry of text, attached to a background. |
| \card | An object of defined area that is one instance of a background and that may contain other objects. |
| \card_graphic | A graphic image appearing on a card layer of the source document. This object type must have one property defining the form used to enclode the image (e.g. \macpict to represent a Macintosh PICT format image). |
| \card_button | An object whose primary purpose is the intiation of some action, attached to a card. |
| \card_field | An object whose primary purpose is to contain, display, and/or allow the entry of text, attached to a card. |
| \background_field_data | Text information attached to a particular card instance of a background _field. |
| Property | Meaning / Defined values | Notes | |
| \HIFF_id | The unique identification of an object description witthin the HIFF file. | 1 |
1. This property is assumed implicitly for every object encoded in a HIFF file, though it may be encoded explicitly at the option of the exporter. It is a sequential numbering of all objects described in the file, beginning with 1 for the initial \file object, and incremented by 1 for each subsequent object described. Files subject to editing in which objects descriptions may be removed or added should include explicit \HIFF_id numbering. This property may be useful in resolving object ownership ambiguities, when used in conjunction with the \parent_object property.
| Property | Meaning /Defined values | Notes |
| \creator | The name of the application which created the source document, e.g. HyperCard. | 1 | /
| \creator_version | The version of the creator application which created the source document. If the source application has a version property or equivalent, the value will be in the format returned by the application. | 2 |
| \H_resolution | The number of the source environment's finest units of horizontal measure that equal the standard unit of measure defined by the property H_resolution_unit. | |
| \H_resolution_unit | Presently, only inch is defined | |
| \V_resolution | The number of the source environment's finest units of vertical measure that equal the standard unit of measure defined by the property V_resolution_unit. | |
| \V_resolution_unit | Presently, only inch is defined | |
| \character_set | The standard chracter set to which text information associated with objects (e.g. names, scripts, data properties) is mapped. ansi - ANSI standard mac - Apple Macintosh pc - IBM PC pca - IBM PS/2 code page 850 | 3 |
| \object_hierarchy | Reserved for future definition. | |
| \name | The name by which the document's file is known to the file system of the source environment. | 4 |
| \caption | The name by which the document is identified to the user, if different from the file system name. | |
| \cantModify | Whether the document is read-only or can be changed. Either true or false. | |
| \size | The size, in bytes, that the source application or its operating system reports for the document. | |
| \freesize | The reduction in size, in bytes, that the source application reports would be made available if it compacted / compressed the document's data. Useful primarily for user feedback. | |
| \external_list | A list of external commands and functions (e.g. HyperCard XCMD resources) included in the file, one per line, with each line containing a comma-separated list of the resource's type, name, ID, and size, e.g. XCMD,Flash,26,128 | 5 |
| Property Meaning / Defined values Notes | ||
| \name | The name by which the parent file is known to the file system of the source environment. | |
| \resource_list | A list of resources included in the parent file, one per line, with each line containing a comma-separated list of the resource's type, name, ID, and size, e.g. ICON,Arrow,26,128 | |
| \handler_list | A list of handlers that the parent file places in the message path of the source document, one per line. | |
| \function_list | A list of functions that the parent file places in the message path of the source document, one per line. | |
| \sequence | Reserved for future definition. |
| Property | Meaning / Defined values | Notes |
| \name | ||
| \id | as identified in the source environment | |
| \size | ||
| \data | in hex format |
| Property | Meaning / Defined values | Notes |
| \name | 1 | |
| \left_top | horizontal, vertical - in the source environments standard units of screen position measure | |
| \size | width, height | |
| \cantModify | ||
| \number_backgrounds | Total number of backgrounds in the window | |
| \number_cards | Total number of cards in the window | |
| \script |
| Property | Meaning / Defined values | Notes |
| \name | ||
| \number | ||
| \ID | ||
| \background_size | height,width - in the units defined by the file's H_resolution and V_resolution properties. | |
| \cantDelete | ||
| \script |
| Property | Meaning / Defined values | Notes |
| \type | The standard graphics format in which the graphics data is encoded. macpict - Macintosh PICT format. wbitmapn - Windows bitmap type n. wmetafilen - Windows metafile type n. | |
| \rect | left,top,right,bottom - rectangle of the graphic's bounding frame. | 1 |
| \layer | Reserved for future definition. | 2 |
| \data | hex data representing the graphic object. |
| Property | Meaning / Defined values | Notes |
| \name | ||
| \number | ||
| \ID | ||
| \rect | ||
| \layer | Reserved for future definition. | |
| \style | ||
| \showName | ||
| \hilite | ||
| \autoHilite | HyperCard 1.x | |
| \textFont | The font name (not number) used for the font by the source environment. See notes in background_field object regarding styled text. | |
| \textSize | ||
| \textStyle | ||
| \textAlign | ||
| \visible | ||
| \icon | The number of the icon resource which is attached to the button. | 1 |
| \icon_data | A copy of the data property value of the icon resource. | 2 |
| \script |
| Property | Meaning / Defined values | Notes |
| \name | ||
| \number | ||
| \ID | ||
| \rect | ||
| \layer | Reserved for future definition. | |
| \style | ||
| \lockText | HyperCard 1.x | |
| \showLines | HyperCard 1.x | |
| \wideMargins | HyperCard 1.x | |
| \autoTab | ||
| \data_format | Reserved for future definition. | 1 |
| \textFont | The font name (not number) used for the font by the source environment. | 1 |
| \textSize | in points | |
| \textHeight | in points | |
| \textStyle | HyperCard 1.x | |
| \textAlign | HyperCard 1.x | |
| \visible | ||
| \script |
| Property | Meaning / Defined values | Notes |
| \name | ||
| \number | ||
| \ID | ||
| \cantDelete | ||
| \script |
| Property | Meaning / Defined values | Notes |
| \type | See \background_graphic. | |
| \rect | ||
| \layer | Reserved for future definition. | |
| \data |
| Property | Meaning / Defined values | Notes |
| \name | 1 | |
| \number | ||
| \ID | ||
| \rect | ||
| \layer | Reserved for future definition. | |
| \style | ||
| \showName | ||
| \hilite | ||
| \autoHilite | ||
| \textFont | ||
| \textSize | ||
| \textStyle | ||
| \textAlign | ||
| \visible | ||
| \icon | ||
| \icon_data | ||
| \script |
| Property | Meaning / Defined values | Notes |
| \name | 1 | |
| \number | ||
| \ID | ||
| \rect | ||
| \layer | Reserved for future definition. | |
| \style | ||
| \lockText | ||
| \showLines | ||
| \wideMargins | ||
| \autoTab | ||
| \textFont | ||
| \textSize | ||
| \textHeight | ||
| \textStyle | ||
| \textAlign | ||
| \visible | ||
| \script | ||
| \data_format | Reserved for future definition. | |
| \data | Contents of the field. |
| Property | Meaning / Defined values | Notes |
| \number | The background field , identified by number, in which to place this data. | |
| \data_format | Reserved for future definition. | |
| \DATA | CONTENTS OF THE FIELD. |
|