Blame SOURCES/esc-1.1.0-fix9.patch

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