![]() |
![]() |
![]() |
![]() |
Widget for displaying web pages
PtWidget --> PtBasic --> PtContainer --> PtClient --> PtWebClient
For more information, see the diagram of the widget hierarchy.
<photon/PtWebClient.h>
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.
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.
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 |
C type | Pt type | Default |
---|---|---|
int | Scalar | 0 (write-only) |
This resource activates and deactivates the current link.
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:
C type | Pt type | Default |
---|---|---|
char * | String | NULL (read-only) |
The Build date of the connected web server.
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:
struct { char szString[128]; unsigned long flags; } FindInfo;
where:
struct { char filename[PATH_MAX]; } SaveasInfo;
where filename is the name of the file in which to save the document.
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:
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 ); }
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.
![]() |
Pt_ARG_WEB_DOWNLOAD does GET requests only. |
C type | Pt type | Default |
---|---|---|
char * | String | NULL |
The current document encoding. See PxTranslateSet() in the Photon Library Reference.
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:
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; }
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:
You can OR the following flags into the action to control the caching of the page and the recording of history:
![]() |
|
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:
![]() |
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.) |
C type | Pt type | Default |
---|---|---|
int | Scalar | 0 |
The value of h_errno after a DNS failure. The possible values are:
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:
![]() |
The next and previous directions are defined by the order of the <FRAME> tag in each <FRAMESET> tag. |
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:
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.
![]() |
The next and previous directions are defined by the order of the links in the HTML 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:
![]() |
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 */ }
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 ); } }
![]() |
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:
The HTML options are:
Default: #ff0000
Default: #0000ff
Default: #008080
Default: TRUE
Default: FALSE
Default: FALSE
Default: FALSE
Default: FALSE
Default: #ffffff
Default: #000000
Default: 10
Default: 20
Default: #606060
Default: #7f7f00
Default: TRUE
Default: TRUE
Default: FALSE
Default: FALSE
Default: FALSE
Default: FALSE
Default: 2
Default: 2
Possible values:
Default: 16
Default: 2
Possible values: 0 - 4
Default: FALSE
Default: #ffffff
Default: #ffff00
Default: 1
The HTTP cookie options are:
Default: cookie.jar
Default: $(HOME)
Default: FALSE
Default: -1
The authentication options are:
Default: 3
The FTP options are:
Default: 80
Default: none
Default: 80
Default: 80
The Gopher options are:
Default: none
Default: 80
Default: none
The HTTP options are:
Default: none
Default: 80
Default: none
The file options are:
Default: TRUE
Default: FALSE
The image options are:
Default: TRUE
Default: 4
Default: FALSE
The print options are:
Default: Page &
Default: &w
Default: helv
Default: 8
Default: &d &t
Default: &u
You can use these special characters in the header and footer strings:
The SOCKS options are:
Default: none
Default: none
Default: none
Default: none
The TCP/IP options are:
Default: TRUE
The disk-cache options are:
Default: FALSE
Default: 0
Note: Verifying is done by using the "If-Modified-Since" request-header.
Default: TRUE
Default: FALSE
Default: /tmp
Default: 5000
Default: main.ndx
The miscellaneous options are:
Default: TRUE
Default: TRUE
Default: none
Default: 4
Default: e90e (the insert cursor)
Default: 1024
Default: e90c (the finger cursor)
Default: e900 (the pointer cursor)
Default: e90c (the finger cursor)
Default: e918 (the point wait cursor)
Default: e900 (the pointer cursor)
Default: e918 (the point wait cursor)
Default: 4
Default: 50
Default: 0
Default: FALSE
Default: 500
Default: TRUE
Default: TRUE
Default: TRUE
Default: 4
Default: e908 (the wait cursor)
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:
![]() |
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. |
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);
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.
![]() |
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.
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.
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:
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.
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);
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:
C type | Pt type | Default |
---|---|---|
char * | String |
Get the value of this resource to obtain the version of the connected web server.
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:
typedef struct { short type; short action; char realm[128]; char url[MAX_URL_LENGTH]; } PtWebAuthenticateCallback_t;
The members of the PtWebAuthenticateCallback_t structure are:
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:
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:
typedef struct { char url[MAX_URL_LENGTH]; } PtWebCompleteCallback_t;
The url member contains the URL of the page that has just completed.
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:
typedef struct { long context; PhPoint_t pos; } PtWebContextCallback_t;
The members of the PtWebContextCallback_t structure are:
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:
typedef struct { int type; int length; char url[MAX_URL_LENGTH]; } PtWebDataReqCallback_t;
The members of the PtWebDataReqCallback_t structure are:
For an example of using the client protocol, see Pt_ARG_WEB_DATA.
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.
![]() |
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:
typedef struct { short type; short reason; char url[MAX_URL_LENGTH]; } PtWebErrorCallback_t;
The members of the PtWebErrorCallback_t structure are:
For other values of type, the possible values of reason are:
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:
typedef struct { char name[128]; char value[2048]; } PtWebMetaDataCallback_t;
The name member for the web page title is title.
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:
typedef struct { short dir; } PtWebNeedScrollCallback_t;
where dir indicates the direction to scroll:
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:
typedef struct { PhDim_t size; long flags; } PtWebWindowCallback_t;
The members of the PtWebWindowCallback_t structure are:
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:
typedef struct { long vheight; long vwidth; long height; long width; long ypos; long xpos; } PtWebPageInfoCallback_t;
The members of the PtWebPageInfoCallback_t structure are:
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.
![]() |
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:
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:
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.
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.
![]() |
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:
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:
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:
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.
![]() |
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:
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:
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:
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:
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:
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:
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:
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:
typedef struct { char url[MAX_URL_LENGTH]; } PtWebUrlCallback_t;
If the widget modifies an inherited resource, the "Default override" column indicates the new value. This modification affects any subclasses of the widget.
![]() |
![]() |
![]() |
![]() |