[Previous] [Contents] [Index] [Next]

PtWebClient

Widget for displaying web pages

Class hierarchy:

PtWidget --> PtBasic --> PtContainer --> PtClient --> PtWebClient

For more information, see the diagram of the widget hierarchy.

PhAB icon:

PtWebClient button in PhAB

Public header:

<photon/PtWebClient.h>

Description:

You can use the PtWebClient widget to start, interact, and control a web server, such as Voyager. PtWebClient also provides a user-defined area within your application for the server to format and display web pages. Your application controls the server by setting widget resources. The server communicates status information and user interaction back to the application using the widget callbacks.

PtWebClient transparently supports the version of HTML that the server supports. For more information about the Voyager web server, see vserver in the QNX 6 Utilities Reference.

Starting the server

Start the server initially by setting the Pt_ARG_WEB_SERVER resource.

Typically, the PtWebClient widget is in a PhAB application, and its Pt_ARG_WEB_SERVER resource is NULL. To start the Voyager web server, do the following in the prerealize setup function for the module containing the widget:

PtSetArg( &args[0], Pt_ARG_WEB_SERVER, "vserver", 0 );
PtSetResources( ABW_web_pane, 1, args );

The string can also include command-line options to the server.

Once the server is started, you can check that it was successful by getting the value of Pt_ARG_WEB_STARTUP_ERRNO. For example:

int        *error;

PtSetArg( &args[0], Pt_ARG_WEB_STARTUP_ERRNO, &error, 0 );
PtGetResources( ABW_web_pane, 1, args );

if ( *error != EOK ) {
    /* error occurred - use errno to display message */
} 

After successfully starting the server, you can access URLs by setting the Pt_ARG_WEB_GET_URL resources.

New resources:

Resource C type Pt type Default
Pt_ARG_WEB_ACTIVATE_LINK int Scalar 0 (write-only)
Pt_ARG_WEB_AUTHENTICATE PtWebClientAuthenticationData_t * Pointer NULL (write-only)
Pt_ARG_WEB_BUILD_DATE char * String NULL (read-only)
Pt_ARG_WEB_COMMAND PtWebCommand_t * Pointer NULL (write-only)
Pt_ARG_WEB_DATA PtWebClientData_t * Pointer NULL (write-only)
Pt_ARG_WEB_DOWNLOAD char *, char * String N/A (write-only)
Pt_ARG_WEB_ENCODING char * String NULL
Pt_ARG_WEB_GET_CONTEXT char * String NULL (read-only)
Pt_ARG_WEB_GET_HISTORY PtWebClientHistory_t * Pointer None (read-only)
Pt_ARG_WEB_GET_URL char * String N/A (write-only)
Pt_ARG_WEB_HELPER PtWebClientHelperData_t * Pointer NULL (write-only)
Pt_ARG_WEB_H_ERRNO int Scalar 0
Pt_ARG_WEB_NAVIGATE_FRAME int Scalar 0
Pt_ARG_WEB_NAVIGATE_LINK int Scalar 0
Pt_ARG_WEB_NAVIGATE_PAGE int Scalar 0
Pt_ARG_WEB_OPTION char *, char* String NULL
Pt_ARG_WEB_PRINT PpPrintContext_t *, int Pointer NULL (write-only)
Pt_ARG_WEB_RELOAD N/A N/A N/A (write-only)
Pt_ARG_WEB_SERVER char * String NULL
Pt_ARG_WEB_SERVER_PID pid_t Scalar read-only
Pt_ARG_WEB_SSL_RESPONSE PtWebClientSSLResponse_t * Pointer NULL
Pt_ARG_WEB_STARTUP_ERRNO int Scalar 0
Pt_ARG_WEB_STOP N/A N/A N/A (write-only)
Pt_ARG_WEB_UNKNOWN_RESP PtWebClientUnknownData_t * Pointer NULL (write-only)
Pt_ARG_WEB_VERSION char * String NULL (read-only)
Pt_CB_WEB_AUTHENTICATE PtCallback_t * Link NULL
Pt_CB_WEB_CLOSE_WINDOW PtCallback_t * Link NULL
Pt_CB_WEB_COMPLETE PtCallback_t * Link NULL
Pt_CB_WEB_CONTEXT PtCallback_t * Link NULL
Pt_CB_WEB_DATA_REQ PtCallback_t * Link NULL
Pt_CB_WEB_ERROR PtCallback_t * Link NULL
Pt_CB_WEB_METADATA PtCallback_t * Link NULL
Pt_CB_WEB_NEED_SCROLL PtCallback_t * Link NULL
Pt_CB_WEB_NEW_WINDOW PtCallback_t * Link NULL
Pt_CB_WEB_PAGE_INFO PtCallback_t * Link NULL
Pt_CB_WEB_SSL_CERTINFO PtCallback_t * Link NULL
Pt_CB_WEB_SSL_CERTNONTRUSTED PtCallback_t * Link NULL
Pt_CB_WEB_SSL_ERROR PtCallback_t * Link NULL
Pt_CB_WEB_START PtCallback_t * Link NULL
Pt_CB_WEB_STATUS PtCallback_t * Link NULL
Pt_CB_WEB_UNKNOWN PtCallback_t * Link NULL
Pt_CB_WEB_URL PtCallback_t * Link NULL

Pt_ARG_WEB_ACTIVATE_LINK (key mode only)

C type Pt type Default
int Scalar 0 (write-only)

This resource activates and deactivates the current link.

Pt_ARG_WEB_AUTHENTICATE

C type Pt type Default
PtWebClientAuthenticationData_t * Pointer NULL (write-only)

Set this resource to give authentication information to the server when the Pt_CB_WEB_AUTHENTICATE callbacks have been invoked. The data structure used is as follows:

typedef struct {
    short    response;
    short    type;
    char     userid[255];
    char     password[255];
    char     url[MAX_URL_LENGTH];
} PtWebClientAuthenticationData_t;
    

The members include:

response
The type of response:
type
The type of authentication:
userid
The user's login string.
password
The user's password string.
url
The URL of the request that invoked the callback.

Pt_ARG_WEB_BUILD_DATE (read only)

C type Pt type Default
char * String NULL (read-only)

The Build date of the connected web server.

Pt_ARG_WEB_COMMAND (write only)

C type Pt type Default
PtWebCommand_t * Pointer NULL

Tell the server to perform a specific command. The command is specified in the len argument to PtSetArg(). If a pointer to the PtWebCommand_t data structure is required with the command, pass it as the value argument to PtSetArg().

The PtWebCommand_t data structure is as follows:

typedef struct {
    union {
        struct {
            char    filename[PATH_MAX];
        } SaveasInfo;
        struct {
            char szString[128];
            unsigned long flags;
        } FindInfo;
        char    scroll_to[128];
        int     reset_type;
        int     num_purge;
    };
} PtWebCommand_t;

