]> git.sesse.net Git - vlc/blobdiff - mozilla/control/npovlc.h
all: rewrite of mozilla plugin
[vlc] / mozilla / control / npovlc.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 52%
rename from mozilla/vlcpeer.h
rename to mozilla/control/npovlc.h
index c5ee26a..1fee65a
@@ -1,61 +1,48 @@
-/*****************************************************************************
- * vlcpeer.h: scriptable peer descriptor
- *****************************************************************************
- * Copyright (C) 2002-2005 the VideoLAN team
- * $Id$
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-#ifndef __VLCPEER_H__
-#define __VLCPEER_H__
-
-#include "vlcintf.h"
-#include "support/classinfo.h"
-
-class VlcPlugin;
-
-class VlcPeer : public VlcIntf, public ClassInfo
-{
-public:
-    NS_DECL_ISUPPORTS
-    NS_DECL_VLCINTF
-
-    // These flags are used by the DOM and security systems to signal that
-    // JavaScript callers are allowed to call this object's scriptable methods.
-    NS_IMETHOD GetFlags(PRUint32 *aFlags)
-    {
-        *aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT;
-        return NS_OK;
-    }
-
-    NS_IMETHOD GetImplementationLanguage(PRUint32 *aImplementationLanguage)
-    {
-        *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
-        return NS_OK;
-    }
-
-             VlcPeer();
-             VlcPeer( VlcPlugin * );
-    virtual ~VlcPeer();
-
-    void     Disable();
-
-private:
-    VlcPlugin * p_plugin;
-};
-
-#endif
+/*****************************************************************************\r
+ * vlc.h: a VLC plugin for Mozilla\r
+ *****************************************************************************\r
+ * Copyright (C) 2002-2005 the VideoLAN team\r
+ * $Id: vlcruntime.h 14466 2006-02-22 23:34:54Z dionoea $\r
+ *\r
+ * Authors: Damien Fouilleul <damien.fouilleul@laposte.net>\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.\r
+ *****************************************************************************/\r
+\r
+/*\r
+** defined runtime script objects\r
+*/\r
+\r
+#include "nporuntime.h"\r
+\r
+class VlcNPObject: public RuntimeNPObject\r
+{\r
+public:\r
+    VlcNPObject(NPP instance, const NPClass *aClass) :\r
+        RuntimeNPObject(instance, aClass) {};\r
+    virtual ~VlcNPObject() {};\r
+\r
+protected:\r
+    friend class RuntimeNPClass<VlcNPObject>;\r
+\r
+    static const int propertyCount;\r
+    static const NPUTF8 * const propertyNames[];\r
+\r
+    static const int methodCount;\r
+    static const NPUTF8 * const methodNames[];\r
+\r
+    virtual InvokeResult invoke(int index, const NPVariant *args, uint32_t argCount, NPVariant *result);\r
+};\r
+\r