Inviwo  0.9.10.1
Inviwo documentation
inviwo::PropertyCefSynchronizer Class Reference

#include <propertycefsynchronizer.h>

+ Inheritance diagram for inviwo::PropertyCefSynchronizer:

Public Member Functions

 PropertyCefSynchronizer (const PropertyWidgetCEFFactory *htmlWidgetFactory)
 
virtual void OnLoadEnd (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int httpStatusCode) override
 
virtual bool OnQuery (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int64 query_id, const CefString &request, bool persistent, CefRefPtr< Callback > callback) override
 
virtual void onWillRemoveProperty (Property *property, size_t index) override
 
- Public Member Functions inherited from inviwo::PropertyOwnerObserver
virtual void onWillAddProperty (Property *property, size_t index)
 
virtual void onDidAddProperty (Property *property, size_t index)
 
virtual void onDidRemoveProperty (Property *property, size_t index)
 
- Public Member Functions inherited from inviwo::Observer
 Observer (const Observer &other)
 
 Observer (Observer &&other)
 
Observeroperator= (Observer &&other)
 
Observeroperator= (const Observer &other)
 
virtual ~Observer ()
 
void removeObservation (ObservableInterface *observable)
 
void removeObservations ()
 

Additional Inherited Members

- Public Attributes inherited from inviwo::PropertyOwnerObserver
friend PropertyOwnerObservable
 
- Protected Types inherited from inviwo::Observer
using ObservableSet = std::unordered_set< ObservableInterface * >
 
- Protected Member Functions inherited from inviwo::Observer
void addObservation (ObservableInterface *observable)
 
- Protected Attributes inherited from inviwo::Observer
ObservableSet observables_
 

Detailed Description

Handles "property.set", "property.get" and "property.subscribe" commands sent from the Inviwo javascript API (see webbrowser/data/js/inviwoapi.js).

Flow of information between PropertyWidgetCEF and browser. Changes can start from Inviwo (left) or browser (right). Information is encoded in JSON format, e.g.

{"command":"subscribe", "path": 'myprocessor.myproperty', "onChange":
"onChangeCallbackJS", "propertyObserver": "observerName"}

Inviwo Browser (JavaScript) Property change | updateFromProperty() --> onChangeCallbackJS(property) | | OnQuery <------— inviwo.setProperty('myprocessor.myproperty', {value: 2.0}); from_json(json, property);

Member Function Documentation

◆ OnLoadEnd()

void inviwo::PropertyCefSynchronizer::OnLoadEnd ( CefRefPtr< CefBrowser >  browser,
CefRefPtr< CefFrame >  frame,
int  httpStatusCode 
)
overridevirtual

Synchronizes all widgets and sets their frame, called when frame has loaded.

◆ OnQuery()

bool inviwo::PropertyCefSynchronizer::OnQuery ( CefRefPtr< CefBrowser >  browser,
CefRefPtr< CefFrame >  frame,
int64  query_id,
const CefString &  request,
bool  persistent,
CefRefPtr< Callback >  callback 
)
overridevirtual

Called due to cefQuery execution in message_router.html. Expects the request to be a JSON data object, see inviwoapi.js: {command: "subscribe", "path": propertyPath, "id":htmlId} for synchronizing property to change. {command: "property.set", "path":"PropertyIdentifier", "value":0.5} for setting a value {command: "property.get", "path": propertyPath} for getting a value. Currently only supports a single property in the request.

See also
PropertyWidgetCEF

The documentation for this class was generated from the following files: