summaryrefslogtreecommitdiff
path: root/trunk/browser-plugin/totemClassInfo.h
diff options
context:
space:
mode:
authorBastien Nocera <hadess@src.gnome.org>2007-01-29 23:21:24 +0000
committerBastien Nocera <hadess@src.gnome.org>2007-01-29 23:21:24 +0000
commit6f6961c06adf36ecb6dc873042b774cbd7ee5d81 (patch)
tree536942c5aa013dfcdbf689c1e3a7d0551c4a8678 /trunk/browser-plugin/totemClassInfo.h
parentfe95cfa6cfe8ee2bc2d80a9917677024177a5b77 (diff)
downloadtotem-6f6961c06adf36ecb6dc873042b774cbd7ee5d81.tar.gz
Tagged for release 2.17.90.V_2_17_90
svn path=/tags/V_2_17_90/; revision=3963
Diffstat (limited to 'trunk/browser-plugin/totemClassInfo.h')
-rw-r--r--trunk/browser-plugin/totemClassInfo.h114
1 files changed, 114 insertions, 0 deletions
diff --git a/trunk/browser-plugin/totemClassInfo.h b/trunk/browser-plugin/totemClassInfo.h
new file mode 100644
index 000000000..76082e41d
--- /dev/null
+++ b/trunk/browser-plugin/totemClassInfo.h
@@ -0,0 +1,114 @@
+/* Totem browser plugin
+ *
+ * Copyright © 2007 Christian Persch
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * $Id: totemNarrowSpacePlugin.cpp 3922 2007-01-19 14:32:48Z hadess $
+ */
+
+#ifndef __TOTEM_CLASSINFO_H__
+#define __TOTEM_CLASSINFO_H__
+
+#include <nsIProgrammingLanguage.h>
+#include <nsISupportsImpl.h>
+#include <nsMemory.h>
+#include <nsXPCOM.h>
+
+#define TOTEM_CLASSINFO_BEGIN(_class,_count,_cid,_description)\
+/* nsISupports getHelperForLanguage (in PRUint32 language); */\
+NS_IMETHODIMP _class::GetHelperForLanguage(PRUint32 language, nsISupports **_retval)\
+{\
+ *_retval = nsnull;\
+ return NS_OK;\
+}\
+\
+/* readonly attribute string contractID; */\
+NS_IMETHODIMP _class::GetContractID(char * *aContractID)\
+{\
+ *aContractID = nsnull;\
+ return NS_OK;\
+}\
+\
+/* readonly attribute string classDescription; */\
+NS_IMETHODIMP _class::GetClassDescription(char * *aClassDescription)\
+{\
+ *aClassDescription = NS_STATIC_CAST (char*,\
+ nsMemory::Clone (_description,\
+ sizeof (_description)));\
+ if (!*aClassDescription)\
+ return NS_ERROR_OUT_OF_MEMORY;\
+\
+ return NS_OK;\
+}\
+\
+/* readonly attribute nsCIDPtr classID; */\
+NS_IMETHODIMP _class::GetClassID(nsCID * *aClassID)\
+{\
+ *aClassID = NS_STATIC_CAST (nsCID*,\
+ nsMemory::Clone (&_cid,\
+ sizeof (nsCID*)));\
+ if (!*aClassID)\
+ return NS_ERROR_OUT_OF_MEMORY;\
+\
+ return NS_OK;\
+}\
+\
+/* readonly attribute PRUint32 implementationLanguage; */\
+NS_IMETHODIMP _class::GetImplementationLanguage(PRUint32 *aImplementationLanguage)\
+{\
+ *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;\
+ return NS_OK;\
+}\
+\
+/* readonly attribute PRUint32 flags; */\
+NS_IMETHODIMP _class::GetFlags(PRUint32 *aFlags)\
+{\
+ *aFlags = nsIClassInfo::PLUGIN_OBJECT | nsIClassInfo::DOM_OBJECT;\
+ return NS_OK;\
+}\
+\
+/* [notxpcom] readonly attribute nsCID classIDNoAlloc; */\
+NS_IMETHODIMP _class::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)\
+{\
+ /* We don't really need to implement this since we're not implementing nsISerializable */\
+ *aClassIDNoAlloc = _cid;\
+ return NS_OK;\
+}\
+\
+NS_IMETHODIMP _class::GetInterfaces (PRUint32 *count, nsIID * **array)\
+{\
+ *array = NS_STATIC_CAST (nsIID**, nsMemory::Alloc (sizeof (nsIID) * _count));\
+ if (!*array)\
+ return NS_ERROR_OUT_OF_MEMORY;\
+\
+ *count = _count;
+
+#define TOTEM_CLASSINFO_ENTRY(_i, _interface)\
+ (*array)[_i] = NS_STATIC_CAST (nsIID*,\
+ nsMemory::Clone(&NS_GET_IID(_interface),\
+ sizeof(nsIID)));\
+ if (!(*array)[_i]) {\
+ NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY (_i, *array);\
+ return NS_ERROR_OUT_OF_MEMORY;\
+ }
+
+
+#define TOTEM_CLASSINFO_END \
+ return NS_OK;\
+}
+
+#endif /* !__TOTEM_CLASSINFO_H__ */