The commands are:

WWW_COMMAND_FIND
Find and highlight a word in the current document. The part of the PtWebCommand_t data structure used is:
struct {
    char szString[128];
    unsigned long flags;
} FindInfo;

where:

WWW_COMMAND_LOADMISSING
Load any missing images.
WWW_COMMAND_SAVEAS
Save the current document to disk. The part of the PtWebCommand_t data structure used is:
struct {
    char    filename[PATH_MAX];
} SaveasInfo;

where filename is the name of the file in which to save the document.

WWW_COMMAND_RESET_OPT
Cause any changed options that may change the current visible page to take effect.
WWW_COMMAND_PURGE_CACHE
Purge the in-memory image and page cache.
WWW_COMMAND_LOADMISSING_CONTEXT
Load a missing image whose context is valid (the context is valid after a Pt_CB_WEB_CONTEXT callback).

Pt_ARG_WEB_DATA (write only)

C type Pt type Default
PtWebClientData_t * Pointer NULL

This resource is set in response to a Pt_CB_WEB_DATA_REQ callback. It provides the header and data of the client protocol data stream to the browser.

The data structure used is as follows:

typedef struct {
    int     type;
    char    url[MAX_URL_LENGTH];
    int     length;
    char    *data;
} PtWebClientData_t;

The members are:

type
Possible values:
url
The URL of this client data stream.
length
The number of bytes (no more than what was asked for in the Pt_CB_WEB_DATA_REQ callback).
data
A pointer to the data.

Here's an example of using the client protocol:

int web_data( PtWidget_t *widget, ApInfo_t *apinfo,
              PtCallbackInfo_t *cbinfo )
{
    PtArg_t                 args[1];
    PtWebClientData_t       webdata;
    PtWebDataReqCallback_t  *web_data_req = cbinfo->cbdata;
    const char              *html =
"<html><body bgcolor=\"#ffffff\"><p>\
<center><table border=1 bgcolor=\"#f8f7d9\"><tr>\
<td>This is a simple test of the client protocol</td>\
<td><font size=4>Voyager Client: Version 2.01\
<br>Built on: %s<br><hr>\
<font size=4>Voyager Server: %s<br>Built on: %s\
</font></center></td></tr></table></center><p>\
</body></html>\n";
    char                    about[512];
    static int              about_sent;
                
    /* eliminate 'unreferenced' warnings */
    apinfo = apinfo;

    if ( !strcmp( web_data_req->url, "client:about" ) ) {
        if( cbinfo->reason_subtype == WWW_DATA_HEADER ) {
            const char *data = "Content-Type: text/html\n";
            webdata.type = WWW_DATA_HEADER;
            webdata.length = strlen(data);
            strcpy( webdata.url, web_data_req->url );
            PtSetArg( &args[0], Pt_ARG_WEB_DATA, data,
                      &webdata );
            PtSetResources( widget, 1, args );
        } else if( cbinfo->reason_subtype == WWW_DATA_BODY ) {
            /* 
             * Since no content length was given, you need
             * to signal EOF with a zero length data packet
             */
            if ( about_sent ) {
                webdata.type = WWW_DATA_BODY;
                strcpy( webdata.url, web_data_req->url );
                webdata.length = 0;
                PtSetArg( &args[0], Pt_ARG_WEB_DATA, "",
                          &webdata );
                PtSetResources( widget, 1, args );
                about_sent = 0;
            } else {
                char *version, *build_date;
                
                PtSetArg( &args[0], Pt_ARG_WEB_VERSION,
                          &version, 0 );
                PtSetArg( &args[1], Pt_ARG_WEB_BUILD_DATE,
                          &build_date, 0 );
                PtGetResources(widget, 2, args );
                sprintf( about, html, __DATE__, version,
                         build_date );
                webdata.type = WWW_DATA_BODY;
                strcpy( webdata.url, web_data_req->url );
                webdata.length = strlen(about);
                PtSetArg( &args[0], Pt_ARG_WEB_DATA, about,
                          &webdata );
                PtSetResources( widget, 1, args );
                about_sent = 1;
            }
        }
    } else {
        if( cbinfo->reason_subtype == WWW_DATA_HEADER ) {
             /* 
              * If I give a content length then I don't need 
              * provide a zero byte data packet
              */
            const char *data =
              "Content-Type: text/plain\nContent-Length: 20\n";              
            webdata.type = WWW_DATA_HEADER;
            webdata.length = strlen(data);
            strcpy( webdata.url, web_data_req->url );
            PtSetArg( &args[0], Pt_ARG_WEB_DATA, data,
                      &webdata );
            PtSetResources( widget, 1, args );
        } else if( cbinfo->reason_subtype == WWW_DATA_BODY ) {
            const char *data = "Unknown client type\n";
            webdata.type = WWW_DATA_BODY;
            strcpy( webdata.url, web_data_req->url );
            webdata.length = strlen( data );
            PtSetArg( &args[0], Pt_ARG_WEB_DATA, data,
            &webdata );
            PtSetResources( widget, 1, args );
        }
    }
    return( Pt_CONTINUE );
}

Pt_ARG_WEB_DOWNLOAD (write only)

C type Pt type Default
char *, char * String N/A

This resource lets you download a file without having to wait for the Pt_CB_WEB_UNKNOWN callback to provide a file. The value argument of PtSetArg() should contain the URL of the file to download and the len argument should contain the filename to save it as.


Note: Pt_ARG_WEB_DOWNLOAD does GET requests only.

Pt_ARG_WEB_ENCODING

C type Pt type Default
char * String NULL

The current document encoding. See PxTranslateSet() in the Photon Library Reference.

Pt_ARG_WEB_GET_CONTEXT (read only)

C type Pt type Default
char * String NULL

This resource gets the context information, which is valid after a Pt_CB_WEB_CONTEXT callback. To get context information, specify the type in the len argument of PtSetArg().

The possible context types are:

Pt_WEB_CONTEXT_ANCHOR
The URL of a link.
Pt_WEB_CONTEXT_OBJECT
The URL of a image or embedded object.
Pt_WEB_CONTEXT_BKGD
The URL of a background image.

Pt_ARG_WEB_GET_HISTORY (read only)

C type Pt type Default
PtWebClientHistory_t * Pointer None

Use this resource to get the site history list from the browser. This is a list of titles and URLs of all the sites visited in the timeframe specified in the History_Expire option (default 4 days).

The data structures used with this resource are:

typedef struct  {
    short num;
    short offset;
} PtWebClientHistory_t;
    

where:

and:

typedef struct  {
    char    title[128];
    char    url[MAX_URL_LENGTH];
} PtWebClientHistoryData_t;
    

Here's an example of how to get the history:

