Author: everaldo
Date: 2007-06-07 11:52:06 -0400 (Thu, 07 Jun 2007)
New Revision: 78853
Modified:
trunk/moon/plugin/ChangeLog
trunk/moon/plugin/moon-plugin.cpp
trunk/moon/plugin/moon-plugin.h
Log:
* moon-plugin.cpp,
* moon-plugin.h: Implement runtime properties structure and 'version'
property.
2007-06-07 Everaldo Canuto <[EMAIL PROTECTED]>
Modified: trunk/moon/plugin/ChangeLog
===================================================================
--- trunk/moon/plugin/ChangeLog 2007-06-07 15:31:03 UTC (rev 78852)
+++ trunk/moon/plugin/ChangeLog 2007-06-07 15:52:06 UTC (rev 78853)
@@ -1,5 +1,11 @@
2007-06-07 Everaldo Canuto <[EMAIL PROTECTED]>
+ * moon-plugin.cpp,
+ * moon-plugin.h: Implement runtime properties structure and 'version'
+ property.
+
+2007-06-07 Everaldo Canuto <[EMAIL PROTECTED]>
+
[PluginClass added to handle script objects]
* plugin-class.cpp,
Modified: trunk/moon/plugin/moon-plugin.cpp
===================================================================
--- trunk/moon/plugin/moon-plugin.cpp 2007-06-07 15:31:03 UTC (rev 78852)
+++ trunk/moon/plugin/moon-plugin.cpp 2007-06-07 15:52:06 UTC (rev 78853)
@@ -272,6 +272,38 @@
int16
PluginInstance::EventHandle (void* event)
{
- /* Our plugin is a windowed so we dont need the windowless code */
return 0;
}
+
+/*** Runtime related
**********************************************************/
+
+bool
+PluginInstance::ClassHasProperty (NPObject *npobj, NPIdentifier name)
+{
+ if (name == NPN_GetStringIdentifier ("settings") ||
+ name == NPN_GetStringIdentifier ("version"))
+ return true;
+
+ return false;
+}
+
+bool
+PluginInstance::ClassGetProperty (NPObject *npobj, NPIdentifier name,
NPVariant *result)
+{
+ if (name == NPN_GetStringIdentifier ("settings"))
+ {
+ // todo!
+ return false;
+ }
+ else if (name == NPN_GetStringIdentifier ("version"))
+ {
+ int len = strlen (PLUGIN_VERSION);
+ char *version = (char *) NPN_MemAlloc (len + 1);
+ memcpy (version, PLUGIN_VERSION, len + 1);
+ STRINGN_TO_NPVARIANT (version, len, *result);
+
+ return true;
+ }
+
+ return false;
+}
Modified: trunk/moon/plugin/moon-plugin.h
===================================================================
--- trunk/moon/plugin/moon-plugin.h 2007-06-07 15:31:03 UTC (rev 78852)
+++ trunk/moon/plugin/moon-plugin.h 2007-06-07 15:52:06 UTC (rev 78853)
@@ -78,6 +78,11 @@
GtkWidget *container; // plugin container object
Canvas *canvas; // plugin canvas object
Surface *surface; // plugin surface object
+
+ // Runtime related
+ virtual bool ClassHasProperty (NPObject *npobj, NPIdentifier name);
+ virtual bool ClassGetProperty (NPObject *npobj, NPIdentifier name,
NPVariant *result);
+
};
#endif /* MOON_PLUGIN */
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches