api web browser v2

Upload: elizabeth-rodriguez

Post on 10-Feb-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/22/2019 API Web Browser V2

    1/31

    EUROGICIEL Ingnierie

    WaylandWeb Browser

    Widi MiracastVersion: 2.0

  • 7/22/2019 API Web Browser V2

    2/31

    Your contactsYour contacts

    All information and additional information can be obtained from the following person:

    COMMERCIAL

    Patrick LEPRINCE is Responsible for the contractual and financialaspects.He has the authority to negotiate the financial terms with the Client.Phone : +33 (0)6 13 18 07 41Fax : +33 (0)2 51 13 94 38E-mail : [email protected]

    06.13.18.07.41

    02.51.13.94.38

    [email protected]

    TECH NIQUAL LEADERJulien LE METAYER technical leader for Eurogiciel west

    02.28.23.20.25

    02.51.13.94.38

    [email protected]

    QUALITY INSURANCECatherine SACCOCCINI is Responsible for quality insurance.

    05.61.00.79.96

    05.61.39.01.15

    [email protected]

    mailto:[email protected]:[email protected]:[email protected]:[email protected]
  • 7/22/2019 API Web Browser V2

    3/31

    SOMMAIRESOMMAIRE

    1.Introduction..............................................................................................................5

    1.1.Wayland....................................................................................................................................5

    1.2.Web Browser Webkit/QT5/Wayland and frameworks.................................................................6

    2.List of functionalities.................................................................................................8

    3.DEFINITION...............................................................................................................9

    3.1.Widget....................................................................................................................................... 9

    3.2.Identifier....................................................................................................................................9

    3.3.Event.......................................................................................................................................... 9

    3.4.Components...............................................................................................................................9

    4.WIDI/MIracast..........................................................................................................10

    5.Virtual keyBoard......................................................................................................11

    6.Audio/Video Management ........................................................................................12

    6.1.Video management in the browser..........................................................................................12

    6.2.Flash support........................................................................................................................... 12

    7.Test ToolS................................................................................................................13

    7.1.API Test tool.............................................................................................................................13

    7.2.Event test tool..........................................................................................................................13

    7.3.External API Test tool...............................................................................................................13

    8.Files to be included to use the API............................................................................14

    9.Architecture............................................................................................................15

    1Communication Architecture.......................................................................................................15

    9.1.0MQ.........................................................................................................................................15

    9.2.RPZC........................................................................................................................................ 16

    10.TEST Software.......................................................................................................17

    11.Web browser API...................................................................................................18

    11.1.newWidgetFullScreen ............................................................................................................18

    11.2.newWidget............................................................................................................................. 18

    11.3.newComponent......................................................................................................................18

    11.4.deleteWidget..........................................................................................................................19

    11.5.setPositionAbsolute................................................................................................................19

    11.6.setSizeAbsolute......................................................................................................................20

    11.7.setVisibility............................................................................................................................. 20

    11.8.setOpacity.............................................................................................................................. 2011.9.setLocationBarVisibility..........................................................................................................21

  • 7/22/2019 API Web Browser V2

    4/31

    11.10.setHistoryNavigationVisibility...............................................................................................21

    11.11.setMenuVisibility..................................................................................................................21

    11.12.setFullScreen........................................................................................................................ 22

    11.13.setURL..................................................................................................................................22

    11.14.setCursorAbsolute................................................................................................................22

    11.15.setCursorRelative.................................................................................................................22

    11.16.setCursorState.....................................................................................................................23

    11.17.clickCursorAbsolute..............................................................................................................23

    11.18.clickCursorRelative...............................................................................................................23

    11.19.sendKey............................................................................................................................... 24

    11.20.sendUTF8Char......................................................................................................................24

    11.21.setFocus............................................................................................................................... 24

    11.22.deleteUserData....................................................................................................................25

    11.23.isLoaded...............................................................................................................................25

    11.24.notifyEvent........................................................................................................................... 25

    11.25.registerOnEvent...................................................................................................................26

    11.26.unregisterEvent.................................................................................................................... 26

    11.27.subscribeToEventService......................................................................................................27

    11.28.unsubscribeFromEventService.............................................................................................27

    11.29.startWidi.............................................................................................................................. 27

    11.30.stopWidi............................................................................................................................... 27

    12.ERRORS CODES......................................................................................................28

    13.define in apiDefines.h............................................................................................29

  • 7/22/2019 API Web Browser V2

    5/31

    1. INTRODUCTION

    Eurogiciel provides 3 modules that is preintegrated and optimized for Intel/SDK(Buildroot).

    The modules are:

    A windows manager/compositer Wayland/Weston windows manager compositeroptimized and HW accelerated for Intel CE. This modules can be integrated withdifferent tool kits :

    QT5

    EFL

    Gnome

    Clutter

    A web browser/widget based on Wayland/QT5 with optimization to speed up webkit

    on Intel CE architecture. This module includes an API allowing to integrated it inembedded system without mouse and external keyboard.

    A Widi/Miracast module. This module includes an API that allows a simple integrationwith the middleware

    1.1. Wayland

    Wayland:

    Wayland is a protocol for a compositor to talk to its client.

    Wayland could be a better approach than X for embedded system Wayland consists

    A protocol

    A reference implementation named Weston

    Why Wayland?

    Fast Boot time

    Small Footprint

    Stable

    Supported by X community

    Compositor and windows manager in same SW

    Flexible (easy to customized)

    Lots of Functionalities

    Windows management

    Native zoom

    Transparency management

    Virtual keyboard

    Rotation control

    Multiple workspace management

  • 7/22/2019 API Web Browser V2

    6/31

    Our implementation:

    1.2. Web Browser Webkit/QT5/Wayland and frameworks

    WhyQT5/Webkit2?

    WebKit2 : split process model, where the web content (JavaScript, HTML, layout,etc) lives in a separate process from the application UI.

    QTwebKit for Qt5 should be the best foundation for great web browsers.

    Support of Wayland

    Applications framework

    Multiple HTML5/CSS3 Widget creation and management

    Example of use cases, a weather forecast information, face book notification

    Full screen browser

    QML applications: easy for designer

    QT applications

  • 7/22/2019 API Web Browser V2

    7/31

    With our solution, we have a very Low CPU usage using HWacceleration

    Application can use openGL ES to accelerate its surface creation Weston uses openGL ES to compose all the applications surfaces

    Example of performance: fulll screen browser rendering 3D HTML5/CSS3 Intel Sodaville chipset for STB 15 % of CPU Intel Berryville chipset for STB 2 % of CPU

  • 7/22/2019 API Web Browser V2

    8/31

  • 7/22/2019 API Web Browser V2

    9/31

    3. DEFINITION

    3.1. Widget

    A widget is an instance of browser.

    Tools bar could be added to the widget: History

    location

    Properties: Size

    Position

    Opacity

    visibility

    3.2. Identifier

    Each widget is controlled by an identifier that is provided at widget creation.

    3.3. Event

    Some functionnalities like Widi/Miracast, Video selection in a web page uses

    asynchronous notifications.The MW can put a call back function to be notified on a givenEVENTCATEGORY/EVENTID

    Example or use: when a user clique on a video on the browser, the MW canbe notified on this event and f the associated URI. The MW can select for suchservice a couple EVENTCATEGORY/EVENTID = EV_VIDEO/ VIDEO_EV_URI

    3.4. Components

    This is used internally for Virtual keyBoard and reserve for future used.

  • 7/22/2019 API Web Browser V2

    10/31

    4. WIDI/MIRACAST

    On optional module Miracat/Widi could be added.

    This API Allows to control this module.

  • 7/22/2019 API Web Browser V2

    11/31

    5. VIRTUAL KEYBOARD

    The Browser includes a virtual Keyboard.

    According to the customer needs, this keyboard could be added or not.

    When a input text is selected, the widget that have the focus is moved tothe center of the screen and the other widget are hidden. When the text isentered all the widget are relocated to their previous locations.

    This mechanism is more ergonomic.

    A detailler...

    Pourrait-on le rendre par la suite activable au niveau API ?

    Comment on l'active et le dsactive actuellement

    Ce mechanism est-il dsactivable

  • 7/22/2019 API Web Browser V2

    12/31

    6. AUDIO/VIDEO MANAGEMENT

    6.1. Video management in the browser

    It consists of adding a patch for webkit which adds a new media player implementation that catchesthe video URI and sends it to the api that will forward it to your client application. The media playeralso displays instructions for the user if no still frame is available in the html code, or if this is anunsupported WebM format (like most youtube videos), and also tells that the video is loading afterclicking on play button (this is where you should hide the browser and give to the media player theURI for full screen decoding).

    6.2. Flash support

    Flash is not supported by default

    A company has an agreement with adobe to integrated this plugincompany name : Triple Play Integration, a Symphony Teleca Company.What they are providing :Flash plugin integration is provided for a fixed price of US$ 30,000 per deviceprofile (a profile is defined as a distinct STB model with a specific PR versionand WebKit based browser version)

    This release generally takes 1 calendar month to complete.

    2 When the customer is ready to deploy Flash Player, the company TPI (Triple PlayIntegration), is authorized by Adobe to resell the required run time licenses. Inquantities less than 50,000 units the price of the license, per unit, is US$ 1.75. Prices decrease for greater quantities purchased at the same time.

    3 If the customer requires continuing support (that is, supporting a new WebKitbrowser on existing profile that TPI has already provided), this may be purchased at ourhourly support rate of US$ 137.50 per man-hour.

  • 7/22/2019 API Web Browser V2

    13/31

    7. TEST TOOLS

    To test tools are available the different API, two Test tools are provided.

    7.1. API Test tool

    A mettre a jour

    7.2. Event test tool

    A voir si ce qui est dessous est a ajouter (outils de test). Il faut principalement expliquer ce que faitnotre outils de test. + mettre a jour la variable LOCATEL_RPCZ_CHANNEL qui a t a prioriremplac par une variable plus gnrique.You can catch the events sent by Widi or video with the application "testEventClient" running on yourPC.See below the steps in the buildroot folder before starting Widi :

    $ cd ./package/webbrowser-api/src/test/.libs$ export LOCATEL_RPCZ_CHANNEL=tcp://:5555$ ./testEventClient -url tcp://:5557 -category 1

    use "-category 1" to catch the widi events (EV_WIDI) and "-category 0" to catch the video events(EV_VIDEO)when you will received an event, you will have (for example) the following traces :>EventServiceLocal::notify Received event notification 2 category 1Received widi event with dataEventServiceLocal::notify Received event notification 1 category 1Received widi event with data 84620828EventServiceLocal::notify Received event notification 1 category 1Received widi event with dataEventServiceLocal::notify Received event notification 0 category 1

    Received widi event with data

    In this example, you receive at first the event WIDI_EV_READY (2)Then WIDI_EV_CONNECTING (1) with the pincode 84620828After entering the pincode on the Nexus, you receive WIDI_EV_CONNECTING (1)And finally WIDI_EV_CONNECTION(0) when the connection is doneAll the events are defined in the file "apiDefines.h"

    7.3. External API Test tool

    This tools will be available soons and will allows to access to the API through a TCPnetwork with a tool Gui oriented.

  • 7/22/2019 API Web Browser V2

    14/31

    8. FILES TO BE INCLUDED TO USE THE API

    A finaliserTo used the browser, you juste need to include the webBrowserApi.h file andlink your software with a client API.

    webBrowserApi.h : all web browser APIapiDefines.h: definition of data used by webBrowserApi.h. (automatically included bywebBrowserApi.h)Quel .so faut il ajouter comme librairie dynamique

    Manque API video et widi

  • 7/22/2019 API Web Browser V2

    15/31

    9. ARCHITECTURE

    1 Communication Architecture

    Le but est de pouvoir comprendre larchitecture et la modularit

    9.1. 0MQ

    We use 0MQ for xxxxxxx

    http://www.zeromq.org/MQ (also seen as ZeroMQ, 0MQ, zmq) looks like an embeddable networking librarybut acts like a concurrency framework. It gives you sockets that carry atomic messagesacross various transports like in-process, inter-process, TCP, and multicast. You canconnect sockets N-to-N with patterns like fanout, pub-sub, task distribution, and request-reply. It's fast enough to be the fabric for clustered products. Its asynchronous I/O modelgives you scalable multicore applications, built as asynchronous message-processingtasks. It has a score of language APIs and runs on most operating systems. MQ is fromiMatix and is LGPLv3 open source

    9.2. RPZC

    We use RPCZ for xxxxxxx

    http://www.zeromq.org/http://www.zeromq.org/
  • 7/22/2019 API Web Browser V2

    16/31

    https://code.google.com/p/rpcz/ RPCZ is a library for writing fast and robust RPC clients and servers that speak Protocol Buffers.

    RPCZ currently supports writing clients and servers in C++ and Python. More languages may beadded in the future.

    The API offers both asynchronous (callbacks) and synchronous (blocking) style functionality. Bothstyles allow specifying deadlines in millisecond resolution.

    RPCZ is built on top of ZeroMQ for handling the low-level I/O details in a lock-free manner.

    The Python module is a Cython wrapper around the C++ API.

    RPCZ has been tested on Ubuntu 11.10 and Mac OS X Lion. I believe it should not be hard to get it tocompile on Windows but I have not tried.

    https://code.google.com/p/rpcz/https://code.google.com/p/rpcz/
  • 7/22/2019 API Web Browser V2

    17/31

    10. TEST SOFTWARE

    Mettre ici les info sur notre programme de test

    xxxxxxxxxxxxxxxxxxxxxxx

  • 7/22/2019 API Web Browser V2

    18/31

    11. WEB BROWSER API

    11.1.newWidgetFullScreen

    enum WBRETURNCODES newWidgetFullScreen(const char * url, unsigned long * id);

    Creates a new widget in full screen, containing a site designated by the @em url location.By default, the widget is transparent at the creation (visibility propertie is true).@param[in] url The location of the site displayed by the widget.@param[out] id The identifier of the new widget.@return WB_API_SUCCESS If the widget is created.

    WB_API_ERR_SYSTEM_ERROR If the widget creation failed due to systemissues.

    WB_API_ERR_LOW_ON_MEMORY If the widget creation failed due to lack ofmemory.

    11.2.newWidget

    enum WBRETURNCODES newWidget(const char * url, unsigned long x, unsigned long y,unsigned long width, unsigned long height, unsigned long * id);

    @fn Creates a new widget with @em height and @em width size at the absolute coordinates( @em x, @em y) on the screen, containing a site designated by the @em url location.The position specified is relative to the top-left corner of the screen, which is (0,0).By default, the widget is transparent at the creation (visibility propertie is true).

    @param[in] url The location of the site displayed by the widget.@param[in] x The coordinate (pixels) of the top-left screen corner of the widget on thehorizontal axis.@param[in] y The coordinate (pixels) of the top-left screen corner of the widget on thevertical axis.@param[in] height The height (pixels) of the widget.@param[in] width The width (pixels) of the widget.@param[in/out] id The identifier of the new widget.@return WB_API_SUCCESS If the widget is created.

    WB_API_ERR_LOW_ON_MEMORY If the widget creation failed due to lack ofmemory.

    WB_API_ERR_SYSTEM_ERROR If widget creation failed due to system issues.

    11.3.newComponent

    enum WBRETURNCODES newComponent(const char * componentType, unsigned longx, unsigned long y, unsigned long parentID, unsigned long * id);

    /*** @fn Creates a new component with @em height and @em width size at the absolute

    coordinates ( @em x, @em y)* on the screen.* The position specified is relative to the top-left corner of the screen, which is (0,0).

  • 7/22/2019 API Web Browser V2

    19/31

  • 7/22/2019 API Web Browser V2

    20/31

    * WB_API_ERR_INVALID_COORDINATES If the coordinates @em x or @em yare out of screen.* WB_API_ERR_LOW_ON_MEMORY If the moving failed due to lack ofmemory.* WB_API_ERR_SYSTEM_ERROR If the moving failed due to systemissues.

    **/

    11.6.setSizeAbsolute

    enum WBRETURNCODES setSizeAbsolute(unsigned long id, unsigned long width,unsigned long height);

    /*** @fn Resizes the widget identified by its @em id, with new @em height* and new @em width.

    ** @param[in] id The identifier of the widget.* @param[in] height The new height (pixels) of the widget.* @param[in] width The new width (pixels) of the widget.* @return WB_API_SUCCESS If the resizing success.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.* WB_API_ERR_INVALID_ID If the @em id is unknown.* WB_API_ERR_INVALID_HEIGHT If the @em height is out of screen or 0.* WB_API_ERR_INVALID_WIDTH If the @em width is out of screen or 0.**/

    11.7.setVisibility

    enum WBRETURNCODES setVisibility(unsigned long id, bool visible);Displays or Hides the widget on the screen identified by its @em id following the visibility @emvisible value.parametersid The identifier of the widget.visible If true, the widget is shown. If false, the widget is hidden.

    returned valuesWB_API_SUCCESS If the new displaying success.WB_API_ERR_INVALID_ID If the @em id is unknown.WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.

    11.8.setOpacity

    enum WBRETURNCODES setOpacity(unsigned long id, unsigned char opacity);

    /*** @fn Sets the opacity of the widget identified by its @em id

  • 7/22/2019 API Web Browser V2

    21/31

    * following the @em opacity value.** @param[in] id The identifier of the widget.* @param[in] opacity Value between 0 (0% = fully transparent) and 255 (100% = opaque)* @return WB_API_SUCCESS If the new opacity setting success.* WB_API_ERR_INVALID_ID If the @em id is unknown.

    * WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.***/

    11.9.setLocationBarVisibility

    enum WBRETURNCODES setLocationBarVisibility(unsigned long id, bool visible);

    /**

    * @fn Displays or Hides the location bar in the widget identified by its @em id* following the visibility @em visible value.** @param[in] id The identifier of the widget.* @param[in] visible If true, the location bar is shown. If false the location bar is hidden.* @return WB_API_SUCCESS If the new displaying success.* WB_API_ERR_INVALID_ID If the @em id is unknown.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.10. setHistoryNavigationVisibility

    enum WBRETURNCODES setHistoryNavigationVisibility(unsigned long id, bool visible);

    /*** @fn Displays or Hides the backward/forward buttons in the widget identified by its @em id* following the visibility @em visible value.* The backward/forward buttons are used to navigate in the widget's history.** @param[in] id The identifier of the widget.

    * @param[in] visible If true, the backward/forward navigation buttons are shown. If false theyare hidden.* @return WB_API_SUCCESS If the new displaying success.* WB_API_ERR_INVALID_ID If the id is unknown.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.11. setMenuVisibility

    enum WBRETURNCODES setMenuVisibility(unsigned long id, bool visible);

    /**

  • 7/22/2019 API Web Browser V2

    22/31

  • 7/22/2019 API Web Browser V2

    23/31

    * @param[in] y The coordinate (pixels) of the top-left screen corner of the cursor on thevertical axis.* @return WB_API_SUCCESS If the new cursor position success.* WB_API_ERR_INVALID_COORDINATES If the coordinates are out of screen.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.

    **/

    11.15. setCursorRelative

    enum WBRETURNCODES setCursorRelative(unsigned long offsetX, unsigned longoffsetY);

    /*** @fn Moves the cursor to relative horizontal and vertical axis from the current cursor position.The offset

    * (@em offsetX, @em offsetY) specified is relative to the current cursor position (x,y) of thescreen.** @param[in] offsetX Offset (pixels) of the cursor coordinate on the horizontal axis.* @param[in] offsetY Offset (pixels) of the cursor coordinate on the vertical axis.* @return WB_API_SUCCESS If the new cursor position success.* WB_API_ERR_INVALID_COORDINATES If the coordinates are out of screen.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.16. setCursorState

    enum WBRETURNCODES setCursorState(bool enabled);

    /*** Enable or disable the mouse cursor dependind on @em enabled value.* Disabling the cursor also hides it while enabling the cursor shows it.* When the cursor is disabled:* - any call to setCursorRelative, setCursorAbsolute, clickCursorRelative andclickCursorAbsolute are ignored and have no effect

    * - if a mouse is connected, its events are also ignored** @param[in] enabled If true, the mouse cursor is shown otherwise it is hidden.* @return WB_API_SUCCESS when the mouse cursor was successfully show orhidden.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.17. clickCursorAbsolute

    enum WBRETURNCODES clickCursorAbsolute(unsigned long x, unsigned long y);

  • 7/22/2019 API Web Browser V2

    24/31

    /*** @fn Simulates the cursor click to the absolute coordinates (@em x, @em y). The position* specified is relative to the top-left corner of the screen, which is (0,0).** @param[in] x The coordinate (pixels) of the top-left screen corner of the cursor on thehorizontal axis.

    * @param[in] y The coordinate (pixels) of the top-left screen corner of the cursor on thevertical axis.* @return WB_API_SUCCESS If the click action success.* WB_API_ERR_INVALID_COORDINATES If the coordinates are out of screen.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.18. clickCursorRelative

    enum WBRETURNCODES clickCursorRelative(unsigned long offsetX, unsigned longoffsetY);

    /*** @fn Simulates the cursor click to relative horizontal and vertical axis from the current cursorposition. The offset* (@em offsetX, @em offsetY) specified is relative to the current cursor position (x,y) of thescreen.** @param[in] offsetX Offset (pixels) of the cursor coordinate on the horizontal axis.* @param[in] offsetY Offset (pixels) of the cursor coordinate on the vertical axis.

    * @return WB_API_SUCCESS If the click action success.* WB_API_ERR_INVALID_COORDINATES If the coordinates are out of screen.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.19. sendKey

    enum WBRETURNCODES sendKey(unsigned char key);

    Simulates the sending of keycodes to the currently active widget as if they where typed fromthe keyboard.@param[in] key Single char keycode.@return WB_API_SUCCESS If the sending of @em key succeed.

    WB_API_ERR_INVALID_ID If the key is unknown.WB_API_ERR_INVALID_KEY If the key is not allowed.WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.

  • 7/22/2019 API Web Browser V2

    25/31

    11.20. sendUTF8Char

    enum WBRETURNCODES sendUTF8Char(const char * utf8Char);

    /*** @fn Simulates the sending of UTF8 characters to the currently active widget.** @param[in] utf8Char Single character using an utf8 representation .* @return WB_API_SUCCESS If the sending of @em utf8Char succeed.* WB_API_ERR_INVALID_ID If the key is unknown.* WB_API_ERR_INVALID_KEY If the key is not allowed.* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.* WB_API_ERR_VALUE_OUTOFRANGE If the utf8Char value is not handled by the API**/

    11.21. setFocus

    enum WBRETURNCODES setFocus(unsigned long id);

    /*** @fn Sets the focus to the specified @em id widget.** @param[in] id The identifier of the widget.* @return WB_API_SUCCESS If the setting of focus success.* WB_API_ERR_INVALID_ID If the id is unknown* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.22. deleteUserData

    enum WBRETURNCODES deleteUserData();

    /*** @fn Deletes all personal informations and cookies for all widgets.*

    * @param[in] id The identifier of the widget.* @return WB_API_SUCCESS If the clear success.when the clear not success* WB_API_ERR_INVALID_ID If the id is unknown* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack ofmemory.* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.* WB_API_ERR_COULD_NOT_DELETE_USERDATA If the clear not success.***/

    11.23. isLoaded

    enum WBRETURNCODES isLoaded(unsigned long id);

  • 7/22/2019 API Web Browser V2

    26/31

    /*** @fn Checks if the resource requested with setURL is loaded** @param[in] id The identifier of the widget.* @return WB_API_SUCCESS If the resource loading is finalized

    * WB_API_INF_NOT_FINALIZED If the resource loading is not finalized* WB_API_ERR_INVALID_ID If the id is unknown* WB_API_ERR_SYSTEM_ERROR If action failed due to system issues.**/

    11.24. notifyEvent

    enum WBRETURNCODES notifyEvent(enum EVENTCATEGORY category, long eventID,const char * data);

    Notify an event to the API@param[in] category the event category@param[in] eventID the evendID@param[in] data the data associated to this event.@return WB_API_SUCCESS If the notification succeed

    WB_API_ERR_INVALID_ID If the eventID is not supportedWB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.

    11.25. registerOnEvent

    enum WBRETURNCODES registerOnEvent(unsigned long subscriberID, enumEVENTCATEGORY category, long eventID, eventCallback callback);

    /*** @fn Register a callback for a dedicated @em eventID for the @em category chosen.** @param[in] category the event category* @param[in] eventID the evendID* @param[in] data the data associated to this event.

    * @return WB_API_SUCCESS when the callback is successfully registered* WB_API_ERR_INVALID_ID If the eventID is not supported* WB_API_ERR_LOW_ON_MEMORY If action failed due to lack of memory.**/Two kind of event categogy are defined they alow to be notify of event on this given category

    Video: the event VIDEO_EV_URI notifies that a video as be selected in a web page.The player can then read (or not according to its state) the video in full screenwith ????? A voir

    Widi: allows to be notified on widi/miracast event

    A voir o sont les API widi de setting de pin code et les API pour rcuprer lurl video

    typedef void (*eventCallback)(const char * data);

  • 7/22/2019 API Web Browser V2

    27/31

    typedef void (*eventsCallback)(long eventID,const char * data);/** @enum categories supported for events */enum EVENTCATEGORY {EV_VIDEO = 0, /** Video event.*/EV_WIDI = 1, /** Widi event.*/

    };

    /** @enum categories supported for events */enum WIDIEVENTID {WIDI_EV_READY = 2, /** Video event.*/WIDI_EV_CONNECTING = 1, /** Video event.*/WIDI_EV_CONNECTION = 0, /** event.*/WIDI_EV_CONNECTION_FAIL = -1, /** Video event.*/

    };

    enum VIDEOEVENTID {VIDEO_EV_URI = 0, /** Video URI.*/

    };

    11.26. unregisterEvent

    enum WBRETURNCODES unregisterEvent(unsigned long subscriberID, enumEVENTCATEGORY category, long eventID);Manque API description

    11.27. subscribeToEventService

    enum WBRETURNCODES subscribeToEventService(unsigned long * subscriberID, constchar * rpczUrlString);Manque API description

    11.28. unsubscribeFromEventService

    enum WBRETURNCODES unsubscribeFromEventService(unsigned long subscriberID);Manque API description

    11.29. startWidi

    enum WBRETURNCODES startWidi(void);Starts the WIDI service

    11.30. stopWidi

    enum WBRETURNCODES stopWidi(void);

  • 7/22/2019 API Web Browser V2

    28/31

    Stop the WIDI service

  • 7/22/2019 API Web Browser V2

    29/31

    12. ERRORS CODES

    /** @enum Return error codes for widget API */enum WBRETURNCODES {WB_API_INF_IGNORED = 1, /** The requested

    operation was ignored.*/WB_API_SUCCESS = 0 , /** The requested

    operation is succed.*/WB_API_ERR_SYSTEM_ERROR = -1, /** A general error

    occurred that is not covered by a more specific error code.*/WB_API_ERR_LOW_ON_MEMORY = -2, /** There is not enough

    memory.*/WB_API_ERR_NULL_POINTER = -3, /** a NULL pointer was

    provided to the API.*/WB_API_ERR_VALUE_OUTOFRANGE = -10, /** A provided

    parameter value is out of range.*/

    WB_API_ERR_INVALID_ID = -11, /** The requested @emid is unknown.*/

    WB_API_ERR_INVALID_OPACITY = -12, /** The requested @emopacity is not valid.*/

    WB_API_ERR_INVALID_COORDINATES = -13, /** The requested @emcoordinates are out of screen.*/

    WB_API_ERR_INVALID_HEIGHT = -14, /** The requested @emheight is out of screen.*/

    WB_API_ERR_INVALID_WIDTH = -15, /** The requested @emwidth is out of screen.*/

    WB_API_ERR_INVALID_URL = -16, /** The requested @em

    url is not valid.*/WB_API_ERR_INVALID_KEY = -17, /** The requested @em

    key code is not valid.*/WB_API_ERR_INVALID_TYPE = -18, /** The requested @em

    type is unknown.*/WB_API_ERR_COULD_NOT_DELETE_USERDATA = -21 /** The user datas

    could not be deleted.*/};

    A remettre sous forme textuelle

    A prciser a quoi sert et surtout comment se trouve/gre les RPCZ error

    /** @def rpcz initialization */#define RPCZDECLAREDCHANNEL "RPCZ_CHANNEL"#define RPCZDECLAREDTIMEOUT "RPCZ_TIMEOUT"#define RPCZDEFAULTCHANNEL "tcp://127.0.0.1:5555"#define RPCZDEFAULTTIMEOUT 60000#define RPCZDEFAULTBINDINGURL "tcp://*:5555"

  • 7/22/2019 API Web Browser V2

    30/31

    13. DEFINE IN APIDEFINES.H

    /** @def rpcz initialization */#define RPCZDECLAREDCHANNEL "RPCZ_CHANNEL"#define RPCZDECLAREDTIMEOUT "RPCZ_TIMEOUT"

    #define RPCZDEFAULTCHANNEL "tcp://127.0.0.1:5555"#define RPCZDEFAULTTIMEOUT 60000#define RPCZDEFAULTBINDINGURL "tcp://*:5555"

    /** @enum Return error codes for widget API */enum WBRETURNCODES {WB_API_INF_IGNORED = 1, /** The requested

    operation was ignored.*/WB_API_SUCCESS = 0 , /** The requested

    operation is succed.*/WB_API_ERR_SYSTEM_ERROR = -1, /** A general error

    occurred that is not covered by a more specific error code.*/WB_API_ERR_LOW_ON_MEMORY = -2, /** There is not enough

    memory.*/WB_API_ERR_NULL_POINTER = -3, /** a NULL pointer was

    provided to the API.*/WB_API_ERR_VALUE_OUTOFRANGE = -10, /** A provided

    parameter value is out of range.*/WB_API_ERR_INVALID_ID = -11, /** The requested @em

    id is unknown.*/WB_API_ERR_INVALID_OPACITY = -12, /** The requested @em

    opacity is not valid.*/

    WB_API_ERR_INVALID_COORDINATES = -13, /** The requested @emcoordinates are out of screen.*/

    WB_API_ERR_INVALID_HEIGHT = -14, /** The requested @emheight is out of screen.*/

    WB_API_ERR_INVALID_WIDTH = -15, /** The requested @emwidth is out of screen.*/

    WB_API_ERR_INVALID_URL = -16, /** The requested @emurl is not valid.*/

    WB_API_ERR_INVALID_KEY = -17, /** The requested @emkey code is not valid.*/

    WB_API_ERR_INVALID_TYPE = -18, /** The requested @em

    type is unknown.*/WB_API_ERR_COULD_NOT_DELETE_USERDATA = -21 /** The user datas

    could not be deleted.*/};

    /** @enum categories supported for events */enum EVENTCATEGORY {EV_VIDEO = 0, /** Video event.*/EV_WIDI = 1, /** Widi event.*/

    };

    /** @enum categories supported for events */enum WIDIEVENTID {

  • 7/22/2019 API Web Browser V2

    31/31

    WIDI_EV_READY = 2, /** Video event.*/WIDI_EV_CONNECTING = 1, /** Video event.*/WIDI_EV_CONNECTION = 0, /** event.*/WIDI_EV_CONNECTION_FAIL = -1, /** Video

    event.*/};

    enum VIDEOEVENTID {VIDEO_EV_URI = 0, /** Video URI.*/

    };

    typedef void (*eventCallback)(const char * data);typedef void (*eventsCallback)(long eventID,const char * data);