if (webProc == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
public Browser(Composite parent, int style) {	super(parent, style);	/* use Photon's built-in anchoring for resizing */	int[] args = {			OS.Pt_ARG_ANCHOR_FLAGS,			OS.Pt_TOP_ANCHORED_TOP | OS.Pt_BOTTOM_ANCHORED_BOTTOM | OS.Pt_LEFT_ANCHORED_LEFT | OS.Pt_RIGHT_ANCHORED_RIGHT,			OS.Pt_TOP_ANCHORED_TOP | OS.Pt_BOTTOM_ANCHORED_BOTTOM | OS.Pt_LEFT_ANCHORED_LEFT | OS.Pt_RIGHT_ANCHORED_RIGHT,			OS.Pt_ARG_FILL_COLOR,			0xFFFFFF,			0 };	webHandle = OS.PtCreateWidget(OS.PtWebClient(), handle, args.length / 3, args);	if (webHandle == 0) {		dispose();		SWT.error (SWT.ERROR_NO_HANDLES);	}	/* configure the widget with a specific server */	File netfront = new File("/usr/photon/bin/netfront"); //$NON-NLS-1$	String name, server;	if (netfront.exists() || (OS.QNX_MAJOR >= 6 && OS.QNX_MINOR >= 3 && OS.QNX_MICRO >= 0)) {		name = "NetfrontServer"; //$NON-NLS-1$		server = "netfront"; //$NON-NLS-1$	} else {		name = "VoyagerServer-2"; //$NON-NLS-1$		server = "vserver"; //$NON-NLS-1$	}	/* set client name */	byte[] nameBuffer = Converter.wcsToMbcs(null, name, true);	int namePtr = OS.malloc(nameBuffer.length);	OS.memmove(namePtr, nameBuffer, nameBuffer.length);	OS.PtSetResource(webHandle, OS.Pt_ARG_CLIENT_NAME, namePtr, 0);	OS.free(namePtr);		/**	 * Feature in Photon PtWebClient.  If you give a server name	 * when the widget is created it will attempt to start a new server	 * rather then attaching a new window context to the existing server.	 * If you don't connect to the existing one then javascript window	 * creation will fail.	 */	if (instanceCount == 0) {		/* select server */		byte[] serverBuffer = Converter.wcsToMbcs(null, server, true);		int serverPtr = OS.malloc(serverBuffer.length);		OS.memmove(serverPtr, serverBuffer, serverBuffer.length);		OS.PtSetResource(webHandle, OS.Pt_ARG_WEB_SERVER, serverPtr, 0);		OS.free(serverPtr);	} 	instanceCount++;		if (callback == null) callback = new Callback(this.getClass(), "webProc", 3, false); //$NON-NLS-1$	int webProc = callback.getAddress();	OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_CLOSE_WINDOW, webProc, OS.Pt_CB_WEB_CLOSE_WINDOW);	OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_COMPLETE, webProc, OS.Pt_CB_WEB_COMPLETE);	OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_DATA_REQ, webProc, OS.Pt_CB_WEB_DATA_REQ);	OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_METADATA, webProc, OS.Pt_CB_WEB_METADATA);		OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_NEW_WINDOW, webProc, OS.Pt_CB_WEB_NEW_WINDOW);	OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_START, webProc, OS.Pt_CB_WEB_START);	OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_STATUS, webProc, OS.Pt_CB_WEB_STATUS);	OS.PtAddCallback(webHandle,OS.Pt_CB_WEB_URL, webProc, OS.Pt_CB_WEB_URL);	Listener listener = new Listener() {		public void handleEvent(Event event) {			switch (event.type) {				case SWT.Dispose: onDispose(); break;				case SWT.FocusIn: onFocusGained(event);	break;			}		}	};		int[] folderEvents = new int[]{		SWT.Dispose,		SWT.FocusIn,  	};	for (int i = 0; i < folderEvents.length; i++) {		addListener(folderEvents[i], listener);	}	OS.PtRealizeWidget(webHandle);}