Bug 47207. Changing printf to PRINTF to use new logging facility. r=valeski,sr=waterson
git-svn-id: svn://10.0.0.236/trunk@81885 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -31,6 +31,11 @@
|
||||
#include <Resources.h>
|
||||
#include <MixedMode.h>
|
||||
#include <A4Stuff.h>
|
||||
#include "nslog.h"
|
||||
|
||||
NS_IMPL_LOG(nsDynamicMDEFLog, 0)
|
||||
#define PRINTF NS_LOG_PRINTF(nsDynamicMDEFLog)
|
||||
#define FLUSH NS_LOG_FLUSH(nsDynamicMDEFLog)
|
||||
|
||||
extern nsWeakPtr gMacMenubar;
|
||||
extern Handle gSystemMDEFHandle;
|
||||
@@ -183,11 +188,11 @@ pascal void nsDynamicMDEFMain(
|
||||
{
|
||||
switch (message) {
|
||||
case kMenuDrawMsg:
|
||||
//printf(" Draw passed in menu is = %d \n", *theMenu);
|
||||
//printf(" t= %d l= %d b= %d r= %d\n", (*menuRect).top, (*menuRect).left, (*menuRect).bottom, (*menuRect).right);
|
||||
//printf(" Point.v = %d Point.h = %d\n", hitPt.v, hitPt.h);
|
||||
//printf(" whichItem = %d \n", *whichItem);
|
||||
//printf(" theMenu.menuID = %d \n", (**theMenu).menuID);
|
||||
//PRINTF(" Draw passed in menu is = %d \n", *theMenu);
|
||||
//PRINTF(" t= %d l= %d b= %d r= %d\n", (*menuRect).top, (*menuRect).left, (*menuRect).bottom, (*menuRect).right);
|
||||
//PRINTF(" Point.v = %d Point.h = %d\n", hitPt.v, hitPt.h);
|
||||
//PRINTF(" whichItem = %d \n", *whichItem);
|
||||
//PRINTF(" theMenu.menuID = %d \n", (**theMenu).menuID);
|
||||
|
||||
nsCheckDestroy(theMenu, whichItem);
|
||||
break;
|
||||
@@ -199,11 +204,11 @@ pascal void nsDynamicMDEFMain(
|
||||
break;
|
||||
|
||||
case kMenuSizeMsg:
|
||||
//printf("Size passed in menu is = %d \n", *theMenu);
|
||||
//printf(" t= %d l= %d b= %d r= %d \n", (*menuRect).top, (*menuRect).left, (*menuRect).bottom ,(*menuRect).right);
|
||||
//printf(" Point.v = %d Point.h = %d \n", hitPt.v, hitPt.h);
|
||||
//printf(" whichItem = %d \n", *whichItem);
|
||||
//printf(" theMenu.menuID = %d \n", (**theMenu).menuID);
|
||||
//PRINTF("Size passed in menu is = %d \n", *theMenu);
|
||||
//PRINTF(" t= %d l= %d b= %d r= %d \n", (*menuRect).top, (*menuRect).left, (*menuRect).bottom ,(*menuRect).right);
|
||||
//PRINTF(" Point.v = %d Point.h = %d \n", hitPt.v, hitPt.h);
|
||||
//PRINTF(" whichItem = %d \n", *whichItem);
|
||||
//PRINTF(" theMenu.menuID = %d \n", (**theMenu).menuID);
|
||||
|
||||
nsCheckDestroy(theMenu, whichItem);
|
||||
|
||||
@@ -215,8 +220,8 @@ pascal void nsDynamicMDEFMain(
|
||||
// nsIMenu * menu = (nsIMenu *) gPreviousMenuStack[gPreviousMenuStack.Count() - 1];
|
||||
MenuHandle menuHandle = (MenuHandle) gPreviousMenuHandleStack[gPreviousMenuHandleStack.Count() - 1];
|
||||
|
||||
//printf(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//printf(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
//PRINTF(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//PRINTF(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
|
||||
if( menu && menuHandle ) {
|
||||
|
||||
@@ -224,7 +229,7 @@ pascal void nsDynamicMDEFMain(
|
||||
|
||||
nsCOMPtr<nsIMenuListener> listener(do_QueryInterface(menu));
|
||||
if(listener) {
|
||||
//printf("MenuPop \n");
|
||||
//PRINTF("MenuPop \n");
|
||||
|
||||
nsMenuEvent mevent;
|
||||
mevent.message = NS_MENU_SELECTED;
|
||||
@@ -242,7 +247,7 @@ pascal void nsDynamicMDEFMain(
|
||||
gPreviousMenuStack.RemoveMenuAt(gPreviousMenuStack.Count() - 1);
|
||||
//NS_IF_RELEASE(menu);
|
||||
|
||||
//printf("%d items now on gPreviousMenuStack \n", gPreviousMenuStack.Count());
|
||||
//PRINTF("%d items now on gPreviousMenuStack \n", gPreviousMenuStack.Count());
|
||||
gPreviousMenuHandleStack.RemoveElementAt(gPreviousMenuHandleStack.Count() - 1);
|
||||
|
||||
}
|
||||
@@ -300,24 +305,24 @@ void nsDynamicChooseItem(
|
||||
Point hitPt,
|
||||
short * whichItem)
|
||||
{
|
||||
//printf("enter DynamicChooseItem \n");
|
||||
//PRINTF("enter DynamicChooseItem \n");
|
||||
nsCallSystemMDEF(kMenuChooseMsg, theMenu, menuRect, hitPt, whichItem);
|
||||
|
||||
nsCheckDestroy(theMenu, whichItem);
|
||||
|
||||
gCurrentMenuItem = *whichItem;
|
||||
|
||||
//printf("exit DynamicChooseItem \n");
|
||||
//PRINTF("exit DynamicChooseItem \n");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void nsDynamicSizeTheMenu(
|
||||
MenuHandle theMenu)
|
||||
{
|
||||
//printf("enter DynamicSizeTheMenu \n");
|
||||
//PRINTF("enter DynamicSizeTheMenu \n");
|
||||
|
||||
nsDoMagic(theMenu);
|
||||
//printf("exit DynamicSizeTheMenu \n");
|
||||
//PRINTF("exit DynamicSizeTheMenu \n");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -338,7 +343,7 @@ bool nsIsHierChild(MenuHandle theMenu)
|
||||
//------------------------------------------------------------------------------
|
||||
void nsDoMagic(MenuHandle theMenu)
|
||||
{
|
||||
//printf("DoMagic \n");
|
||||
//PRINTF("DoMagic \n");
|
||||
// ask if this is a child of the previous menu
|
||||
PRBool isChild = PR_FALSE;
|
||||
|
||||
@@ -369,7 +374,7 @@ void nsDoMagic(MenuHandle theMenu)
|
||||
//------------------------------------------------------------------------------
|
||||
void nsBuildMenu(MenuHandle theMenu, PRBool isChild)
|
||||
{
|
||||
// printf("enter BuildMenu \n");
|
||||
// PRINTF("enter BuildMenu \n");
|
||||
nsCOMPtr<nsIMenuBar> menubar = do_QueryReferent(gMacMenubar);
|
||||
if (!menubar || !theMenu) {
|
||||
return;
|
||||
@@ -405,7 +410,7 @@ void nsBuildMenu(MenuHandle theMenu, PRBool isChild)
|
||||
gPreviousTopLevelMenu = menu;
|
||||
|
||||
gPreviousMenuBar = getter_AddRefs(NS_GetWeakReference(menubar));
|
||||
//printf("exit BuildMenu \n");
|
||||
//PRINTF("exit BuildMenu \n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -415,7 +420,7 @@ void nsBuildMenu(MenuHandle theMenu, PRBool isChild)
|
||||
// Not top level, so we can't use recursive MenuSelect <sigh>
|
||||
// We must use the previously chosen menu item in combination
|
||||
// with the current menu to determine what menu needs to be constructed
|
||||
//printf("gCurrentMenuItem = %d \n", gCurrentMenuItem);
|
||||
//PRINTF("gCurrentMenuItem = %d \n", gCurrentMenuItem);
|
||||
if (gCurrentMenuItem){
|
||||
if (gPreviousMenuStack.Count() > 0)
|
||||
{
|
||||
@@ -423,7 +428,7 @@ void nsBuildMenu(MenuHandle theMenu, PRBool isChild)
|
||||
gPreviousMenuStack.GetMenuAt(gPreviousMenuStack.Count() - 1, getter_AddRefs(prevMenu));
|
||||
|
||||
//nsIMenu * prevMenu = (nsIMenu *) gPreviousMenuStack[gPreviousMenuStack.Count() - 1];
|
||||
//printf("gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count() );
|
||||
//PRINTF("gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count() );
|
||||
|
||||
if(prevMenu)
|
||||
{
|
||||
@@ -440,7 +445,7 @@ void nsBuildMenu(MenuHandle theMenu, PRBool isChild)
|
||||
}
|
||||
}
|
||||
}
|
||||
//printf("exit BuildMenu \n");
|
||||
//PRINTF("exit BuildMenu \n");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -451,7 +456,7 @@ void nsPostBuild(nsIMenu * menu, MenuHandle theMenu, PRBool isChild)
|
||||
{
|
||||
nsPushMenu(menu);
|
||||
nsPushMenuHandle(theMenu);
|
||||
//printf("Push: %d items in gMenuHandleStack \n", gMenuHandleStack.Count());
|
||||
//PRINTF("Push: %d items in gMenuHandleStack \n", gMenuHandleStack.Count());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -506,8 +511,8 @@ void nsPreviousMenuStackUnwind(nsIMenu * aMenuJustBuilt, MenuHandle aMenuHandleJ
|
||||
{
|
||||
//PRBool shouldReleaseMenubar = PR_FALSE;
|
||||
|
||||
//printf("PreviousMenuStackUnwind called \n");
|
||||
//printf("%d items on gPreviousMenuStack \n", gPreviousMenuStack.Count());
|
||||
//PRINTF("PreviousMenuStackUnwind called \n");
|
||||
//PRINTF("%d items on gPreviousMenuStack \n", gPreviousMenuStack.Count());
|
||||
while (gPreviousMenuHandleStack.Count())
|
||||
{
|
||||
nsCOMPtr<nsIMenu> menu; // = (nsIMenu *) gPreviousMenuStack[gPreviousMenuStack.Count() - 1];
|
||||
@@ -518,8 +523,8 @@ void nsPreviousMenuStackUnwind(nsIMenu * aMenuJustBuilt, MenuHandle aMenuHandleJ
|
||||
if (menu)
|
||||
{
|
||||
|
||||
//printf(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//printf(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
//PRINTF(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//PRINTF(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
|
||||
if( menuHandle ) {
|
||||
|
||||
@@ -543,13 +548,13 @@ void nsPreviousMenuStackUnwind(nsIMenu * aMenuJustBuilt, MenuHandle aMenuHandleJ
|
||||
// NS_IF_RELEASE(menu);
|
||||
//shouldReleaseMenubar = PR_TRUE;
|
||||
|
||||
//printf("%d items now on gPreviousMenuStack \n", gPreviousMenuStack.Count());
|
||||
//PRINTF("%d items now on gPreviousMenuStack \n", gPreviousMenuStack.Count());
|
||||
gPreviousMenuHandleStack.RemoveElementAt(gPreviousMenuHandleStack.Count() - 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//printf(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//printf(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
//PRINTF(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//PRINTF(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
|
||||
// we are the aMenuHandleJustBuilt
|
||||
return;
|
||||
@@ -571,8 +576,8 @@ void nsPreviousMenuStackUnwind(nsIMenu * aMenuJustBuilt, MenuHandle aMenuHandleJ
|
||||
//if ( shouldReleaseMenubar )
|
||||
// gPreviousMenuBar = nsnull;
|
||||
|
||||
//printf(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//printf(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
//PRINTF(" gPreviousMenuStack.Count() = %d \n", gPreviousMenuStack.Count());
|
||||
//PRINTF(" gPreviousMenuHandleStack.Count() = %d \n", gPreviousMenuHandleStack.Count());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user