[Home] [ToC] [Up] [Prev] [Next]
The iHTML library language services provide data structures and functions for managing and interacting with the system's back-end language modules.
typedef struct ih_language_rec IHLanguage; struct ih_language_rec { /* The interface functions for this language. Must always be set. */ IHLanguageFunc* Fn; /* Version information */ int Version; int Revision; int Submake; char* BuildDate; /* ASCII name of this language */ char* Name; /* The total size in bytes of this language's IHLangEnv structure. */ int LangEnvSize; };
This structure defines the entire public interface to an externally loaded language module. It is returned by the language's initialization function, and includes fields indicating the name and version of the module, as well as a pointer to the module's function table.
typedef struct ih_language_func_rec { void (*Term) IH_PROTO((IHLanguage* language)); IHLangEnv* (*AllocLangEnv) IH_PROTO((IHLangEnv* le)); void (*FreeLangEnv) IH_PROTO((IHLangEnv* le)); int (*ExecLangEnv) IH_PROTO((IHLangEnv* le, IHModuleInfo* main)); void (*StopLangEnv) IH_PROTO((IHLangEnv* le, IHModuleInfo* main)); IHModuleInfo* (*AllocModule) IH_PROTO((IHModuleInfo* mi)); void (*FreeModule) IH_PROTO((IHModuleInfo* mi)); IHEmbeddedInfo* (*AllocEmbedded) IH_PROTO((IHEmbeddedInfo* ei)); void (*FreeEmbedded) IH_PROTO((IHEmbeddedInfo* ei)); int (*ExecEmbedded) IH_PROTO((IHEmbeddedInfo* ei)); void (*StopEmbedded) IH_PROTO((IHEmbeddedInfo* ei)); int (*HandleEvent) IH_PROTO((IHLangEnv* env, IHEvent* event)); HTMLNode (*IHMarkup_HeadNode) IH_PROTO((IHMarkup markup)); HTMLNode (*IHMarkup_TailNode) IH_PROTO((IHMarkup markup)); void (*IHMarkup_SetHead) IH_PROTO((IHMarkup markup, HTMLNode node)); void (*IHMarkup_Ref) IH_PROTO((IHMarkup markup)); void (*IHMarkup_Deref) IH_PROTO((IHMarkup markup)); } IHLanguageFunc;
This structure contains a language module's functional interface. It is composed of pointers to the various functions the module implements, used by the iHTML Library to make calls into the module.
typedef IHLanguage* (LanguageInit) IH_PROTO((static char* browser, static char* language));
(static char*)
browser
(static char*)
language
This is the type of a language module's
initialization function, which is called to initialize the
language upon loading it, and get the language's public
interface. This entry point is the only public symbol defined
by a dynamically loaded module, and most be globally visible as
IHTML_language
, where
language is the (case-sensitive!) name of the
module. If that symbol is not found, the generic symbol
IHTMLinterface
will be tried instead.
IHWidgetObj IH_AllocWidget(IHGlobalInfo*
gi, IHDocument doc, IHLangEnv* langenv, IHWidgetObj par,
IHWidgetRep rep, IHMemberValue* init)
(IHGlobalInfo*)
gi
(IHDocument)
doc
(IHLangEnv*)
doc
(IHWidgetObj)
par
(IHWidgetRep)
rep
(const IHMemberValue*)
init
(IHWidgetObj)
The newly
created language-side widget.
Creates a new language widget object. Similar to BR_AllocWidget(), except that a specific IHWidgetRep can be supplied for this object to use; otherwise, it will allocate its own from the browser.
void IH_CleanHTMLNode(HTMLNode
node)
(HTMLNode)
node
Cleans any interface information that has been associated with the given HTMLNode before deallocating it. This routine must be called when freeing any HTMLNodes owned by the interface, e.g. when freeing nodes in BR_FreeMarkup().
void IH_DerefMarkup(IHLanguage* lang,
IHMarkup markup)
(IHLanguage*)
lang
(IHMarkup)
markup
Decrements the number of pointer references on the given IHMarkup. The IHMarkup or any HTMLNode nodes owned by it can not be relied upon to exist after this call.
void IH_FreeWidget(IHLangEnv*
langenv,IHWidgetObj widget)
(IHLangEnv*)
doc
(IHWidgetObj)
widget
Deallocates a previously allocated language-side widget, freeing all resources that were originally allocated along with it.
void IH_GetWidgetMembers(IHLangEnv*
langenv, IHWidgetObj widget, IHMemberValue* values)
(IHLangEnv*)
doc
(IHWidgetObj)
widget
(const IHMemberValue*)
value
Retrieves the values of the given widget's member attributes. The argument values is an array of IHMemberValue structures, terminated with a member of IWM_NULL_ID.
void IH_HandleEvent(IHEvent*
event)
(IHEvent*)
event
Send the given event off to the language module that can handle it.
HTMLNode IH_HeadMarkupNode(IHLanguage*
lang, IHMarkup markup)
(IHLanguage*)
lang
(IHMarkup)
markup
(HTMLNode)
The first node in
the tree owned by markup
This routine returns the first HTMLNode that is owned and being managed by the language-side tree markup.
IHLanguage*
IH_ImportLanguage(IHContentType* type)
(IHContentType*)
type
(IHLanguage*)
A handle on the
requested language.
Loads an external language module, links it into the browser, and returns its public interface. The language is found by looking through an internally generated list of available languages, searching for one that implements the given content type. Once one is found, an external module named "impl" is hunted for in the path for that name'd language. The module is then loaded and initialized, and the interface to it returned.
If a language implementing the given content type has already been loaded, its interface is immediately returned, instead.
void IH_RefMarkup(IHLanguage* lang,
IHMarkup markup)
(IHLanguage*)
lang
(IHMarkup)
markup
Adds a pointer reference to the given IHMarkup. This is used when linking HTMLNode trees together, to indicate links between trees with different owners.
void IH_ReleaseLanguage(IHLanguage*
lang)
(IHLanguage*)
lang
Releases a handle in the given language interface, as returned previously by IH_ImportLanguage(). Every IH_ImportLanguage() call that returns a non-NULL value must be matched with exactly one IH_ReleaseLanguage() call, when the language is no longer needed.
void IH_SetMarkupHead(IHLanguage* lang,
IHMarkup markup, HTMLNode node)
(IHLanguage*)
lang
(IHMarkup)
markup
(HTMLNode)
node
Informs that IHMarkup that it has a new head node. This is called when deleting a tree of nodes, to make sure that the head node saved by the IHMarkup is kept up to date. If NULL, this IHMarkup does not own any more nodes.
void IH_SetWidgetMembers(IHLangEnv*
langenv, IHWidgetObj widget, IHMemberValue* values)
(IHLangEnv*)
doc
(IHWidgetObj)
widget
(const IHMemberValue*)
value
Sets the values of the given widget's member attributes. The argument values is an array of IHMemberValue structures, terminated with a member of IWM_NULL_ID.
HTMLNode IH_TailMarkupNode(IHLanguage*
lang, IHMarkup markup)
(IHLanguage*)
lang
(IHMarkup)
markup
(HTMLNode)
The last node in
the tree owned by markup
This routine returns the last HTMLNode that is owned and being managed by the language-side tree markup.
[Home] [ToC] [Up] [Prev] [Next]
Dianne Kyra Hackborn <hackbod@angryredplanet.com> | Last modified: Tue Oct 8 04:31:26 PDT 1996 |