aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-05-01 22:04:24 +0800
committerChristian Persch <chpe@src.gnome.org>2005-05-01 22:04:24 +0800
commit165179754e9c3a75b1c5405dd14dc6ea6939dca3 (patch)
treee76d6ba2a23d824e2c42458f68b705c7b24a157c /embed
parentacb714c91f67a95851bada8d1c272e52b579f3ab (diff)
downloadgsoc2013-epiphany-165179754e9c3a75b1c5405dd14dc6ea6939dca3.tar
gsoc2013-epiphany-165179754e9c3a75b1c5405dd14dc6ea6939dca3.tar.gz
gsoc2013-epiphany-165179754e9c3a75b1c5405dd14dc6ea6939dca3.tar.bz2
gsoc2013-epiphany-165179754e9c3a75b1c5405dd14dc6ea6939dca3.tar.lz
gsoc2013-epiphany-165179754e9c3a75b1c5405dd14dc6ea6939dca3.tar.xz
gsoc2013-epiphany-165179754e9c3a75b1c5405dd14dc6ea6939dca3.tar.zst
gsoc2013-epiphany-165179754e9c3a75b1c5405dd14dc6ea6939dca3.zip
Simplify the class info implementation for EphySidebar.
2005-05-01 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphySidebar.cpp: * embed/mozilla/EphySidebar.h: * embed/mozilla/MozRegisterComponents.cpp: Simplify the class info implementation for EphySidebar.
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/EphySidebar.cpp91
-rw-r--r--embed/mozilla/EphySidebar.h3
-rw-r--r--embed/mozilla/MozRegisterComponents.cpp13
3 files changed, 13 insertions, 94 deletions
diff --git a/embed/mozilla/EphySidebar.cpp b/embed/mozilla/EphySidebar.cpp
index 479ae63ad..fda1babd8 100644
--- a/embed/mozilla/EphySidebar.cpp
+++ b/embed/mozilla/EphySidebar.cpp
@@ -36,8 +36,7 @@
#include "ephy-embed-single.h"
#include "ephy-debug.h"
-/* Implementation file */
-NS_IMPL_ISUPPORTS2(EphySidebar, nsISidebar, nsIClassInfo)
+NS_IMPL_ISUPPORTS1_CI(EphySidebar, nsISidebar)
EphySidebar::EphySidebar()
{
@@ -103,91 +102,3 @@ EphySidebar::AddSearchEngine (const char *aEngineURL,
return NS_OK;
}
-
-//------------------------------------------------------------------------------
-//nsIClassInfo Impl.
-//------------------------------------------------------------------------------
-
-/* void getInterfaces (out PRUint32 count, [array, size_is (count), retval] out nsIIDPtr array); */
-NS_IMETHODIMP EphySidebar::GetInterfaces(PRUint32 *aCount, nsIID * **aArray)
-{
- PRUint32 count = 2;
-
- *aCount = count;
-
- *aArray = NS_STATIC_CAST(nsIID **, nsMemory::Alloc(count * sizeof(nsIID *)));
- NS_ENSURE_TRUE(*aArray, NS_ERROR_OUT_OF_MEMORY);
-
- nsIID *iid = NS_STATIC_CAST(nsIID *,
- nsMemory::Clone(&(NS_GET_IID(nsISidebar)),
- sizeof(nsIID)));
- if (!iid)
- {
- NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(0, *aArray);
-
- return NS_ERROR_OUT_OF_MEMORY;
- }
- (*aArray)[0] = iid;
-
-
- iid = NS_STATIC_CAST(nsIID *,
- nsMemory::Clone(&(NS_GET_IID(nsIClassInfo)),
- sizeof(nsIID)));
- if (!iid)
- {
- NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(1, *aArray);
-
- return NS_ERROR_OUT_OF_MEMORY;
- }
- (*aArray)[1] = iid;
-
- return NS_OK;
-}
-
-/* nsISupports getHelperForLanguage (in PRUint32 language); */
-NS_IMETHODIMP EphySidebar::GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
-{
- *_retval = nsnull;
- return NS_OK;
-}
-
-/* readonly attribute string contractID; */
-NS_IMETHODIMP EphySidebar::GetContractID(char * *aContractID)
-{
- *aContractID = nsCRT::strdup(NS_SIDEBAR_CONTRACTID);
- return NS_OK;
-}
-
-/* readonly attribute string classDescription; */
-NS_IMETHODIMP EphySidebar::GetClassDescription(char * *aClassDescription)
-{
- *aClassDescription = nsCRT::strdup("Sidebar");
- return NS_OK;
-}
-
-/* readonly attribute nsCIDPtr classID; */
-NS_IMETHODIMP EphySidebar::GetClassID(nsCID * *aClassID)
-{
- *aClassID = nsnull;
- return NS_OK;
-}
-
-/* readonly attribute PRUint32 implementationLanguage; */
-NS_IMETHODIMP EphySidebar::GetImplementationLanguage(PRUint32 *aImplementationLanguage)
-{
- *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
- return NS_OK;
-}
-
-/* readonly attribute PRUint32 flags; */
-NS_IMETHODIMP EphySidebar::GetFlags(PRUint32 *aFlags)
-{
- *aFlags = nsIClassInfo::DOM_OBJECT;
- return NS_OK;
-}
-
-/* [notxpcom] readonly attribute nsCID classIDNoAlloc; */
-NS_IMETHODIMP EphySidebar::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
-{
- return NS_ERROR_NOT_AVAILABLE;
-}
diff --git a/embed/mozilla/EphySidebar.h b/embed/mozilla/EphySidebar.h
index fe5b98a48..0d7219e03 100644
--- a/embed/mozilla/EphySidebar.h
+++ b/embed/mozilla/EphySidebar.h
@@ -37,11 +37,10 @@
{0xb1, 0x8e, 0x6e, 0xe5, 0xd8, 0x5a, 0x20, 0x2a} \
}
-class EphySidebar : public nsISidebar, nsIClassInfo
+class EphySidebar : public nsISidebar
{
public:
NS_DECL_ISUPPORTS
- NS_DECL_NSICLASSINFO
NS_DECL_NSISIDEBAR
EphySidebar();
diff --git a/embed/mozilla/MozRegisterComponents.cpp b/embed/mozilla/MozRegisterComponents.cpp
index fcc8ee93e..4a8f8243f 100644
--- a/embed/mozilla/MozRegisterComponents.cpp
+++ b/embed/mozilla/MozRegisterComponents.cpp
@@ -70,7 +70,10 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(GtkNSSDialogs)
NS_GENERIC_FACTORY_CONSTRUCTOR(GtkNSSKeyPairDialogs)
NS_GENERIC_FACTORY_CONSTRUCTOR(GtkNSSSecurityWarningDialogs)
#endif
-
+
+/* class information */
+NS_DECL_CLASSINFO(EphySidebar)
+
static NS_METHOD
RegisterContentPolicy(nsIComponentManager *aCompMgr, nsIFile *aPath,
const char *registryLocation, const char *componentType,
@@ -186,7 +189,13 @@ static const nsModuleComponentInfo sAppComps[] = {
EPHY_SIDEBAR_CID,
NS_SIDEBAR_CONTRACTID,
EphySidebarConstructor,
- RegisterSidebar
+ RegisterSidebar,
+ nsnull /* no unregister func */,
+ nsnull /* no factory destructor */,
+ NS_CI_INTERFACE_GETTER_NAME(EphySidebar),
+ nsnull /* no language helper */,
+ &NS_CLASSINFO_NAME(EphySidebar),
+ nsIClassInfo::DOM_OBJECT
},
};