Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::PropertyCefSynchronizer Class Reference

#include <propertycefsynchronizer.h>

+ Inheritance diagram for inviwo::PropertyCefSynchronizer:

Public Member Functions

 PropertyCefSynchronizer (CefRefPtr< CefBrowser > browser, const PropertyWidgetCEFFactory *htmlWidgetFactory)
 
virtual void OnLoadStart (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, TransitionType transition_type) override
 
virtual void OnLoadEnd (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int httpStatusCode) override
 
virtual bool OnQuery (CefRefPtr< CefBrowser > browser, CefRefPtr< CefFrame > frame, int64_t 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 (PropertyOwner *owner, Property *property, size_t index)
 
virtual void onDidAddProperty (Property *property, size_t index)
 
virtual void onDidRemoveProperty (PropertyOwner *owner, 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 Member Functions inherited from inviwo::Observer
void addObservation (ObservableInterface *observable)
 
- Protected Attributes inherited from inviwo::Observer
std::unordered_set< ObservableInterface * > observables_
 

Detailed Description

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

The path can be to a Processor (myprocessor.myproperty) or system/module Settings (mysetting.myproperty) properties.

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()

virtual 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.

◆ OnLoadStart()

virtual void inviwo::PropertyCefSynchronizer::OnLoadStart ( CefRefPtr< CefBrowser > browser,
CefRefPtr< CefFrame > frame,
TransitionType transition_type )
overridevirtual

Removes all property synchronizations.

◆ OnQuery()

virtual bool inviwo::PropertyCefSynchronizer::OnQuery ( CefRefPtr< CefBrowser > browser,
CefRefPtr< CefFrame > frame,
int64_t 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

◆ onWillRemoveProperty()

virtual void inviwo::PropertyCefSynchronizer::onWillRemoveProperty ( Property * property,
size_t index )
overridevirtual

Reimplemented from inviwo::PropertyOwnerObserver.


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