PtArg_t args[1];
PtWebClientHistoryData_t list[HISTORY_REQUEST_SIZE];
PtWebClientHistory_t list_info;
char *description[HI_MAX_LIST_SIZE];
int i, item_count = 0, loop = TRUE;
    
list_info.num = HISTORY_REQUEST_SIZE;
list_info.offset = 0;
      
/* retrieve history list from voyager server */
while (loop) {
    /* get the next 10 history entries */
    PtSetArg(&args[0], Pt_ARG_WEB_GET_HISTORY,
             &list, &list_info);
    PtGetResources( w, 1, args);
                         
    for (i=0; i < 10; i++, item_count++) {
        if (list[i].url[0] == 0 ||
            item_count >= HI_MAX_LIST_SIZE) {
            loop = FALSE;
            break;
        }
        if ( description[item_count] =
             malloc(strlen(list[i].url) +
                    strlen(list[i].title) + 4) ) 
            sprintf(description[item_count], "%s\t%s\t",
                    list[i].title, list[i].url);
    }
    list_info.offset += HISTORY_REQUEST_SIZE;
}

Pt_ARG_WEB_GET_URL (write only)

C type Pt type Default
char * String N/A

The URL that you want the browser to display or save. Set the len argument of PtSetArg() to one of:

WWW_ACTION_DISPLAY
Display the URL in the browser.
WWW_ACTION_SAVEAS
Download and save the URL.

You can OR the following flags into the action to control the caching of the page and the recording of history:

WWW_NO_MEMORY_CACHE
Don't cache the page in memory.
WWW_NO_DISK_CACHE
Don't cache the page on disk.
WWW_NO_SITE_HISTORY
Don't record the site in the site history.
WWW_NO_PAGE_HISTORY
Don't record the site in the page history.

Note:
  • When saving a URL, the browser responds with a Pt_CB_WEB_UNKNOWN to obtain a filename to save the file once it has determined that it can get the URL or see Pt_ARG_WEB_DOWNLOAD.
  • The maximum length of a URL string is 1024 bytes or MAX_URL_LENGTH.

Pt_ARG_WEB_HELPER (write only)

C type Pt type Default
PtWebClientHelperData_t * Pointer NULL

Setting this resource tells the server which external helper applications are available. The data structure used is as follows:

typedef struct {
    short   action;
    char    mimetype[256];
    char    suffixes[256];
    char    encoding[20];
    char    helperapp[PATH_MAX];
} PtWebClientHelperData_t;
    

The members of this structure are:

action
The action to take:
mimetype
The mimetype of the data that the helper application can handle.
suffixes
The file suffixes of the helper application data files (e.g. "mpeg mpg").
encoding
Currently not used.
helperapp
The complete filename to the helper application; use %s to indicate where the data file should appear on the command line.

Note: If you wish to control the running of the helper application yourself, add the helper with no help application (i.e. helperapp=""). A Pt_CB_WEB_UNKNOWN callback is called if an HTML page contains an <embed> tag to a file with the mimetype or suffix provided. (Normally these files are ignored.)

Pt_ARG_WEB_H_ERRNO

C type Pt type Default
int Scalar 0

The value of h_errno after a DNS failure. The possible values are:

HOST_NOT_FOUND
No such host is known.
NO_DATA
The name is known to the name server, but has no IP address associated with it -- this isn't a temporary error. Another type of request to the name server using this domain name results in an answer (e.g. a mail-forwarder may be registered for this domain).
NO_RECOVERY
Some unexpected server failure was encountered. This is a nonrecoverable error.
TRY_AGAIN
This is usually a temporary error and means that the local server didn't receive a response from an authoritative server. A retry at some later time may succeed.

Pt_ARG_WEB_NAVIGATE_FRAME

C type Pt type Default
int Scalar 0

Controls focus navigation of FRAMES pages when the browser is in key mode. Set the value argument of PtSetArg() to one of:

WWW_DIRECTION_UP
Focus the frame above the current one.
WWW_DIRECTION_DOWN
Focus the frame below the current one.
WWW_DIRECTION_LEFT
Focus the frame to the left of the current one.
WWW_DIRECTION_RIGHT
Focus the frame to the right of the current one.
WWW_DIRECTION_FWD
Focus the next frame.
WWW_DIRECTION_BACK
Focus the previous frame.

Note: The next and previous directions are defined by the order of the <FRAME> tag in each <FRAMESET> tag.

Pt_ARG_WEB_NAVIGATE_LINK

C type Pt type Default
int Scalar 0

This resource controls focus navigation of links on the current page when the browser is in key mode. Set the value argument to PtSetArg() to one of the following:

WWW_DIRECTION_UP
Focus the link above the current one.
WWW_DIRECTION_DOWN
Focus the link below the current one.
WWW_DIRECTION_LEFT
Focus the link to the left of the current one.
WWW_DIRECTION_RIGHT
Focus the link to the right of the current one.
WWW_DIRECTION_FWD
Focus the next link.
WWW_DIRECTION_BACK
Focus the previous link.

When an IMAGE-MAP type link has been activated, this resource is used to navigate the "ImageMap_Cursor" over the image map in the specified direction. The len argument is then used to specify the number of pixels to move the cursor.

When a FORM type object has been activated (given focus), these commands are turned into cursor-key directions and given to the form object.


Note: The next and previous directions are defined by the order of the links in the HTML page.

Pt_ARG_WEB_NAVIGATE_PAGE

C type Pt type Default
int Scalar 0

This resource controls the scrolling of the displayed page and the ability to navigate back and forward through pages in the page history. Set the value argument to a direction and the len argument to the amount to scroll, in percentage of the visible page (e.g. 100 == scroll one full page). The direction must be one of:

WWW_DIRECTION_UP
Scroll the page up.
WWW_DIRECTION_DOWN
Scroll the page down.
WWW_DIRECTION_LEFT
Scroll the page to the left.
WWW_DIRECTION_RIGHT
Scroll the page to the right.
WWW_DIRECTION_FWD
Go to the previous page in the page history.
WWW_DIRECTION_BACK
Go to the next page in the page history.

Note: The len argument has no effect when using WWW_DIRECTION_FWD or WWW_DIRECTION_BACK.

Getting the value of this resource indicates whether or not you can perform a given operation. Currently, only WWW_DIRECTION_FWD and WWW_DIRECTION_BACK are supported.

The format of the data returned is 1 << WWW_DIRECTION_xx. For example:

int    *nav_dir;

PtSetArg( &arg, Pt_ARG_WEB_NAVIGATE_PAGE, &nav_dir, 0 );
PtGetResources( webclient, 1, args );

if ( *nav_dir & (1 << WWW_DIRECTION_FWD ) ) {

    /* I can go forward in the page history  */

} else if ( *nav_dir & (1 << WWW_DIRECTION_BACK ) ) {

    /* I can go backward in the page history */

}

