[Fedora-directory-commits] esc/src/app/xul/esc/defaults/preferences esc-prefs.js, 1.1.1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/defaults/preferences
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12835
Modified Files:
esc-prefs.js
Log Message:
Update to the latest.
Index: esc-prefs.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/defaults/preferences/esc-prefs.js,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esc-prefs.js 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ esc-prefs.js 13 Sep 2006 17:53:40 -0000 1.2
@@ -15,7 +15,7 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
-pref("toolkit.defaultChromeURI", "chrome://esc/content/settings.xul");
+#pref("toolkit.defaultChromeURI", "chrome://esc/content/settings.xul");
pref("esc.tps.url","http://test.host.com:7888/nk_service");
@@ -23,7 +23,7 @@
#pref("esc.enroll.ui.url","http://test.host.com:7888/cgi-bin/esc.cgi?action=autoenroll");
#pref("esc.enrolled.token.url","http://www.test.com");
-pref("esc.hide.on.startup","yes");
+pref("esc.hide.on.startup","no");
@@ -33,3 +33,11 @@
pref("capability.principal.codebase.p0.id", "file://");
pref("esc.tps.message.timeout","90");
+
+pref("esc.factory.mode","no");
+pref("esc.show.tabs.ui","no");
+
+pref("browser.dom.window.dump.enabled",true);
+pref("javascript.options.showInConsole",true);
+pref("nglayout.debug.disable_xul_cache",true);
+pref("nglayour.debug.disable_xul_fastload",true);
17 years, 7 months
[Fedora-directory-commits] esc/src/app/xul/esc/components escCLH.js, NONE, 1.1
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/components
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12802
Added Files:
escCLH.js
Log Message:
Initial revision.
--- NEW FILE escCLH.js ---
/*
* -myapp commandline handler; starts up My App.
*/
const nsIAppShellService = Components.interfaces.nsIAppShellService;
const nsISupports = Components.interfaces.nsISupports;
const nsICategoryManager = Components.interfaces.nsICategoryManager;
const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
const nsICommandLine = Components.interfaces.nsICommandLine;
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
const nsIFactory = Components.interfaces.nsIFactory;
const nsIModule = Components.interfaces.nsIModule;
const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
var consoleService = Components
.classes['@mozilla.org/consoleservice;1']
.getService( Components.interfaces.nsIConsoleService );
function recordMessage( message ) {
consoleService.logStringMessage("esc: " + message + "\n");
}
/*
* Classes
*/
const escCLH = {
/* nsISupports */
QueryInterface : function clh_QI(iid) {
if (iid.equals(nsICommandLineHandler) ||
iid.equals(nsIFactory) ||
iid.equals(nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
/* nsICommandLineHandler */
handle : function clh_handle(cmdLine) {
var args = new Object();
args.urlopt = false;
recordMessage("handle command line");
try {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator);
var win = wm.getMostRecentWindow(null);
if(win)
{
recordMessage("Subsequent invocation. Launch an Admin page.");
win.launchSETTINGS();
return;
}
var chromeURI = "chrome://esc/content/hiddenWindow.xul";
recordMessage(chromeURI);
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
.getService(nsIWindowWatcher);
wwatch.openWindow(null, chromeURI, "_blank",
"chrome,dialog,height=-1,width=-1,popup=yes", cmdLine);
}
catch(e) {}
},
helpInfo : " -myapp Open the My App.\n",
/* nsIFactory */
createInstance : function clh_CI(outer, iid) {
if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION;
return this.QueryInterface(iid);
},
lockFactory : function clh_lock(lock) {
/* no-op */
}
};
const clh_contractID = "@redhat.com/esc-clh;1";
const clh_CID = Components.ID("{36c65861-52a8-4ce9-aa3b-235b88216ed4}");
const clh_category = "c-esc";
const escCLHModule = {
/* nsISupports */
QueryInterface : function mod_QI(iid) {
if (iid.equals(nsIModule) ||
iid.equals(nsISupports))
return this;
throw Components.results.NS_ERROR_NO_INTERFACE;
},
/* nsIModule */
getClassObject : function mod_gch(compMgr, cid, iid) {
if (cid.equals(clh_CID))
return escCLH.QueryInterface(iid);
throw Components.results.NS_ERROR_NOT_REGISTERED;
},
registerSelf : function mod_regself(compMgr, fileSpec, location, type) {
compMgr.QueryInterface(nsIComponentRegistrar);
compMgr.registerFactoryLocation(clh_CID,
"escCLH",
clh_contractID,
fileSpec,
location,
type);
var catMan = Components.classes["@mozilla.org/categorymanager;1"]
.getService(nsICategoryManager);
catMan.addCategoryEntry("command-line-handler",
clh_category,
clh_contractID, true, true);
},
unregisterSelf : function mod_unreg(compMgr, location, type) {
compMgr.QueryInterface(nsIComponentRegistrar);
compMgr.unregisterFactoryLocation(clh_CID, location);
var catMan = Components.classes["@mozilla.org/categorymanager;1"]
.getService(nsICategoryManager);
catMan.deleteCategoryEntry("command-line-handler", clh_category);
},
canUnload : function (compMgr) {
return true;
}
};
/* Module initialisation */
function NSGetModule(comMgr, fileSpec) {
return escCLHModule;
}
17 years, 7 months
[Fedora-directory-commits] esc/src/app/xpcom/tray Makefile, 1.1.1.1, 1.2 Makefile.in, 1.1.1.1, 1.2 Makefile.moz, 1.1.1.1, 1.2 rhITray.idl, 1.1.1.1, 1.2 rhITrayWindNotify.idl, 1.1.1.1, 1.2 rhLinuxTray.cpp, 1.1.1.1, 1.2 rhMacTray.cpp, 1.1.1.1, 1.2 rhTray.cpp, 1.1.1.1, 1.2 rhTray.h, 1.1.1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom/tray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12696/tray
Modified Files:
Makefile Makefile.in Makefile.moz rhITray.idl
rhITrayWindNotify.idl rhLinuxTray.cpp rhMacTray.cpp rhTray.cpp
rhTray.h
Log Message:
Update to latest
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile 13 Sep 2006 17:50:07 -0000 1.2
@@ -29,14 +29,18 @@
#MOZ_OBJDIR=$(MOZ_SRCDIR)
endif
+ifeq ($(OS_ARCH),Linux)
+endif
+
all export install clean deploy args::
echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR) $@"
+ echo $(DIST)
$(MAKE) -f Makefile.moz $@ \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
libs::
@@ -45,13 +49,13 @@
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR) \
$(MAKE) -f Makefile.moz deploy \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR)
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/Makefile.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile.in 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile.in 13 Sep 2006 17:50:07 -0000 1.2
@@ -23,18 +23,39 @@
CORE_INC=$(SOURCE_XP_DIR)/public
MOZ_SRCDIR=$(SOURCE_XP_DIR)/src/mozilla
-MOZ_OBJDIR=$(DIST)/xulrunner_build/mozilla
+MOZ_OBJDIR=$(DIST)/xulrunner_build
ifeq ($(OS_ARCH), Darwin)
#MOZ_OBJDIR=$(MOZ_SRCDIR)
endif
-all export libs install clean args::
- echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR)"
+ifeq ($(OS_ARCH),Linux)
+endif
+
+all export install clean deploy args::
+ echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR) $@"
+ echo $(DIST)
$(MAKE) -f Makefile.moz $@ \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
- MOZ_SRCDIR=$(MOZ_OBJDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_SRCDIR=$(MOZ_SRCDIR) \
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
+libs::
+
+ $(MAKE) -f Makefile.moz libs \
+ OBJDIR=$(OBJDIR) \
+ CORE_DIST=$(DIST) \
+ CORE_INC=$(CORE_INC) \
+ MOZ_SRCDIR=$(MOZ_SRCDIR) \
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR) \
+
+ $(MAKE) -f Makefile.moz deploy \
+ OBJDIR=$(OBJDIR) \
+ CORE_DIST=$(DIST) \
+ CORE_INC=$(CORE_INC) \
+ MOZ_SRCDIR=$(MOZ_SRCDIR) \
+ MOZ_OBJ_DIR=$(MOZ_OBJDIR)
+
Index: Makefile.moz
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/Makefile.moz,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile.moz 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile.moz 13 Sep 2006 17:50:07 -0000 1.2
@@ -28,12 +28,20 @@
MDDEPDIR := $(OBJDIR)/.deps
DESTDIR = $(MOZ_OBJDIR)/install
+NOTIFY_DEPTH = $(CORE_DEPTH)/src/lib/notifytray
+NOTIFY_CXX_FLAGS = -I$(NOTIFY_DEPTH) $(shell pkg-config --cflags glib-2.0)
+NOTIFY_LDFLAGS = $(shell pkg-config --libs libnotify)
+
+NO_DIST_INSTALL = 1
+ifeq ($(OS_ARCH),Linux)
+
+endif
-include $(MOZ_OBJDIR)/config/autoconf.mk
OS_CXXFLAGS += $(HOST_CXXFLAGS)
-MODULE = rhTray
+#MODULE = rhTray
XPIDL_MODULE = rhTray
LIBRARY_NAME = rhTray
@@ -44,13 +52,19 @@
RESFILE=cool.res
endif
+ifeq ($(OS_ARCH),Linux)
+
+COOLKEY_LIBS+= -L $(CORE_DIST)/lib -ltraynotify -L/usr/lib $(NOTIFY_LDFLAGS)
+
+endif
+
IS_COMPONENT = 1
MODULE_NAME = rhTray
# Ensure that the xpcom classes that we build
# do not export themselves
-DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES)
+DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES) -I./_xpidlgen
REQUIRES = string \
@@ -71,9 +85,8 @@
ifeq ($(OS_ARCH),Linux)
CPPSRCS = \
- rhLinuxTray.cpp \
- $(NULL)
-
+ rhLinuxTray.cpp \
+ $(NULL)
endif
ifeq ($(OS_ARCH),Darwin)
@@ -93,7 +106,7 @@
INSTALL_STUFF =
ifeq ($(OS_ARCH),Linux)
-INSTALL_STUFF += CoolKeyLogo.gif
+INSTALL_STUFF += icon.png
endif
ifeq ($(OS_ARCH),WINNT)
@@ -104,16 +117,14 @@
ifeq ($(OS_ARCH),Linux)
-
-CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS)
-
+CXXFLAGS += $(MOZ_GTK_CFLAGS) $(MOZ_GTK2_CFLAGS) $(NOTIFY_CXX_FLAGS)
endif
all:: export libs deploy
libs:: $(INSTALL_STUFF) rhTray.h
- $(NSINSTALL) rhTray.h $(DIST)/include/rhTray
+ $(NSINSTALL) rhTray.h $(CORE_INC)/rhTray
clean::
@@ -122,8 +133,8 @@
deploy::
echo "Deploying"
echo $(IMPORT_LIBRARY)
- $(NSINSTALL) ./$(LIB_PREFIX)rhTray$(DLL_SUFFIX) $(CORE_DEPTH)/esc/app/xul/esc/components
- $(NSINSTALL) ./_xpidlgen/*.xpt $(INSTALL_STUFF) $(CORE_DEPTH)/esc/app/xul/esc/components
+ $(NSINSTALL) ./$(LIB_PREFIX)rhTray$(DLL_SUFFIX) $(CORE_DEPTH)/src/app/xul/esc/components
+ $(NSINSTALL) ./_xpidlgen/*.xpt $(INSTALL_STUFF) $(CORE_DEPTH)/src/app/xul/esc/components
# separate libraries linked in.
Index: rhITray.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhITray.idl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhITray.idl 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhITray.idl 13 Sep 2006 17:50:07 -0000 1.2
@@ -1,22 +1,5 @@
-/** BEGIN COPYRIGHT BLOCK
- * 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; version 2 of the License.
- *
- * 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., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- *
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
#include "nsISupports.idl"
-
+#include "rhITrayWindNotify.idl"
interface nsIBaseWindow;
[scriptable,uuid(18100a23-0e0f-4201-8378-c9625d09be39)]
@@ -31,7 +14,16 @@
void hideall();
void showall();
boolean isInitializedAlready();
- void sendnotification(in string aMessage);
+ void sendnotification(in string aTitle, in string aMessage,in unsigned long aSeverity,in unsigned long aTimeout,in string aIcon);
+
+ void settooltipmsg(in string aMessage);
+ void seticonimage(in string aIcon);
+
+ void hideicon();
+ void showicon();
+
+ void setwindnotifycallback(in rhITrayWindNotify jsNotify);
+ void unsetwindnotifycallback(in rhITrayWindNotify jsNotify);
};
Index: rhITrayWindNotify.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhITrayWindNotify.idl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhITrayWindNotify.idl 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhITrayWindNotify.idl 13 Sep 2006 17:50:07 -0000 1.2
@@ -1,20 +1,3 @@
-/** BEGIN COPYRIGHT BLOCK
- * 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; version 2 of the License.
- *
- * 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., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- *
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
#include "nsISupports.idl"
Index: rhLinuxTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhLinuxTray.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhLinuxTray.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhLinuxTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,18 +15,23 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "rhTray.h"
#include "nsIGenericFactory.h"
#include <prlog.h>
+#include "notifytray.h"
+#include "intl/nsIStringBundle.h"
NS_IMPL_ISUPPORTS1(rhTray, rhITray)
-
GtkWidget* rhTray::mWnd = NULL;
GtkWidget* rhTray::mIconMenu = NULL;
int rhTray::mInitialized = 0;
+std::list< nsCOMPtr<rhITrayWindNotify> > rhTray::gTrayWindNotifyListeners;
+
map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
@@ -35,18 +40,45 @@
rhTray::rhTray()
{
/* member initializers and constructor code */
+
}
rhTray::~rhTray()
{
- PR_LOG( trayLog, 5, ("rhTray::~rhTray\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::~rhTray\n"));
Cleanup();
/* destructor code */
}
+NS_IMETHODIMP rhTray::Setwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setwindnotifycallback\n"));
+
+ if(jsNotify)
+ AddTrayWindNotifyListener(jsNotify);
+
+
+ return NS_OK;
+
+}
+ /* void unsetwindnotifycallback (in rhITrayWindNotify jsNotify); */
+
+NS_IMETHODIMP rhTray::Unsetwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Unsetwindnotifycallback\n"));
+
+ if(jsNotify)
+ RemoveTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+}
+
/* void add (); */
NS_IMETHODIMP rhTray::Add(nsIBaseWindow *aWindow)
{
@@ -54,7 +86,7 @@
NS_ENSURE_ARG(aWindow);
- PR_LOG( trayLog, 5, ("rhTray::Add %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Add %p \n",aWindow));
HRESULT res = Initialize();
if(res != S_OK)
{
@@ -72,7 +104,7 @@
/* void remove (); */
NS_IMETHODIMP rhTray::Remove(nsIBaseWindow *aWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::Remove window %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Remove window %p \n",aWindow));
if(!aWindow)
return NS_OK;
@@ -133,9 +165,11 @@
}
-NS_IMETHODIMP rhTray::Sendnotification(const char *aMessage)
+NS_IMETHODIMP rhTray::Sendnotification(const char *aTitle,const char *aMessage,PRUint32 aSeverity,PRUint32 aTimeout, const char *aIcon)
{
+ if(aMessage)
+ notify_icon_send_tooltip_msg(aTitle,aMessage,aSeverity,aTimeout,aIcon);
return NS_OK;
@@ -156,7 +190,42 @@
return NS_OK;
}
+/* void settooltipmsg (in string aMessage); */
+NS_IMETHODIMP rhTray::Settooltipmsg(const char *aMessage)
+{
+
+ if(aMessage)
+ notify_icon_set_static_tooltip(aMessage);
+
+ return NS_OK;
+}
+
+/* void seticonimage (in string aIcon); */
+NS_IMETHODIMP rhTray::Seticonimage(const char *aIcon)
+{
+
+
+ return NS_OK;
+}
+
+/* void hideicon (); */
+NS_IMETHODIMP rhTray::Hideicon(void)
+{
+
+ notify_icon_hide();
+
+ return NS_OK;
+}
+
+/* void showicon (); */
+NS_IMETHODIMP rhTray::Showicon(void)
+{
+
+ notify_icon_show();
+
+ return NS_OK;
+}
HRESULT rhTray::Initialize()
{
@@ -166,21 +235,32 @@
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize \n"));
g_set_print_handler(rhTray::TrayPrintHandler);
-
- HRESULT res = E_FAIL;
+
+ notify_icon_create_with_image_file(COOLKEY_ICON);
+
+ HRESULT res = notify_icon_created_ok();
if(res != S_OK)
{
return E_FAIL;
}
+
+ GtkWidget *icon_widget = notify_icon_get_box_widget();
+
+ if(icon_widget)
+ {
+ g_signal_connect(G_OBJECT(icon_widget), "button-press-event", G_CALLBACK(rhTray::IconCBProc), NULL);
+
+ }
+
res = CreateEventWindow();
- PR_LOG( trayLog, 5, ("rhTray::Initialize result of CreateIconMenu %d \n",res));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize result of CreateIconMenu %d \n",res));
if(res != S_OK)
{
@@ -189,6 +269,8 @@
mInitialized = 1;
+ notify_icon_hide();
+
return S_OK;
}
@@ -199,7 +281,7 @@
HRESULT rhTray::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTray::Cleanup.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Cleanup.\n"));
RemoveAllListeners();
DestroyEventWindow();
@@ -211,7 +293,7 @@
void rhTray::ShowAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::ShowAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -235,7 +317,7 @@
void rhTray::HideAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::HideAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::HideAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
@@ -258,7 +340,7 @@
HRESULT rhTray::DestroyEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::DestroyEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::DestroyEventWindow \n"));
rhTray::mWnd = 0;
@@ -268,7 +350,7 @@
void rhTray::IconMenuCBProc(GtkWidget *widget, gpointer data)
{
- PR_LOG( trayLog, 5, ("rhTray::IconMenuCBProc data %s \n",data));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::IconMenuCBProc data %s \n",data));
if(!strcmp((char *)data,"icon.min"))
@@ -278,6 +360,7 @@
if(!strcmp((char *)data,"icon.max"))
{
+ NotifyTrayWindListeners(MENU_EVT,MENU_SHOW);
rhTray::ShowAllListeners();
}
@@ -290,7 +373,7 @@
HRESULT rhTray::CreateIconMenu()
{
- PR_LOG( trayLog, 5, ("rhTray::CreateIconMenu \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateIconMenu \n"));
if(mIconMenu)
return E_FAIL;
@@ -298,11 +381,11 @@
mIconMenu = gtk_menu_new ();
GtkWidget *min_item = gtk_menu_item_new_with_label ("Hide");
- GtkWidget *max_item = gtk_menu_item_new_with_label ("Show");
+ GtkWidget *max_item = gtk_menu_item_new_with_label ("Manage Keys");
GtkWidget *exit_item = gtk_menu_item_new_with_label ("Exit");
gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), max_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), min_item);
+ //gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), min_item);
gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), exit_item);
g_signal_connect(G_OBJECT (min_item), "activate",
@@ -326,7 +409,7 @@
void rhTray::IconCBProc(GtkWidget *button, GdkEventButton *event, void *data)
{
- PR_LOG( trayLog, 5, ("rhTray::IconCBProc \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::IconCBProc \n"));
if(event->type != GDK_BUTTON_PRESS)
@@ -364,7 +447,7 @@
HRESULT rhTray::CreateEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::CreateEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateEventWindow \n"));
HRESULT res = CreateIconMenu();
return res;
@@ -376,7 +459,7 @@
nsresult rv;
- PR_LOG( trayLog, 5, ("rhTray::AddListener %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddListener %p \n",aWindow));
NS_ENSURE_ARG(aWindow);
nativeWindow aNativeWindow;
@@ -394,7 +477,7 @@
gdk_window_get_user_data (gWnd,(void **)&hWnd);
- PR_LOG(trayLog,5, ("rhTray::AddListener is widget %p .\n",hWnd));
+ PR_LOG(trayLog,PR_LOG_DEBUG, ("rhTray::AddListener is widget %p .\n",hWnd));
if(!hWnd)
{
return E_FAIL;
@@ -407,20 +490,20 @@
if(already)
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener current level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener current level widget %p \n",hWnd));
hWnd = gtk_widget_get_toplevel( hWnd);
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
if (GTK_WIDGET_TOPLEVEL (hWnd))
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener is really a top level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener is really a top level widget %p \n",hWnd));
}
rhTrayWindowListener *create = new rhTrayWindowListener(hWnd);
@@ -450,7 +533,7 @@
HRESULT rhTray::RemoveListener(nsIBaseWindow *aBaseWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
if(!aBaseWindow)
return S_OK;
@@ -478,7 +561,7 @@
HRESULT rhTray::RemoveAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListenesr\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListenesr\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -503,11 +586,109 @@
}
+//rhTrayWindNotify methods
+
+rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ std::list<nsCOMPtr<rhITrayWindNotify> >::const_iterator it;
+
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ if((*it) == listener)
+ {
+ return (*it);
+ }
+}
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+
+ return nsnull;
+
+
+
+}
+
+int rhTray::GetTrayWindNotifyListSize()
+{
+ return gTrayWindNotifyListeners.size();
+
+}
+
+
+void rhTray::AddTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p \n",
+listener));
+
+ if(GetTrayWindNotifyListener(listener ))
+ {
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",listener));
+
+ return ;
+
+ }
+
+ gTrayWindNotifyListeners.push_back(listener);
+
+
+}
+
+void rhTray::RemoveTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ if(!GetTrayWindNotifyListener(listener))
+ {
+ return;
+ }
+
+ gTrayWindNotifyListeners.remove(listener);
+
+
+ listener = NULL;
+}
+
+
+void rhTray::ClearTrayWindNotifyList()
+{
+
+ while (gTrayWindNotifyListeners.size() > 0) {
+ rhITrayWindNotify * node = (gTrayWindNotifyListeners.front()).get();
+
+ node = NULL;
+
+ gTrayWindNotifyListeners.pop_front();
+ }
+
+}
+
+void rhTray::NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData,PRUint32 aKeyData,PRUint32 aData1, PRUint32 aData2)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::NotifyTrayWindListeners \n"));
+
+ //Now notify all the listeners of the event
+
+ std::list< nsCOMPtr <rhITrayWindNotify> >::const_iterator it;
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ PRBool claimed = 0;
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("NotifyTrayWindListeners about to notify \n"));
+ ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed);
+
+
+ }
+
+}
+
void rhTray::TrayPrintHandler(const gchar *string)
{
- PR_LOG( trayLog, 5, ("rhTray:TrayPrintHandler. : %s \n",(char *) string));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray:TrayPrintHandler. : %s \n",(char *) string));
}
//rhTrayWindowListener Methods
@@ -519,12 +700,12 @@
rhTrayWindowListener::~rhTrayWindowListener()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::rhTrayWindowListener.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::rhTrayWindowListener.\n"));
}
HRESULT rhTrayWindowListener::Initialize()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Initialize \n"));
if(mWnd)
{
@@ -548,7 +729,7 @@
gtk_window_deiconify(GTK_WINDOW(mWnd));
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
}
}
@@ -558,7 +739,7 @@
if(mWnd)
{
gtk_widget_hide(mWnd);
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Hide Window %p\n",mWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Hide Window %p\n",mWnd));
}
}
@@ -568,7 +749,7 @@
g_print("WndDestroyCBProc \n");
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WndDestroyCBProc \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WndDestroyCBProc \n"));
}
@@ -578,7 +759,7 @@
{
g_print("WndDeleteCBProc\n");
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WndDeleteCBProc \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WndDeleteCBProc \n"));
rhTrayWindowListener *me = (rhTrayWindowListener *) data;
Index: rhMacTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhMacTray.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhMacTray.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhMacTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "rhTray.h"
#include "nsIGenericFactory.h"
#include <prlog.h>
@@ -30,6 +32,8 @@
map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
+std::list< nsCOMPtr<rhITrayWindNotify> > rhTray::gTrayWindNotifyListeners;
+
static PRLogModuleInfo *trayLog = PR_NewLogModule("tray");
rhTray::rhTray()
@@ -40,13 +44,39 @@
rhTray::~rhTray()
{
- PR_LOG( trayLog, 5, ("rhTray::~rhTray\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::~rhTray\n"));
Cleanup();
/* destructor code */
}
+NS_IMETHODIMP rhTray::Setwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setwindnotifycallback\n"));
+
+ if(jsNotify)
+ AddTrayWindNotifyListener(jsNotify);
+
+
+ return NS_OK;
+
+}
+ /* void unsetwindnotifycallback (in rhITrayWindNotify jsNotify); */
+
+NS_IMETHODIMP rhTray::Unsetwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Unsetwindnotifycallback\n"));
+
+ if(jsNotify)
+ RemoveTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+}
+
/* void add (); */
NS_IMETHODIMP rhTray::Add(nsIBaseWindow *aWindow)
{
@@ -54,7 +84,7 @@
NS_ENSURE_ARG(aWindow);
- PR_LOG( trayLog, 5, ("rhTray::Add %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Add %p \n",aWindow));
HRESULT res = Initialize();
if(res != S_OK)
@@ -73,7 +103,7 @@
/* void remove (); */
NS_IMETHODIMP rhTray::Remove(nsIBaseWindow *aWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::Remove window %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Remove window %p \n",aWindow));
if(!aWindow)
return NS_OK;
@@ -150,17 +180,46 @@
}
-NS_IMETHODIMP rhTray::Sendnotification(const char *aMessage)
+NS_IMETHODIMP rhTray::Sendnotification(const char *aTitle,const char *aMessage,PRUint32 aSeverity,PRUint32 aTimeout, const char *aIcon)
+{
+ return NS_OK;
+
+}
+
+/* void settooltipmsg (in string aMessage); */
+NS_IMETHODIMP rhTray::Settooltipmsg(const char *aMessage)
+{
+ return NS_OK;
+}
+
+/* void seticonimage (in string aIcon); */
+NS_IMETHODIMP rhTray::Seticonimage(const char *aIcon)
+{
+
+
+ return NS_OK;
+}
+
+/* void hideicon (); */
+NS_IMETHODIMP rhTray::Hideicon(void)
{
+
return NS_OK;
+}
+
+/* void showicon (); */
+NS_IMETHODIMP rhTray::Showicon(void)
+{
+
+ return NS_OK;
}
void rhTray::ShowApp()
{
- PR_LOG( trayLog, 5, ("rhTray::Show app! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Show app! \n"));
::ShowHideProcess(&rhTray::mPSN,TRUE);
::SetFrontProcess(&rhTray::mPSN);
@@ -181,19 +240,19 @@
if(mInitialized)
return S_OK;
- PR_LOG( trayLog, 5, ("rhTray::Initialize dock: \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize dock: \n"));
OSErr pRes = GetCurrentProcess (
&mPSN
);
- PR_LOG( trayLog, 5, ("rhTray::Initialize App PID result %d \n",pRes));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize App PID result %d \n",pRes));
HRESULT res = CreateApplicationListener();
- PR_LOG( trayLog, 5, ("rhTray::Initialize result of CreateApplicationListener %d \n",res));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize result of CreateApplicationListener %d \n",res));
if(res != S_OK)
{
@@ -207,7 +266,7 @@
HRESULT rhTray::RemoveIcon()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveIcon. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveIcon. \n"));
@@ -216,7 +275,7 @@
HRESULT rhTray::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTray::Cleanup.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Cleanup.\n"));
RemoveAllListeners();
DestroyEventWindow();
@@ -244,7 +303,7 @@
if(!target)
return E_FAIL;
- PR_LOG( trayLog, 5, ("rhTray::CreateApplicationListener . app target %p\n",target));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateApplicationListener . app target %p\n",target));
int numTypes = 4;
@@ -265,7 +324,7 @@
{
ShowApp();
- PR_LOG( trayLog, 5, ("rhTray::ShowAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -289,7 +348,7 @@
void rhTray::HideAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::HideAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::HideAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
@@ -313,7 +372,7 @@
HRESULT rhTray::DestroyEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::DestroyEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::DestroyEventWindow \n"));
return S_OK;
@@ -326,7 +385,7 @@
nsresult rv;
- PR_LOG( trayLog, 5, ("rhTray::AddListener %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddListener %p \n",aWindow));
NS_ENSURE_ARG(aWindow);
nativeWindow aNativeWindow;
@@ -357,13 +416,13 @@
if(already)
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener top level widget %p \n",hWnd));
rhTrayWindowListener *create = new rhTrayWindowListener(hWnd);
@@ -391,7 +450,7 @@
HRESULT rhTray::RemoveListener(nsIBaseWindow *aBaseWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
if(!aBaseWindow)
return S_OK;
@@ -419,7 +478,7 @@
HRESULT rhTray::RemoveAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListenesr\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListenesr\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -444,18 +503,111 @@
}
+//rhTrayWindNotify methods
+
+rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ std::list<nsCOMPtr<rhITrayWindNotify> >::const_iterator it;
+
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ if((*it) == listener)
+ {
+ return (*it);
+ }
+}
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+
+ return nsnull;
+
+
+
+}
+
+int rhTray::GetTrayWindNotifyListSize()
+{
+ return gTrayWindNotifyListeners.size();
+
+}
+
+void rhTray::AddTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p \n",
+listener));
+
+ if(GetTrayWindNotifyListener(listener ))
+ {
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",listener));
+
+ return ;
+
+ }
+
+ gTrayWindNotifyListeners.push_back(listener);
+
+
+}
+
+void rhTray::RemoveTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ if(!GetTrayWindNotifyListener(listener))
+ {
+ return;
+ }
+
+ gTrayWindNotifyListeners.remove(listener);
+
+
+ listener = NULL;
+}
+
+void rhTray::ClearTrayWindNotifyList()
+{
+
+ while (gTrayWindNotifyListeners.size() > 0) {
+ rhITrayWindNotify * node = (gTrayWindNotifyListeners.front()).get();
+
+ node = NULL;
+
+ gTrayWindNotifyListeners.pop_front();
+ }
+
+}
+
+void rhTray::NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData,PRUint32 aKeyData,PRUint32 aData1, PRUint32 aData2)
+{
+
+ //Now notify all the listeners of the event
+
+ std::list< nsCOMPtr <rhITrayWindNotify> >::const_iterator it;
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ PRBool claimed = 0;
+
+ ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed);
+
+
+ }
+
+}
+
pascal OSStatus rhTray::ApplicationProc(EventHandlerCallRef nextHandler, EventRef aEvent, void *userData)
{
OSStatus result = eventNotHandledErr;
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc .\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc .\n"));
int theEvent = GetEventKind(aEvent);
int theClass = GetEventClass(aEvent);
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc class %d event: %d \n",theClass,theEvent));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc class %d event: %d \n",theClass,theEvent));
switch(theClass)
{
@@ -466,12 +618,12 @@
{
case kEventAppActivated:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App activated! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App activated! \n"));
break;
case kEventAppDeactivated:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App deactivated! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App deactivated! \n"));
result = noErr;
break;
@@ -482,7 +634,7 @@
case kEventClassCommand:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kEventClassCommand! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kEventClassCommand! \n"));
HICommand commandStruct;
@@ -494,19 +646,19 @@
switch(commandStruct.commandID)
{
case kHICommandHide:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandHide! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandHide! \n"));
break;
case kHICommandSelectWindow:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandSelectWindow! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandSelectWindow! \n"));
break;
case kHICommandClose:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandClose! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandClose! \n"));
break;
case kHICommandQuit:
- PR_LOG( trayLog, 5, ("rhTray::ApplicationProc App kHICommandQuit! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandQuit! \n"));
break;
};
@@ -532,14 +684,14 @@
rhTrayWindowListener::~rhTrayWindowListener()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
Cleanup();
}
HRESULT rhTrayWindowListener::Initialize()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Initialize \n"));
mEventHandlerUPP = NewEventHandlerUPP(rhTrayWindowListener::WindowProc);
@@ -564,24 +716,24 @@
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
if(IsWindowCollapsed(mWnd))
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow : uncollapsing collapsed window. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow : uncollapsing collapsed window. \n"));
::CollapseWindow(mWnd,FALSE);
}
if(!IsWindowVisible(mWnd))
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow : Window not visible showing... \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow : Window not visible showing... \n"));
::ShowWindow(mWnd);
}
//::BringToFront(mWnd);
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow : \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow : \n"));
rhTray::ShowApp();
@@ -593,7 +745,7 @@
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: HideWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: HideWindow \n"));
//OSStatus res = ::CollapseWindow(mWnd,TRUE);
@@ -601,7 +753,7 @@
rhTray::HideApp();
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: HideWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: HideWindow \n"));
}
@@ -616,13 +768,13 @@
int theEvent = GetEventKind(aEvent);
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc event: %d \n",theEvent));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc event: %d \n",theEvent));
switch(theEvent)
{
case kEventWindowClose:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc attempting Window close! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc attempting Window close! \n"));
if(self)
self->HideWindow();
@@ -631,17 +783,17 @@
case kEventWindowHidden:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc attempting Window hide! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc attempting Window hide! \n"));
break;
case kEventWindowClosed:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc Window closed! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc Window closed! \n"));
break;
case kEventMouseDown:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::WindowProc mouse down! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc mouse down! \n"));
break;
}
@@ -652,7 +804,7 @@
HRESULT rhTrayWindowListener::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Cleanup. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Cleanup. \n"));
if(mEventHandlerRef)
{
Index: rhTray.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhTray.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhTray.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhTray.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "rhTray.h"
#include "nsIGenericFactory.h"
#include <prlog.h>
@@ -28,6 +30,8 @@
ATOM rhTray::mWndClass = 0;
+std::list< nsCOMPtr<rhITrayWindNotify> > rhTray::gTrayWindNotifyListeners;
+
map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
NOTIFYICONDATA rhTray::mIconData;
@@ -50,13 +54,36 @@
rhTray::~rhTray()
{
- PR_LOG( trayLog, 5, ("rhTray::~rhTray\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::~rhTray\n"));
Cleanup();
/* destructor code */
}
+NS_IMETHODIMP rhTray::Setwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setwindnotifycallback\n"));
+
+ if(jsNotify)
+ AddTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+
+}
+ /* void unsetwindnotifycallback (in rhITrayWindNotify jsNotify); */
+
+NS_IMETHODIMP rhTray::Unsetwindnotifycallback(rhITrayWindNotify *jsNotify)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Unsetwindnotifycallback\n"));
+
+ if(jsNotify)
+ RemoveTrayWindNotifyListener(jsNotify);
+
+ return NS_OK;
+}
+
/* void add (); */
NS_IMETHODIMP rhTray::Add(nsIBaseWindow *aWindow)
{
@@ -64,7 +91,7 @@
NS_ENSURE_ARG(aWindow);
- PR_LOG( trayLog, 5, ("rhTray::Add %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Add %p \n",aWindow));
HRESULT res = Initialize();
if(res != S_OK)
{
@@ -82,8 +109,7 @@
/* void remove (); */
NS_IMETHODIMP rhTray::Remove(nsIBaseWindow *aWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::Remove window %p \n",aWindow));
-
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Remove window %p \n",aWindow));
return NS_OK;
}
@@ -150,7 +176,7 @@
return NS_OK;
}
-NS_IMETHODIMP rhTray::Sendnotification(const char *aMessage)
+NS_IMETHODIMP rhTray::Sendnotification(const char *aTitle,const char *aMessage,PRUint32 aSeverity,PRUint32 aTimeout, const char *aIcon)
{
if(aMessage)
@@ -163,6 +189,38 @@
}
+/* void settooltipmsg (in string aMessage); */
+NS_IMETHODIMP rhTray::Settooltipmsg(const char *aMessage)
+{
+ return NS_OK;
+}
+
+/* void seticonimage (in string aIcon); */
+NS_IMETHODIMP rhTray::Seticonimage(const char *aIcon)
+{
+
+
+ return NS_OK;
+}
+
+/* void hideicon (); */
+NS_IMETHODIMP rhTray::Hideicon(void)
+{
+
+
+ return NS_OK;
+}
+
+/* void showicon (); */
+NS_IMETHODIMP rhTray::Showicon(void)
+{
+
+
+ return NS_OK;
+}
+
+
+
HRESULT rhTray::SendBalloonTooltipMessage(char *aMessage)
{
@@ -189,9 +247,8 @@
return S_OK;
}
- PR_LOG( trayLog, 5, ("rhTray::Initialize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize \n"));
- //MessageBox(NULL,"Inside rhTray::Initialize!",NULL,NULL);
HRESULT res = CreateEventWindow();
@@ -227,7 +284,7 @@
rhTray::mIconData.uTimeout = 1000;
- PR_LOG(trayLog,5,("rhTray::Initialize tray icon handle %d \n",icon));
+ PR_LOG(trayLog,PR_LOG_DEBUG,("rhTray::Initialize tray icon handle %d \n",icon));
::Shell_NotifyIcon( NIM_ADD, &rhTray::mIconData);
@@ -238,7 +295,7 @@
HRESULT rhTray::RemoveIcon()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveIcon. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveIcon. \n"));
::Shell_NotifyIcon(NIM_DELETE,&rhTray::mIconData);
@@ -248,7 +305,7 @@
HRESULT rhTray::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTray::Cleanup.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Cleanup.\n"));
RemoveAllListeners();
DestroyEventWindow();
@@ -260,7 +317,7 @@
void rhTray::ShowAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::ShowAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -284,7 +341,7 @@
void rhTray::HideAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::HideAllListeners.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::HideAllListeners.\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
@@ -307,7 +364,7 @@
HRESULT rhTray::DestroyEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::DestroyEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::DestroyEventWindow \n"));
::DestroyWindow(rhTray::mWnd);
rhTray::mWnd = 0;
@@ -318,7 +375,7 @@
HRESULT rhTray::CreateEventWindow()
{
- PR_LOG( trayLog, 5, ("rhTray::CreateEventWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::CreateEventWindow \n"));
::SetLastError(0);
HINSTANCE hInst = ::GetModuleHandle(NULL);
@@ -388,13 +445,13 @@
{
case WM_LBUTTONDBLCLK:
- PR_LOG( trayLog, 5, ("rhTray::WindowProc: WM_LBUTTONDBLCLK \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::WindowProc: WM_LBUTTONDBLCLK \n"));
ShowAllListeners();
break;
case WM_RBUTTONDOWN:
- PR_LOG( trayLog, 5, ("rhTray::WindowProc: WM_RBUTTONDOWN \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::WindowProc: WM_RBUTTONDOWN \n"));
HRESULT res = rhTray::ShowPopupMenu (IDR_MENU1);
@@ -424,7 +481,7 @@
break;
case WM_CREATE:
- PR_LOG( trayLog, 5, ("rhTray::WindowProc: WM_CREATE \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::WindowProc: WM_CREATE \n"));
break;
default:
break;
@@ -444,7 +501,7 @@
nsresult rv;
- PR_LOG( trayLog, 5, ("rhTray::AddListener %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddListener %p \n",aWindow));
NS_ENSURE_ARG(aWindow);
nativeWindow aNativeWindow;
@@ -470,7 +527,7 @@
if(already)
{
- PR_LOG( trayLog, 5, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener Window already registered %p \n",aWindow));
return S_OK;
}
@@ -502,7 +559,7 @@
hMenu = ::LoadMenu (::GetModuleHandle("rhTray.dll"),
MAKEINTRESOURCE (PopupMenuResource));
- PR_LOG( trayLog, 5, ("rhTray::ShowPopupMenu hMenu %d error %d\n",hMenu,GetLastError()));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowPopupMenu hMenu %d error %d\n",hMenu,GetLastError()));
if (hMenu != 0) {
POINT pt;
@@ -526,7 +583,7 @@
HRESULT rhTray::RemoveListener(nsIBaseWindow *aBaseWindow)
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveWindowListener %p \n",aBaseWindow));
if(!aBaseWindow)
return S_OK;
@@ -556,7 +613,7 @@
HRESULT rhTray::RemoveAllListeners()
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListenesr\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListenesr\n"));
map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
rhTrayWindowListener *cur = NULL;
@@ -570,7 +627,7 @@
{
- PR_LOG( trayLog, 5, ("rhTray::RemoveAllListeners deleting %p\n",cur));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::RemoveAllListeners deleting %p\n",cur));
delete cur;
@@ -584,6 +641,96 @@
}
+//rhTrayWindNotify methods
+
+rhITrayWindNotify* rhTray::GetTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ std::list<nsCOMPtr<rhITrayWindNotify> >::const_iterator it;
+
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ if((*it) == listener)
+ {
+ return (*it);
+ }
+}
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+
+ return nsnull;
+
+}
+
+int rhTray::GetTrayWindNotifyListSize()
+{
+ return gTrayWindNotifyListeners.size();
+
+}
+void rhTray::AddTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p \n",
+listener));
+
+ if(GetTrayWindNotifyListener(listener ))
+ {
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddTrayWindNotifyListener: %p listener already in list. \n",listener));
+
+ return ;
+
+ }
+
+ gTrayWindNotifyListeners.push_back(listener);
+
+
+}
+
+void rhTray::RemoveTrayWindNotifyListener(rhITrayWindNotify *listener)
+{
+
+ if(!GetTrayWindNotifyListener(listener))
+ {
+ return;
+ }
+
+ gTrayWindNotifyListeners.remove(listener);
+
+
+ listener = NULL;
+}
+
+void rhTray::ClearTrayWindNotifyList()
+{
+
+ while (gTrayWindNotifyListeners.size() > 0) {
+ rhITrayWindNotify * node = (gTrayWindNotifyListeners.front()).get();
+
+ node = NULL;
+
+ gTrayWindNotifyListeners.pop_front();
+ }
+
+}
+
+void rhTray::NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData,PRUint32 aKeyData,PRUint32 aData1, PRUint32 aData2)
+{
+
+ //Now notify all the listeners of the event
+
+ std::list< nsCOMPtr <rhITrayWindNotify> >::const_iterator it;
+ for(it=gTrayWindNotifyListeners.begin(); it!=gTrayWindNotifyListeners.end(); ++it) {
+
+ PRBool claimed = 0;
+
+ ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed);
+
+
+ }
+
+}
+
//rhTrayWindowListener Methods
@@ -597,7 +744,7 @@
rhTrayWindowListener::~rhTrayWindowListener()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::~rhTrayWindowListener.\n"));
Cleanup();
@@ -636,27 +783,25 @@
case WM_NCLBUTTONDOWN:
switch(wParam)
{
-
case HTMINBUTTON:
if(me)
{
me->HideWindow();
-
}
- PR_LOG( trayLog, 5, ("rhTrayWindowListener Minimize\n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener Minimize\n"));
eventClaimed = 1;
break;
case HTMAXBUTTON:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Maximize \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Maximize \n"));
eventClaimed = 1;
break;
case HTCLOSE:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener Close! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener Close! \n"));
if(me)
{
@@ -677,7 +822,7 @@
case WA_ACTIVE:
case WA_CLICKACTIVE:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener ACTIVATE! \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener ACTIVATE! \n"));
break;
@@ -701,7 +846,7 @@
}
- PR_LOG( trayLog, 5, ("rhTrayWindowListener WM_SHOWWINDOW wParam %d lParam %d! \n",wParam, lParam));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener WM_SHOWWINDOW wParam %d lParam %d! \n",wParam, lParam));
show = (int) wParam;
@@ -709,7 +854,7 @@
if(lParam == 0)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener WM_SHOW called from ShowWindow or HideWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener WM_SHOW called from ShowWindow or HideWindow \n"));
}
@@ -721,7 +866,7 @@
{
case SC_CLOSE:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: WM_SYSCOMMAND SC_CLOSE \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: WM_SYSCOMMAND SC_CLOSE \n"));
break;
default:
@@ -735,7 +880,7 @@
{
case SIZE_MINIMIZED:
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: WM_SIZE SIZE_MINIMIZE \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: WM_SIZE SIZE_MINIMIZE \n"));
break;
default:
@@ -751,7 +896,7 @@
if(eventClaimed)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Event claimed \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Event claimed \n"));
return FALSE;
}
@@ -766,7 +911,7 @@
HRESULT rhTrayWindowListener::Cleanup()
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener::Cleanup. \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::Cleanup. \n"));
return S_OK;
@@ -790,7 +935,7 @@
{
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: ShowWindow \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
::ShowWindow(mWnd,SW_SHOW);
::ShowWindow(mWnd,SW_RESTORE);
@@ -804,7 +949,7 @@
if(mWnd)
{
- PR_LOG( trayLog, 5, ("rhTrayWindowListener:: Hide Window \n"));
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Hide Window \n"));
::ShowWindow(mWnd,SW_MINIMIZE);
::ShowWindow(mWnd,SW_HIDE);
Index: rhTray.h
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/tray/rhTray.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhTray.h 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhTray.h 13 Sep 2006 17:50:07 -0000 1.2
@@ -26,6 +26,20 @@
#include "widget/nsIBaseWindow.h"
#include "widget/nsIWidget.h"
+
+// Event Defines
+#define MENU_EVT 1
+#define APP_EVT 2
+#define WINDOW_EVT 3
+
+#define SHOW_ALL_WINDOWS 4
+#define HIDE_ALL_WINDOWS 5
+
+#define MENU_SHOW 6
+#define APP_SHOW 7
+
+
+
#ifdef XP_WIN32
#define _WIN32_IE 0x0500
@@ -46,8 +60,11 @@
#include <gtk/gtk.h>
+extern "C" {
+#include "notifytray.h"
+}
-#define COOLKEY_ICON "components/CoolKeyLogo.gif"
+#define COOLKEY_ICON "components/icon.png"
#endif
#include <map>
@@ -151,6 +168,20 @@
HRESULT DestroyEventWindow();
HRESULT RemoveIcon();
+
+ // rhTrayWindNotify content
+
+ static std::list< nsCOMPtr<rhITrayWindNotify> > gTrayWindNotifyListeners;
+
+
+ rhITrayWindNotify* GetTrayWindNotifyListener(rhITrayWindNotify *listener);
+
+ int GetTrayWindNotifyListSize();
+ void AddTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void RemoveTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void ClearTrayWindNotifyList();
+
+ static void NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData =0,PRUint32 aKeyData=0, PRUint32 aData1=0, PRUint32 aData2=0);
};
#endif
@@ -240,6 +271,21 @@
//Gtk print handler
static void TrayPrintHandler(const gchar *string);
+
+
+ // rhTrayWindNotify content
+
+ static std::list< nsCOMPtr<rhITrayWindNotify> > gTrayWindNotifyListeners;
+
+
+ rhITrayWindNotify* GetTrayWindNotifyListener(rhITrayWindNotify *listener);
+
+ int GetTrayWindNotifyListSize();
+ void AddTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void RemoveTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void ClearTrayWindNotifyList();
+
+ static void NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData =0,PRUint32 aKeyData=0, PRUint32 aData1=0, PRUint32 aData2=0);
};
#endif
@@ -331,6 +377,21 @@
HRESULT RemoveIcon();
+
+ // rhTrayWindNotify content
+
+ static std::list< nsCOMPtr<rhITrayWindNotify> > gTrayWindNotifyListeners;
+
+
+ rhITrayWindNotify* GetTrayWindNotifyListener(rhITrayWindNotify *listener);
+
+ int GetTrayWindNotifyListSize();
+ void AddTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void RemoveTrayWindNotifyListener(rhITrayWindNotify *listener);
+ void ClearTrayWindNotifyList();
+
+ static void NotifyTrayWindListeners(PRUint32 aEvent, PRUint32 aEventData =0,PRUint32 aKeyData=0, PRUint32 aData1=0, PRUint32 aData2=0);
+
};
#endif
17 years, 7 months
[Fedora-directory-commits] esc/src/app/xpcom CoolKeyCSP.cpp, 1.1.1.1, 1.2 Makefile, 1.1.1.1, 1.2 Makefile.moz, 1.1.1.1, 1.2 rhCoolKey.cpp, 1.1.1.1, 1.2 rhICoolKey.idl, 1.1.1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xpcom
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12696
Modified Files:
CoolKeyCSP.cpp Makefile Makefile.moz rhCoolKey.cpp
rhICoolKey.idl
Log Message:
Update to latest
Index: CoolKeyCSP.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/CoolKeyCSP.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKeyCSP.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ CoolKeyCSP.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include <string.h>
#include <windows.h>
//#include <wincrypt.h>
@@ -384,7 +386,7 @@
- PR_LOG( coolKeyCSPLog, 5, ("CoolKeyCSPListener::RhNotifyStateChange state %d \n",aKeyState));
+ PR_LOG( coolKeyCSPLog, PR_LOG_DEBUG, ("CoolKeyCSPListener::RhNotifyStateChange state %d \n",aKeyState));
AutoCoolKey key(aKeyType, aKeyID);
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ Makefile 13 Sep 2006 17:50:07 -0000 1.2
@@ -26,6 +26,9 @@
MOZ_SRCDIR=$(SOURCE_XP_DIR)/src/mozilla
MOZ_OBJDIR=$(DIST)/xulrunner_build
+ifeq ($(OS_ARCH),Linux)
+endif
+
all export install clean deploy args::
echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR)"
@@ -34,7 +37,8 @@
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
libs::
echo "***** Dropping into the Mozilla build environment ***** $(MOZ_OBJDIR)"
@@ -43,12 +47,14 @@
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
$(MAKE) -f Makefile.moz deploy \
OBJDIR=$(OBJDIR) \
CORE_DIST=$(DIST) \
CORE_INC=$(CORE_INC) \
MOZ_SRCDIR=$(MOZ_SRCDIR) \
- MOZ_OBJDIR=$(MOZ_OBJDIR)
+ MOZ_OBJDIR=$(MOZ_OBJDIR) \
+
Index: Makefile.moz
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/Makefile.moz,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile.moz 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ Makefile.moz 13 Sep 2006 17:50:07 -0000 1.2
@@ -1,4 +1,4 @@
-# ***** BEGIN COPYRIGHT BLOCK *****
+
# 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; version 2 of the License.
@@ -28,29 +28,25 @@
MDDEPDIR := $(OBJDIR)/.deps
DESTDIR = $(MOZ_OBJDIR)/install
+NO_DIST_INSTALL = 1
-include $(MOZ_OBJDIR)/config/autoconf.mk
-#include $(CORE_DEPTH)/esc/mozilla/config.mk
-
#XULRUNNER release bundle, taken from ftp site
DEPLOY_OBJDIR = $(CORE_DEPTH)/dist/$(OBJDIR)/esc_build
+XULRUNNER_ZIP_NAME = xulrunner-1.8.0.1.*.tar.gz
+XULRUNNER_BIN_PATH = $(MOZ_OBJDIR)/dist/xulrunner
+XULRUNNER_EXEC = xulrunner
ifeq ($(OS_ARCH), Darwin)
XULRUNNER_BIN_PATH = /Library/Frameworks/XUL.framework
XULRUNNER_EXEC = xulrunner-bin
XULRUNNER_FRAME_DEST = ESC.app/Contents/Frameworks/XUL.framework
XULRUNNER_FRAME_BASE = ESC.app/Contents/Frameworks
-else
-XULRUNNER_BIN_PATH = /opt/xulrunner/1.8.0.1/xulrunner
-DEPLOY_OBJDIR = $(CORE_DEPTH)/dist/$(OBJDIR)/esc_build
-XULRUNNER_EXEC = xulrunner
-XULRUNNER_FRAME_DEST = esc
endif
ifeq ($(OS_ARCH), WINNT)
-XULRUNNER_BIN_PATH = C:/"Program Files"/"Mozilla XULRunner"/1.8.0.1/xulrunner
OS_LIBS += crypt32.lib
CSPSRCS = CoolKeyCSP.cpp
endif
@@ -75,7 +71,7 @@
# Ensure that the xpcom classes that we build
# do not export themselves
-DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES) -I$(CORE_INC)/ckymanager -I$(CORE_INC)/httpchuncked
+DEFINES += -DXPCOM_GLUE $(GECKO_INCLUDES) -I$(CORE_INC)/ckymanager -I$(CORE_INC)/httpchuncked -I./_xpidlgen
REQUIRES = string \
@@ -99,24 +95,26 @@
XPCOM_EXTRA = $(CORE_DIST)/lib/coolkeypk11.dll
ifeq ($(OS_ARCH),Linux)
-INSTALL_STUFF += $(CORE_DEPTH)/esc/app/gtk/CoolKeyLogo.gif
+INSTALL_STUFF +=
endif
-include $(topsrcdir)/config/config.mk
-
-all:: export libs deploy
+install::
+ifdef DESTDIR
+ $(NSINSTALL) $(DEPLOY_OBJDIR)/esc/* $(DESTDIR)
+endif
+all:: export libs
libs:: $(INSTALL_STUFF) rhCoolKey.h
#$(NSINSTALL) $(INSTALL_STUFF) $(DIST)/bin
- $(NSINSTALL) rhCoolKey.h $(DIST)/include/rhCoolKey
+ $(NSINSTALL) rhCoolKey.h $(CORE_INC)/include/rhCoolKey
clean::
rm -f Makefile.in
rm -rf $(DEPLOY_OBJDIR)
- rm -f $(CORE_DEPTH)/esc/app/xul/esc/test.zip
- rm -rf $(CORE_DEPTH)/esc/app/xul/esc/esc
+ rm -rf $(CORE_DEPTH)/src/app/xul/esc/esc
deploy: $(DEPLOY_OBJDIR)
echo "deploy! on $(OS_ARCH)"
@@ -161,28 +159,35 @@
$(DEPLOY_OBJDIR):
echo "Installing!"
- $(NSINSTALL) ./$(LIB_PREFIX)rhCoolKey$(DLL_SUFFIX) $(CORE_DEPTH)/esc/app/xul/esc/components
- $(NSINSTALL) ./_xpidlgen/*.xpt $(CORE_DEPTH)/esc/app/xul/esc/components
+ $(NSINSTALL) ./$(LIB_PREFIX)rhCoolKey$(DLL_SUFFIX) $(CORE_DEPTH)/src/app/xul/esc/components
+ $(NSINSTALL) ./_xpidlgen/*.xpt $(CORE_DEPTH)/src/app/xul/esc/components
echo "Creating $(DEPLOY_OBJDIR)"
mkdir $(DEPLOY_OBJDIR)
- cd $(CORE_DEPTH)/esc/app/xul/esc; zip -r test.zip * -x *\CVS\*; unzip -d esc test.zip
- $(XULRUNNER_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)/esc/app/xul/esc/esc $(DEPLOY_OBJDIR)
+ cd $(CORE_DEPTH)/src/app/xul/esc; zip -r test.zip * -x *\CVS\* \*.fix*; unzip -d esc test.zip ; rm -f test.zip
+ $(XULRUNNER_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)/src/app/xul/esc/esc $(DEPLOY_OBJDIR)
ifeq ($(OS_ARCH), Darwin)
mkdir $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_BASE)
+ cp -Rf -v $(XULRUNNER_BIN_PATH) $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)
# mkdir $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_BASE)/XUL.framework
endif
- cp -Rf -v $(XULRUNNER_BIN_PATH) $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)
+ #cp -Rf -v $(XULRUNNER_BIN_PATH) $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)
+
+ tar -xzvf $(MOZ_OBJDIR)/dist/$(XULRUNNER_ZIP_NAME) -C $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)/esc
ifeq ($(OS_ARCH),WINNT)
cp -f $(XPCOM_EXTRA) $(DEPLOY_OBJDIR)/ESC/components
endif
+ifdef DESTDIR
+ $(NSINSTALL) $(DEPLOY_OBJDIR) $(DESTDIR)
+endif
-include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH),WINNT)
IMPORT_LIBRARY=
endif
+
Index: rhCoolKey.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhCoolKey.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhCoolKey.cpp 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ rhCoolKey.cpp 13 Sep 2006 17:50:07 -0000 1.2
@@ -15,10 +15,11 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include <stdio.h>
#include "rhCoolKey.h"
#include "CoolKey.h"
-#include "CoolKeyPref.h"
#include "nsMemory.h"
#include "nsXPCOM.h"
@@ -95,7 +96,7 @@
CoolKeyShutdownObserver::~CoolKeyShutdownObserver()
{
- PR_LOG( coolKeyLog, 5, ("CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n"));
}
@@ -108,7 +109,7 @@
if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
{
- PR_LOG( coolKeyLog, 5, ("CoolKeyShutdownObserver::Observe shutting down"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdownObserver::Observe shutting down"));
if(single)
{
@@ -167,7 +168,7 @@
rhCoolKey::rhCoolKey()
:mJsNotify(nsnull),mProxy(nsnull)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::rhCoolKey: %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::rhCoolKey: %p \n",this));
if(!single)
{
@@ -187,7 +188,7 @@
if(res == PR_FALSE)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::rhCoolKey: InitInstance failed. coolKey_instance %p\n",coolKey_instance));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("ESC InitInstance failed,exiting. CoolKey instance %p\n",coolKey_instance));
exit(1);
}
@@ -199,17 +200,17 @@
{
/* destructor code */
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::~rhCoolKey: %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::~rhCoolKey: %p \n",this));
}
void rhCoolKey::ShutDownInstance()
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ShutDownInstance. %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ShutDownInstance. %p \n",this));
if (mProxy)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ShutDownInstance: About to dereference Proxy Object. Proxy %p \n",mProxy));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ShutDownInstance: About to dereference Proxy Object. Proxy %p \n",mProxy));
CoolKeyUnregisterListener(mProxy);
@@ -307,11 +308,11 @@
{
PRBool ret = PR_TRUE;
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::InitInstance %p \n",this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::InitInstance %p \n",this));
char *path = (char *) GRE_GetXPCOMPath();
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GREPath %s \n",path));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GREPath %s \n",path));
char xpcom_path[512];
@@ -326,7 +327,7 @@
sprintf(xpcom_path,"%s/%s",path,lib_name);
#endif
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::xpcom_path %s \n",xpcom_path));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::xpcom_path %s \n",xpcom_path));
XPCOMGlueStartup(xpcom_path);
@@ -346,7 +347,7 @@
}
else
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::InitInstance:Can't create proxy. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Can't create Proxy Object for ESC. \n"));
}
@@ -402,7 +403,7 @@
observerService->AddObserver(observer, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
} else {
- PR_LOG(coolKeyLog,5,("Could not get an observer service. We will leak on shutdown."));
+ PR_LOG(coolKeyLog,PR_LOG_ERROR,("Could not get an observer service. We will leak on shutdown."));
}
return ret;
@@ -414,7 +415,7 @@
rhICoolKey *proxyObject = NULL;
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::CreateProxyObject: \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::CreateProxyObject: \n"));
nsCOMPtr<nsIProxyObjectManager> manager =
do_GetService(NS_XPCOMPROXY_CONTRACTID);
@@ -424,7 +425,7 @@
manager->GetProxyForObject(NS_UI_THREAD_EVENTQ, NS_GET_IID(rhICoolKey), this, PROXY_SYNC | PROXY_ALWAYS, (void**)&proxyObject);
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::CreateProxyObject: original: %p proxy %p \n",this,proxyObject));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::CreateProxyObject: original: %p proxy %p \n",this,proxyObject));
return proxyObject;
@@ -433,12 +434,12 @@
CoolKeyNode* rhCoolKey::GetCoolKeyInfo(unsigned long aKeyType, const char * aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetCoolKeyInfo: gASCAvailableKeys %p looking for key %s type %d \n",&gASCAvailableKeys,aKeyID,aKeyType));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyInfo: gASCAvailableKeys %p looking for key %s type %d \n",&gASCAvailableKeys,aKeyID,aKeyType));
std::list<CoolKeyNode*>::const_iterator it;
for(it=gASCAvailableKeys.begin(); it!=gASCAvailableKeys.end(); ++it) {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetCoolKeyInfo: current key %s type %d, looking for key %s type %d \n",(*it)->mKeyID.get(),(*it)->mKeyType,aKeyID,aKeyType));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyInfo: current key %s type %d, looking for key %s type %d \n",(*it)->mKeyID.get(),(*it)->mKeyType,aKeyID,aKeyType));
if ((*it)->mKeyType == aKeyType && !strcmp((*it)->mKeyID.get(), aKeyID))
return *it;
@@ -451,7 +452,7 @@
PRBool rhCoolKey::ASCCoolKeyIsAvailable(unsigned long aKeyType, char * aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCCoolKeyIsAvailable type %d id %s \n",aKeyType,aKeyID));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCCoolKeyIsAvailable type %d id %s \n",aKeyType,aKeyID));
return GetCoolKeyInfo(aKeyType, aKeyID) ? PR_TRUE : PR_FALSE;
}
@@ -461,7 +462,7 @@
nsEmbedCString *aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCGetAvailableCoolKeyAt: index %d type %d id %s \n",aIndex,aKeyType,aKeyID));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCGetAvailableCoolKeyAt: index %d type %d id %s \n",aIndex,aKeyType,aKeyID));
if (!aKeyType || !aKeyID)
return E_FAIL;
@@ -488,7 +489,7 @@
{
int size = (int) gASCAvailableKeys.size();
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCGetNumAvailableCoolKeys %d \n",size));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCGetNumAvailableCoolKeys %d \n",size));
return size;
}
@@ -501,21 +502,21 @@
rhIKeyNotify* rhCoolKey::GetNotifyKeyListener(rhIKeyNotify *listener){
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: %p size %d \n",listener,gNotifyListeners.size() ));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: %p size %d \n",listener,gNotifyListeners.size() ));
std::list<nsCOMPtr<rhIKeyNotify> >::const_iterator it;
for(it=gNotifyListeners.begin(); it!=gNotifyListeners.end(); ++it) {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: cur %p looking for %p \n",(*it).get(),listener));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: cur %p looking for %p \n",(*it).get(),listener));
if((*it) == listener)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning %p \n",listener,(*it).get()));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning %p \n",listener,(*it).get()));
return (*it);
}
}
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetNotifyKeyListener: looking for %p returning NULL. \n",listener));
return nsnull;
}
@@ -587,23 +588,19 @@
if (!node)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::InsertKeyIntoAvailableList: Can't create CoolKeyNode \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Can't create new CoolKey Data Structure. \n"));
return;
-
}
-
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::InsertKeyIntoAvailableList: about to add node to available key list.\n"));
gASCAvailableKeys.push_back(node);
-
}
void rhCoolKey::RemoveKeyFromAvailableList(unsigned long aKeyType, const char * aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RemoveKeyFromAvailableList type %d id %s \n",aKeyType,aKeyID));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RemoveKeyFromAvailableList type %d id %s \n",aKeyType,aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -615,7 +612,7 @@
void rhCoolKey::ClearAvailableList()
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ClearAvailableList \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ClearAvailableList \n"));
while (gASCAvailableKeys.size() > 0) {
CoolKeyNode *node = gASCAvailableKeys.front();
delete node;
@@ -625,7 +622,7 @@
HRESULT rhCoolKey::ASCSetCoolKeyPin(unsigned long aKeyType, const char * aKeyID, const char * aPin)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::ASCSetCoolKeyPin type %d id %s pin %s \n",aKeyType,aKeyID,aPin));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::ASCSetCoolKeyPin type %d id %s pin %s \n",aKeyType,aKeyID,aPin));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
return E_FAIL;
@@ -639,7 +636,7 @@
NS_IMETHODIMP rhCoolKey::RhNotifyKeyStateChange(PRUint32 aKeyType,const char *aKeyID, PRUint32 aKeyState, PRUint32 aData,const char* strData)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhNotifyKeyStateChange: id: %s type: %d state %d data: %d \n",aKeyID,aKeyType, aKeyState,aData));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange: id: %s type: %d state %d data: %d \n",aKeyID,aKeyType, aKeyState,aData));
CoolKeyNode tempKey(aKeyType, aKeyID,(CoolKeyStatus) aKeyState);
CoolKeyNode *node = NULL;
@@ -657,12 +654,12 @@
if (CoolKeyIsEnrolled(&key))
keyStatus = eAKS_Available; else if (CoolKeyHasApplet(&key)) keyStatus = eAKS_Uninitialized;
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange: Key Inserted. keyStatus %d \n",keyStatus));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Key Inserted. ID %s \n",aKeyID));
InsertKeyIntoAvailableList(tempKey.mKeyType,aKeyID ,(CoolKeyStatus) keyStatus);
break;
}
case eCKState_KeyRemoved:
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange: Key Removed. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Key Removed. ID %s \n",aKeyID));
RemoveKeyFromAvailableList(tempKey.mKeyType, aKeyID);
break;
case eCKState_EnrollmentComplete:
@@ -700,8 +697,6 @@
std::list< nsCOMPtr <rhIKeyNotify> >::const_iterator it;
for(it=gNotifyListeners.begin(); it!=gNotifyListeners.end(); ++it) {
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange about to call RhNotifyKeyStateChange listener: %p",(*it).get()));
-
((rhIKeyNotify *) (*it))->RhNotifyKeyStateChange(aKeyType,aKeyID,aKeyState,aData,strData);
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhNotifyKeyStateChange after call to RhNotifyKeyStateChange listener: %p",(*it).get()));
@@ -709,100 +704,33 @@
}
- // Do any post processing:
-
- switch (aKeyState)
- {
- case eCKState_KeyInserted:
- if (gAutoEnrollBlankTokens && !CoolKeyIsEnrolled(&key))
- //ASCEnrollCoolKey(aKey->mKeyType, keyID, "housekey"), NULL, NULL,NULL,NULL);
- break;
- }
-
- return NS_OK;
-
+ return NS_OK;
}
NS_IMETHODIMP rhCoolKey::RhCoolKeyUnSetNotifyCallback(rhIKeyNotify *jsNotify)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p \n",jsNotify,this));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p \n",jsNotify,this));
RemoveNotifyKeyListener(jsNotify);
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: removed listener, size now %d \n",GetNotifyKeyListenerListSize()));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: removed listener, size now %d \n",GetNotifyKeyListenerListSize()));
if(GetNotifyKeyListenerListSize() == 0)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p Listener size 0. \n",jsNotify,this));
-
- /* if(mProxy)
- {
-
- CoolKeyUnregisterListener(mProxy);
- NS_RELEASE(mProxy);
- mProxy = nsnull;
-
- }
-*/
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback Object: input %p this %p Listener size 0. \n",jsNotify,this));
}
-
-/*
- if(!jsNotify || !mJsNotify)
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback: KeyNotify already unset. \n"));
- return NS_OK;
-
- }
-
- if(jsNotify == mJsNotify)
- {
- mJsNotify = nsnull;
-
- if(mProxy)
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback: About to dereference Proxy Object. Proxy %p \n",mProxy));
-
- CoolKeyUnregisterListener(mProxy);
-
- NS_RELEASE(mProxy);
-
- mProxy = nsnull;
- }
-
- }
- else
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeyUnSetNotifyCallback: Input Notify Object not equal to member property. \n"));
- }
-
-*/
-
return NS_OK;
}
NS_IMETHODIMP rhCoolKey::RhCoolKeySetNotifyCallback(rhIKeyNotify *jsNotify)
{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCoolKeySetNotifyCallback Object: %p this %p\n",jsNotify,this));
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeySetNotifyCallback Object: %p this %p\n",jsNotify,this));
-
-
- AddNotifyKeyListener(jsNotify);
-
-
- /* if(!jsNotify || mJsNotify)
- {
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhCoolKeySetNotifyCallback: returning error. \n"));
- return NS_ERROR_FAILURE;
-
- }
-
- mJsNotify = jsNotify;
-
-*/
+ AddNotifyKeyListener(jsNotify);
return NS_OK;
@@ -817,14 +745,12 @@
if (!node)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhBlinkCoolKey: GetCoolKeyInfo failed. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhBlinkCoolKey: GetCoolKeyInfo failed. \n"));
return NS_ERROR_FAILURE;
}
-
if (!aKeyID)
{
- PR_LOG( coolKeyLog, 5, ("rhCoolKey::RhBlinkCoolKey: aKeyID is null. \n"));
return NS_ERROR_FAILURE ;
}
@@ -846,7 +772,7 @@
NS_IMETHODIMP rhCoolKey::EnrollCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aEnrollmentType, const char *aScreenName, const char *aPin, const char *aScreenNamePWord, const char *aTokenCode)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhEnrollCoolKey thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to Enroll Key ,ID: %s \n",aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
@@ -870,7 +796,6 @@
return NS_OK;
}
-
return NS_OK;
}
@@ -879,7 +804,7 @@
NS_IMETHODIMP rhCoolKey::ResetCoolKeyPIN(PRUint32 aKeyType, const char *aKeyID, const char *aScreenName, const char *aPIN, const char *aScreenNamePwd)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhResetCoolKeyPIN thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to Reset Key PIN, ID: %s \n",aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -923,7 +848,7 @@
NS_IMETHODIMP rhCoolKey::RenewCoolKey(PRUint32 aKeyType, const char *aKeyID)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhRenewCoolKey (not implemented) thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("rhCoolKey::RhRenewCoolKey (not implemented) thread: %p \n",PR_GetCurrentThread()));
return NS_ERROR_NOT_IMPLEMENTED;
}
@@ -932,7 +857,7 @@
NS_IMETHODIMP rhCoolKey::FormatCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aEnrollmentType, const char *aScreenName, const char *aPIN, const char *aScreenNamePWord, const char *aTokenCode)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhFormatCoolKey thread: %p \n",PR_GetCurrentThread()));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to Format Key, ID: %s. ",aKeyID));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -975,7 +900,6 @@
NS_IMETHODIMP rhCoolKey::CancelCoolKeyOperation(PRUint32 aKeyType, const char *aKeyID)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCancelCoolKeyOperation thread: %p \n",PR_GetCurrentThread()));
CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID);
if (!node)
@@ -983,14 +907,14 @@
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhCancelCoolKeyOperation type %d id %s status %d: \n",aKeyType,aKeyID,node->mStatus));
+
// If the key isn't busy, then there's nothing to do.
if (node->mStatus != eAKS_EnrollmentInProgress &&
node->mStatus != eAKS_UnblockInProgress &&
node->mStatus != eAKS_PINResetInProgress &&
node->mStatus != eAKS_RenewInProgress &&
- node->mStatus != eAKS_FormatInProgress) // &&
- // node->mStatus != eAKS_BlinkInProgress)
+ node->mStatus != eAKS_FormatInProgress)
return NS_OK;
AutoCoolKey key(aKeyType, aKeyID);
@@ -1008,7 +932,6 @@
NS_IMETHODIMP rhCoolKey::GetCoolKeyCertNicknames(PRUint32 aKeyType, const char *aKeyID, PRUint32 *count, char ***str)
{
-
if(!aKeyID || !count)
{
return NS_ERROR_FAILURE;
@@ -1065,7 +988,6 @@
NS_IMETHODIMP rhCoolKey::GetAvailableCoolKeys(PRUint32 *count, char ***str)
{
-
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetAvailableCoolKeys thread: %p \n",PR_GetCurrentThread()));
if(!count || !str)
@@ -1077,12 +999,11 @@
long numKeys = ASCGetNumAvailableCoolKeys();
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetAvailableCoolKeys num keys found: %d \n",numKeys));
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to get number of keys. Value: %d \n",numKeys));
if(numKeys == 0)
{
return NS_OK;
-
}
array = (char **) nsMemory::Alloc((sizeof(char *) * numKeys));
@@ -1103,8 +1024,6 @@
const char *id = keyID.get();
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetAvailableCoolKeys iter %d id %s\n",i,id));
-
array[i] = NULL;
if(id)
@@ -1141,7 +1060,6 @@
*_retval = eAKS_Unavailable;
}
-
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::RhGetCoolKeyStatus retval: %d \n",*_retval));
@@ -1185,15 +1103,38 @@
{
char *info = (char *) certInfo.c_str();
-
char *temp = (char *) nsMemory::Clone(info,sizeof(char) * strlen(info) + 1);
-
*aCertInfo = temp;
-
}
return NS_OK;
}
+
+
+/* string GetCoolKeyIssuerInfo (in unsigned long aKeyType, in string aKeyID); */ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuerInfo(PRUint32 aKeyType, const char *aKeyID, char **_retval)
+ {
+
+ *_retval = NULL;
+
+ AutoCoolKey key(aKeyType, aKeyID);
+
+ char issuerInfo[256];
+
+ HRESULT res = CoolKeyGetIssuerInfo(&key, (char *)&issuerInfo,256);
+
+ PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("Attempting to get the key's Issuer: Key: %s, Issuer %s. \n",aKeyID, (char *) issuerInfo));
+
+ if(res == S_OK)
+ {
+ char *temp = (char *) nsMemory::Clone(issuerInfo,sizeof(char) * strlen((char *)issuerInfo) + 1);
+ *_retval = temp;
+
+ }
+ return NS_OK;
+
+ }
+
+
/* void rhGetCoolKeyPolicy (in unsigned long aKeyType, in string aKeyID, out string policy); */
NS_IMETHODIMP rhCoolKey::GetCoolKeyPolicy(PRUint32 aKeyType, const char *aKeyID, char **policy)
{
@@ -1207,7 +1148,6 @@
char policyChar[MAX_STR_LEN] ;
policyChar[0] = 0;
-
AutoCoolKey key(aKeyType, aKeyID);
HRESULT hres = CoolKeyGetPolicy(&key, policyChar, MAX_STR_LEN);
@@ -1226,12 +1166,45 @@
return NS_OK;
}
+
+/* string GetCoolKeyIssuedTo (in unsigned long aKeyType, in string aKeyID); */
+NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuedTo(PRUint32 aKeyType, const char *aKeyID, char **issuedTo)
+{
+ if (!aKeyID) {
+ return NS_ERROR_FAILURE;
+ }
+
+ AutoCoolKey key(aKeyType, ( char *)aKeyID);
+
+ // const char *keyName = CoolKeyGetTokenName(&key);
+
+ char buff[512];
+ int bufLength = 512;
+ buff[0] = 0;
+
+ CoolKeyGetIssuedTo(&key, (char *) buff, bufLength);
+
+
+ if(!buff[0])
+ {
+ return NS_OK;
+ }
+
+ PR_LOG(coolKeyLog,PR_LOG_DEBUG,("rhCoolKey::RhGetCoolKeyGetIssuedTo %s \n",(char *) buff));
+
+ char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1);
+
+ *issuedTo = temp;
+
+ return NS_OK;
+
+}
/* boolean SetCoolKeyConfigValue (in string aName, in string aValue); */
NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue, PRBool *_retval)
{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::SetCoolKeyConfigValue thread: %p \n",PR_GetCurrentThread()));
if(!aName || !aValue)
{
-
*_retval = 0;
return NS_ERROR_FAILURE;
}
@@ -1244,6 +1217,7 @@
/* string GetCoolKeyConfigValue (in string aName); */
NS_IMETHODIMP rhCoolKey::GetCoolKeyConfigValue(const char *aName, char **_retval)
{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyConfigValue thread: %p \n",PR_GetCurrentThread()));
if(!aName)
{
@@ -1252,7 +1226,6 @@
*_retval = (char *) doGetCoolKeyConfigValue(aName);
-
return NS_OK;
}
@@ -1344,7 +1317,7 @@
{
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyVersion \n"));
- char *version = "1.2.0";
+ char *version = "1.0.0-10";
char *versionVal = (char *) nsMemory::Clone(version,sizeof(char) * strlen(version) + 1);
@@ -1360,19 +1333,6 @@
// Implement full module and factory dance so we can see what is going on
-//static const nsModuleComponentInfo components[] =
-//{
-// { "CoolKey",
-// COOLKEY_CID,
-// "@redhat.com/rhcoolkey",
-// rhCoolKeyConstructor
-// }
-//};
-
-//NS_IMPL_NSGETMODULE(nsSampleModule, components)
-
-
-// factory implementation class for component
class rhCoolKeyFactory: public nsIFactory{
private:
nsrefcnt mRefCnt;
@@ -1501,7 +1461,7 @@
NS_IMETHODIMP_(nsrefcnt)
rhCoolKeyModule::AddRef(void)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::AddRef \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::AddRef \n"));
++mRefCnt;
return mRefCnt;
}
@@ -1510,7 +1470,7 @@
NS_IMETHODIMP_(nsrefcnt)
rhCoolKeyModule::Release(void)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::Release \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::Release \n"));
--mRefCnt;
if (mRefCnt == 0) {
mRefCnt = 1; /* stabilize */
@@ -1524,7 +1484,7 @@
NS_IMETHODIMP
rhCoolKeyModule::QueryInterface(REFNSIID aIID, void** aInstancePtr)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::QueryInterface \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::QueryInterface \n"));
if ( !aInstancePtr )
return NS_ERROR_NULL_POINTER;
@@ -1558,7 +1518,7 @@
void** result)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::GetClassObject \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::GetClassObject \n"));
if (!kCoolKeyCID.Equals(aClass))
return NS_ERROR_FACTORY_NOT_REGISTERED;
@@ -1589,7 +1549,7 @@
nsIComponentRegistrar* compReg = nsnull;
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::RegisterSelf \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::RegisterSelf \n"));
nsresult rv = aCompMgr->QueryInterface(kIComponentRegistrarIID, (void**)&compReg);
if (NS_FAILED(rv))
return rv;
@@ -1612,7 +1572,7 @@
const char* registryLocation)
{
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::UnregisterSelf \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::UnregisterSelf \n"));
nsIComponentRegistrar* compReg = nsnull;
nsresult rv = aCompMgr->QueryInterface(kIComponentRegistrarIID, (void**)&compReg);
@@ -1642,7 +1602,7 @@
{
nsresult rv = NS_OK;
-PR_LOG( coolKeyLog, 5, ("rhCoolKeyModule::NSGetModule \n"));
+PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKeyModule::NSGetModule \n"));
// Create and initialize the module instance
rhCoolKeyModule *m = new rhCoolKeyModule();
Index: rhICoolKey.idl
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xpcom/rhICoolKey.idl,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rhICoolKey.idl 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ rhICoolKey.idl 13 Sep 2006 17:50:07 -0000 1.2
@@ -56,10 +56,14 @@
boolean GetCoolKeyIsEnrolled(in unsigned long aKeyType, in string aKeyID);
+ string GetCoolKeyIssuerInfo(in unsigned long aKeyType, in string aKeyID);
+
string GetCoolKeyPolicy(in unsigned long aKeyType,in string aKeyID);
string GetCoolKeyCertInfo(in unsigned long aKeyType, in string aKeyID, in string aCertNickname);
+ string GetCoolKeyIssuedTo(in unsigned long aKeyType, in string aKeyID);
+
boolean GetCoolKeyRequiresAuthentication(in unsigned long aKeyType,in string aKeyID);
boolean GetCoolKeyIsAuthenticated(in unsigned long aKeyType,in string aKeyID);
17 years, 7 months
[Fedora-directory-commits] esc/src/xulrunner Makefile,NONE,1.1
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/xulrunner
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12630
Added Files:
Makefile
Log Message:
Initial revision.
--- NEW FILE Makefile ---
#! gmake
#
# BEGIN COPYRIGHT BLOCK
# 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; version 2 of the License.
#
# 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., 59 Temple
# Place, Suite 330, Boston, MA 02111-1307 USA.
#
# Copyright (C) 2005 Red Hat, Inc.
# All rights reserved.
# END COPYRIGHT BLOCK
CORE_DEPTH = ../..
include $(CORE_DEPTH)/coreconf/config.mk
include $(CORE_DEPTH)/coreconf/rules.mk
#This just builds Xulrunner if necessary
TYPE=Debug
ifdef BUILD_OPT
TYPE=Release
endif
MOZ_SRCDIR=$(SOURCE_XP_DIR)/src/mozilla
MOZ_OBJDIR=$(DIST)/xulrunner_build
MOZ_RELOBJDIR=$(shell pwd)/$(MOZ_OBJDIR)
default: $(MOZ_OBJDIR)
#use the dependencies to know if we need to rebuild or not
export:: $(MOZ_OBJDIR)
lib:: $(MOZ_OBJDIR)
install:: $(MOZ_OBJDIR)
clean::
$(MOZ_OBJDIR): $(MOZ_SRCDIR)/.mozconfig $(MOZ_SRCDIR)/client.mk
(cd $(MOZ_SRCDIR) ; make -f client.mk build )
(cd $(MOZ_OBJDIR)/xulrunner/installer ; make )
touch $(MOZ_OBJDIR)
$(MOZ_SRCDIR)/.mozconfig: $(SOURCE_XP_DIR)/target.$(TYPE)
echo $@
rm -f $@
echo "mk_add_options MOZ_CO_PROJECT=xulrunner" > $@.$(TYPE)
echo "mk_add_options MOZ_OBJDIR=$(MOZ_RELOBJDIR)" >> $@.$(TYPE)
echo "ac_add_options --enable-application=xulrunner" >> $@.$(TYPE)
echo "ac_add_options --disable-tests" >> $@.$(TYPE)
echo "ac_cv_visibility_pragma=no" >> $@.$(TYPE)
ifdef BUILD_OPT
echo "ac_add_options --enable-optimize" >> $@.$(TYPE)
echo "ac_add_options --disable-debug" >> $@.$(TYPE)
else
echo "ac_add_options --disable-optimize" >> $@.$(TYPE)
echo "ac_add_options --enable-debug" >> $@.$(TYPE)
endif
ifeq ($(OS_ARCH),Linux)
echo "ac_add_options --disable-javaxpcom" >> $@.$(TYPE)
echo "ac_add_options --enable-default-toolkit=gtk2" >> $@.$(TYPE)
echo "ac_add_options --enable-xft" >> $@.$(TYPE)
echo "ac_add_options --disable-freetype2" >> $@.$(TYPE)
echo "ac_add_options --with-system-nspr" >> $@.$(TYPE)
echo "ac_add_options --with-system-nss" >> $@.$(TYPE)
endif
ifeq ($(OS_ARCH), WINNT)
echo "ac_add_options --disable-javaxpcom" >> $@.$(TYPE)
endif
cp $@.$(TYPE) $@
cat $@
#detect changes in .mozconfig and restart mozilla builds if necessary
# we can only do a debug or a release build at one time. if we
# try to run concurrent builds in the same tree, we will fail.
#NOTE: This also means we can't do multiple builds on different platforms
# at the same time in the mozilla tree
$(SOURCE_XP_DIR)/target.Debug:
rm -f $(SOURCE_XP_DIR)/target.Release # release is 'out of date' now
touch $(SOURCE_XP_DIR)/target.Debug
$(SOURCE_XP_DIR)/target.Release:
rm -f $(SOURCE_XP_DIR)/target.Debug # debug is 'out of date' now
touch $(SOURCE_XP_DIR)/target.Release
17 years, 7 months
[Fedora-directory-commits] esc/src Makefile, 1.1.1.1, 1.2 manifest.mn, 1.1.1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12574
Modified Files:
Makefile manifest.mn
Log Message:
Minor code cleanup.
Index: Makefile
===================================================================
RCS file: /cvs/dirsec/esc/src/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ Makefile 13 Sep 2006 17:46:53 -0000 1.2
@@ -23,14 +23,25 @@
ifeq ($(OS_ARCH), WINNT)
-DIRS += mozilla app/xpcom/tray app/xpcom win32
+DIRS += xulrunner app/xpcom/tray app/xpcom win32
endif
ifeq ($(OS_ARCH), Darwin)
-DIRS += mozilla app/xpcom/tray app/xpcom mac
+DIRS += xulrunner app/xpcom/tray app/xpcom mac
endif
ifeq ($(OS_ARCH), Linux)
-DIRS += mozilla lib/docklet app/xpcom/tray app/xpcom
+DIRS += xulrunner lib/notifytray app/xpcom/tray app/xpcom
+endif
+
+
+ifneq ($(OS_ARCH),Linux)
+IMPORTS += src/xulrunner/v1.8.0.1/xulrunner-1.8.0.1-source.tar.gz
+importnss:
+ifeq ($(IMPORT_NSS),1)
+ifneq ($(wildcard $(NSSDIR)/$(OBJDIR)/include/prtypes.h),$(NSSDIR)/$(OBJDIR)/include/prtypes.h)
+ $(MAKE) import
+endif
+endif
endif
Index: manifest.mn
===================================================================
RCS file: /cvs/dirsec/esc/src/manifest.mn,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- manifest.mn 12 Jun 2006 23:39:49 -0000 1.1.1.1
+++ manifest.mn 13 Sep 2006 17:46:53 -0000 1.2
@@ -15,7 +15,7 @@
# All rights reserved.
# END COPYRIGHT BLOCK
-CORE_DEPTH = ..
+CORE_DEPTH = ../
DIRS = \
lib/NssHttpClient \
17 years, 7 months