NOTE:
This project is no longer being maintained: it was developed for my masters thesis, which was completed in early 1997. I still, however, welcome any questions or comments that people may have.

[Home] [ToC] [Up] [Prev] [Next]


iHTML Library Services

Document Interface

The iHTML library document services define various types that are used to store high-level scripting information related to a document (e.g., information about the <OBJECT> tags embedded in a document), and functions for managing the interaction between these data structures and the browser itself.


Types

IHCodeInfo
Synopsis
Context of a language-side piece of code.
Definition
typedef struct ih_code_info_rec   IHCodeInfo;
struct ih_code_info_rec {
  IHNode node;
  IHGlobalInfo* interface;
  IHLanguage* language;   /* Language of module */
  IHLangEnv* langenv;     /* Language environment for this code segment */
  IHBufferP source;       /* Raw source retrieved from URL/document */
  IHLangCode code;        /* Compiled code to be executed by interpreter */
  IHList params;          /* (IHEmbeddedParam*) List of  args */
  char *class;            /* URL where this module may be retrieved from */
  char *classtype;        /* Directly supplied content type of module */
  char *data;             /* Name of standard module */
  char *datatype;         /* Directly supplied content type of module */
  char *symbol;           /* Symbol to expose object as */
  int version;            /* Minimum version allowed */
  int running;            /* If TRUE, this code is currently running */
};
See Also
IHGlobalInfo IHLanguage, IHLangEnv, IHBufferP, IHLangCode, IHEmbeddedParam, IHModuleInfo, IHEmbeddedInfo,

This type represents the interface between a browser document and back-end language module's script that is common to all types of code. It is created as a result of parsing a <OBJECT> tag, initializing the needed language module, and retrieving any associated scripts or data files.

The params is a list of all the <PARAM> param tags that were included with the object, and these attributes:

IHDelayedStartup
Synopsis
The context on a script that is ready to run, whenever the global document script has started.
Definition
typedef struct ih_delayed_startup_rec {
  IHNode node;
  IHModuleInfo* module;
  IHEmbeddedInfo* object;
} IHDelayedStartup;
See Also
IHModuleInfo, IHEmbeddedInfo

This type is used to keep track of individual language-side that are ready to run, but waiting for the document script to begin execution. Only one of the two fields should be non-NULL, and it points to the script that is waiting.

IHEmbeddedInfo
Synopsis
Additional context information needed for code used in embedded objects.
Definition
struct ih_embedded_info_rec {
  IHCodeInfo code;
  IHWidgetRep widget;   /* Browser-side widget associated with this */
  IHWidgetObj object;   /* Language-side object associated with this */
};
See Also
IHCodeInfo,

This type adds data to an IHCodeInfo that is needed by code segments being used as embedded objects.

IHEmbeddedParam
Synopsis
A single parsed <PARAM> tag.
Definition
typedef struct ih_embedded_param_rec {
  IHNode node;
  IHParamType type;
  char *param;
  char *value;
} IHEmbeddedParam;
See Also
IHParamType,

This type encaspulates the information associating a parameter name with its value, used to represent the <PARAM> tags found when parsing a <OBJECT>, or any other name/value mapping.

IHGlobalInfo
Synopsis
Represents the context associated with one browser document's entire scripting session.
Definition
typedef struct ih_inter_info_rec  IHGlobalInfo;
struct ih_inter_info_rec {
  IHDocument document;    /* Document this interface is on */
  IHBrowser browser;      /* Browser-specific information */
  IHLanguage* language;   /* Language of main program, as per  */
  IHModuleInfo* main;     /* Main program embedded in document */
  int running;            /* TRUE if anything is currently executing */
  int ready;              /* TRUE if the main program is available */
  int num_modules;        /* Number of modules in the modules list */
  int num_objects;        /* Number of objects in the objects list */
  IHList langenvs;        /* (IHLangEnv*) All language environments */
  IHList modules;         /* (IHModuleInfo*) Modules in document */
  IHList objects;         /* (IHEmbeddedInfo*) Embedded objects in document */
  IHList delayed;         /* (IHDelayedStartup) Code waiting for main to run */
};
See Also
IHDocument, IHBrowser, IHLanguage, IHLangEnv, IHModuleInfo, IHEmbeddedInfo, IHDelayedStartup

This type contains all global information about the iHTML state associated with a document. It keeps track of all the scripts currently connected with it, the status of the system, and provides a handle for performing global operations on the system.

IHModuleInfo
Synopsis
Additional context information needed for code used in modules.
Definition
struct ih_module_info_rec {
  IHCodeInfo code;
  int program;            /* Flag -- TRUE if document script */
};
See Also
IHCodeInfo,

