Blame SOURCES/esc-1.1.0-fix9.patch

f35d1b
diff -up ./esc/src/app/daemon/manifest.mn.fix9 ./esc/src/app/daemon/manifest.mn
f35d1b
--- ./esc/src/app/daemon/manifest.mn.fix9	2011-03-24 12:35:31.481712082 -0700
f35d1b
+++ ./esc/src/app/daemon/manifest.mn	2011-03-24 12:35:39.758712086 -0700
f35d1b
@@ -37,7 +37,7 @@ DEFINES += $(shell pkg-config --cflags x
f35d1b
 CPPFLAGS		+= $(DEFINES) -g
f35d1b
 
f35d1b
 LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib -L$(XULRUNNER_LIBS_LDFLAGS)  -lnss3 -lnspr4  -lssl3 -lckyapplet $(shell pkg-config --libs xft) 
f35d1b
-LDFLAGS +=  -lckymanager -lhttpchunked -lm  -lnss3 -lplc4 -lplds4
f35d1b
+LDFLAGS +=  -lckymanager -lhttpchunked -lm  -lnss3 -lplc4 -lplds4 -lX11
f35d1b
 # MODULE public and private header  directories are implicitly REQUIRED.
f35d1b
 
f35d1b
 CPPSRCS = \
f35d1b
diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix9 ./esc/src/app/xpcom/rhCoolKey.cpp
f35d1b
--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix9	2011-03-24 12:37:10.273712093 -0700
f35d1b
+++ ./esc/src/app/xpcom/rhCoolKey.cpp	2011-03-24 12:37:18.813712092 -0700
f35d1b
@@ -70,6 +70,7 @@
f35d1b
 
f35d1b
 #define PSM_COMPONENT_CONTRACTID "@mozilla.org/psm;1"
f35d1b
 #define NS_CERTOVERRIDE_CONTRACTID "@mozilla.org/security/certoverride;1"
f35d1b
+#define RH_COOLKEY_CONTRACTID "@redhat.com/rhCoolKey;1"
f35d1b
 
f35d1b
 static const nsIID kIModuleIID = NS_IMODULE_IID;
f35d1b
 static const nsIID kIFactoryIID = NS_IFACTORY_IID;
f35d1b
@@ -1711,297 +1712,36 @@ NS_IMETHODIMP rhCoolKey::GetCoolKeyVersi
f35d1b
 
f35d1b
 NS_GENERIC_FACTORY_CONSTRUCTOR(rhCoolKey)
f35d1b
 
f35d1b
-NS_IMPL_ISUPPORTS1(rhCoolKey,rhICoolKey) 
f35d1b
-
f35d1b
-// Implement full module and factory dance so we can see what is going on 
f35d1b
-
f35d1b
-class rhCoolKeyFactory: public nsIFactory{
f35d1b
-private:
f35d1b
-nsrefcnt mRefCnt;
f35d1b
-public:
f35d1b
-rhCoolKeyFactory();
f35d1b
-virtual ~rhCoolKeyFactory();
f35d1b
-
f35d1b
-NS_IMETHOD QueryInterface(const nsIID &aIID, void **aResult);
f35d1b
-NS_IMETHOD_(nsrefcnt) AddRef(void);
f35d1b
-NS_IMETHOD_(nsrefcnt) Release(void);
f35d1b
-
f35d1b
-NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result);
f35d1b
-NS_IMETHOD LockFactory(PRBool lock);
f35d1b
-
f35d1b
+// Build a table of ClassIDs (CIDs) which are implemented by this module. CIDs
f35d1b
+// // should be completely unique UUIDs.
f35d1b
+// // each entry has the form { CID, service, factoryproc, constructorproc }
f35d1b
+// // where factoryproc is usually NULL.
f35d1b
+static const mozilla::Module::CIDEntry kCoolKeyCIDs[] = {
f35d1b
+     { &kCoolKeyCID, false, NULL, rhCoolKeyConstructor },
f35d1b
+         { NULL }
f35d1b
+         };
f35d1b
+
f35d1b
+// Build a table which maps contract IDs to CIDs.
f35d1b
+// // A contract is a string which identifies a particular set of functionality. In some
f35d1b
+// // cases an extension component may override the contract ID of a builtin gecko component
f35d1b
+// // to modify or extend functionality.
f35d1b
+//
f35d1b
+static const mozilla::Module::ContractIDEntry kCoolKeyContracts[] = {
f35d1b
+     { RH_COOLKEY_CONTRACTID, &kCoolKeyCID },
f35d1b
+     { NULL }
f35d1b
 };
f35d1b
 
f35d1b
-rhCoolKeyFactory::rhCoolKeyFactory()
f35d1b
-{
f35d1b
-mRefCnt = 0;
f35d1b
-}
f35d1b
-rhCoolKeyFactory::~rhCoolKeyFactory()
f35d1b
-{
f35d1b
-}
f35d1b
-
f35d1b
-NS_IMETHODIMP rhCoolKeyFactory::QueryInterface(const nsIID &aIID,
f35d1b
-void **aResult)
f35d1b
-{
f35d1b
-if (aResult == NULL) {
f35d1b
-return NS_ERROR_NULL_POINTER;
f35d1b
-}
f35d1b
-*aResult = NULL;
f35d1b
-if (aIID.Equals(kISupportsIID)) {
f35d1b
-*aResult = (void *) this;
f35d1b
-}
f35d1b
-else
f35d1b
-if (aIID.Equals(kIFactoryIID)) {
f35d1b
-*aResult = (void *) this;
f35d1b
-}
f35d1b
-
f35d1b
-if (*aResult == NULL) {
f35d1b
-return NS_ERROR_NO_INTERFACE;
f35d1b
-}
f35d1b
-
f35d1b
-AddRef();
f35d1b
-return NS_OK;
f35d1b
-}
f35d1b
-
f35d1b
-NS_IMETHODIMP_(nsrefcnt) rhCoolKeyFactory::AddRef()
f35d1b
-{
f35d1b
-return ++mRefCnt;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-NS_IMETHODIMP_(nsrefcnt) rhCoolKeyFactory::Release()
f35d1b
-{
f35d1b
-if (--mRefCnt == 0) {
f35d1b
-delete this;
f35d1b
-return 0;
f35d1b
-}
f35d1b
-return mRefCnt;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-NS_IMETHODIMP
f35d1b
-rhCoolKeyFactory::CreateInstance(nsISupports *aOuter, const nsIID & iid, void * *result)
f35d1b
-{
f35d1b
-if (!result)
f35d1b
-return NS_ERROR_INVALID_ARG;
f35d1b
-
f35d1b
-rhCoolKey* sample = new rhCoolKey();
f35d1b
-if (!sample)
f35d1b
-return NS_ERROR_OUT_OF_MEMORY;
f35d1b
-
f35d1b
-nsresult rv = sample->QueryInterface(iid, result);
f35d1b
-
f35d1b
-if (NS_FAILED(rv)) {
f35d1b
-*result = nsnull;
f35d1b
-delete sample;
f35d1b
-}
f35d1b
-
f35d1b
-return rv;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-NS_IMETHODIMP
f35d1b
-rhCoolKeyFactory::LockFactory(PRBool lock)
f35d1b
-{
f35d1b
-return NS_ERROR_NOT_IMPLEMENTED;
f35d1b
-}
f35d1b
-
f35d1b
-// Module implementation
f35d1b
-class rhCoolKeyModule : public nsIModule
f35d1b
-{
f35d1b
-public:
f35d1b
-rhCoolKeyModule();
f35d1b
-virtual ~rhCoolKeyModule();
f35d1b
-
f35d1b
-// nsISupports methods:
f35d1b
-NS_IMETHOD QueryInterface(const nsIID & uuid, void * *result);
f35d1b
-NS_IMETHOD_(nsrefcnt) AddRef(void);
f35d1b
-NS_IMETHOD_(nsrefcnt) Release(void);
f35d1b
-
f35d1b
-// nsIModule methods:
f35d1b
-NS_IMETHOD GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass, const nsIID & aIID, void * *aResult);
f35d1b
-NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr, const char *aType);
f35d1b
-NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr);
f35d1b
-NS_IMETHOD CanUnload(nsIComponentManager *aCompMgr, PRBool *_retval);
f35d1b
-
f35d1b
-private:
f35d1b
-nsrefcnt mRefCnt;
f35d1b
+static const mozilla::Module kCoolKeyModule = {
f35d1b
+    mozilla::Module::kVersion,
f35d1b
+    kCoolKeyCIDs,
f35d1b
+    kCoolKeyContracts,
f35d1b
+    NULL 
f35d1b
 };
f35d1b
 
f35d1b
+// The following line implements the one-and-only "NSModule" symbol exported from this
f35d1b
+// // shared library.
f35d1b
+ NSMODULE_DEFN(rhCoolKeyModule) = &kCoolKeyModule;
f35d1b
+//
f35d1b
 
f35d1b
-//----------------------------------------------------------------------
f35d1b
-
f35d1b
-rhCoolKeyModule::rhCoolKeyModule()
f35d1b
-{
f35d1b
-mRefCnt = 0;
f35d1b
-}
f35d1b
-
f35d1b
-rhCoolKeyModule::~rhCoolKeyModule()
f35d1b
-{
f35d1b
-}
f35d1b
-
f35d1b
-// nsISupports implemention
f35d1b
-NS_IMETHODIMP_(nsrefcnt)
f35d1b
-rhCoolKeyModule::AddRef(void)
f35d1b
-{
f35d1b
-char tBuff[56];
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::AddRef \n",GetTStamp(tBuff,56)));
f35d1b
-++mRefCnt;
f35d1b
-return mRefCnt;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-NS_IMETHODIMP_(nsrefcnt)
f35d1b
-rhCoolKeyModule::Release(void)
f35d1b
-{
f35d1b
-char tBuff[56];
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::Release : mRefCnt %d \n",GetTStamp(tBuff,56),mRefCnt - 1));
f35d1b
---mRefCnt;
f35d1b
-if (mRefCnt == 0) {
f35d1b
-mRefCnt = 1; /* stabilize */
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::Release deleting Module \n",GetTStamp(tBuff,56)));
f35d1b
-delete this;
f35d1b
-return 0;
f35d1b
-}
f35d1b
-return mRefCnt;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-NS_IMETHODIMP
f35d1b
-rhCoolKeyModule::QueryInterface(REFNSIID aIID, void** aInstancePtr)
f35d1b
-{
f35d1b
-char tBuff[56];
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::QueryInterface \n",GetTStamp(tBuff,56)));
f35d1b
-if ( !aInstancePtr )
f35d1b
-return NS_ERROR_NULL_POINTER;
f35d1b
-
f35d1b
-nsISupports* foundInterface;
f35d1b
-
f35d1b
-if ( aIID.Equals(kIModuleIID) )
f35d1b
-foundInterface = (nsIModule*) this;
f35d1b
-
f35d1b
-else if ( aIID.Equals(kISupportsIID) )
f35d1b
-foundInterface = (nsISupports*) this;
f35d1b
-
f35d1b
-else
f35d1b
-foundInterface = 0;
f35d1b
-
f35d1b
-if (foundInterface) {
f35d1b
-foundInterface->AddRef();
f35d1b
-*aInstancePtr = foundInterface;
f35d1b
-return NS_OK;
f35d1b
-}
f35d1b
-
f35d1b
-*aInstancePtr = foundInterface;
f35d1b
-return NS_NOINTERFACE;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-// Create a factory object for creating instances of aClass.
f35d1b
-NS_IMETHODIMP
f35d1b
-rhCoolKeyModule::GetClassObject(nsIComponentManager *aCompMgr,
f35d1b
-const nsCID& aClass,
f35d1b
-const nsIID& aIID,
f35d1b
-void** result)
f35d1b
-{
f35d1b
-char tBuff[56];
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::GetClassObject \n",GetTStamp(tBuff,56)));
f35d1b
-if (!kCoolKeyCID.Equals(aClass))
f35d1b
-return NS_ERROR_FACTORY_NOT_REGISTERED;
f35d1b
-
f35d1b
-if (!result)
f35d1b
-return NS_ERROR_INVALID_ARG;
f35d1b
-
f35d1b
-rhCoolKeyFactory* factory = new rhCoolKeyFactory();
f35d1b
-if (!factory)
f35d1b
-return NS_ERROR_OUT_OF_MEMORY;
f35d1b
-
f35d1b
-nsresult rv = factory->QueryInterface(aIID, result);
f35d1b
-
f35d1b
-if (NS_FAILED(rv)) {
f35d1b
-*result = nsnull;
f35d1b
-delete factory;
f35d1b
-}
f35d1b
-
f35d1b
-return rv;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-NS_IMETHODIMP
f35d1b
-rhCoolKeyModule::RegisterSelf(nsIComponentManager *aCompMgr,
f35d1b
-nsIFile* aPath,
f35d1b
-const char* registryLocation,
f35d1b
-const char* componentType)
f35d1b
-{
f35d1b
-
f35d1b
-char tBuff[54];
f35d1b
-nsIComponentRegistrar* compReg = nsnull;
f35d1b
-
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::RegisterSelf \n",GetTStamp(tBuff,56)));
f35d1b
-nsresult rv = aCompMgr->QueryInterface(kIComponentRegistrarIID, (void**)&compReg);
f35d1b
-if (NS_FAILED(rv))
f35d1b
-return rv;
f35d1b
-
f35d1b
-rv = compReg->RegisterFactoryLocation(kCoolKeyCID,
f35d1b
-"CoolKey",
f35d1b
-"@redhat.com/rhCoolKey",
f35d1b
-aPath,
f35d1b
-registryLocation,
f35d1b
-componentType);
f35d1b
-
f35d1b
-compReg->Release();
f35d1b
-
f35d1b
-return rv;
f35d1b
-}
f35d1b
-
f35d1b
-NS_IMETHODIMP
f35d1b
-rhCoolKeyModule::UnregisterSelf(nsIComponentManager* aCompMgr,
f35d1b
-nsIFile* aPath,
f35d1b
-const char* registryLocation)
f35d1b
-{
f35d1b
-char tBuff[56];
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::UnregisterSelf \n",GetTStamp(tBuff,56)));
f35d1b
-nsIComponentRegistrar* compReg = nsnull;
f35d1b
-
f35d1b
-nsresult rv = aCompMgr->QueryInterface(kIComponentRegistrarIID, (void**)&compReg);
f35d1b
-if (NS_FAILED(rv))
f35d1b
-return rv;
f35d1b
-
f35d1b
-rv = compReg->UnregisterFactoryLocation(kCoolKeyCID, aPath);
f35d1b
-
f35d1b
-compReg->Release();
f35d1b
-
f35d1b
-return rv;
f35d1b
-}
f35d1b
-
f35d1b
-NS_IMETHODIMP
f35d1b
-rhCoolKeyModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
f35d1b
-{
f35d1b
-*okToUnload = PR_FALSE; // we do not know how to unload.
f35d1b
-return NS_OK;
f35d1b
-}
f35d1b
-
f35d1b
-
f35d1b
-//----------------------------------------------------------------------
f35d1b
-
f35d1b
-extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
f35d1b
-nsIFile* location,
f35d1b
-nsIModule** return_cobj)
f35d1b
-{
f35d1b
-nsresult rv = NS_OK;
f35d1b
-
f35d1b
-char tBuff[56];
f35d1b
-PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKeyModule::NSGetModule \n",GetTStamp(tBuff,56)));
f35d1b
-
f35d1b
-// Create and initialize the module instance
f35d1b
-rhCoolKeyModule *m = new rhCoolKeyModule();
f35d1b
-if (!m) {
f35d1b
-return NS_ERROR_OUT_OF_MEMORY;
f35d1b
-}
f35d1b
+NS_IMPL_ISUPPORTS1(rhCoolKey,rhICoolKey) 
f35d1b
 
f35d1b
-// Increase refcnt and store away nsIModule interface to m in return_cobj
f35d1b
-rv = m->QueryInterface(kIModuleIID, (void**)return_cobj);
f35d1b
-if (NS_FAILED(rv)) {
f35d1b
-delete m;
f35d1b
-}
f35d1b
-return rv;
f35d1b
-}
f35d1b
diff -up ./esc/src/app/xpcom/rhCoolKey.h.fix9 ./esc/src/app/xpcom/rhCoolKey.h
f35d1b
--- ./esc/src/app/xpcom/rhCoolKey.h.fix9	2011-03-24 12:40:07.291712102 -0700
f35d1b
+++ ./esc/src/app/xpcom/rhCoolKey.h	2011-03-24 12:40:15.644712108 -0700
f35d1b
@@ -19,7 +19,9 @@
f35d1b
 #define RH_COOLKEY_H
f35d1b
 
f35d1b
 #include "rhICoolKey.h"
f35d1b
-#include "nsIGenericFactory.h"
f35d1b
+/*#include "nsIGenericFactory.h" */
f35d1b
+#include "mozilla/ModuleUtils.h"
f35d1b
+#include "nsIClassInfoImpl.h"
f35d1b
 #include "nsEmbedString.h"
f35d1b
 #include <list>
f35d1b
 #include "nspr.h"
f35d1b
diff -up ./esc/src/app/xpcom/rhICoolKey.idl.fix9 ./esc/src/app/xpcom/rhICoolKey.idl
f35d1b
--- ./esc/src/app/xpcom/rhICoolKey.idl.fix9	2011-03-24 12:42:27.595712113 -0700
f35d1b
+++ ./esc/src/app/xpcom/rhICoolKey.idl	2011-03-24 12:42:39.069712124 -0700
f35d1b
@@ -17,12 +17,11 @@
f35d1b
 
f35d1b
 #include "nsISupports.idl"
f35d1b
 #include "rhIKeyNotify.idl"
f35d1b
-#include "nsIObserver.idl"
f35d1b
+//#include "nsIObserver.idl"
f35d1b
 
f35d1b
-interface nsIDOMHTMLDocument;
f35d1b
 [scriptable,uuid(ea54eee4-9548-4b63-b94d-c519ffc91d09)]
f35d1b
 
f35d1b
-interface rhICoolKey: nsISupports
f35d1b
+interface rhICoolKey:nsISupports
f35d1b
 {
f35d1b
 
f35d1b
     void rhNotifyKeyStateChange(in unsigned long aKeyType, in string aKeyID,  in unsigned long aKeyState, in unsigned long aData, in string strData);
f35d1b
diff -up ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix9 ./esc/src/app/xpcom/tray/rhLinuxTray.cpp
f35d1b
--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix9	2011-03-24 12:43:20.262712118 -0700
f35d1b
+++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp	2011-03-24 12:43:34.767712121 -0700
f35d1b
@@ -18,14 +18,17 @@
f35d1b
 #define FORCE_PR_LOG 1
f35d1b
 
f35d1b
 #include "rhTray.h"
f35d1b
-#include "nsIGenericFactory.h"
f35d1b
+#include "mozilla/ModuleUtils.h"
f35d1b
 #include <prlog.h>
f35d1b
 #include "notifytray.h"
f35d1b
 #include "nsIStringBundle.h"
f35d1b
 #include <gdk/gdkx.h>
f35d1b
 #include <stdlib.h>
f35d1b
 
f35d1b
-NS_IMPL_ISUPPORTS1(rhTray, rhITray)
f35d1b
+#define RH_COOLKEY_TRAY_CONTRACTID "@redhat.com/rhTray;1"
f35d1b
+
f35d1b
+static const nsCID kCoolKeyTrayCID = RH_TRAY_CID;
f35d1b
+
f35d1b
 
f35d1b
 GtkWidget* rhTray::mWnd = NULL;
f35d1b
 GtkWidget* rhTray::mIconMenu = NULL;
f35d1b
@@ -861,15 +864,36 @@ gboolean rhTrayWindowListener::WndDelete
f35d1b
 NS_GENERIC_FACTORY_CONSTRUCTOR(rhTray)
f35d1b
 
f35d1b
 
f35d1b
-//rhTray Module Implementation
f35d1b
+// Build a table of ClassIDs (CIDs) which are implemented by this module. CIDs
f35d1b
+// // // should be completely unique UUIDs.
f35d1b
+// // // each entry has the form { CID, service, factoryproc, constructorproc }
f35d1b
+// // // where factoryproc is usually NULL.
f35d1b
+
f35d1b
+static const mozilla::Module::CIDEntry kCoolKeyTrayCIDs[] = {
f35d1b
+      { &kCoolKeyTrayCID, false, NULL, rhTrayConstructor },
f35d1b
+               { NULL }
f35d1b
+};
f35d1b
 
f35d1b
-static const nsModuleComponentInfo components[] =
f35d1b
-{
f35d1b
-  { "rhTray",
f35d1b
-    RH_TRAY_CID,
f35d1b
-    "@redhat.com/rhTray",
f35d1b
-    rhTrayConstructor
f35d1b
-  }
f35d1b
+// Build a table which maps contract IDs to CIDs.
f35d1b
+// A contract is a string which identifies a particular set of functionality. In some
f35d1b
+// cases an extension component may override the contract ID of a builtin gecko component
f35d1b
+// to modify or extend functionality.
f35d1b
+
f35d1b
+static const mozilla::Module::ContractIDEntry kCoolKeyTrayContracts[] = {
f35d1b
+    { RH_COOLKEY_TRAY_CONTRACTID, &kCoolKeyTrayCID },
f35d1b
+    { NULL }
f35d1b
 };
f35d1b
 
f35d1b
-NS_IMPL_NSGETMODULE(rhTrayModule, components)
f35d1b
+static const mozilla::Module kCoolKeyTrayModule = {
f35d1b
+    mozilla::Module::kVersion,
f35d1b
+    kCoolKeyTrayCIDs,
f35d1b
+    kCoolKeyTrayContracts,
f35d1b
+   NULL
f35d1b
+};
f35d1b
+
f35d1b
+// The following line implements the one-and-only "NSModule" symbol exported from this
f35d1b
+// shared library.
f35d1b
+NSMODULE_DEFN(rhCoolKeyTrayModule) = &kCoolKeyTrayModule;
f35d1b
+
f35d1b
+NS_IMPL_ISUPPORTS1(rhTray,rhITray)
f35d1b
+
f35d1b
diff -up ./esc/src/app/xpcom/tray/rhTray.h.fix9 ./esc/src/app/xpcom/tray/rhTray.h
f35d1b
--- ./esc/src/app/xpcom/tray/rhTray.h.fix9	2011-03-24 12:44:10.035712119 -0700
f35d1b
+++ ./esc/src/app/xpcom/tray/rhTray.h	2011-03-24 12:44:19.059712129 -0700
f35d1b
@@ -19,7 +19,8 @@
f35d1b
 #define RH_TRAY_H
f35d1b
 
f35d1b
 #include "rhITray.h"
f35d1b
-#include "nsIGenericFactory.h"
f35d1b
+//#include "nsIGenericFactory.h"
f35d1b
+//#include mozilla/ModuleUtils.h
f35d1b
 #include "nsEmbedString.h"
f35d1b
 #include <list>
f35d1b
 #include "nsCOMPtr.h"
f35d1b
diff -up ./esc/src/app/xul/esc/application.ini.fix9 ./esc/src/app/xul/esc/application.ini
f35d1b
--- ./esc/src/app/xul/esc/application.ini.fix9	2011-03-24 12:45:51.087712126 -0700
f35d1b
+++ ./esc/src/app/xul/esc/application.ini	2011-03-24 12:46:01.780712129 -0700
f35d1b
@@ -25,11 +25,11 @@ Vendor=RedHat
f35d1b
 Name=ESC
f35d1b
 ;
f35d1b
 ; This field specifies your application's version.  This field is optional.
f35d1b
-Version=1.1.0-12
f35d1b
+Version=1.1.0-13
f35d1b
 ;
f35d1b
 ; This field specifies your application's build ID (timestamp).  This field is
f35d1b
 ; required.
f35d1b
-BuildID=0000001012
f35d1b
+BuildID=0000001013
f35d1b
 ;
f35d1b
 ; This ID is just an example.  Every XUL app ought to have it's own unique ID.
f35d1b
 ; You can use the microsoft "guidgen" or "uuidgen" tools, or go on
f35d1b
@@ -41,12 +41,12 @@ ID={6380471b-1924-4b48-b652-49f42951af86
f35d1b
 ; This field is required.  It specifies the minimum Gecko version that this
f35d1b
 ; application requires.  Specifying 1.8 matches all releases with a version
f35d1b
 ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
f35d1b
-MinVersion=1.9
f35d1b
+MinVersion=1.99
f35d1b
 ;
f35d1b
 ; This field is optional.  It specifies the maximum Gecko version that this
f35d1b
 ; application requires.  It should be specified if your application uses
f35d1b
 ; unfrozen interfaces.  Specifying 1.8 matches all releases with a version
f35d1b
 ; prefixed by 1.8 (e.g., 1.8a4, 1.8b, 1.8.2).
f35d1b
-MaxVersion=1.99
f35d1b
+MaxVersion=2.99
f35d1b
 
f35d1b
 [Shell]
f35d1b
diff -up ./esc/src/app/xul/esc/chrome/chrome.manifest.fix9 ./esc/src/app/xul/esc/chrome/chrome.manifest
f35d1b
--- ./esc/src/app/xul/esc/chrome/chrome.manifest.fix9	2011-03-24 12:52:14.601712157 -0700
f35d1b
+++ ./esc/src/app/xul/esc/chrome/chrome.manifest	2011-03-24 12:52:23.723712155 -0700
f35d1b
@@ -1,19 +0,0 @@
f35d1b
-# BEGIN COPYRIGHT BLOCK
f35d1b
-# This Program is free software; you can redistribute it and/or modify it under
f35d1b
-# the terms of the GNU General Public License as published by the Free Software
f35d1b
-# Foundation; version 2 of the License.
f35d1b
-#
f35d1b
-# This Program is distributed in the hope that it will be useful, but WITHOUT
f35d1b
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
f35d1b
-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
f35d1b
-#
f35d1b
-# You should have received a copy of the GNU General Public License along with
f35d1b
-# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
f35d1b
-# Place, Suite 330, Boston, MA 02111-1307 USA.
f35d1b
-#
f35d1b
-# Copyright (C) 2005 Red Hat, Inc.
f35d1b
-# All rights reserved.
f35d1b
-# END COPYRIGHT BLOCK
f35d1b
-
f35d1b
-content esc content/esc/
f35d1b
-locale esc en-US locale/en-US/
f35d1b
diff -up ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix9 ./esc/src/app/xul/esc/chrome/content/esc/ESC.js
f35d1b
--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix9	2011-03-24 12:52:49.995712156 -0700
f35d1b
+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js	2011-03-24 12:52:59.829712160 -0700
f35d1b
@@ -132,7 +132,7 @@ jsNotify.prototype = {
f35d1b
 
f35d1b
   try {
f35d1b
     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
f35d1b
-    netkey = Components.classes["@redhat.com/rhCoolKey"].getService();
f35d1b
+    netkey = Components.classes["@redhat.com/rhCoolKey;1"].getService();
f35d1b
     netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey);
f35d1b
     gNotify = new jsNotify;
f35d1b
     netkey.rhCoolKeySetNotifyCallback(gNotify);
f35d1b
diff -up ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js.fix9 ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js
f35d1b
--- ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js.fix9	2011-03-24 12:53:21.344712157 -0700
f35d1b
+++ ./esc/src/app/xul/esc/chrome/content/esc/TRAY.js	2011-03-24 12:53:28.456712159 -0700
f35d1b
@@ -63,7 +63,7 @@ jsWindNotify.prototype = {
f35d1b
  // GECKO ONLY initialization
f35d1b
 try {
f35d1b
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
f35d1b
-   gTray =  Components.classes["@redhat.com/rhTray"].getService();
f35d1b
+   gTray =  Components.classes["@redhat.com/rhTray;1"].getService();
f35d1b
 
f35d1b
 
f35d1b
       gTray = gTray.QueryInterface(Components.interfaces.rhITray);
f35d1b
diff -up ./esc/src/app/xul/esc/chrome.manifest.fix9 ./esc/src/app/xul/esc/chrome.manifest
f35d1b
--- ./esc/src/app/xul/esc/chrome.manifest.fix9	2011-03-24 12:49:14.983712140 -0700
f35d1b
+++ ./esc/src/app/xul/esc/chrome.manifest	2011-03-24 12:49:47.350712147 -0700
f35d1b
@@ -0,0 +1,33 @@
f35d1b
+# BEGIN COPYRIGHT BLOCK
f35d1b
+# This Program is free software; you can redistribute it and/or modify it under
f35d1b
+# the terms of the GNU General Public License as published by the Free Software
f35d1b
+# Foundation; version 2 of the License.
f35d1b
+#
f35d1b
+# This Program is distributed in the hope that it will be useful, but WITHOUT
f35d1b
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
f35d1b
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
f35d1b
+#
f35d1b
+# You should have received a copy of the GNU General Public License along with
f35d1b
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
f35d1b
+# Place, Suite 330, Boston, MA 02111-1307 USA.
f35d1b
+#
f35d1b
+# Copyright (C) 2005 Red Hat, Inc.
f35d1b
+# All rights reserved.
f35d1b
+# END COPYRIGHT BLOCK
f35d1b
+
f35d1b
+content esc chrome/content/esc/
f35d1b
+locale esc en-US chrome/locale/en-US/
f35d1b
+
f35d1b
+interfaces components/rhICoolKey.xpt
f35d1b
+interfaces components/rhIKeyNotify.xpt
f35d1b
+interfaces components/rhITray.xpt
f35d1b
+interfaces components/rhITrayWindNotify.xpt
f35d1b
+
f35d1b
+
f35d1b
+binary-component components/librhCoolKey.so
f35d1b
+binary-component components/librhTray.so
f35d1b
+
f35d1b
+
f35d1b
+component {36c65861-52a8-4ce9-aa3b-235b88216ed4}  components/escCLH.js
f35d1b
+contract  @redhat.com/esc-clh;1 {36c65861-52a8-4ce9-aa3b-235b88216ed4} 
f35d1b
+category command-line-handler escCLH @redhat.com/esc-clh;1 
f35d1b
diff -up ./esc/src/app/xul/esc/components/escCLH.js.fix9 ./esc/src/app/xul/esc/components/escCLH.js
f35d1b
--- ./esc/src/app/xul/esc/components/escCLH.js.fix9	2011-03-24 12:54:15.072712160 -0700
f35d1b
+++ ./esc/src/app/xul/esc/components/escCLH.js	2011-03-24 12:54:53.868712165 -0700
f35d1b
@@ -2,6 +2,8 @@
f35d1b
 * -myapp commandline handler; starts up My App.
f35d1b
 */
f35d1b
 
f35d1b
+ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
f35d1b
+
f35d1b
  const nsIAppShellService    = Components.interfaces.nsIAppShellService;
f35d1b
  const nsISupports           = Components.interfaces.nsISupports;
f35d1b
  const nsICategoryManager    = Components.interfaces.nsICategoryManager;
f35d1b
@@ -20,20 +22,26 @@
f35d1b
   consoleService.logStringMessage("esc: " + message  + "\n");
f35d1b
  }
f35d1b
 
f35d1b
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
f35d1b
+
f35d1b
 /*
f35d1b
 * Classes
f35d1b
 */
f35d1b
+
f35d1b
+function escCLH() {}
f35d1b
  
f35d1b
- const escCLH = {
f35d1b
+  escCLH.prototype = {
f35d1b
+
f35d1b
+
f35d1b
+   contractID:  "@redhat.com/esc-clh;1",
f35d1b
+   classID:  Components.ID("{36c65861-52a8-4ce9-aa3b-235b88216ed4}"),
f35d1b
+  // const clh_category = "c-esc";
f35d1b
+
f35d1b
+
f35d1b
    /* nsISupports */
f35d1b
-   QueryInterface : function clh_QI(iid) {
f35d1b
-       if (iid.equals(nsICommandLineHandler) ||
f35d1b
-           iid.equals(nsIFactory) ||
f35d1b
-           iid.equals(nsISupports))
f35d1b
-           return this;
f35d1b
 
f35d1b
-       throw Components.results.NS_ERROR_NO_INTERFACE;
f35d1b
-   },
f35d1b
+   QueryInterface : XPCOMUtils.generateQI([nsICommandLineHandler]),
f35d1b
+
f35d1b
 
f35d1b
    /* nsICommandLineHandler */
f35d1b
 
f35d1b
@@ -91,76 +99,8 @@
f35d1b
 
f35d1b
    helpInfo : "  -myapp  Open the My App.\n",
f35d1b
 
f35d1b
-   /* nsIFactory */
f35d1b
-
f35d1b
-   createInstance : function clh_CI(outer, iid) {
f35d1b
-       if (outer != null)
f35d1b
-           throw Components.results.NS_ERROR_NO_AGGREGATION;
f35d1b
-
f35d1b
-       return this.QueryInterface(iid);
f35d1b
-   },
f35d1b
-
f35d1b
-   lockFactory : function clh_lock(lock) {
f35d1b
-       /* no-op */
f35d1b
-   }
f35d1b
- };
f35d1b
-
f35d1b
- const clh_contractID = "@redhat.com/esc-clh;1";
f35d1b
- const clh_CID = Components.ID("{36c65861-52a8-4ce9-aa3b-235b88216ed4}");
f35d1b
- const clh_category = "c-esc";
f35d1b
-
f35d1b
- const escCLHModule = {
f35d1b
-   /* nsISupports */
f35d1b
-
f35d1b
-   QueryInterface : function mod_QI(iid) {
f35d1b
-       if (iid.equals(nsIModule) ||
f35d1b
-           iid.equals(nsISupports))
f35d1b
-           return this;
f35d1b
-
f35d1b
-       throw Components.results.NS_ERROR_NO_INTERFACE;
f35d1b
-   },
f35d1b
-
f35d1b
-   /* nsIModule */
f35d1b
-   getClassObject : function mod_gch(compMgr, cid, iid) {
f35d1b
-       if (cid.equals(clh_CID))
f35d1b
-           return escCLH.QueryInterface(iid);
f35d1b
-
f35d1b
-       throw Components.results.NS_ERROR_NOT_REGISTERED;
f35d1b
-   },
f35d1b
-
f35d1b
-   registerSelf : function mod_regself(compMgr, fileSpec, location, type) {
f35d1b
-       compMgr.QueryInterface(nsIComponentRegistrar);
f35d1b
-
f35d1b
-       compMgr.registerFactoryLocation(clh_CID,
f35d1b
-                                       "escCLH",
f35d1b
-                                       clh_contractID,
f35d1b
-                                       fileSpec,
f35d1b
-                                       location,
f35d1b
-                                       type);
f35d1b
-
f35d1b
-       var catMan = Components.classes["@mozilla.org/categorymanager;1"]
f35d1b
-                              .getService(nsICategoryManager);
f35d1b
-       catMan.addCategoryEntry("command-line-handler",
f35d1b
-                               clh_category,
f35d1b
-                               clh_contractID, true, true);
f35d1b
-   },
f35d1b
-
f35d1b
-   unregisterSelf : function mod_unreg(compMgr, location, type) {
f35d1b
-       compMgr.QueryInterface(nsIComponentRegistrar);
f35d1b
-
f35d1b
-       compMgr.unregisterFactoryLocation(clh_CID, location);
f35d1b
-
f35d1b
-       var catMan = Components.classes["@mozilla.org/categorymanager;1"]
f35d1b
-                              .getService(nsICategoryManager);
f35d1b
-       catMan.deleteCategoryEntry("command-line-handler", clh_category);
f35d1b
-   },
f35d1b
-
f35d1b
-   canUnload : function (compMgr) {
f35d1b
-       return true;
f35d1b
-   }
f35d1b
  };
f35d1b
 
f35d1b
  /* Module initialisation */
f35d1b
- function NSGetModule(comMgr, fileSpec) {
f35d1b
-   return escCLHModule;
f35d1b
- }
f35d1b
+
f35d1b
+var NSGetFactory = XPCOMUtils.generateNSGetFactory([escCLH]);
f35d1b
diff -up ./esc/src/lib/notifytray/notifyareaicon.c.fix9 ./esc/src/lib/notifytray/notifyareaicon.c
f35d1b
--- ./esc/src/lib/notifytray/notifyareaicon.c.fix9	2011-03-24 12:57:00.410712173 -0700
f35d1b
+++ ./esc/src/lib/notifytray/notifyareaicon.c	2011-03-24 12:57:21.501712174 -0700
f35d1b
@@ -90,19 +90,7 @@ notify_area_icon_class_init (NotifyAreaI
f35d1b
 static void
f35d1b
 notify_area_icon_unrealize (GtkWidget *widget)
f35d1b
 {
f35d1b
-  NotifyAreaIcon *icon =  (NotifyAreaIcon *) widget;
f35d1b
-
f35d1b
-  GdkWindow *root_window;
f35d1b
-
f35d1b
   g_print("notify_area_icon_unrealize \n");
f35d1b
-  if (icon->manager_wnd != None)
f35d1b
-    {
f35d1b
-      GdkWindow *gdkwin;
f35d1b
-      gdkwin = gdk_window_lookup (icon->manager_wnd);
f35d1b
-
f35d1b
-    }
f35d1b
-
f35d1b
-  root_window = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
f35d1b
 
f35d1b
   if (GTK_WIDGET_CLASS (plug_parent_class)->unrealize)
f35d1b
     (* GTK_WIDGET_CLASS (plug_parent_class)->unrealize) (widget);
f35d1b
@@ -159,14 +147,6 @@ notify_area_icon_update_manager_wnd(Noti
f35d1b
  
f35d1b
   xdisplay = gdk_display;
f35d1b
   
f35d1b
-  if (icon->manager_wnd != None)
f35d1b
-    {
f35d1b
-      GdkWindow *gdkwin;
f35d1b
-
f35d1b
-      gdkwin = gdk_window_lookup (icon->manager_wnd);
f35d1b
-      
f35d1b
-    }
f35d1b
-  
f35d1b
   XGrabServer (xdisplay);
f35d1b
   
f35d1b
   icon->manager_wnd = XGetSelectionOwner (xdisplay, icon->selection_atom);
f35d1b
@@ -235,7 +215,7 @@ notify_area_icon_new(const gchar *name)
f35d1b
 {
f35d1b
   NotifyAreaIcon *icon;
f35d1b
   char buff[256];
f35d1b
-  GdkWindow *root;
f35d1b
+ /* GdkWindow *root; */
f35d1b
 
f35d1b
   Screen *xscreen = DefaultScreenOfDisplay (gdk_display);
f35d1b
 
f35d1b
@@ -275,8 +255,6 @@ notify_area_icon_new(const gchar *name)
f35d1b
   notify_area_icon_update_manager_wnd(icon); 
f35d1b
 
f35d1b
    g_print ("attempted to update_manager_wnd: %p",(void *)icon->manager_wnd);
f35d1b
-
f35d1b
-  root = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
f35d1b
  
f35d1b
   icon->tooltips = gtk_tooltips_new ();
f35d1b
 
f35d1b
diff -up ./esc/src/lib/notifytray/notifytray.c.fix9 ./esc/src/lib/notifytray/notifytray.c
f35d1b
--- ./esc/src/lib/notifytray/notifytray.c.fix9	2011-03-24 12:57:57.680712175 -0700
f35d1b
+++ ./esc/src/lib/notifytray/notifytray.c	2011-03-24 12:58:07.243712165 -0700
f35d1b
@@ -239,7 +239,7 @@ void notify_icon_send_tooltip_msg(const 
f35d1b
     }
f35d1b
 
f35d1b
     g_print("icon %s", icon);
f35d1b
-    NotifyNotification *not = notify_notification_new(msg_title, message,icon, GTK_WIDGET(notify));
f35d1b
+    NotifyNotification *not = notify_notification_new(msg_title, message,icon); /*, GTK_WIDGET(notify));*/
f35d1b
 
f35d1b
     if(not)
f35d1b
     {