Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Source files linted.

  • Loading branch information...
commit 7756b9297ac2149596528011c915a6c788308616 1 parent 9d98abc
Michelangelo De Simone authored
View
7,712 BrowserAdapter.cpp
3,856 additions, 3,856 deletions not shown
View
1,018 BrowserAdapter.h
@@ -47,202 +47,204 @@ struct BrowserMetaViewport;
/**
* This is the NPAPI browser plugin to our browser. This object communicates with
* the browser server which renders a browser page into this adapter.
- *
+ *
* All js_* methods are the implementations of the exposed JavaScript routines
* callable by a JavaScript program.
- *
+ *
* The msg* methods are unsolicited messages sent by the browser server when it
* needs to inform this adapter of something.
- *
+ *
* The handle* methods are called by the browser via the AdapterBase::PrvNPP_HandleEvent
* NPAPI plugin callback event handler.
*/
class BrowserAdapter : public BrowserClientBase
- , public AdapterBase
- , public KineticScrollerListener
+ , public AdapterBase
+ , public KineticScrollerListener
{
public:
- BrowserAdapter(NPP instance, GMainContext *ctxt, int16_t argc, char* argn[], char* argv[]);
- virtual ~BrowserAdapter();
-
- void freeze();
- void thaw();
- bool isFrozen();
-
- bool flashGestureLock() const { return mFlashGestureLock; }
-
- // Methods exposed to JavaScript:
- static const char* js_addUrlRedirect(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_clearHistory(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_clickAt(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_deleteImage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_generateIconFromFile(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_getHistoryState(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_goBack(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_goForward(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_interrogateClicks(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_openURL(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_pageScaleAndScroll(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_reloadPage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_resizeImage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_saveViewToFile(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_selectPopupMenuItem(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_sendDialogResponse(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setMagnification(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setMinFontSize(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setPageIdentifier(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_smartZoom(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setViewportSize(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_stopLoad(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_gestureStart(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_gestureChange(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_gestureEnd(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_scrollStarting(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_scrollEnding(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setEnableJavaScript(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setBlockPopups(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setHeaderHeight(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setAcceptCookies(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ BrowserAdapter(NPP instance, GMainContext *ctxt, int16_t argc, char* argn[], char* argv[]);
+ virtual ~BrowserAdapter();
+
+ void freeze();
+ void thaw();
+ bool isFrozen();
+
+ bool flashGestureLock() const {
+ return mFlashGestureLock;
+ }
+
+ // Methods exposed to JavaScript:
+ static const char* js_addUrlRedirect(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_clearHistory(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_clickAt(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_deleteImage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_generateIconFromFile(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_getHistoryState(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_goBack(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_goForward(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_interrogateClicks(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_openURL(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_pageScaleAndScroll(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_reloadPage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_resizeImage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_saveViewToFile(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_selectPopupMenuItem(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_sendDialogResponse(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setMagnification(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setMinFontSize(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setPageIdentifier(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_smartZoom(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setViewportSize(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_stopLoad(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_gestureStart(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_gestureChange(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_gestureEnd(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_scrollStarting(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_scrollEnding(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setEnableJavaScript(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setBlockPopups(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setHeaderHeight(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setAcceptCookies(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_setShowClickedLink(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_mouseEvent(AdapterBase* adapter, const NPVariant* args, uint32_t argCount, NPVariant* result);
- static const char* js_addElementHighlight(AdapterBase* adapter, const NPVariant* args, uint32_t argCount, NPVariant* result);
- static const char* js_removeElementHighlight(AdapterBase* adapter, const NPVariant* args, uint32_t argCount, NPVariant* result);
- static const char* js_connectBrowserServer(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_disconnectBrowserServer(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_pageFocused(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_inspectUrlAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_mouseEvent(AdapterBase* adapter, const NPVariant* args, uint32_t argCount, NPVariant* result);
+ static const char* js_addElementHighlight(AdapterBase* adapter, const NPVariant* args, uint32_t argCount, NPVariant* result);
+ static const char* js_removeElementHighlight(AdapterBase* adapter, const NPVariant* args, uint32_t argCount, NPVariant* result);
+ static const char* js_connectBrowserServer(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_disconnectBrowserServer(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_pageFocused(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_inspectUrlAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_isEditing(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_insertStringAtCursor(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_enableSelectionMode(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_disableSelectionMode(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_clearSelection(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_saveImageAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_getImageInfoAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_selectAll(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_cut(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_saveImageAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_getImageInfoAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_selectAll(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_cut(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_copy(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_paste(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_interactiveAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_getElementInfoAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setMouseMode(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_startDeferWindowChange(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_stopDeferWindowChange(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
-
- static const char* js_setSpotlight(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_removeSpotlight(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_paste(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_interactiveAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_getElementInfoAtPoint(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setMouseMode(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_startDeferWindowChange(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_stopDeferWindowChange(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+
+ static const char* js_setSpotlight(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_removeSpotlight(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_setHTML(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_disableEnhancedViewport(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_ignoreMetaTags(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setNetworkInterface(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_enableFastScaling(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setDefaultLayoutWidth(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_disableEnhancedViewport(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_ignoreMetaTags(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setNetworkInterface(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_enableFastScaling(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setDefaultLayoutWidth(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const char* js_printFrame(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_skipPaintHack(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_findInPage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char *js_mouseHoldAt(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_handleFlick(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setVisibleSize(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
- static const char* js_setDNSServers(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_skipPaintHack(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_findInPage(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char *js_mouseHoldAt(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_handleFlick(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setVisibleSize(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
+ static const char* js_setDNSServers(AdapterBase *adapter, const NPVariant *args, uint32_t argCount, NPVariant *result);
static const int kRecordBufferEmptyError = -10;
-
- static const int kExceptionMessageLength = 128;
+
+ static const int kExceptionMessageLength = 128;
protected:
-
- // AdapterBase overrides:
- virtual bool handlePenDown(NpPalmPenEvent *event);
- virtual bool handlePenUp(NpPalmPenEvent *event);
- virtual bool handlePenMove(NpPalmPenEvent *event);
- virtual bool handlePenClick(NpPalmPenEvent *event);
- virtual bool handlePenDoubleClick(NpPalmPenEvent *event);
-
- virtual bool handleKeyDown(NpPalmKeyEvent *event);
- virtual bool handleKeyUp(NpPalmKeyEvent *event);
-
- virtual bool handleTouchStart(NpPalmTouchEvent *event);
- virtual bool handleTouchEnd(NpPalmTouchEvent *event);
- virtual bool handleTouchMove(NpPalmTouchEvent *event);
- virtual bool handleTouchCancelled(NpPalmTouchEvent *event);
-
- virtual bool handleGesture(NpPalmGestureEvent *event);
-
- virtual void handlePaint(NpPalmDrawEvent* event);
- virtual void handleWindowChange(NPWindow* window);
-
- virtual bool handleFocus(bool val);
-
- // KineticScrollerListener overrides:
- virtual void scrollTo(int x, int y);
- virtual void startedAnimating();
- virtual void stoppedAnimating();
-
- // BrowserClientBase overrides:
- virtual void serverConnected();
- virtual void serverDisconnected();
-
- // Async message handlers inherited from BrowserClientBase:
- virtual void msgPainted(int32_t sharedBufferKey);
- virtual void msgReportError(const char* url, int32_t code, const char* msg);
- virtual void msgContentsSizeChanged(int32_t width, int32_t height);
- virtual void msgScrolledTo(int32_t contentsX, int32_t contentsY);
- virtual void msgLoadStarted();
- virtual void msgLoadStopped();
- virtual void msgLoadProgress(int32_t progress);
- virtual void msgLocationChanged(const char* uri, bool canGoBack, bool canGoForward);
- virtual void msgTitleChanged(const char* title);
- virtual void msgTitleAndUrlChanged(const char* title, const char* url, bool canGoBack, bool canGoForward);
- virtual void msgDialogAlert(const char* syncPipePath, const char* msg);
- virtual void msgDialogConfirm(const char* syncPipePath, const char* msg);
- virtual void msgDialogSSLConfirm(const char* syncPipePath, const char* host,int32_t code, const char* certFile);
- virtual void msgDialogPrompt(const char* syncPipePath, const char* msg, const char* defaultValue);
- virtual void msgDialogUserPassword(const char* syncPipePath, const char* msg);
- virtual void msgActionData(const char* dataType, const char* data);
- virtual void msgDownloadStart(const char* url);
- virtual void msgDownloadProgress(const char* url, int32_t totalSizeSoFar, int32_t totalSize);
- virtual void msgDownloadError(const char* url, const char* errorMsg);
- virtual void msgDownloadFinished(const char* url, const char* mimeType, const char* tmpFilePath);
- virtual void msgLinkClicked(const char* url);
- virtual void msgMimeHandoffUrl(const char* mimeType, const char* url);
- virtual void msgMimeNotSupported(const char* mimeType, const char* url);
- virtual void msgCreatePage(int32_t identifier);
- virtual void msgClickRejected(int32_t counter);
- virtual void msgPopupMenuShow(const char* identifier, const char* menuDataFileName);
- virtual void msgPopupMenuHide(const char* identifier);
- virtual void msgSmartZoomCalculateResponseSimple(int32_t pointX, int32_t pointY, int32_t left, int32_t top, int32_t right, int32_t bottom, int fullscreenSpotlightHandle);
- virtual void msgFailedLoad(const char* domain, int32_t errorCode, const char* failingURL, const char* localizedDescription);
- virtual void msgSetMainDocumentError(const char* domain, int32_t errorCode, const char* failingURL, const char* localizedDescription);
- virtual void msgEditorFocused(bool focused, int32_t fieldType, int32_t fieldActions);
- virtual void msgDidFinishDocumentLoad();
- virtual void msgUpdateGlobalHistory(const char* url, bool reload);
+
+ // AdapterBase overrides:
+ virtual bool handlePenDown(NpPalmPenEvent *event);
+ virtual bool handlePenUp(NpPalmPenEvent *event);
+ virtual bool handlePenMove(NpPalmPenEvent *event);
+ virtual bool handlePenClick(NpPalmPenEvent *event);
+ virtual bool handlePenDoubleClick(NpPalmPenEvent *event);
+
+ virtual bool handleKeyDown(NpPalmKeyEvent *event);
+ virtual bool handleKeyUp(NpPalmKeyEvent *event);
+
+ virtual bool handleTouchStart(NpPalmTouchEvent *event);
+ virtual bool handleTouchEnd(NpPalmTouchEvent *event);
+ virtual bool handleTouchMove(NpPalmTouchEvent *event);
+ virtual bool handleTouchCancelled(NpPalmTouchEvent *event);
+
+ virtual bool handleGesture(NpPalmGestureEvent *event);
+
+ virtual void handlePaint(NpPalmDrawEvent* event);
+ virtual void handleWindowChange(NPWindow* window);
+
+ virtual bool handleFocus(bool val);
+
+ // KineticScrollerListener overrides:
+ virtual void scrollTo(int x, int y);
+ virtual void startedAnimating();
+ virtual void stoppedAnimating();
+
+ // BrowserClientBase overrides:
+ virtual void serverConnected();
+ virtual void serverDisconnected();
+
+ // Async message handlers inherited from BrowserClientBase:
+ virtual void msgPainted(int32_t sharedBufferKey);
+ virtual void msgReportError(const char* url, int32_t code, const char* msg);
+ virtual void msgContentsSizeChanged(int32_t width, int32_t height);
+ virtual void msgScrolledTo(int32_t contentsX, int32_t contentsY);
+ virtual void msgLoadStarted();
+ virtual void msgLoadStopped();
+ virtual void msgLoadProgress(int32_t progress);
+ virtual void msgLocationChanged(const char* uri, bool canGoBack, bool canGoForward);
+ virtual void msgTitleChanged(const char* title);
+ virtual void msgTitleAndUrlChanged(const char* title, const char* url, bool canGoBack, bool canGoForward);
+ virtual void msgDialogAlert(const char* syncPipePath, const char* msg);
+ virtual void msgDialogConfirm(const char* syncPipePath, const char* msg);
+ virtual void msgDialogSSLConfirm(const char* syncPipePath, const char* host,int32_t code, const char* certFile);
+ virtual void msgDialogPrompt(const char* syncPipePath, const char* msg, const char* defaultValue);
+ virtual void msgDialogUserPassword(const char* syncPipePath, const char* msg);
+ virtual void msgActionData(const char* dataType, const char* data);
+ virtual void msgDownloadStart(const char* url);
+ virtual void msgDownloadProgress(const char* url, int32_t totalSizeSoFar, int32_t totalSize);
+ virtual void msgDownloadError(const char* url, const char* errorMsg);
+ virtual void msgDownloadFinished(const char* url, const char* mimeType, const char* tmpFilePath);
+ virtual void msgLinkClicked(const char* url);
+ virtual void msgMimeHandoffUrl(const char* mimeType, const char* url);
+ virtual void msgMimeNotSupported(const char* mimeType, const char* url);
+ virtual void msgCreatePage(int32_t identifier);
+ virtual void msgClickRejected(int32_t counter);
+ virtual void msgPopupMenuShow(const char* identifier, const char* menuDataFileName);
+ virtual void msgPopupMenuHide(const char* identifier);
+ virtual void msgSmartZoomCalculateResponseSimple(int32_t pointX, int32_t pointY, int32_t left, int32_t top, int32_t right, int32_t bottom, int fullscreenSpotlightHandle);
+ virtual void msgFailedLoad(const char* domain, int32_t errorCode, const char* failingURL, const char* localizedDescription);
+ virtual void msgSetMainDocumentError(const char* domain, int32_t errorCode, const char* failingURL, const char* localizedDescription);
+ virtual void msgEditorFocused(bool focused, int32_t fieldType, int32_t fieldActions);
+ virtual void msgDidFinishDocumentLoad();
+ virtual void msgUpdateGlobalHistory(const char* url, bool reload);
virtual void msgPurgePage();
- virtual void msgInspectUrlAtPointResponse(int32_t queryNum, bool succeeded, const char* url, const char* desc, int32_t rectWidth, int32_t rectHeight, int32_t rectX, int32_t rectY);
- virtual void msgGetHistoryStateResponse(int32_t queryNum, bool canGoBack, bool canGoForward);
- virtual void msgIsEditing(int32_t queryNum, bool isEditing);
- virtual void msgUrlRedirected(const char* url, const char* userData);
- virtual void msgMetaViewportSet(double initialScale, double minimumScale, double maximumScale, int32_t width, int32_t height, bool userScalable);
- virtual void msgHighlightRects(const char* rectsArrayJson);
- virtual void msgSaveImageAtPointResponse(int32_t queryNum, bool succeeded, const char* filepath);
- virtual void msgGetImageInfoAtPointResponse(int32_t queryNum, bool succeeded, const char* baseUri, const char* src,
- const char* title, const char* altText, int32_t width, int32_t height, const char* mimeType);
- virtual void msgGetElementInfoAtPointResponse(int32_t queryNum, bool succeeded, const char* element, const char* id,
- const char* name, const char* cname, const char* type, int32_t left, int32_t top, int32_t right, int32_t bottom, bool isEditable);
- virtual void msgMakePointVisible(int32_t x, int32_t y);
- virtual void msgIsInteractiveAtPointResponse(int32_t queryNum, bool interactive);
- virtual void msgCopiedToClipboard();
- virtual void msgPastedFromClipboard();
- virtual void msgRemoveSelectionReticle();
- virtual void msgCopySuccessResponse(int32_t queryNum, bool success);
- virtual void msgPluginFullscreenSpotlightCreate(int32_t spotlightHandle, int32_t rectX, int32_t rectY, int32_t rectWidth, int32_t rectHeight);
- virtual void msgPluginFullscreenSpotlightRemove();
- virtual void msgSpellingWidgetVisibleRectUpdate(int32_t rectX, int32_t rectY, int32_t rectWidth, int32_t rectHeight);
- virtual void msgHitTestResponse(int32_t queryNum, const char *hitTestResultJson);
+ virtual void msgInspectUrlAtPointResponse(int32_t queryNum, bool succeeded, const char* url, const char* desc, int32_t rectWidth, int32_t rectHeight, int32_t rectX, int32_t rectY);
+ virtual void msgGetHistoryStateResponse(int32_t queryNum, bool canGoBack, bool canGoForward);
+ virtual void msgIsEditing(int32_t queryNum, bool isEditing);
+ virtual void msgUrlRedirected(const char* url, const char* userData);
+ virtual void msgMetaViewportSet(double initialScale, double minimumScale, double maximumScale, int32_t width, int32_t height, bool userScalable);
+ virtual void msgHighlightRects(const char* rectsArrayJson);
+ virtual void msgSaveImageAtPointResponse(int32_t queryNum, bool succeeded, const char* filepath);
+ virtual void msgGetImageInfoAtPointResponse(int32_t queryNum, bool succeeded, const char* baseUri, const char* src,
+ const char* title, const char* altText, int32_t width, int32_t height, const char* mimeType);
+ virtual void msgGetElementInfoAtPointResponse(int32_t queryNum, bool succeeded, const char* element, const char* id,
+ const char* name, const char* cname, const char* type, int32_t left, int32_t top, int32_t right, int32_t bottom, bool isEditable);
+ virtual void msgMakePointVisible(int32_t x, int32_t y);
+ virtual void msgIsInteractiveAtPointResponse(int32_t queryNum, bool interactive);
+ virtual void msgCopiedToClipboard();
+ virtual void msgPastedFromClipboard();
+ virtual void msgRemoveSelectionReticle();
+ virtual void msgCopySuccessResponse(int32_t queryNum, bool success);
+ virtual void msgPluginFullscreenSpotlightCreate(int32_t spotlightHandle, int32_t rectX, int32_t rectY, int32_t rectWidth, int32_t rectHeight);
+ virtual void msgPluginFullscreenSpotlightRemove();
+ virtual void msgSpellingWidgetVisibleRectUpdate(int32_t rectX, int32_t rectY, int32_t rectWidth, int32_t rectHeight);
+ virtual void msgHitTestResponse(int32_t queryNum, const char *hitTestResultJson);
virtual void msgAddFlashRects(const char* rectsArrayJson);
virtual void msgRemoveFlashRects(const char* rectsArrayJson);
- virtual void msgShowPrintDialog();
- virtual void msgGetTextCaretBoundsResponse(int32_t queryNum, int32_t left, int32_t top, int32_t right, int32_t bottom);
- virtual void msgUpdateScrollableLayers(const char* json);
-
+ virtual void msgShowPrintDialog();
+ virtual void msgGetTextCaretBoundsResponse(int32_t queryNum, int32_t left, int32_t top, int32_t right, int32_t bottom);
+ virtual void msgUpdateScrollableLayers(const char* json);
+
private:
/* TODO: We should get this from the webkit headers */
enum InteractiveRectType {
@@ -251,9 +253,15 @@ class BrowserAdapter : public BrowserClientBase
};
struct Point {
- Point(int x, int y) { this->x = x; this->y = y; }
+ Point(int x, int y) {
+ this->x = x;
+ this->y = y;
+ }
Point(const Point& rhs) : x(rhs.x), y(rhs.y) {}
- void set(int x, int y) { this->x = x; this->y = y; }
+ void set(int x, int y) {
+ this->x = x;
+ this->y = y;
+ }
bool operator==(const Point& rhs) const {
return x == rhs.x && y == rhs.y;
}
@@ -266,65 +274,65 @@ class BrowserAdapter : public BrowserClientBase
int y;
};
- struct BrowserServerCallArgs {
- BrowserServerCallArgs(int queryNum) : m_queryNum(queryNum) {}
+ struct BrowserServerCallArgs {
+ BrowserServerCallArgs(int queryNum) : m_queryNum(queryNum) {}
virtual ~BrowserServerCallArgs() {}
- int m_queryNum; ///< The query number used to associate the reply with the correct call.
- };
-
- /**
- * We save arguments to inspectUrlAtPoint in this object so that when we receive
- * the response we can handle it properly.
- */
- struct InspectUrlAtPointArgs : public BrowserServerCallArgs {
- int m_x; ///< The orginally supplied X coordinate.
- int m_y; ///< The originally supplied Y coordinate.
- NPObject* m_successCb; ///< The success callback function.
-
- InspectUrlAtPointArgs(int x, int y, NPObject* cb, int queryNum);
- virtual ~InspectUrlAtPointArgs ();
- };
-
- struct GetImageInfoAtPointArgs : public BrowserServerCallArgs {
- int m_x; ///< The orginally supplied X coordinate.
- int m_y; ///< The originally supplied Y coordinate.
- NPObject* m_callback; ///< The success callback function.
-
- GetImageInfoAtPointArgs(int x, int y, NPObject* cb, int queryNum);
- virtual ~GetImageInfoAtPointArgs ();
- };
-
- struct IsInteractiveAtPointArgs : public BrowserServerCallArgs {
- int m_x; ///< The orginally supplied X coordinate.
- int m_y; ///< The originally supplied Y coordinate.
- NPObject* m_callback; ///< The success callback function.
-
- IsInteractiveAtPointArgs(int x, int y, NPObject* cb, int queryNum);
- virtual ~IsInteractiveAtPointArgs ();
- };
-
- struct GetElementInfoAtPointArgs : public BrowserServerCallArgs {
- int m_x; ///< The orginally supplied X coordinate.
- int m_y; ///< The originally supplied Y coordinate.
- NPObject* m_callback; ///< The success callback function.
-
- GetElementInfoAtPointArgs(int x, int y, NPObject* cb, int queryNum);
- virtual ~GetElementInfoAtPointArgs ();
- };
-
- struct GetHistoryStateArgs : public BrowserServerCallArgs {
- NPObject* m_successCb; ///< The success callback function.
-
- GetHistoryStateArgs(NPObject* cb, int queryNum);
- virtual ~GetHistoryStateArgs ();
- };
-
- struct IsEditingArgs : public BrowserServerCallArgs {
- NPObject* m_callback; ///< js callback fired when reply is ready
-
- IsEditingArgs(NPObject* callback, int queryNum);
- virtual ~IsEditingArgs();
- };
+ int m_queryNum; ///< The query number used to associate the reply with the correct call.
+ };
+
+ /**
+ * We save arguments to inspectUrlAtPoint in this object so that when we receive
+ * the response we can handle it properly.
+ */
+ struct InspectUrlAtPointArgs : public BrowserServerCallArgs {
+ int m_x; ///< The orginally supplied X coordinate.
+ int m_y; ///< The originally supplied Y coordinate.
+ NPObject* m_successCb; ///< The success callback function.
+
+ InspectUrlAtPointArgs(int x, int y, NPObject* cb, int queryNum);
+ virtual ~InspectUrlAtPointArgs ();
+ };
+
+ struct GetImageInfoAtPointArgs : public BrowserServerCallArgs {
+ int m_x; ///< The orginally supplied X coordinate.
+ int m_y; ///< The originally supplied Y coordinate.
+ NPObject* m_callback; ///< The success callback function.
+
+ GetImageInfoAtPointArgs(int x, int y, NPObject* cb, int queryNum);
+ virtual ~GetImageInfoAtPointArgs ();
+ };
+
+ struct IsInteractiveAtPointArgs : public BrowserServerCallArgs {
+ int m_x; ///< The orginally supplied X coordinate.
+ int m_y; ///< The originally supplied Y coordinate.
+ NPObject* m_callback; ///< The success callback function.
+
+ IsInteractiveAtPointArgs(int x, int y, NPObject* cb, int queryNum);
+ virtual ~IsInteractiveAtPointArgs ();
+ };
+
+ struct GetElementInfoAtPointArgs : public BrowserServerCallArgs {
+ int m_x; ///< The orginally supplied X coordinate.
+ int m_y; ///< The originally supplied Y coordinate.
+ NPObject* m_callback; ///< The success callback function.
+
+ GetElementInfoAtPointArgs(int x, int y, NPObject* cb, int queryNum);
+ virtual ~GetElementInfoAtPointArgs ();
+ };
+
+ struct GetHistoryStateArgs : public BrowserServerCallArgs {
+ NPObject* m_successCb; ///< The success callback function.
+
+ GetHistoryStateArgs(NPObject* cb, int queryNum);
+ virtual ~GetHistoryStateArgs ();
+ };
+
+ struct IsEditingArgs : public BrowserServerCallArgs {
+ NPObject* m_callback; ///< js callback fired when reply is ready
+
+ IsEditingArgs(NPObject* callback, int queryNum);
+ virtual ~IsEditingArgs();
+ };
struct CopySuccessCallbackArgs : public BrowserServerCallArgs {
NPObject* m_callback; ///< js callback fired when reply is ready
@@ -334,174 +342,174 @@ class BrowserAdapter : public BrowserClientBase
};
struct SaveImageAtPointArgs : public BrowserServerCallArgs {
- int m_x; ///< The orginally supplied X coordinate.
- int m_y; ///< The originally supplied Y coordinate.
- NPObject* m_callback; ///< js callback fired when reply is ready
-
- SaveImageAtPointArgs(int x, int y, NPObject* cb, int queryNum);
- virtual ~SaveImageAtPointArgs();
- };
-
- struct HitTestArgs : public BrowserServerCallArgs {
- const char *m_type;
+ int m_x; ///< The orginally supplied X coordinate.
+ int m_y; ///< The originally supplied Y coordinate.
+ NPObject* m_callback; ///< js callback fired when reply is ready
+
+ SaveImageAtPointArgs(int x, int y, NPObject* cb, int queryNum);
+ virtual ~SaveImageAtPointArgs();
+ };
+
+ struct HitTestArgs : public BrowserServerCallArgs {
+ const char *m_type;
Point m_pt;
- int m_modifiers;
-
- HitTestArgs(const char *type, const Point& pt, int modifiers, int queryNum);
- virtual ~HitTestArgs();
- };
-
- struct GetTextCaretArgs : public BrowserServerCallArgs {
- NPObject *m_callback;
-
- GetTextCaretArgs(NPObject *cb, int queryNum);
- virtual ~GetTextCaretArgs();
- };
-
- struct UrlRedirectInfo {
- std::string re;
- bool redir;
- std::string udata;
- int type;
-
- UrlRedirectInfo( const char* urlRe, bool redirect, const char* userData, int redirectType ) :
- re(urlRe), redir(redirect), udata(userData), type(redirectType) {}
- };
-
- struct SelectionReticleInfo {
- PGSurface* surface;
- GSource* timeoutSource;
- int x;
- int y;
- int centerOffsetX;
- int centerOffsetY;
+ int m_modifiers;
+
+ HitTestArgs(const char *type, const Point& pt, int modifiers, int queryNum);
+ virtual ~HitTestArgs();
+ };
+
+ struct GetTextCaretArgs : public BrowserServerCallArgs {
+ NPObject *m_callback;
+
+ GetTextCaretArgs(NPObject *cb, int queryNum);
+ virtual ~GetTextCaretArgs();
+ };
+
+ struct UrlRedirectInfo {
+ std::string re;
+ bool redir;
+ std::string udata;
+ int type;
+
+ UrlRedirectInfo( const char* urlRe, bool redirect, const char* userData, int redirectType ) :
+ re(urlRe), redir(redirect), udata(userData), type(redirectType) {}
+ };
+
+ struct SelectionReticleInfo {
+ PGSurface* surface;
+ GSource* timeoutSource;
+ int x;
+ int y;
+ int centerOffsetX;
+ int centerOffsetY;
bool show;
- };
-
- /**
- * A collection of arguments that have been used for a call into BrowserServer that we're waiting
- * for a reply on.
- */
- template<typename T>
- class ArgList
- {
- private:
+ };
+
+ /**
+ * A collection of arguments that have been used for a call into BrowserServer that we're waiting
+ * for a reply on.
+ */
+ template<typename T>
+ class ArgList
+ {
+ private:
typedef std::list<T*> myArgList;
- public:
- ~ArgList() {
- typename myArgList::const_iterator i;
- for (i = m_args.begin(); i != m_args.end(); ++i) {
- delete *i;
- }
- }
-
- /**
- * Add an argument object to this list. We now own the pointer.
- */
- void add(T* arg) {
- m_args.push_back(arg);
- }
-
- /**
- * Find an argument object whose query number matches the one provided.
- * <strong>The caller now owns the argument object.</strong>
- */
- T* get(int queryNum) {
- typename myArgList::iterator i;
- for (i = m_args.begin(); i != m_args.end(); ++i) {
- T* args = *i;
- if (args->m_queryNum == queryNum) {
- m_args.erase(i); // Caller now owns this pointer
- return args;
- }
- }
- return NULL; // Not found
- };
-
- private:
- myArgList m_args;
- };
-
- KineticScroller* mScroller;
- PGSurface* mDirtyPattern;
+ public:
+ ~ArgList() {
+ typename myArgList::const_iterator i;
+ for (i = m_args.begin(); i != m_args.end(); ++i) {
+ delete *i;
+ }
+ }
+
+ /**
+ * Add an argument object to this list. We now own the pointer.
+ */
+ void add(T* arg) {
+ m_args.push_back(arg);
+ }
+
+ /**
+ * Find an argument object whose query number matches the one provided.
+ * <strong>The caller now owns the argument object.</strong>
+ */
+ T* get(int queryNum) {
+ typename myArgList::iterator i;
+ for (i = m_args.begin(); i != m_args.end(); ++i) {
+ T* args = *i;
+ if (args->m_queryNum == queryNum) {
+ m_args.erase(i); // Caller now owns this pointer
+ return args;
+ }
+ }
+ return NULL; // Not found
+ };
+
+ private:
+ myArgList m_args;
+ };
+
+ KineticScroller* mScroller;
+ PGSurface* mDirtyPattern;
Point m_pageOffset; // Position of top left corner relative to a Netscape page
Point m_touchPtDoc; // last touch press or touch move point in document coordinates
- // viewport size
- int mViewportWidth;
- int mViewportHeight;
+ // viewport size
+ int mViewportWidth;
+ int mViewportHeight;
- double mZoomLevel;
- bool mZoomFit;
- int mPageWidth;
- int mPageHeight;
- int mContentWidth;
- int mContentHeight;
+ double mZoomLevel;
+ bool mZoomFit;
+ int mPageWidth;
+ int mPageHeight;
+ int mContentWidth;
+ int mContentHeight;
Point mScrollPos;
- bool mInGestureChange;
+ bool mInGestureChange;
- BrowserMetaViewport* mMetaViewport;
- BrowserCenteredZoom* mCenteredZoom;
+ BrowserMetaViewport* mMetaViewport;
+ BrowserCenteredZoom* mCenteredZoom;
- BrowserOffscreen* mOffscreen0;
- BrowserOffscreen* mOffscreen1;
- BrowserOffscreen* mOffscreenCurrent;
+ BrowserOffscreen* mOffscreen0;
+ BrowserOffscreen* mOffscreen1;
+ BrowserOffscreen* mOffscreenCurrent;
- PGSurface* mFrozenSurface;
- bool mFrozen;
+ PGSurface* mFrozenSurface;
+ bool mFrozen;
Point mFrozenRenderPos;
- int mFrozenRenderWidth;
- int mFrozenRenderHeight;
- float mFrozenZoomFactor;
-
- bool m_passInputEvents;
- bool mFirstPaintComplete; ///< Set once the first non-empty paint has been completed.
- bool mEnableJavaScript;
- bool mBlockPopups;
- bool mAcceptCookies;
- bool mShowClickedLink;
-
- int m_defaultLayoutWidth;
-
- bool mBrowserServerConnected; ///< Is this adapter currently connected to the BrowserServer?
- bool mNotifiedOfBrowserServerDisconnect; ///< Has our owner been notified of a BrowserServer disconnect?
-
- bool mSendFinishDocumentLoadNotification; ///< True when load is complete but didFinishDocumentLoad not sent
-
- std::list<UrlRedirectInfo*> m_urlRedirects; ///< an ordered list of URL's to redirect back to the app
-
- int16_t mArgc; ///< Saved copy of argc when adapter is initialized
- char** mArgn; ///< Saved copy of argn when adapter is initialized
- char** mArgv; ///< Saved copy of argv when adapter is initialized
- bool mPaintEnabled;
- bool mInScroll;
- bool bEditorFocused; ///< Is the current page focused.
-
- bool m_useFastScaling;
- double m_startingZoomLevel;
+ int mFrozenRenderWidth;
+ int mFrozenRenderHeight;
+ float mFrozenZoomFactor;
+
+ bool m_passInputEvents;
+ bool mFirstPaintComplete; ///< Set once the first non-empty paint has been completed.
+ bool mEnableJavaScript;
+ bool mBlockPopups;
+ bool mAcceptCookies;
+ bool mShowClickedLink;
+
+ int m_defaultLayoutWidth;
+
+ bool mBrowserServerConnected; ///< Is this adapter currently connected to the BrowserServer?
+ bool mNotifiedOfBrowserServerDisconnect; ///< Has our owner been notified of a BrowserServer disconnect?
+
+ bool mSendFinishDocumentLoadNotification; ///< True when load is complete but didFinishDocumentLoad not sent
+
+ std::list<UrlRedirectInfo*> m_urlRedirects; ///< an ordered list of URL's to redirect back to the app
+
+ int16_t mArgc; ///< Saved copy of argc when adapter is initialized
+ char** mArgn; ///< Saved copy of argn when adapter is initialized
+ char** mArgv; ///< Saved copy of argv when adapter is initialized
+ bool mPaintEnabled;
+ bool mInScroll;
+ bool bEditorFocused; ///< Is the current page focused.
+
+ bool m_useFastScaling;
+ double m_startingZoomLevel;
int32_t mPageIdentifier;
- ArgList<InspectUrlAtPointArgs> m_inspectUrlArgs;
- ArgList<GetHistoryStateArgs> m_historyStateArgs;
- ArgList<IsEditingArgs> m_isEditingArgs;
- ArgList<GetImageInfoAtPointArgs>m_getImageInfoAtPointArgs;
- ArgList<IsInteractiveAtPointArgs>m_isInteractiveAtPointArgs;
- ArgList<SaveImageAtPointArgs> m_saveImageAtPointArgs;
- ArgList<GetElementInfoAtPointArgs> m_getElementInfoAtPointArgs;
- ArgList<CopySuccessCallbackArgs> m_copySuccessCallbackArgs;
- ArgList<HitTestArgs> m_hitTestArgs;
- ArgList<GetTextCaretArgs> m_getTextCaretArgs;
-
- int mBsQueryNum;
- bool m_interrogateClicks;
- int mMouseMode;
- bool mLogAlertMessages;
-
- bool mPageFocused; ///< Is the onwer of this adapter focused?
+ ArgList<InspectUrlAtPointArgs> m_inspectUrlArgs;
+ ArgList<GetHistoryStateArgs> m_historyStateArgs;
+ ArgList<IsEditingArgs> m_isEditingArgs;
+ ArgList<GetImageInfoAtPointArgs>m_getImageInfoAtPointArgs;
+ ArgList<IsInteractiveAtPointArgs>m_isInteractiveAtPointArgs;
+ ArgList<SaveImageAtPointArgs> m_saveImageAtPointArgs;
+ ArgList<GetElementInfoAtPointArgs> m_getElementInfoAtPointArgs;
+ ArgList<CopySuccessCallbackArgs> m_copySuccessCallbackArgs;
+ ArgList<HitTestArgs> m_hitTestArgs;
+ ArgList<GetTextCaretArgs> m_getTextCaretArgs;
+
+ int mBsQueryNum;
+ bool m_interrogateClicks;
+ int mMouseMode;
+ bool mLogAlertMessages;
+
+ bool mPageFocused; ///< Is the onwer of this adapter focused?
bool mServerConnectedInvoked; // has successfully invoked serverConnected
bool mServerConnectedInvoking; // in calling serverConnected
@@ -518,141 +526,143 @@ class BrowserAdapter : public BrowserClientBase
bool mMouseInInteractiveRect;
RectMap mDefaultInteractiveRects;
- BrowserScrollableLayerMap mScrollableLayers;
- BrowserScrollableLayerScrollSession mScrollableLayerScrollSession;
-
+ BrowserScrollableLayerMap mScrollableLayers;
+ BrowserScrollableLayerScrollSession mScrollableLayerScrollSession;
+
SelectionReticleInfo mSelectionReticle;
-
+
static gboolean removeSelectionReticleCallback(gpointer arg);
- // the highlight area (mouse, gesture are directly send to it)
- int m_spotlightHandle;
- int m_spotlightAlpha; // 0~ 255
- BrowserRect m_spotlightRect;
-
- pbnjson::JSchemaFile m_hitTestSchema;
-
- bool init();
- bool initializeIpcBuffer();
- void setDefaultViewportSize();
- void sendStateToServer();
-
- // gesture handling
- void doGestureStart(int cx, int cy, float scale, float rotate, int center_x, int center_y);
- void doGestureChange(int cx, int cy, float scale, float rotate, int center_x, int center_y, bool isGestureEnd=false);
- void doGestureEnd(int cx, int cy, float scale, float rotate, int center_x, int center_y);
-
- void sendGestureStart(int cx, int cy, float scale, float rotate, int center_x, int center_y);
- void sendGestureChange(int cx, int cy, float scale, float rotate, int center_x, int center_y);
- void sendGestureEnd(int cx, int cy, float scale, float rotate, int center_x, int center_y);
- void sendSingleTap(int cx, int cy, int modifiers);
-
- // touch handling
- bool doTouchEvent(int32_t type, NpPalmTouchEvent *event);
-
- static BrowserAdapter* GetAndInitAdapter( AdapterBase* adapter );
- static void addJsonProperty(struct json_value* root, const char* name, const char* value);
- static void addJsonProperty(struct json_value* root, const char* name, int32_t value);
- static void addJsonProperty(struct json_value* root, const char* name, bool value);
- static int readPngFile(const char* pszFileName, uint32_t* &pPixelData, int &nImageWidth, int &nImageHeight);
- static int readPngFile(const char* pszFileName, PContext2D& context, PPixmap* &pPixmap,
- int &nImageWidth, int &nImageHeight);
- static int preScaleImage(PPixmap* pPixmap, int nImageWidth, int nImageHeight);
- static int writePngFile(const char* pszFileName, const uint32_t* pPixelData, int nImageWidth, int nImageHeight);
- static bool isSafeDir(const char* pszFileName);
- bool prvSmartZoom(const Point& pt);
- void invalidate(void);
- void handlePaintInFrozenState(NpPalmDrawEvent* event);
-
- void scale(double zoom);
- void scaleAndScrollTo(double zoom, int x, int y);
+ // the highlight area (mouse, gesture are directly send to it)
+ int m_spotlightHandle;
+ int m_spotlightAlpha; // 0~ 255
+ BrowserRect m_spotlightRect;
+
+ pbnjson::JSchemaFile m_hitTestSchema;
+
+ bool init();
+ bool initializeIpcBuffer();
+ void setDefaultViewportSize();
+ void sendStateToServer();
+
+ // gesture handling
+ void doGestureStart(int cx, int cy, float scale, float rotate, int center_x, int center_y);
+ void doGestureChange(int cx, int cy, float scale, float rotate, int center_x, int center_y, bool isGestureEnd=false);
+ void doGestureEnd(int cx, int cy, float scale, float rotate, int center_x, int center_y);
+
+ void sendGestureStart(int cx, int cy, float scale, float rotate, int center_x, int center_y);
+ void sendGestureChange(int cx, int cy, float scale, float rotate, int center_x, int center_y);
+ void sendGestureEnd(int cx, int cy, float scale, float rotate, int center_x, int center_y);
+ void sendSingleTap(int cx, int cy, int modifiers);
+
+ // touch handling
+ bool doTouchEvent(int32_t type, NpPalmTouchEvent *event);
+
+ static BrowserAdapter* GetAndInitAdapter( AdapterBase* adapter );
+ static void addJsonProperty(struct json_value* root, const char* name, const char* value);
+ static void addJsonProperty(struct json_value* root, const char* name, int32_t value);
+ static void addJsonProperty(struct json_value* root, const char* name, bool value);
+ static int readPngFile(const char* pszFileName, uint32_t* &pPixelData, int &nImageWidth, int &nImageHeight);
+ static int readPngFile(const char* pszFileName, PContext2D& context, PPixmap* &pPixmap,
+ int &nImageWidth, int &nImageHeight);
+ static int preScaleImage(PPixmap* pPixmap, int nImageWidth, int nImageHeight);
+ static int writePngFile(const char* pszFileName, const uint32_t* pPixelData, int nImageWidth, int nImageHeight);
+ static bool isSafeDir(const char* pszFileName);
+ bool prvSmartZoom(const Point& pt);
+ void invalidate(void);
+ void handlePaintInFrozenState(NpPalmDrawEvent* event);
+
+ void scale(double zoom);
+ void scaleAndScrollTo(double zoom, int x, int y);
void fireScrolledToEvent(int x, int y);
- bool isActivated();
+ bool isActivated();
void setPageIdentifier(int32_t identifier);
- void enableFastScaling(bool enable);
+ void enableFastScaling(bool enable);
- int showHighlight(PGContext* gc);
- void removeHighlight();
- void invalidateHighlightRectsRegion();
+ int showHighlight(PGContext* gc);
+ void removeHighlight();
+ void invalidateHighlightRectsRegion();
- void updateMouseInFlashStatus(bool inFlashRect);
- void updateFlashGestureLockStatus(bool gestureLockEnabled);
- bool flashRectContainsPoint(const Point& pt);
- bool rectContainsPoint(RectMap &rectMap, const Point& pt);
- void updateMouseInInteractiveStatus(bool inInteractiveRect);
- bool interactiveRectContainsPoint(const Point& pt);
- void jsonToRects(const char* rectsArrayJson);
+ void updateMouseInFlashStatus(bool inFlashRect);
+ void updateFlashGestureLockStatus(bool gestureLockEnabled);
+ bool flashRectContainsPoint(const Point& pt);
+ bool rectContainsPoint(RectMap &rectMap, const Point& pt);
+ void updateMouseInInteractiveStatus(bool inInteractiveRect);
+ bool interactiveRectContainsPoint(const Point& pt);
+ void jsonToRects(const char* rectsArrayJson);
- bool detectScrollableLayerUnderMouseDown(const Point& pagePt, const Point& mousePt);
- bool scrollLayerUnderMouse(const Point& currentMousePtDoc);
- void resetScrollableLayerScrollSession();
- void showActiveScrollableLayer(PGContext* gc);
+ bool detectScrollableLayerUnderMouseDown(const Point& pagePt, const Point& mousePt);
+ bool scrollLayerUnderMouse(const Point& currentMousePtDoc);
+ void resetScrollableLayerScrollSession();
+ void showActiveScrollableLayer(PGContext* gc);
- // used to create a scrim around a plugin rectangle "spotlight"
- int showSpotlight(PGContext* gc);
+ // used to create a scrim around a plugin rectangle "spotlight"
+ int showSpotlight(PGContext* gc);
- void initSelectionReticleSurface();
- void showSelectionReticle(PGContext* gc);
- void invalidateSelectionReticleRegion();
+ void initSelectionReticleSurface();
+ void showSelectionReticle(PGContext* gc);
+ void invalidateSelectionReticleRegion();
- bool sendRequestOffscreenChange(bool sync, int asyncDelayMillis);
+ bool sendRequestOffscreenChange(bool sync, int asyncDelayMillis);
bool isPointInList(const Point &point, const NpPalmTouchList &list);
- bool shouldPassInputEvents();
- bool shouldPassTouchEvents();
+ bool shouldPassInputEvents();
+ bool shouldPassTouchEvents();
- struct timeval m_lastPassedEventTime;
+ struct timeval m_lastPassedEventTime;
- unsigned long long m_ft;
+ unsigned long long m_ft;
- void scrollCaretIntoViewAfterResize(int oldwidth, int oldheight, double oldZoomLevel);
- BrowserRect m_textCaretRect;
+ void scrollCaretIntoViewAfterResize(int oldwidth, int oldheight, double oldZoomLevel);
+ BrowserRect m_textCaretRect;
Point m_clickPt; ///< Point where mouse clicked (minus header)
Point m_penDownDoc; ///< Mouse down location in scaled document coordinates
- bool m_dragging;
- bool m_didDrag;
- bool m_didHold;
- bool m_sentToBS;
-
- GSource *m_clickTimerSource;
- static gboolean clickTimeoutCb(gpointer data);
- void startClickTimer();
- void stopClickTimer();
-
- GSource *m_mouseHoldTimerSource;
- static gboolean mouseHoldTimeoutCb(gpointer data);
- void startMouseHoldTimer();
- void stopMouseHoldTimer();
-
- struct SentMouseHoldEvent {
- SentMouseHoldEvent() : pt(0,0), sent(false) {}
- void reset() { sent = false; }
- void set(int cx, int cy)
- {
+ bool m_dragging;
+ bool m_didDrag;
+ bool m_didHold;
+ bool m_sentToBS;
+
+ GSource *m_clickTimerSource;
+ static gboolean clickTimeoutCb(gpointer data);
+ void startClickTimer();
+ void stopClickTimer();
+
+ GSource *m_mouseHoldTimerSource;
+ static gboolean mouseHoldTimeoutCb(gpointer data);
+ void startMouseHoldTimer();
+ void stopMouseHoldTimer();
+
+ struct SentMouseHoldEvent {
+ SentMouseHoldEvent() : pt(0,0), sent(false) {}
+ void reset() {
+ sent = false;
+ }
+ void set(int cx, int cy)
+ {
pt.set(cx, cy);
- sent = true;
- }
+ sent = true;
+ }
Point pt;
- bool sent;
- };
- SentMouseHoldEvent m_sentMouseHoldEvent;
-
- GSource *m_zoomTimerSource;
- static gboolean zoomTimerTimeoutCb(gpointer data);
- bool animateZoom();
- void startZoomAnimation(double zoom, int x, int y);
- void stopZoomAnimation();
+ bool sent;
+ };
+ SentMouseHoldEvent m_sentMouseHoldEvent;
+
+ GSource *m_zoomTimerSource;
+ static gboolean zoomTimerTimeoutCb(gpointer data);
+ bool animateZoom();
+ void startZoomAnimation(double zoom, int x, int y);
+ void stopZoomAnimation();
Point m_zoomPt;
- double m_zoomTarget;
- int m_zoomXInterval;
- int m_zoomYInterval;
- double m_zoomLevelInterval;
+ double m_zoomTarget;
+ int m_zoomXInterval;
+ int m_zoomYInterval;
+ double m_zoomLevelInterval;
int m_headerHeight; ///< Height (in pixels) of the header which is a space above the page we don't draw.
void showScrollbar();
@@ -663,30 +673,30 @@ class BrowserAdapter : public BrowserClientBase
int mScrollbarOpacity;
GSource* mScrollbarFadeSource;
- struct RecordedGestureEntry {
- RecordedGestureEntry(float s, float r, int cX, int cY)
- : scale(s)
- , rotate(r)
- , centerX(cX)
- , centerY(cY) {
- }
+ struct RecordedGestureEntry {
+ RecordedGestureEntry(float s, float r, int cX, int cY)
+ : scale(s)
+ , rotate(r)
+ , centerX(cX)
+ , centerY(cY) {
+ }
- float scale;
- float rotate;
- int centerX;
- int centerY;
- };
+ float scale;
+ float rotate;
+ int centerX;
+ int centerY;
+ };
- std::list<RecordedGestureEntry> m_recordedGestures;
+ std::list<RecordedGestureEntry> m_recordedGestures;
- void recordGesture(float s, float r, int cX, int cY);
- RecordedGestureEntry getAveragedGesture() const;
+ void recordGesture(float s, float r, int cX, int cY);
+ RecordedGestureEntry getAveragedGesture() const;
bool destroyBufferLock();
bool createBufferLock();
sem_t* m_bufferLock;
char* m_bufferLockName;
- friend class BrowserAdapterData;
+ friend class BrowserAdapterData;
};
View
76 BrowserAdapterManager.cpp
@@ -22,77 +22,77 @@ LICENSE@@@ */
BrowserAdapterManager* BrowserAdapterManager::instance()
{
- static BrowserAdapterManager* s_instance = 0;
- if (G_UNLIKELY(s_instance == 0)) {
+ static BrowserAdapterManager* s_instance = 0;
+ if (G_UNLIKELY(s_instance == 0)) {
- s_instance = new BrowserAdapterManager;
- }
+ s_instance = new BrowserAdapterManager;
+ }
- return s_instance;
+ return s_instance;
}
BrowserAdapterManager::BrowserAdapterManager()
- : m_adapterList(0)
+ : m_adapterList(0)
{
}
BrowserAdapterManager::~BrowserAdapterManager()
{
- g_list_free(m_adapterList);
+ g_list_free(m_adapterList);
}
void BrowserAdapterManager::registerAdapter(BrowserAdapter* adapter)
{
- m_adapterList = g_list_prepend(m_adapterList, adapter);
+ m_adapterList = g_list_prepend(m_adapterList, adapter);
}
void BrowserAdapterManager::unregisterAdapter(BrowserAdapter* adapter)
{
- m_adapterList = g_list_remove(m_adapterList, adapter);
+ m_adapterList = g_list_remove(m_adapterList, adapter);
}
void BrowserAdapterManager::adapterActivated(BrowserAdapter* adapter, bool activated)
{
- if (activated) {
+ if (activated) {
- GList* head = g_list_first(m_adapterList);
+ GList* head = g_list_first(m_adapterList);
if (head && head->data != adapter) {
- m_adapterList = g_list_remove(m_adapterList, adapter);
- m_adapterList = g_list_prepend(m_adapterList, adapter);
- }
+ m_adapterList = g_list_remove(m_adapterList, adapter);
+ m_adapterList = g_list_prepend(m_adapterList, adapter);
+ }
- // Freeze all the other adapters and thaw this one
- for (GList* iter = g_list_first(m_adapterList); iter; iter = g_list_next(iter)) {
+ // Freeze all the other adapters and thaw this one
+ for (GList* iter = g_list_first(m_adapterList); iter; iter = g_list_next(iter)) {
- BrowserAdapter* a = (BrowserAdapter*) iter->data;
- if (a == adapter)
- continue;
+ BrowserAdapter* a = (BrowserAdapter*) iter->data;
+ if (a == adapter)
+ continue;
- a->freeze();
- }
+ a->freeze();
+ }
- adapter->thaw();
- }
-/*
- // if we are really concerned about memory we should enable this
- else {
- adapter->freeze();
- }
-*/
+ adapter->thaw();
+ }
+ /*
+ // if we are really concerned about memory we should enable this
+ else {
+ adapter->freeze();
+ }
+ */
}
void BrowserAdapterManager::inactiveAdaptersActivate()
{
- for (GList* iter = g_list_first(m_adapterList); iter; iter = g_list_next(iter)) {
+ for (GList* iter = g_list_first(m_adapterList); iter; iter = g_list_next(iter)) {
- BrowserAdapter* a = (BrowserAdapter*) iter->data;
- //thaw the first frozen adapter that is encountered
- if(a->isFrozen()){
-
- a->thaw();
- break;
- }
+ BrowserAdapter* a = (BrowserAdapter*) iter->data;
+ //thaw the first frozen adapter that is encountered
+ if(a->isFrozen()) {
- }
+ a->thaw();
+ break;
+ }
+
+ }
}
View
20 BrowserAdapterManager.h
@@ -27,21 +27,21 @@ class BrowserAdapterManager
{
public:
- static BrowserAdapterManager* instance();
+ static BrowserAdapterManager* instance();
+
+ void registerAdapter(BrowserAdapter* adapter);
+ void unregisterAdapter(BrowserAdapter* adapter);
+ void adapterActivated(BrowserAdapter* adapter, bool activated);
+ void inactiveAdaptersActivate();
- void registerAdapter(BrowserAdapter* adapter);
- void unregisterAdapter(BrowserAdapter* adapter);
- void adapterActivated(BrowserAdapter* adapter, bool activated);
- void inactiveAdaptersActivate();
-
private:
- BrowserAdapterManager();
- ~BrowserAdapterManager();
+ BrowserAdapterManager();
+ ~BrowserAdapterManager();
private:
-
- GList* m_adapterList;
+
+ GList* m_adapterList;
};
View
12 BrowserCenteredZoom.h
@@ -21,12 +21,12 @@ LICENSE@@@ */
struct BrowserCenteredZoom
{
- double scale;
- int centerX;
- int centerY;
- int scrollX;
- int scrollY;
- double zoomLevel;
+ double scale;
+ int centerX;
+ int centerY;
+ int scrollX;
+ int scrollY;
+ double zoomLevel;
};
#endif /* BROWSERCENTEREDZOOM_H */
View
3,092 BrowserClientBase.cpp
@@ -1,4 +1,4 @@
-// This file is autogenerated from YapCodeGen. Do not Edit
+// This file is autogenerated from YapCodeGen. Do not Edit
#include <stdlib.h>
#include <stdio.h>
@@ -9,2117 +9,2117 @@
void BrowserClientBase::syncCmdRenderToFile(const char* filename, int32_t viewX, int32_t viewY, int32_t viewW, int32_t viewH, int32_t& result)
{
- YapPacket* cmd = packetCommand();
- YapPacket* reply = packetReply();
- (*cmd) << (int16_t) 0x0014; // RenderToFile
- (*cmd) << filename;
- (*cmd) << viewX;
- (*cmd) << viewY;
- (*cmd) << viewW;
- (*cmd) << viewH;
- sendSyncCommand();
- (*reply) >> result;
+ YapPacket* cmd = packetCommand();
+ YapPacket* reply = packetReply();
+ (*cmd) << (int16_t) 0x0014; // RenderToFile
+ (*cmd) << filename;
+ (*cmd) << viewX;
+ (*cmd) << viewY;
+ (*cmd) << viewW;
+ (*cmd) << viewH;
+ sendSyncCommand();
+ (*reply) >> result;
}
void BrowserClientBase::asyncCmdConnect(int32_t pageWidth, int32_t pageHeight, int32_t sharedBufferKey1, int32_t sharedBufferKey2, int32_t sharedBufferSize, int32_t identifier)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1000; // Connect
- (*_cmd) << pageWidth;
- (*_cmd) << pageHeight;
- (*_cmd) << sharedBufferKey1;
- (*_cmd) << sharedBufferKey2;
- (*_cmd) << sharedBufferSize;
- (*_cmd) << identifier;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1000; // Connect
+ (*_cmd) << pageWidth;
+ (*_cmd) << pageHeight;
+ (*_cmd) << sharedBufferKey1;
+ (*_cmd) << sharedBufferKey2;
+ (*_cmd) << sharedBufferSize;
+ (*_cmd) << identifier;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetWindowSize(int32_t width, int32_t height)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1001; // SetWindowSize
- (*_cmd) << width;
- (*_cmd) << height;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1001; // SetWindowSize
+ (*_cmd) << width;
+ (*_cmd) << height;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetUserAgent(const char* userAgent)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1003; // SetUserAgent
- (*_cmd) << userAgent;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1003; // SetUserAgent
+ (*_cmd) << userAgent;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdOpenUrl(const char* url)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1004; // OpenUrl
- (*_cmd) << url;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1004; // OpenUrl
+ (*_cmd) << url;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetHtml(const char* url, const char* body)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1005; // SetHtml
- (*_cmd) << url;
- (*_cmd) << body;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1005; // SetHtml
+ (*_cmd) << url;
+ (*_cmd) << body;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdClickAt(int32_t contentX, int32_t contentY, int32_t numClicks, int32_t counter)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1007; // ClickAt
- (*_cmd) << contentX;
- (*_cmd) << contentY;
- (*_cmd) << numClicks;
- (*_cmd) << counter;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1007; // ClickAt
+ (*_cmd) << contentX;
+ (*_cmd) << contentY;
+ (*_cmd) << numClicks;
+ (*_cmd) << counter;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdKeyDown(uint16_t key, uint16_t modifiers)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1008; // KeyDown
- (*_cmd) << key;
- (*_cmd) << modifiers;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1008; // KeyDown
+ (*_cmd) << key;
+ (*_cmd) << modifiers;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdKeyUp(uint16_t key, uint16_t modifiers)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1009; // KeyUp
- (*_cmd) << key;
- (*_cmd) << modifiers;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1009; // KeyUp
+ (*_cmd) << key;
+ (*_cmd) << modifiers;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdForward()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x100A; // Forward
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x100A; // Forward
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdBack()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x100B; // Back
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x100B; // Back
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdReload()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x100C; // Reload
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x100C; // Reload
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdStop()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x100D; // Stop
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x100D; // Stop
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdPageFocused(bool focused)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1010; // PageFocused
- (*_cmd) << focused;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1010; // PageFocused
+ (*_cmd) << focused;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdExit()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1011; // Exit
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1011; // Exit
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdCancelDownload(const char* url)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1015; // CancelDownload
- (*_cmd) << url;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1015; // CancelDownload
+ (*_cmd) << url;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdInterrogateClicks(bool enable)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1016; // InterrogateClicks
- (*_cmd) << enable;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1016; // InterrogateClicks
+ (*_cmd) << enable;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdZoomSmartCalculateRequest(int32_t pointX, int32_t pointY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1017; // ZoomSmartCalculateRequest
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1017; // ZoomSmartCalculateRequest
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdDragStart(int32_t contentX, int32_t contentY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x101A; // DragStart
- (*_cmd) << contentX;
- (*_cmd) << contentY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x101A; // DragStart
+ (*_cmd) << contentX;
+ (*_cmd) << contentY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdDragProcess(int32_t deltaX, int32_t deltaY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x101B; // DragProcess
- (*_cmd) << deltaX;
- (*_cmd) << deltaY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x101B; // DragProcess
+ (*_cmd) << deltaX;
+ (*_cmd) << deltaY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdDragEnd(int32_t contentX, int32_t contentY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x101C; // DragEnd
- (*_cmd) << contentX;
- (*_cmd) << contentY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x101C; // DragEnd
+ (*_cmd) << contentX;
+ (*_cmd) << contentY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetMinFontSize(int32_t minFontSizePt)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1103; // SetMinFontSize
- (*_cmd) << minFontSizePt;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1103; // SetMinFontSize
+ (*_cmd) << minFontSizePt;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdFindString(const char* str, bool fwd)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1104; // FindString
- (*_cmd) << str;
- (*_cmd) << fwd;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1104; // FindString
+ (*_cmd) << str;
+ (*_cmd) << fwd;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdClearSelection()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1105; // ClearSelection
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1105; // ClearSelection
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdClearCache()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1106; // ClearCache
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1106; // ClearCache
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdClearCookies()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1107; // ClearCookies
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1107; // ClearCookies
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdPopupMenuSelect(const char* identifier, int32_t selectedIdx)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1108; // PopupMenuSelect
- (*_cmd) << identifier;
- (*_cmd) << selectedIdx;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1108; // PopupMenuSelect
+ (*_cmd) << identifier;
+ (*_cmd) << selectedIdx;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetEnableJavaScript(bool enable)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1109; // SetEnableJavaScript
- (*_cmd) << enable;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1109; // SetEnableJavaScript
+ (*_cmd) << enable;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetBlockPopups(bool enable)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x110A; // SetBlockPopups
- (*_cmd) << enable;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x110A; // SetBlockPopups
+ (*_cmd) << enable;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetAcceptCookies(bool enable)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x110B; // SetAcceptCookies
- (*_cmd) << enable;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x110B; // SetAcceptCookies
+ (*_cmd) << enable;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdMouseEvent(int32_t type, int32_t contentX, int32_t contentY, int32_t detail)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x110C; // MouseEvent
- (*_cmd) << type;
- (*_cmd) << contentX;
- (*_cmd) << contentY;
- (*_cmd) << detail;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x110C; // MouseEvent
+ (*_cmd) << type;
+ (*_cmd) << contentX;
+ (*_cmd) << contentY;
+ (*_cmd) << detail;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdGestureEvent(int32_t type, int32_t contentX, int32_t contentY, double scale, double rotate, int32_t centerX, int32_t centerY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x110D; // GestureEvent
- (*_cmd) << type;
- (*_cmd) << contentX;
- (*_cmd) << contentY;
- (*_cmd) << scale;
- (*_cmd) << rotate;
- (*_cmd) << centerX;
- (*_cmd) << centerY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x110D; // GestureEvent
+ (*_cmd) << type;
+ (*_cmd) << contentX;
+ (*_cmd) << contentY;
+ (*_cmd) << scale;
+ (*_cmd) << rotate;
+ (*_cmd) << centerX;
+ (*_cmd) << centerY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdDisconnect()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x110E; // Disconnect
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x110E; // Disconnect
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdInspectUrlAtPoint(int32_t queryNum, int32_t pointX, int32_t pointY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x110F; // InspectUrlAtPoint
- (*_cmd) << queryNum;
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x110F; // InspectUrlAtPoint
+ (*_cmd) << queryNum;
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdGetHistoryState(int32_t queryNum)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1111; // GetHistoryState
- (*_cmd) << queryNum;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1111; // GetHistoryState
+ (*_cmd) << queryNum;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdClearHistory()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1112; // ClearHistory
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1112; // ClearHistory
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetAppIdentifier(const char* identifier)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1113; // SetAppIdentifier
- (*_cmd) << identifier;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1113; // SetAppIdentifier
+ (*_cmd) << identifier;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdAddUrlRedirect(const char* urlRe, int32_t type, bool redirect, const char* userData)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1114; // AddUrlRedirect
- (*_cmd) << urlRe;
- (*_cmd) << type;
- (*_cmd) << redirect;
- (*_cmd) << userData;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1114; // AddUrlRedirect
+ (*_cmd) << urlRe;
+ (*_cmd) << type;
+ (*_cmd) << redirect;
+ (*_cmd) << userData;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetShowClickedLink(bool enable)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1115; // SetShowClickedLink
- (*_cmd) << enable;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1115; // SetShowClickedLink
+ (*_cmd) << enable;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdGetInteractiveNodeRects(int32_t pointX, int32_t pointY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1116; // GetInteractiveNodeRects
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1116; // GetInteractiveNodeRects
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdIsEditing(int32_t queryNum)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1117; // IsEditing
- (*_cmd) << queryNum;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1117; // IsEditing
+ (*_cmd) << queryNum;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdInsertStringAtCursor(const char* text)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1118; // InsertStringAtCursor
- (*_cmd) << text;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1118; // InsertStringAtCursor
+ (*_cmd) << text;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdEnableSelection(int32_t pointX, int32_t pointY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1119; // EnableSelection
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1119; // EnableSelection
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdDisableSelection()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x111A; // DisableSelection
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x111A; // DisableSelection
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSaveImageAtPoint(int32_t queryNum, int32_t pointX, int32_t pointY, const char* dstDir)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x111B; // SaveImageAtPoint
- (*_cmd) << queryNum;
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- (*_cmd) << dstDir;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x111B; // SaveImageAtPoint
+ (*_cmd) << queryNum;
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ (*_cmd) << dstDir;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdGetImageInfoAtPoint(int32_t queryNum, int32_t pointX, int32_t pointY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x111C; // GetImageInfoAtPoint
- (*_cmd) << queryNum;
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x111C; // GetImageInfoAtPoint
+ (*_cmd) << queryNum;
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdIsInteractiveAtPoint(int32_t queryNum, int32_t pointX, int32_t pointY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x111D; // IsInteractiveAtPoint
- (*_cmd) << queryNum;
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x111D; // IsInteractiveAtPoint
+ (*_cmd) << queryNum;
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdGetElementInfoAtPoint(int32_t queryNum, int32_t pointX, int32_t pointY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x111E; // GetElementInfoAtPoint
- (*_cmd) << queryNum;
- (*_cmd) << pointX;
- (*_cmd) << pointY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x111E; // GetElementInfoAtPoint
+ (*_cmd) << queryNum;
+ (*_cmd) << pointX;
+ (*_cmd) << pointY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSelectAll()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x111F; // SelectAll
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x111F; // SelectAll
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdCopy(int32_t queryNum)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1120; // Copy
- (*_cmd) << queryNum;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1120; // Copy
+ (*_cmd) << queryNum;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdPaste()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1121; // Paste
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1121; // Paste
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdCut()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1122; // Cut
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1122; // Cut
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetMouseMode(int32_t mode)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1123; // SetMouseMode
- (*_cmd) << mode;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1123; // SetMouseMode
+ (*_cmd) << mode;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdDisableEnhancedViewport(bool disable)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1124; // DisableEnhancedViewport
- (*_cmd) << disable;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1124; // DisableEnhancedViewport
+ (*_cmd) << disable;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdIgnoreMetaTags(bool ignore)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1125; // IgnoreMetaTags
- (*_cmd) << ignore;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1125; // IgnoreMetaTags
+ (*_cmd) << ignore;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetScrollPosition(int32_t cx, int32_t cy, int32_t cw, int32_t ch)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1500; // SetScrollPosition
- (*_cmd) << cx;
- (*_cmd) << cy;
- (*_cmd) << cw;
- (*_cmd) << ch;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1500; // SetScrollPosition
+ (*_cmd) << cx;
+ (*_cmd) << cy;
+ (*_cmd) << cw;
+ (*_cmd) << ch;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdPluginSpotlightStart(int32_t cx, int32_t cy, int32_t cw, int32_t ch)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1501; // PluginSpotlightStart
- (*_cmd) << cx;
- (*_cmd) << cy;
- (*_cmd) << cw;
- (*_cmd) << ch;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1501; // PluginSpotlightStart
+ (*_cmd) << cx;
+ (*_cmd) << cy;
+ (*_cmd) << cw;
+ (*_cmd) << ch;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdPluginSpotlightEnd()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1502; // PluginSpotlightEnd
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1502; // PluginSpotlightEnd
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdHideSpellingWidget()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1503; // HideSpellingWidget
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1503; // HideSpellingWidget
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetNetworkInterface(const char* interfaceName)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1504; // SetNetworkInterface
- (*_cmd) << interfaceName;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1504; // SetNetworkInterface
+ (*_cmd) << interfaceName;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdHitTest(int32_t queryNum, int32_t cx, int32_t cy)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1505; // HitTest
- (*_cmd) << queryNum;
- (*_cmd) << cx;
- (*_cmd) << cy;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1505; // HitTest
+ (*_cmd) << queryNum;
+ (*_cmd) << cx;
+ (*_cmd) << cy;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetVirtualWindowSize(int32_t width, int32_t height)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1506; // SetVirtualWindowSize
- (*_cmd) << width;
- (*_cmd) << height;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1506; // SetVirtualWindowSize
+ (*_cmd) << width;
+ (*_cmd) << height;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdPrintFrame(const char* frameName, int32_t lpsJobId, int32_t width, int32_t height, int32_t dpi, bool landscape, bool reverseOrder)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1507; // PrintFrame
- (*_cmd) << frameName;
- (*_cmd) << lpsJobId;
- (*_cmd) << width;
- (*_cmd) << height;
- (*_cmd) << dpi;
- (*_cmd) << landscape;
- (*_cmd) << reverseOrder;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1507; // PrintFrame
+ (*_cmd) << frameName;
+ (*_cmd) << lpsJobId;
+ (*_cmd) << width;
+ (*_cmd) << height;
+ (*_cmd) << dpi;
+ (*_cmd) << landscape;
+ (*_cmd) << reverseOrder;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdTouchEvent(int32_t type, int32_t touchCount, int32_t modifiers, const char* touchesJson)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1508; // TouchEvent
- (*_cmd) << type;
- (*_cmd) << touchCount;
- (*_cmd) << modifiers;
- (*_cmd) << touchesJson;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1508; // TouchEvent
+ (*_cmd) << type;
+ (*_cmd) << touchCount;
+ (*_cmd) << modifiers;
+ (*_cmd) << touchesJson;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdHoldAt(int32_t contentX, int32_t contentY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1509; // HoldAt
- (*_cmd) << contentX;
- (*_cmd) << contentY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1509; // HoldAt
+ (*_cmd) << contentX;
+ (*_cmd) << contentY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdGetTextCaretBounds(int32_t queryNum)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x150a; // GetTextCaretBounds
- (*_cmd) << queryNum;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x150a; // GetTextCaretBounds
+ (*_cmd) << queryNum;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdFreeze()
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x150b; // Freeze
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x150b; // Freeze
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdThaw(int32_t sharedBufferKey1, int32_t sharedBufferKey2, int32_t sharedBufferSize)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x150c; // Thaw
- (*_cmd) << sharedBufferKey1;
- (*_cmd) << sharedBufferKey2;
- (*_cmd) << sharedBufferSize;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x150c; // Thaw
+ (*_cmd) << sharedBufferKey1;
+ (*_cmd) << sharedBufferKey2;
+ (*_cmd) << sharedBufferSize;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdReturnBuffer(int32_t sharedBufferKey)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x150d; // ReturnBuffer
- (*_cmd) << sharedBufferKey;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x150d; // ReturnBuffer
+ (*_cmd) << sharedBufferKey;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetZoomAndScroll(double zoom, int32_t cx, int32_t cy)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x150e; // SetZoomAndScroll
- (*_cmd) << zoom;
- (*_cmd) << cx;
- (*_cmd) << cy;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x150e; // SetZoomAndScroll
+ (*_cmd) << zoom;
+ (*_cmd) << cx;
+ (*_cmd) << cy;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdScrollLayer(int32_t id, int32_t deltaX, int32_t deltaY)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x150f; // ScrollLayer
- (*_cmd) << id;
- (*_cmd) << deltaX;
- (*_cmd) << deltaY;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x150f; // ScrollLayer
+ (*_cmd) << id;
+ (*_cmd) << deltaX;
+ (*_cmd) << deltaY;
+ sendAsyncCommand();
}
void BrowserClientBase::asyncCmdSetDNSServers(const char* servers)
{
- YapPacket* _cmd = packetCommand();
- (*_cmd) << (int16_t) 0x1510; // SetDNSServers
- (*_cmd) << servers;
- sendAsyncCommand();
+ YapPacket* _cmd = packetCommand();
+ (*_cmd) << (int16_t) 0x1510; // SetDNSServers
+ (*_cmd) << servers;
+ sendAsyncCommand();
}
bool BrowserClientBase::sendRawCmd(const char* rawCmd)
{
- gchar** strSplit = g_strsplit(rawCmd, " ", 0);
+ gchar** strSplit = g_strsplit(rawCmd, " ", 0);
- int argCount = 0;
- while (strSplit[argCount] != 0) argCount++;
- if (argCount == 0) return false;
+ int argCount = 0;
+ while (strSplit[argCount] != 0) argCount++;
+ if (argCount == 0) return false;
- bool matched = false;
+ bool matched = false;
- if (!matched && (strcmp(strSplit[0], "Connect") == 0)) {
- if ((argCount - 1) < 6) return false;
- matched = true;
+ if (!matched && (strcmp(strSplit[0], "Connect") == 0)) {
+ if ((argCount - 1) < 6) return false;
+ matched = true;
- int32_t pageWidth = atol(strSplit[1]);
- int32_t pageHeight = atol(strSplit[2]);
- int32_t sharedBufferKey1 = atol(strSplit[3]);
- int32_t sharedBufferKey2 = atol(strSplit[4]);
- int32_t sharedBufferSize = atol(strSplit[5]);
- int32_t identifier = atol(strSplit[6]);
+ int32_t pageWidth = atol(strSplit[1]);
+ int32_t pageHeight = atol(strSplit[