Changes between Version 25 and Version 26 of HTMLGfx


Ignore:
Timestamp:
Jan 21, 2015, 9:29:15 PM (9 years ago)
Author:
romw
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HTMLGfx

    v25 v26  
    3939Top level goals are:
    4040 * Projects should only need to create HTML/CSS/!JavaScript to have a fully functional graphics application.
    41  * Use native platforms predominate HTML rendering technology.
    42 
    43 === Development Methods ===
    44 Use whatever framework/tools are required to build a customized browser-based application.
    45 
    46 On Windows:
    47  * Use Visual Studio
    48  * Use Active Template Library
     41 * Projects should be able to use their favorite browser to debug their graphics application.
    4942
    5043== Detailed System Design ==
    5144
    52 === CHTMLBrowserWnd ===
     45=== HTML Window ===
    5346This component is responsible for creating the main frame window used for hosting the web browser
    54 control via CHTMLBrowserHost.
    55 
    56 As part of the normal operations of the window, it should update the URL the web browser control is
    57 displaying as state changes are detected.  It should also publish updated information to the !JavaScript
    58 interface.
     47control as well as creating the web browser control itself.
     48
     49As part of the normal operations of the window, it should update which URL the web browser control is
     50displaying as state changes are detected.
    5951
    6052It supports whatever requirements are described for BOINC graphics applications.
     
    6254Reference: [GraphicsApi#Graphicsapps Making graphics applications for BOINC]
    6355
    64 === CHTMLBrowserHost ===
    65 This component hosts the web browser control and exposes whatever interfaces/callbacks the control
    66 requires for logging and display purposes.  As part of its creation process it creates/exposes
    67 the !JavaScript interface for CHTMLBrowserWnd to use.
    68 
    69 === CHTMLBrowserHostUI ===
    70 This component acts as the !JavaScript interoperability component.  It should only support single
    71 threaded access.
     56=== HTTP Server ===
     57This component serves up content from the slot directory running the application.  It should only be
     58bound to the loopback adapter and should not provide a default document nor a directory listing
     59when queried.  It should only serve up files that are contained within the slot directory structure.
     60
     61=== HTTP Server RPCs ===
     62
     63==== Embedded Static Content ====
     64The following files are embedded within the executable:
     65|| Namespace              || Contents ||
     66|| /api/static/index.html || [http://boinc.berkeley.edu/gitweb/?p=boinc-v2.git;a=blob;f=samples/gfx_html/templates/index.html;hb=master index.html] ||
     67|| /api/static/boinc.png  || [http://boinc.berkeley.edu/gitweb/?p=boinc-v2.git;a=blob;f=samples/gfx_html/templates/boinc.png;hb=master boinc.png] ||
     68|| /api/static/boinc.js   || [http://boinc.berkeley.edu/gitweb/?p=boinc-v2.git;a=blob;f=samples/gfx_html/templates/boinc.js;hb=master boinc.js] ||
     69
     70==== Retrieve init_data.xml ====
     71Returns the contents of the init_data.xml file.
     72
     73|| Namespace:  || /api/getInitData ||
     74|| Parameters: || None ||
     75|| Returns:    || XmlDocument ||
     76
     77==== Retrieve graphics_status.xml ====
     78Returns the contents of the graphics_status.xml file and in addition the Vboxwrapper WebAPI and Remote
     79Desktop port information.
     80
     81|| Namespace:  || /api/getGraphicsStatus ||
     82|| Parameters: || None ||
     83|| Returns:    || XmlDocument ||
     84
     85==== Reset reread_init_data_file flag ====
     86Resets the internal flag notifying the HTML application it needs to read the init_data.xml file.  This
     87flag is published as part of the /api/getGraphicsStatus API.
     88
     89|| Namespace:  || /api/resetReadFlag ||
     90|| Parameters: || None ||
     91|| Returns:    || XmlDocument ||
     92
     93==== Calling RPCs ====
     94Here is some prototype code for calling the described RPCs:
     95{{{
     96function createRequest {
     97    var xmlHttp = null;
     98    var XMLHttpFactories = [
     99        function () { return new XMLHttpRequest() },
     100        function () { return new ActiveXObject('Msxml2.XMLHTTP') },
     101        function () { return new ActiveXObject('Msxml3.XMLHTTP') },
     102        function () { return new ActiveXObject('Microsoft.XMLHTTP') }
     103    ];
     104
     105    for (var i = 0; i < XMLHttpFactories.length; i++) {
     106        try {
     107            xmlHttp = XMLHttpFactories[i]();
     108        } catch (e) {
     109            continue;
     110        }
     111        break;
     112    }
     113    return xmlHttp;
     114}
     115
     116function sendRequest(url) {
     117    var req = createRequest();
     118    var response = null;
     119    req.open('GET', url, false);
     120    req.send();
     121    response = req.responseXML;
     122    req = null;
     123    return response;
     124}
     125
     126var xmlDocument = sendRequest('/api/getInitData');
     127
     128}}}
    72129
    73130=== State URL Selection Process ===
     
    118175    document to display before the task exits in 5 seconds or less.
    119176
    120 '''NOTE:''' Any file specified in the configuration file and any related support files
    121 will need to have the <copy_file/> directive included in the versions.xml file
    122 describing the application version.
    123 
    124177=== Graphics Status File ===
    125178It is read once a second and is generally managed via the worker applications via