May 2017

EventEmitter

Our EventEmitter in PhantomSQL is based on NodeJS version so they should be compatible. Here are couple examples on how to use the emitter. Basic usage of registering and listening to an event. "use strict";   const {EventEmitter} = require(’events’);   // Dump all the args em.on(’hello-event’, (…arg)=> {console.info("Hello event handler : " + arg)}); …

EventEmitter Read More »

Creating Javascript accessible object from C++ / CEF

Example with Chromium Embedded Framework (CEF) on how to create an object in C++ and make it accessible via Javascript. console.inof(api) Object {ready: true, version: "psql.0.0.1", info: Object, getVersion: function}console.inof(api) Object {ready: true, version: "psql.0.0.1", info: Object, getVersion: function} void ExtractEngineApp::OnContextCreated( CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefV8Context> context) {   auto info = CefV8Value::CreateObject(NULL, NULL); info->SetValue("major", …

Creating Javascript accessible object from C++ / CEF Read More »