Languages

Menu
Sites
Language
Can Native App draw on the Web App screen?
Hi,
 
I'm trying to have Native App (eg. service apps, plugins, etc.) draw graphics on the Web App screen.
Why I want to do this is because we have to draw using the parsed result of non-image binary data, which is too large and complicated to be processed by JavaScript.
 
At first, NPAPIs seemed to be appropriate for this purpose and I succeeded call functions in Web App from Native, but I couldn't find the way to draw graphics on browser. MDN sais struct NPWindow has 'Platform specific handle' in its member and the handle is 'Ecore_X_Window' of EFL in Tizen. However, it doesn't seem that Native Apps are allowed to use the EFL features directly.
 
Does anyone know how to use the EFL features in Native plugins?
Or is there better way to meet our purpose?
 
Thanks!

Responses

2 Replies
Byron Gavras
Can you please tell me how you succeeded to call functions in Web App from Native? I use the NPRuntime webapplication from Tizen SDK samples. I can see that there is an object NPRuntimeMatrix. But without the source code of Native Application i don't know how to use this. Thanks in advance.
Hi, You can get information about NPPlugin on https://developer.mozilla.org/en-US/docs/Gecko_Plugin_API_Reference . And a sample code is available on the following site though you might need to modify a bit for tizen. http://mxr.mozilla.org/mozilla1.9.2/source/modules/plugin/sdk/samples/npruntime/ To call functions in Web App from Native, you can use NPN_Evaluate().
NPP pNPInstance;
NPObject* pWindowObj;
NPVariant res; // return value from JavaScript function

// get window object
NPN_GetValue(pNInstance, NPNWindowNPObject, &pWindowObj);

// make function call string
NPString str;
str.UTF8Characters = "myJavascriptFunction()";
str.UTF8Length = strlen(str.UTF8Characters);

// call JavaScript function
NPN_Evaluate(pNPInstance, pWindowObj, &str, &res);