The W3Application object is the central actor in a W3Kit application. It handles communications with HTTP and display servers, and coordinates the saving, restoring, and updating of the state of application objects. Application state is updated through a simulated "event loop".
The W3Application object is created from the program arguments, which might for example specify which X11 display to use. The returned W3Application is also stored in the global variable W3App.
+ newArgc:(int)argc argv:(char **)argv; - free; - (BOOL)isBootstrap; - (const char *)appTitle; // -appName for human consumption
The contents can be generated either from scratch or from a past run. If generated from scratch they can be sent to the W3Application using setContents:. The -loadFromHttp method exhumes the "essential state" of the contents from the CGI POST data on the standard input.
- loadFromHttp; - setContents:anHtmlOutput; - contents;
The event loop is put in motion with the run message; calling the stop message from within the event loop causes run to return before the next event is dispatched.
- run; - stop; - (BOOL)sendAction:(SEL)aSelector to:aTarget from:sender;
- terminateWithHtmlError:(const char *)format,...; - terminateWithDocument:theResult;
The printHtml method starts the whole process, freezing the current application state for caching in the new Form. The printf: method will be most useful for Form layout.
Note that "submit" buttons can be manipulated as full-fledged widgets via the W3Button class. However, the "reset" buttons can only be generated through the methods below.
- printHtml; - printf:(const char *)format,...; - printHtmlResetButton; - printHtmlResetButtonWithStringValue:(const char *)value; - printHtmlSubmitButton; - printHtmlSubmitButtonWithStringValue:(const char *)value; - printHtmlHeader; - printHtmlTrailer; - printHtmlInputNameFor:anHtmlInput;Because HTML 1.8 (for example, X Mosaic) and HTML+ differ in the way that graphical inputs are specified, graphical widgets should use the imageInputType method below to implement inputType (see W3Input).
If the HTTP server running the application is CGI/1.1 compatible (for example, NCSA HTTPD 1.2 or later), then the application can tell which client is invoking it, and change conventions accordingly. If the server is only CGI/1.0 compatible, the conventions of HTML 1.8 are assumed.
- (const char *)imageInputType;This method returns the current output document as a W3Document.
Author: Paul Burchard
Comments to: email@example.com
Created: Apr 18 1994 --- Last modified: Jun 18 1996