This type adds data to an IHCodeInfo that is needed by code segments being used as modules. This includes regular modules and document-level scripts.

IHParamType
Synopsis
Value identifying the type of an IHEmbeddedParam.
Definition
typedef enum {
  IHParamType_Static, /* Occurred as attribute -- "param" is a static string */
  IHParamType_Attr,   /* Occurred as a <PARAM> -- "param" is a markup attr. */
  IHParamType_String  /* Generic -- "param" and "value" should be free()d. */
} IHParamType;
See Also
IHEmbeddedParam,

This type enumerates the possible types of IHEmbeddedParam objects there are.

IHRun
Synopsis
The current script execution state of a document context.
Definition
typedef enum {
  IRun_None,            /* No script is currently executing */
  IRun_Exec             /* A script is executing right now */
} IHRun;
See Also
IHGlobalInfo

This type enumerates the possible execution state of a document context's scripts.

IHState
Synopsis
The current state of a document context.
Definition
typedef enum {
  IState_Nothing,       /* No interface in this document */
  IState_Loaded,        /* Interface has been loaded/compiled */
  ISTate_Active         /* Document's interface is active */
} IHState;
See Also
IHGlobalInfo

The type is an enumeration of the possible states a document interface can be in.


Functions

IH_FreeInterface
Synopsis
void IH_FreeInterface(IHGlobalInfo* gi)
Arguments
(IHGlobalInfo*) gi
The document interface context to deallocate.
Return
nothing.
See Also
IHGlobalInfo

Deallocates and frees all resources attached to an IHGlobalInfo that was previously created by BR_ParseInterface().

IH_FreeParam
Synopsis
void IH_FreeParam(IHEmbeddedParam* ep)
Arguments
(IHEmbeddedParam*) ep
The parameter to deallocate.
Return
nothing.
See Also
IHEmbeddedParam

Deallocates the given IHEmbeddedParam node and all data associated with it.

IH_ParseEmbedded
Synopsis
IHEmbeddedInfo* IH_ParseEmbedded(IHGlobalInfo* gi, IHDocument doc, IHWidgetRep widget, HTMLNode objdef)
Arguments
(IHGlobalInfo*) gi
The interface context this embedded object occurs in.
(IHDocument) doc
The browser document this embedded object occurs in.
(IHWidgetRep) widget
Browser-side widget that represents the object.
(HTMLNode) objdef
HTML markup that defines the object.
Return
(IHEmbeddedInfo*) Handle on a new embedded object.
See Also
IHGlobalInfo IHDocument, IHWidgetRep, HTMLNode, IHEmbeddedInfo

Parse an HTML <OBJECT> definition and create a new language-side object for it. This includes creating an IHEmbeddedInfo structure and connecting it to the interface, starting a request for the URL that contains the program, and connecting these to the IHWidgetRep object. When the URL request has completed, the IHWidgetRep will be notified and the code will be started.

IH_ParseInterface
Synopsis
IHGlobalInfo* IH_ParseInterface(IHDocument doc)
Arguments
(IHDocument) doc
A document that is being created by the browser.
Return
(IHGlobalInfo*) A new iHTML interface context for the document.
Bugs
  • This semantics of this function will have to change to support progressive display of documents.
See Also
IHDocument, IHGlobalInfo

Parses, allocates, and initializes a new iHTML scripting interface section for the given document. If NULL is returned, the document does not contain any scripts or objects. Otherwise, the function will start retrieving the scripts, loading language modules, and executing things as they become available. Not that if there is a document script associated with this document, it is responsible for initially formatting the browser display itself.

IH_StartInterface
Synopsis
void IH_StartInterface(IHGlobalInfo* gi)
Arguments
(IHGlobalInfo*) gi
A document interface context.
Return
nothing.
See Also
IHGlobalInfo

Re-starts all scripts in the given interface context.

IH_StopInterface
Synopsis
void IH_StopInterface(IHGlobalInfo* gi)
Arguments
(IHGlobalInfo*) gi
A document interface context.
Return
nothing.
See Also
IHGlobalInfo

Stops all scripts created by the given interface. This should be called before the browser deallocates resources attached to a document.


[Home] [ToC] [Up] [Prev] [Next]

_________.oo_Q_Q_oo.____________________________________________
Dianne Kyra Hackborn <hackbod@angryredplanet.com>
Last modified: Sun Oct 27 13:15:26 PST 1996

This web page and all material contained herein is Copyright (c) 1997 Dianne Hackborn, unless otherwise noted. All rights reserved.