[Home] [ToC] [Up] [Prev] [Next]
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.
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 */ };
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:
DATA
(as __DATA__
)
CLASSID
(as __CLASSID__
)
CODEBASE
(as __CODEBASE__
)
STANDBY
(as __STANDBY__
)
TITLE
(as __TITLE__
)
WIDTH
(as __WIDTH__
)
HEIGHT
(as __HEIGHT__
)
NAME
(as __NAME__
)
typedef struct ih_delayed_startup_rec { IHNode node; IHModuleInfo* module; IHEmbeddedInfo* object; } IHDelayedStartup;
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.
struct ih_embedded_info_rec { IHCodeInfo code; IHWidgetRep widget; /* Browser-side widget associated with this */ IHWidgetObj object; /* Language-side object associated with this */ };
This type adds data to an IHCodeInfo that is needed by code segments being used as embedded objects.
<PARAM>
tag.
typedef struct ih_embedded_param_rec { IHNode node; IHParamType type; char *param; char *value; } IHEmbeddedParam;
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.
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 */ };
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.
struct ih_module_info_rec { IHCodeInfo code; int program; /* Flag -- TRUE if document script */ };
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.
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;
This type enumerates the possible types of IHEmbeddedParam objects there are.
typedef enum { IRun_None, /* No script is currently executing */ IRun_Exec /* A script is executing right now */ } IHRun;
This type enumerates the possible execution state of a document context's scripts.
typedef enum { IState_Nothing, /* No interface in this document */ IState_Loaded, /* Interface has been loaded/compiled */ ISTate_Active /* Document's interface is active */ } IHState;
The type is an enumeration of the possible states a document interface can be in.
void IH_FreeInterface(IHGlobalInfo*
gi)
(IHGlobalInfo*)
gi
Deallocates and frees all resources attached to an IHGlobalInfo that was previously created by BR_ParseInterface().
void IH_FreeParam(IHEmbeddedParam*
ep)
(IHEmbeddedParam*)
ep
Deallocates the given IHEmbeddedParam node and all data associated with it.
IHEmbeddedInfo*
IH_ParseEmbedded(IHGlobalInfo* gi, IHDocument doc,
IHWidgetRep widget, HTMLNode objdef)
(IHGlobalInfo*)
gi
(IHDocument)
doc
(IHWidgetRep)
widget
(HTMLNode)
objdef
(IHEmbeddedInfo*)
Handle on a
new embedded object.
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.
IHGlobalInfo*
IH_ParseInterface(IHDocument doc)
(IHDocument)
doc
(IHGlobalInfo*)
A new
iHTML interface context for the document.
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.
void IH_StartInterface(IHGlobalInfo*
gi)
(IHGlobalInfo*)
gi
Re-starts all scripts in the given interface context.
void IH_StopInterface(IHGlobalInfo*
gi)
(IHGlobalInfo*)
gi
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]
Dianne Kyra Hackborn <hackbod@angryredplanet.com> | Last modified: Sun Oct 27 13:15:26 PST 1996 |