mital / mcrux

Automatically exported from code.google.com/p/mcrux
0 stars 0 forks source link

Spike out JavaScript to C++ calls #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Spiking out JavaScript to C++ calls.
Static mappings of C++ functions to JavaScript.
In JavaScript code we should be having:
mcrux.someFunction();

the above function call should map to the corresponding function inside C++
code and it should be called properly.

Original issue reported on code.google.com by mital.d....@gmail.com on 13 Dec 2008 at 2:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Check In No 4
Adding Example of JavaScript to C++ call.
The function mapping are static.

Original comment by mital.d....@gmail.com on 13 Dec 2008 at 2:33

GoogleCodeExporter commented 9 years ago
Add functionality of Passing parameters to the c++ function call and get return 
value
from the C++ function call.

Original comment by mital.d....@gmail.com on 14 Dec 2008 at 12:24

GoogleCodeExporter commented 9 years ago
CheckIn:6

Adding parameter passing to the C++ function call and getting value back from 
the C++
function.

Original comment by mital.d....@gmail.com on 14 Dec 2008 at 12:51

GoogleCodeExporter commented 9 years ago
* call MCrux::myMethod() method. This method should be called on the MCrux 
object
which has created the JSGlobalObject.

Original comment by mital.d....@gmail.com on 14 Dec 2008 at 1:08

GoogleCodeExporter commented 9 years ago
CheckIn: 7
Adding a separate project called "Call C++ Object Method"
* when method from JavaScript is invoked then this calls provided method of 
given C++
object. (routed through the Static Functions)

Calling MCrux::getPluginHandler() method which return MCruxPluginHandler*
calling mcruxPluginHandler->initialize() method with the list of plugins to be
initialized with.

TODO:
1) take a list of arguments.
2) Refactor.
3) check about memory leaks

Original comment by mital.d....@gmail.com on 14 Dec 2008 at 2:53

GoogleCodeExporter commented 9 years ago
Create the function at startup by calling APIs to create functions.

Original comment by mital.d....@gmail.com on 15 Dec 2008 at 5:15

GoogleCodeExporter commented 9 years ago
Add a sample Demo Plugin application. In this application there are two 
components.
DemoPlugin.dll
* this dll contains a method with the similar signature to
JSObjectCallAsFunctionCallback.
The dll should be dynamically loaded and we should be able to call this object's
functionality with provided static name (say "demo").

Original comment by mital.d....@gmail.com on 20 Dec 2008 at 12:09

GoogleCodeExporter commented 9 years ago
CheckIn: 9
Adding a Demo Plugin Application
From JavaScript we are calling "mcrux.initialize(...)" with the plugin name as 
parameter.
the plugin "DemoPlugin.dll" is loaded.
The DemoPlugin.dll contains one Method "MyDemoPluginMethod".
In Initialize method we are creating the "demo" object with myFunction() method
assigned to MyDemoPluginMethod.
Now From JavaScript we are calling "demo.myFunction()". This works perfect. :)

Original comment by mital.d....@gmail.com on 20 Dec 2008 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by mital.d....@gmail.com on 28 Dec 2008 at 3:11

GoogleCodeExporter commented 9 years ago
Adding Functionality to create MCruxPlugin Object with new operator.

example JavaScript Code:

function myFunction()
{
    alert("sqlite Example ! creating mydb object with new operator");
    var mydb = new sqlite_database();
    alert("mydb created successfully now calling someFunction() over it");
    mydb.someFunction();
    alert("after SomeFunction call");
}

Original comment by mital.d....@gmail.com on 31 Jan 2009 at 10:26

GoogleCodeExporter commented 9 years ago
We Figured out the JavaScript to C++ calls :)

Original comment by mital.d....@gmail.com on 21 Feb 2009 at 2:51