Pt_ARG_WEB_OPTION

C type Pt type Default
char *, char* String NULL

Set this resource to set options on the web server. This resource takes two parameters:

For example, to change the scrollbar size:

PtArg_t args[1];

PtSetArg( &args[0], Pt_ARG_WEB_OPTION, "10", 
          "iScrollbarSize" );
PtSetResources( webclient_wgt, 1, args );
    

You can read the options from the server by getting the value of this resource. The following piece of code increases the font size by one level:

char *size;

PtSetArg( &args[0], Pt_ARG_WEB_OPTION, &size, 
          "iUserTextSize" );
PtGetResources( ABW_web_pane, 1, args );

if ( size ) { 
    fontsize = atoi( size ); 
    if ( fontsize < 3 ) {
        sprintf( buf, "%d", fontsize + 1 ); 
        PtSetArg( &args[0], Pt_ARG_WEB_OPTION, 
                  buf, "iUserTextSize" ); 
        PtSetResources( ABW_web_pane, 1, args ); 
    }
}

Note: If you're changing options that have visual effects after the PtWebClient widget is realized, then you must issue a reset command in order for the changes to be seen. The command is as follows:
PtSetArg( &args[0], Pt_ARG_WEB_COMMAND, 0, 
          WWW_COMMAND_RESET_OPT );
PtSetResources( ABW_web_pane, 1, args );
    

The following sections list the options and their defaults:

HTML Options

The HTML options are:

A:active color
The color of a link when you click on it with the mouse.

Default: #ff0000

A:link color
The normal color of a link.

Default: #0000ff

A:visited color
The color of a link after it's been visited.

Default: #008080

bAutoLoadImages
If TRUE, images are loaded as they're encountered in the page. If FALSE, images are loaded only if the WWW_COMMAND_LOADMISSING command is issued.

Default: TRUE

bDisableHighlight
Don't highlight text while dragging over it.

Default: FALSE

bDisableImagePlaceHolders
Disable drawing on the missing/error image placeholders.

Default: FALSE

bIgnoreDocumentAttributes
If TRUE, color attributes override what's specified in the page.

Default: FALSE

bkey_mode
If set to TRUE, key navigation is enabled.

Default: FALSE

BODY background
The color of the page background.

Default: #ffffff

BODY color
The color of text inside the body on the HTML page.

Default: #000000

BODY font-family
The font family name of the text in the body portion of the page.
BODY margin-right
The margin, in pixels, between right side of display area and the first visible element in the page (Note: page tags may override this).

Default: 10

BODY margin-top
The margin, in pixels, between top of display area and the first visible element in the page (Note: page tags may override this).

Default: 20

bot_border_color
The bottom color of borders in frame pages.

Default: #606060

bot_focus_color
The bottom color of the focus box in key mode.

Default: #7f7f00

bUnderlineLinks
If TRUE, the link on a page is underlined.

Default: TRUE

bview_source
Allow page source to be viewed (setting this option to FALSE saves memory).

Default: TRUE

disable_exception_dlg
Don't allow the Javascript exception dialog to be displayed.

Default: FALSE

disable_new_windows
Don't allow Javascript windows to open.

Default: FALSE

enable_link_arm
Activate links on arm (useful for touch screens).

Default: FALSE

enable_print_bgcolor
Print background colors.

Default: FALSE

form_font
The font used for lists, comboboxes, submit buttons and reset buttons.
frame_spacing
The spacing between frames, in pixels.

Default: 2

H* font-family
The font family name of the text used in headings on the page.
iReformatHandling
Reformat handling

Default: 2

Possible values:

iScrollbarSize
The scrollbar width, in pixels.

Default: 16

iUserTextSize
The base logical font size of text size used in the page.

Default: 2

Possible values: 0 - 4

java_disable
Disable Java applet tag parsing (forced TRUE if vgr_javanpl.so isn't found).

Default: FALSE

mono_form_font
The font used for editable form fields.
PRE font-family
The font family name used for preformatted text ( this should be a fixed-width font).
top_border_color
The top color of borders in frame pages.

Default: #ffffff

top_focus_color
The top color of the focus box in key mode.

Default: #ffff00

underline_width
The line thickness, in pixels, of the underline used on links.

Default: 1

HTTP cookie options

The HTTP cookie options are:

cookiejar_name
The name of file to store cookie information in.

Default: cookie.jar

cookiejar_path
The directory used to write the cookie file in.

Default: $(HOME)

cookiejar_save_always
Always keep the cookie-jar file on disk up-to-date.

Default: FALSE

cookiejar_size
The maximum size, in bytes, that the cookie-jar file is allowed to grow. A value of -1 means no limit.

Default: -1

Authentication options

The authentication options are:

max_password_guesses
The maximum number of guesses allowed when performing authentication.

Default: 3

FTP options

The FTP options are:

email_address
The email address used for the password on anonymous logins of FTP server.

Default: 80

ftp_proxy_host
The host name or IP address of proxy server for FTP requests.

Default: none

ftp_proxy_port
The port number on FTP proxy server to use.

Default: 80

proxy_overrides
A comma-separated list of host names or IP addresses to bypass the FTP proxy server when accessed.

Default: 80

Gopher options

The Gopher options are:

gopher_proxy_host
The host name or IP address of the proxy server for gopher requests.

Default: none

gopher_proxy_port
The port number on the gopher proxy server to use.

Default: 80

proxy_overrides
A comma-separated list of host names or IP addresses to bypass the gopher proxy server when accessed

Default: none

HTTP options

The HTTP options are:

http_proxy_host
The host name or IP address of proxy server for HTTP requests.

Default: none

http_proxy_port
The port number on the HTTP proxy server to use.

Default: 80

proxy_overrides
A comma-separated list of host names or IP addresses to bypass the HTTP proxy server when accessed.

Default: none

File options

The file options are:

file_display_dir
Display directory listings as HTML pages. For example, file:/ produces an HTML page with the content of the root directory.

Default: TRUE

file_strict_access
Enable strict file access (file: URLs must have the WWW_STRICT_FILE_ACCESS flag set when requested via Pt_ARG_WEB_GET_URL or Pt_ARG_WEB_DOWNLOAD).

Default: FALSE

Image options

The image options are:

bProgressiveImageDisplay
Display images progressively as they're being loaded.

Default: TRUE

concurrent_decodes
The number of concurrent JPEG decodings that should be done. This option can save significant memory when decoding JPEGS to 256 colors.

Default: 4

quantize_jpegs
Always convert JPEGS to a 256-color palette. (The default is based on current graphics mode; if running on a high-color or direct-color graphics driver, JPEGS are converted to the default color mode, usually 24-bit. If a palette-based graphics driver is running, the JPEGS are always converted to 256 colors using the current hardware palette, and setting this option has no effect.)

Default: FALSE

Print options

The print options are:

Print_Left_Footer_String
The left footer used when printing.

Default: Page &

Print_Left_Header_String
The left header string used when printing.

Default: &w

Print_Header_Font
The font used in the header and footer.

Default: helv

Print_Header_Font_Size
The font size used in the header and footer.

Default: 8

Print_Right_Footer_String
The right footer used when printing.

Default: &d &t

Print_Right_Header_String
The right header string used when printing.

Default: &u

You can use these special characters in the header and footer strings:

&w
Page title
&u
URL
&p
Page number
&d
Date -- American style ("mmm dd yyyy")
&D
Date -- European style ("dd mmm yyyy")
&t
Time -- 12-hour format ("HH:MM am")
&T
Time -- 24-hour format ("HH:MM")
&&
The ampersand (&) character

SOCKS options

The SOCKS options are:

socks_app
The application name to pass to the SOCKS server.

Default: none

socks_port
The port number on the SOCKS server to use.

Default: none

socks_server
The host name or IP address of the SOCKS server for any requests.

Default: none

socks_user
The userid to pass to the SOCKS server.

Default: none

TCP/IP options

The TCP/IP options are:

file_buckets
Fill network buffers before processing them.

Default: TRUE

max_connections
Default: 4
socket_timeout
Default: 2400

Disk-cache options

The disk-cache options are:

clear_main_cache_on_exit
Clear the on-disk cache when the browser exits.

Default: FALSE

dcache_verify_policy
0 means never verify if document has changed; 1 means verify if document has changed once per session; 2 means always verify if document has changed.

Default: 0

Note: Verifying is done by using the "If-Modified-Since" request-header.

enable_disk_cache
Enable on-disk caching.

Default: TRUE

keep_index_file_updated
Keep the disk cache index file updated on disk when it changes instead of once on exiting.

Default: FALSE

main_cache_dir
The directory used to store cache files.

Default: /tmp

main_cache_kb_size
The maximum size of the on-disk cache.

Default: 5000

main_index_file
The name of the cache index file.

Default: main.ndx

Miscellaneous options

The miscellaneous options are:

Accept_Charset_Header
The value string to pass with the Accept-Charset header (see the HTTP specification).

Default: TRUE

Accept_Language_Header
The value string to pass with the Accept-Language header (see the HTTP specification).

Default: TRUE

Global_History_File
The full pathname of the file to store the site history list in. (Note: this page is an HTML-formatted page.)

Default: none

History_Expire
The number of days used to expire entries in the site history list.

Default: 4

IBeam_Cursor
See /usr/include/photon/PhCursor.h

Default: e90e (the insert cursor)

Image_Cache_Size_KB
The size of image cache, in kilobytes.

Default: 1024

ImageMap_Cursor
See /usr/include/photon/PhCursor.h

Default: e90c (the finger cursor)

ImageMap_Cursor_NoLink
See /usr/include/photon/PhCursor.h

Default: e900 (the pointer cursor)

Link_Cursor
See /usr/include/photon/PhCursor.h

Default: e90c (the finger cursor)

LinkWait_Cursor
See /usr/include/photon/PhCursor.h

Default: e918 (the point wait cursor)

Normal_Cursor
See /usr/include/photon/PhCursor.h

Default: e900 (the pointer cursor)

NormalWait_Cursor
See /usr/include/photon/PhCursor.h

Default: e918 (the point wait cursor)

Page_Cache_Size
The number of pages kept in memory.

Default: 4

Page_History_Length
The maximum number of pages allowed in the page history (back/forward history).

Default: 50

Safe_Memory_Free
The minimum amount of memory, in kilobytes, to leave for the system. If the system has less than this amount available, Voyager's requests to allocate memory fail.

Default: 0

Show_Server_Errors
Display the HTML-formatted error pages received from the remote HTTP servers. Otherwise generate a Pt_CB_WEB_ERROR callback.

Default: FALSE

Site_History_Length
The maximum number of sites allowed in the site history (the list is obtained from server).

Default: 500

Use_Anti_Alias
Use anti-aliased fonts.

Default: TRUE

Use_Double_Buffer
Enable double-buffered rendering.

Default: TRUE

Use_Explicit_Accept_Headers
Send an explicit Accept: content-type header request field in the HTTP header; otherwise send Accept: */*.

Default: TRUE

Visitation_Horizon
The number of days after which to expire the visited links display (i.e. VLINK -> LINK).

Default: 4

Wait_Cursor
See /usr/include/photon/PhCursor.h

Default: e908 (the wait cursor)

Pt_ARG_WEB_PRINT (write-only)

C type Pt type Default
PpPrintContext_t *, int Pointer

Set this resource to print the page. You can use the len argument of PtSetArg() to specify a combination of the following flags:

WWW_PRINT_FROM_CACHE
When printing, let the print filters read images from the image cache, to reduce the size of intermediate file.
Note: Use this option only if the filter is run locally. It's up to the client application to prevent any activation in the server while printing.

WWW_PRINT_ALL_FRAMES
Print all frames as shown on the current page.

Pt_ARG_WEB_RELOAD (write only)

C type Pt type Default
N/A N/A N/A

This is a write-only resource without any specified type. Set it to any value to reload the current page:

PtSetArg (&args[0], Pt_ARG_WEB_RELOAD, 0, 0);
PtSetResources (widget, 1, args);

Pt_ARG_WEB_SERVER

C type Pt type Default
char * String NULL

The path and any options to the web server to start. Setting this resource starts the server; if there's a server already attached to the client, it's shut down and the new one is started.

This resource performs a "name lookup" before spawning the server. You can set this resource or the Pt_ARG_CLIENT_NAME resource (see PtClient) to connect to an existing web server.


Note: Any options set prior to setting the resource are set back to their defaults.

For an example of using this resource, see "Starting the server," above.

Pt_ARG_WEB_SERVER_PID (read only)

C type Pt type Default
pid_t Scalar

A read-only resource that returns the PID of the web server. The value is 0 if the widget has connected to an existing server, or -1 if spawn() has failed.

Pt_ARG_WEB_SSL_RESPONSE

C type Pt type Default
PtWebClientSSLResponse_t * Pointer NULL

A resource that's used only if you're using the SSL (Secure Sockets Layer) version on the web server. This resource is used in response to the Pt_CB_WEB_SSL_CERTNONTRUSTED and Pt_CB_WEB_SSL_ERROR callbacks. The data structure used is as follows:

typedef struct {
    char    url[MAX_URL_LENGTH];
    int     response;
} PtWebClientSSLResponse_t;

The members include:

url
The URL obtained from the Pt_CB_WEB_SSL_ERROR callback.
response
The type of response:

Pt_ARG_WEB_STARTUP_ERRNO (read only)

C type Pt type Default
int Scalar 0

A read-only resource that you can use to determine if the server started successfully. If the value isn't EOK, use errno to determine what went wrong. For more information, see "Starting the server," above.

Pt_ARG_WEB_STOP (write only)

C type Pt type Default
N/A N/A N/A

This is a write-only resource without any specified type. Set it to any value to stop the loading of the current page:

PtSetArg (&args[0], Pt_ARG_WEB_STOP, 0, 0);
PtSetResources (widget, 1, args);

Pt_ARG_WEB_UNKNOWN_RESP (write-only)

C type Pt type Default
PtWebClientUnknownData_t * Pointer

Set this resource to give a response to the server after a Pt_CB_WEB_UNKNOWN callback. The data structure used is as follows:

typedef struct {
    short   response;
    char    filename[PATH_MAX];
    char    url[MAX_URL_LENGTH];
} PtWebClientUnknownData_t;

The members include:

response
The type of response:
filename
The name of the file in which to save unknown data.
url
The URL obtained from the Pt_CB_WEB_UNKNOWN callback.

Pt_ARG_WEB_VERSION (read only)

C type Pt type Default
char * String

Get the value of this resource to obtain the version of the connected web server.

Pt_CB_WEB_AUTHENTICATE

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the server requires authentication information or when canceling a previous authentication request. To return the information, set the Pt_ARG_WEB_AUTHENTICATE resource.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_AUTHENTICATE
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebAuthenticateCallback_t structure:
typedef struct {
    short    type;
    short    action;
    char     realm[128];
    char     url[MAX_URL_LENGTH];
} PtWebAuthenticateCallback_t;

The members of the PtWebAuthenticateCallback_t structure are:

type
The type of authentication used:
action
The action to take:
realm
The realm name.
url
The URL that requires the authentication.

Pt_CB_WEB_CLOSE_WINDOW

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when a web page with Javascript requests that its window be closed.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_CLOSE_WINDOW
reason_subtype
Not used.
event
NULL
cbdata
NULL

Pt_CB_WEB_COMPLETE

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the page has completed loading. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_COMPLETE
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebCompleteCallback_t structure:
typedef struct {
    char    url[MAX_URL_LENGTH];
} PtWebCompleteCallback_t;

The url member contains the URL of the page that has just completed.

Pt_CB_WEB_CONTEXT

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the user has right-clicked on the current page with the mouse.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_CONTEXT
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebContextCallback_t structure:
typedef struct {
    long        context;
    PhPoint_t   pos;
} PtWebContextCallback_t;

The members of the PtWebContextCallback_t structure are:

context
The context, which is one of:
pos
A PhPoint_t structure (see the Photon Library Reference) that contains the (x, y) coordinates of the location where the right mouse button was pressed.

Pt_CB_WEB_DATA_REQ

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when a file has been requested using the client protocol in the URL (e.g. client:about). The callback notifies the client that the server is waiting for data; to return the data, set the Pt_ARG_WEB_DATA resource.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_DATA_REQ
reason_subtype
The same as the type member in the callback data.
event
NULL
cbdata
A pointer to a PtWebDataReqCallback_t structure:
typedef struct {
    int     type;
    int     length;
    char    url[MAX_URL_LENGTH];
} PtWebDataReqCallback_t;

The members of the PtWebDataReqCallback_t structure are:

type
The type of request:
length
The maximum amount of data the server can accept.
url
The URL of the request.

For an example of using the client protocol, see Pt_ARG_WEB_DATA.

Pt_CB_WEB_ERROR

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked if an error occurs while loading a page. This includes unknown URL protocols such as mailto:, allowing the client to handle them.


Note: The mailto links are handled by the client. This is done by watching for the mailto URL in the Pt_CB_WEB_ERROR callback.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_ERROR
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebErrorCallback_t structure:
typedef struct {
    short    type;
    short    reason;
    char     url[MAX_URL_LENGTH];
} PtWebErrorCallback_t;

The members of the PtWebErrorCallback_t structure are:

type
The type of error:
reason
If type is WWW_ERROR_SERVER_EXIT, the reason member contains the terminating status of the server (see waitpid() for more information on determining why the server terminated).

For other values of type, the possible values of reason are:

-1
Unspecified or unknown error.
-2
Parameter check / consistency check failed.
-3
Low memory.
-4
Low image cache memory.
-5
The operation was aborted.
-6
Bad header.
-8
The document contains no data.
-9
Missing service API.
-10
Missing request API.
-11
Multiple init.
-12
DNS failure.
-13
Connection failure.
-14
Network failure.
-15
Bad input stream.
-16
Request for data sink failed.
-17
New data sink failed.
-18
Invalid redirect.
-19
Unknown server error.
-21
Unknown document character set encoding.
-31
Corrupt data.
-39
Helper failed.
-40
SSL not supported.
-41
Unknown URL (No URL handler could be found to process the given URL).
-400
HTTP -- Bad request.
-401
HTTP -- Unauthorized.
-402
HTTP -- Payment required.
-403
HTTP -- Forbidden.
-404
HTTP -- Not found.
-405
HTTP -- Method not allowed.
-406
HTTP -- Not acceptable.
-407
HTTP -- Proxy authentication required.
-408
HTTP -- Request time-out.
-409
HTTP -- Conflict.
-410
HTTP -- Gone.
-411
HTTP -- Length required.
-412
HTTP -- Precondition required.
-413
HTTP -- Request entity too large.
-414
HTTP -- Request URL too large.
-415
HTTP -- Unsupported media type.
-500
HTTP -- Internal server error.
-501
HTTP -- Not implemented.
-502
HTTP -- Bad gateway.
-503
HTTP -- Service unavailable.
-504
HTTP -- Gateway time-out.
-505
HTTP -- HTTP version not supported.
-1200
FTP -- Server error.
-1202
FTP -- Error 332.
-1203
FTP -- Error 530.

Pt_CB_WEB_METADATA

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked to inform the client of meta data that was read from the page. The most common meta data returned is the web page title.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_METADATA
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebMetaDataCallback_t structure:
typedef struct {
    char    name[128];
    char    value[2048];
} PtWebMetaDataCallback_t;

The name member for the web page title is title.

Pt_CB_WEB_NEED_SCROLL (key mode only)

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the server requires the client to scroll the page.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_NEED_SCROLL
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebNeedScrollCallback_t structure:
typedef struct {
    short    dir;
} PtWebNeedScrollCallback_t;

where dir indicates the direction to scroll:

Pt_CB_WEB_NEW_WINDOW

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the browser requests that a new PtWebClient widget be connected to the server so that it can display a page.

If no callback is attached, then the requested page appears in the window that the request was made (i.e. user clicked in). This doesn't apply to Javascript open windows.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_NEW_WINDOW
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebWindowCallback_t structure:
typedef struct {
    PhDim_t     size;
    long        flags;
} PtWebWindowCallback_t;

The members of the PtWebWindowCallback_t structure are:

size
A PhDim_t structure (see the Photon Library Reference) that defines the dimensions of the new window.
flags
A combination of the following bits:

Pt_CB_WEB_PAGE_INFO

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the page size or position has changed. Each callback is passed a PtCallbackInfo_t structure that contains at least:

reason
Pt_CB_WEB_PAGE_INFO
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebPageInfoCallback_t structure:
typedef struct {
    long    vheight;
    long    vwidth;
    long    height;
    long    width;
    long    ypos;
    long    xpos;
} PtWebPageInfoCallback_t;

The members of the PtWebPageInfoCallback_t structure are:

vheight
The height of the visible portion, in pixels.
vwidth
The width of the visible portion, in pixels.
height
The height of the page, in pixels.
width
The width of the page, in pixels.
ypos
The position of the right side of the page, in pixels.
xpos
The position of the top of the page, in pixels.

Pt_CB_WEB_SSL_CERTINFO

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks that are invoked when the web server has discovered an SSL connection; invoked after the handshake phase has determined the other party's identity.


Note: This callback list is invoked only if you're using the SSL version of the Voyager server (Spyrus Terisa version).

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_SSL_CERTINFO
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebSSLCertInfoCallback_t structure:
typedef struct PtWebSSLCertInfoCallback_t {
    char            url[MAX_URL_LENGTH];
    char            cipher_kind[64];
    int             is_sgc;
    int             version;
    unsigned int    flags;
    struct {
        char        serial[64];
        char        subject[1024];
        char        issuer[1024];
    }               certinfo;
    time_t  valid_begin, valid_end;
    char    status[256];
    char    extensions[4096];
} PtWebSSLCertInfoCallback_t;

The members of the PtWebSSLCertInfoCallback_t structure are:

url
The URL associated with the error.
cipher_kind
The cipher suite used for the connection (SSL_3_RSA_WITH_RC4-128_MD5, SSL_3_RSA_WITH_RC4_40_MD5, etc.)
is_sgc
Nonzero if the connection is using the "Server Gated Cryptography" (also called "Step-Up Encryption").
version
The version number: 2 for SSL 2.0, 0x0300 (768) for SSL 3.0, 0x0301 for TLS 1.0.
flags
Flags for future extensions (always zero in the current implementation).
certinfo.serial
The serial number for the certificate (a hexadecimal number).
certinfo.subject, certinfo.issuer
Distinguished names of the public key being certified.
valid_begin, valid_end
The time (in seconds since 01/01/1970 0h GMT) at which the certificates became valid and invalid.
status
The status of the certificate, represented as a string (Valid, Pending, Expired, Trusted root, Unverified, and so on).
extensions
Some additional information about the SSL connections (string).

When this callback is invoked, typically the client saves this information relative to the current SSL connection, in order to be able to display it on a subsequent user's request (usually when the user clicks on the lock).

This callback returns only Pt_CONTINUE; there's no need to fill up a special structure as response.

Pt_CB_WEB_SSL_CERTNONTRUSTED

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks that are invoked when the web server has discovered that the current SSL connection is made with nontrusted certificate. Note that Voyager supports only server certificate, and not Client certificates.


Note: This callback list is invoked only if you're using the SSL version of the Voyager server (Spyrus Terisa version).

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_SSL_CERTNONTRUSTED
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebSSLCertNonTrustedCallback_t structure:
typedef struct PtWebSSLCertNonTrustedCallback_t {
    int     f_abort;
    char    url[MAX_URL_LENGTH];
    char    subject[1024];
    char    issuer[1024];
    char    cert_serial[64];
    time_t  valid_begin, valid_end;
    char    status[256];
} PtWebSSLCertNonTrustedCallback_t;

The members of the PtWebSSLCertNonTrustedCallback_t structure are:

f_abort
Not currently used; it's always set to FALSE.
url
The URL associated with the error.
subject, issuer
Distinguished names of the public key being certified.
cert_serial
The serial number for the certificate (hexadecimal number).
valid_begin, valid_end
The time (in seconds since 01/01/1970 0h GMT) at which the certificates became valid and invalid.
status
The status of the certificate, represented as a string (Valid, Pending, Expired, Trusted root, Unverified, and so on).

When this callback is invoked, typically the client displays a dialog giving three choices to the user:

The transaction is halted until you set the Pt_ARG_WEB_SSL_RESPONSE resource. You need to fill in a PtWebClientSSLResponse_t structure with the URL found in the callback structure and one of these response codes:

SSL_CERTNONTRUSTED_ABORT
Abort the connection to the site.
SSL_CERTNONTRUSTED_CONTINUE
Connect to the site, don't save the certificate.
SSL_CERTNONTRUSTED_ACCEPT
Connect to the site, save the certificate.

Pt_CB_WEB_SSL_ERROR

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks that are invoked when the Voyager server has discovered an error or inconsistency with the current SSL transaction.


Note: This callback list is invoked only if you're using the SSL version of the Voyager server (Spyrus Terisa version).

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_SSL_ERROR
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebSSLErrorCallback_t structure:
typedef struct {
    char url[MAX_URL_LENGTH];
    int  certerr;
} PtWebSSLErrorCallback_t;

The members of the PtWebSSLErrorCallback_t structure are:

The transaction is halted until you set the Pt_ARG_WEB_SSL_RESPONSE resource. You need to fill in a PtWebClientSSLResponse_t structure with the URL found in the callback structure and one of the following response codes:

Pt_CB_WEB_START

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when a page starts loading. Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_START
reason_subtype
Not used.
event
NULL
cbdata
NULL

Pt_CB_WEB_STATUS

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks that are invoked when the browser's status changes. These callbacks give you many different types of information.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_STATUS
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebStatusCallback_t structure:
typedef struct {
    char    desc[MAX_URL_LENGTH + 6];
    short   type;
} PtWebStatusCallback_t;

This callback gives you many different types of information. Before performing any actions, you should first check the type and then act accordingly.

The types are:

WWW_STATUS_MOUSE
Reports when the mouse moved over links, images, etc.
WWW_STATUS_CONNECT
Reports connection-related messages.
WWW_STATUS_DEFAULT
Reported when Javascript requests the default status bar text be changed (i.e. window.defaultStatus="..."). The defaultStatus message appears when nothing else is in the status bar.
WWW_STATUS_PROGRESS
A progress message (e.g. the number of bytes downloaded).
WWW_STATUS_INFO
Reports various information. Valid INFO types are:
FORM-EDIT
Single-line text field has focus.
FORM-PASS
The password field has focus.
FORM-LIST
Single select list has focus.
FORM-MULTILIST
Multi-select list has focus.
FORM-COMBO
Combo box has focus.
FORM-TEXTAREA
Multi-line text field has focus.
FORM-CHECKBOX
Check box has focus.
FORM-RADIO
Radio button has focus.
FORM-SUBMIT
Submit button has focus.
FORM-RESET
Reset button has focus.
LINK-IMAGE-MAP
Image map has focus.
LINK-IMAGE
Image link has focus.
LINK-TEXT
Text link has focus.
FRAMESET-DOC
Frames document has been loaded.
FORM-CURSOR-LEFT
The cursor inside a FORM control or image map has reached the leftmost position.
FORM-CURSOR-RIGHT
The cursor inside a FORM control or image map has reached the rightmost cursor position.
FORM-CURSOR-TOP
The cursor inside a FORM control or image map has reached the topmost position.
FORM-CURSOR-BOTTOM
The cursor inside a FORM control or image map has reached the bottommost cursor position.
PAGE-TOP
The page has scrolled to its topmost position.
PAGE-BOTTOM
The page has scrolled to its bottommost position.
PAGE-LEFT
The page has scrolled to its leftmost position.
PAGE-RIGHT
The page has scrolled to its rightmost position.
WWW_STATUS_PRINT
Reports print-related status (pages printed):

Pt_CB_WEB_UNKNOWN

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks invoked when the server has received a file that it can't display or has no external helpers that match its mimetype or file suffix. Set Pt_ARG_WEB_UNKNOWN_RESP to provide a filename or cancel the download anytime after this callback.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_UNKNOWN
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebUnknownCallback_t structure:
typedef struct {
    short    action;
    char     content_type[64];
    int      content_length;
    char     url[MAX_URL_LENGTH];
} PtWebUnknownCallback_t;

The members of the PtWebUnknownCallback_t structure are:

action
The action taking place:
content_type
The mime content type of the file (if available).
content_length
The length of the file (-1 if unknown).
url
The URL of the file.

Pt_CB_WEB_URL

C type Pt type Default
PtCallback_t * Link NULL

A list of PtCallback_t structures that define the callbacks that are invoked when the browser has a complete URL to be loaded. This is useful for saving internal history lists or saving URLs in hotlists.

Each callback is passed a PtCallbackInfo_t structure that contains at least the following members:

reason
Pt_CB_WEB_URL
reason_subtype
Not used.
event
NULL
cbdata
A pointer to a PtWebUrlCallback_t structure:
typedef struct {
    char    url[MAX_URL_LENGTH];
} PtWebUrlCallback_t;

Inherited resources:

If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.

Resource Inherited from Default override
Pt_ARG_ANCHOR_FLAGS PtWidget
Pt_ARG_ANCHOR_OFFSETS PtWidget
Pt_ARG_AREA PtWidget
Pt_ARG_BANDWIDTH_THRESHOLD PtBasic Not used by this class.
Pt_ARG_BASIC_FLAGS PtBasic
Pt_ARG_BEVEL_WIDTH PtWidget 0
Pt_ARG_BITMAP_CURSOR PtWidget
Pt_ARG_BEVEL_COLOR PtBasic
Pt_ARG_BEVEL_CONTRAST PtBasic
Pt_ARG_CLIENT_FLAGS PtClient
Pt_ARG_CLIENT_NAME PtClient "VoyagerServer-2"
Pt_ARG_CLIENT_REPLY_LEN PtClient
Pt_ARG_CLIENT_SEND PtClient
Pt_ARG_CLIENT_SERVER PtClient
Pt_ARG_COLOR PtBasic
Pt_ARG_CONTAINER_FLAGS PtContainer
Pt_ARG_CONTRAST PtBasic
Pt_ARG_CURSOR_COLOR PtWidget
Pt_ARG_CURSOR_OVERRIDE PtContainer
Pt_ARG_CURSOR_TYPE PtWidget
Pt_ARG_DARK_BEVEL_COLOR PtBasic
Pt_ARG_DARK_FILL_COLOR PtBasic
Pt_ARG_DATA PtWidget
Pt_ARG_DIM PtWidget
Pt_ARG_EFLAGS PtWidget
Pt_ARG_EXTENT PtWidget
Pt_ARG_FILL_COLOR PtBasic
Pt_ARG_FILL_PATTERN PtBasic
Pt_ARG_FLAGS PtWidget
Pt_ARG_HEIGHT PtWidget
Pt_ARG_HELP_TOPIC PtWidget
Pt_ARG_HIGHLIGHT_ROUNDNESS PtBasic
Pt_ARG_INLINE_COLOR PtBasic
Pt_ARG_LIGHT_BEVEL_COLOR PtBasic
Pt_ARG_LIGHT_FILL_COLOR PtBasic
Pt_ARG_MARGIN_HEIGHT PtBasic
Pt_ARG_MARGIN_WIDTH PtBasic
Pt_ARG_MAXIMUM_DIM PtWidget
Pt_ARG_MINIMUM_DIM PtWidget
Pt_ARG_OUTLINE_COLOR PtBasic
Pt_ARG_POINTER PtWidget
Pt_ARG_POS PtWidget
Pt_ARG_RESIZE_FLAGS PtWidget
Pt_ARG_STYLE PtBasic
Pt_ARG_TITLE PtContainer
Pt_ARG_TITLE_FONT PtContainer
Pt_ARG_TRANS_PATTERN PtBasic
Pt_ARG_USER_DATA PtWidget
Pt_ARG_WIDTH PtWidget
Pt_CB_ACTIVATE PtBasic
Pt_CB_ARM PtBasic
Pt_CB_BALLOONS PtContainer
Pt_CB_BLOCKED PtWidget
Pt_CB_CHILD_ADDED_REMOVED PtContainer
Pt_CB_CLIENT_CONNECTED PtClient
Pt_CB_CLIENT_EVENT PtClient
Pt_CB_CLIENT_NOT_FOUND PtClient
Pt_CB_DESTROYED PtWidget
Pt_CB_DISARM PtBasic
Pt_CB_DND PtWidget
Pt_CB_FILTER PtWidget
Pt_CB_GOT_FOCUS PtBasic
Pt_CB_HOTKEY PtWidget
Pt_CB_IS_DESTROYED PtWidget
Pt_CB_LOST_FOCUS PtBasic
Pt_CB_MENU PtBasic
Pt_CB_OUTBOUND PtWidget
Pt_CB_RAW PtWidget
Pt_CB_REALIZED PtWidget
Pt_CB_REPEAT PtBasic
Pt_CB_RESIZE PtContainer
Pt_CB_UNREALIZED PtWidget

[Previous] [Contents] [Index] [Next]