From 48580976469f7c46b730f96effacfa680e55e3cd Mon Sep 17 00:00:00 2001 From: David Elliott Date: Sun, 8 Feb 2004 07:07:04 +0000 Subject: [PATCH] Use wxLogTrace instead of wxLogDebug for trace messages git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/cocoa/NSControl.mm | 2 +- src/cocoa/NSWindow.mm | 6 +++--- src/cocoa/app.mm | 10 +++++----- src/cocoa/bitmap.mm | 2 +- src/cocoa/bmpbuttn.mm | 6 +++--- src/cocoa/button.mm | 6 +++--- src/cocoa/checkbox.mm | 2 +- src/cocoa/choice.mm | 2 +- src/cocoa/control.mm | 6 +++--- src/cocoa/dc.mm | 4 ++-- src/cocoa/dcclient.mm | 8 ++++---- src/cocoa/dcmemory.mm | 2 +- src/cocoa/dialog.mm | 16 ++++++++-------- src/cocoa/evtloop.mm | 2 +- src/cocoa/frame.mm | 2 +- src/cocoa/mbarman.mm | 2 +- src/cocoa/mdi.mm | 8 ++++---- src/cocoa/menu.mm | 4 ++-- src/cocoa/menuitem.mm | 4 ++-- src/cocoa/radiobut.mm | 2 +- src/cocoa/toolbar.mm | 6 +++--- src/cocoa/toplevel.mm | 18 +++++++++--------- src/cocoa/window.mm | 30 +++++++++++++++--------------- 23 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/cocoa/NSControl.mm b/src/cocoa/NSControl.mm index 2f601e3b6b..39981e4dbd 100644 --- a/src/cocoa/NSControl.mm +++ b/src/cocoa/NSControl.mm @@ -40,7 +40,7 @@ - (void)wxNSControlAction: (id)sender { - wxLogDebug(wxT("wxNSControlAction")); + wxLogTrace(wxTRACE_COCOA,wxT("wxNSControlAction")); wxCocoaNSControl *wxcontrol = wxCocoaNSControl::GetFromCocoa(sender); wxCHECK_RET(wxcontrol,wxT("wxNSControlAction received but no wxCocoaNSControl exists!")); wxcontrol->CocoaTarget_action(); diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index ca5960caf0..7032045d68 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -77,14 +77,14 @@ - (BOOL)windowShouldClose: (id)sender { - wxLogDebug(wxT("windowShouldClose")); + wxLogTrace(wxTRACE_COCOA,wxT("windowShouldClose")); wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(sender); if(tlw && !tlw->CocoaDelegate_windowShouldClose()) { - wxLogDebug(wxT("Window will not be closed")); + wxLogTrace(wxTRACE_COCOA,wxT("Window will not be closed")); return NO; } - wxLogDebug(wxT("Window will be closed")); + wxLogTrace(wxTRACE_COCOA,wxT("Window will be closed")); return YES; } diff --git a/src/cocoa/app.mm b/src/cocoa/app.mm index 909b71fe4f..3fcbd3b162 100644 --- a/src/cocoa/app.mm +++ b/src/cocoa/app.mm @@ -89,7 +89,7 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication); && ([NSDefaultRunLoopMode isEqualToString:mode] || [NSModalPanelRunLoopMode isEqualToString:mode])) { sg_needIdle = false; - wxLogDebug(wxT("Processing idle events")); + wxLogTrace(wxTRACE_COCOA,wxT("Processing idle events")); while(wxTheApp->ProcessIdle()) { // Get the same events except don't block @@ -98,19 +98,19 @@ WX_IMPLEMENT_POSER(wxPoserNSApplication); if(event) return event; // we didn't get one, do some idle work - wxLogDebug(wxT("Looping idle events")); + wxLogTrace(wxTRACE_COCOA,wxT("Looping idle events")); } // No more idle work requested, block - wxLogDebug(wxT("Finished idle processing")); + wxLogTrace(wxTRACE_COCOA,wxT("Finished idle processing")); } else - wxLogDebug(wxT("Avoiding idle processing sg_needIdle=%d"),sg_needIdle); + wxLogTrace(wxTRACE_COCOA,wxT("Avoiding idle processing sg_needIdle=%d"),sg_needIdle); return [super nextEventMatchingMask:mask untilDate:expiration inMode:mode dequeue:flag]; } - (void)sendEvent: (NSEvent*)anEvent { - wxLogDebug(wxT("SendEvent")); + wxLogTrace(wxTRACE_COCOA,wxT("SendEvent")); sg_needIdle = true; [super sendEvent: anEvent]; } diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index bb7302cf8e..2b13a11ef6 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -296,7 +296,7 @@ bool wxBitmap::Create(int w, int h, int d) bytesPerRow: 0 bitsPerPixel: 0]; - wxLogDebug(wxT("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p"), M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]); + wxLogTrace(wxTRACE_COCOA,wxT("M_BITMAPDATA=%p NSBitmapImageRep bitmapData=%p"), M_BITMAPDATA, [M_BITMAPDATA->m_cocoaNSBitmapImageRep bitmapData]); M_BITMAPDATA->m_ok = true; M_BITMAPDATA->m_numColors = 0; M_BITMAPDATA->m_quality = 0; diff --git a/src/cocoa/bmpbuttn.mm b/src/cocoa/bmpbuttn.mm index 7933e5dffa..50da8d7cdc 100644 --- a/src/cocoa/bmpbuttn.mm +++ b/src/cocoa/bmpbuttn.mm @@ -32,10 +32,10 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID winid, const wxValidator& validator, const wxString& name) { wxAutoNSAutoreleasePool pool; - wxLogDebug(wxT("Creating control with id=%d"),winid); + wxLogTrace(wxTRACE_COCOA,wxT("Creating control with id=%d"),winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; - wxLogDebug(wxT("Created control with id=%d"),GetId()); + wxLogTrace(wxTRACE_COCOA,wxT("Created control with id=%d"),GetId()); m_cocoaNSView = NULL; SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]); // NOTE: YES we want to release this (to match the alloc). @@ -60,7 +60,7 @@ wxBitmapButton::~wxBitmapButton() void wxBitmapButton::Cocoa_wxNSButtonAction(void) { - wxLogDebug(wxT("YAY!")); + wxLogTrace(wxTRACE_COCOA,wxT("YAY!")); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); InitCommandEvent(event); // event.SetEventObject(this); Command(event); diff --git a/src/cocoa/button.mm b/src/cocoa/button.mm index f9d006b3a7..6e7603190b 100644 --- a/src/cocoa/button.mm +++ b/src/cocoa/button.mm @@ -32,10 +32,10 @@ bool wxButton::Create(wxWindow *parent, wxWindowID winid, const wxValidator& validator, const wxString& name) { wxAutoNSAutoreleasePool pool; - wxLogDebug(wxT("Creating control with id=%d"),winid); + wxLogTrace(wxTRACE_COCOA,wxT("Creating control with id=%d"),winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; - wxLogDebug(wxT("Created control with id=%d"),GetId()); + wxLogTrace(wxTRACE_COCOA,wxT("Created control with id=%d"),GetId()); m_cocoaNSView = NULL; SetNSButton([[NSButton alloc] initWithFrame: MakeDefaultNSRect(size)]); // NOTE: YES we want to release this (to match the alloc). @@ -60,7 +60,7 @@ wxButton::~wxButton() void wxButton::Cocoa_wxNSButtonAction(void) { - wxLogDebug(wxT("YAY!")); + wxLogTrace(wxTRACE_COCOA,wxT("YAY!")); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, GetId()); InitCommandEvent(event); // event.SetEventObject(this); Command(event); diff --git a/src/cocoa/checkbox.mm b/src/cocoa/checkbox.mm index 659025be55..7b96b3ca0f 100644 --- a/src/cocoa/checkbox.mm +++ b/src/cocoa/checkbox.mm @@ -113,7 +113,7 @@ wxCheckBoxState wxCheckBox::DoGet3StateValue() const void wxCheckBox::Cocoa_wxNSButtonAction(void) { - wxLogDebug(wxT("Checkbox")); + wxLogTrace(wxTRACE_COCOA,wxT("Checkbox")); // What we really want to do is override [NSCell -nextState] to return // NSOnState in lieu of NSMixedState but this works (aside from the // very slightly noticeable drawing of - and then a check) -DE diff --git a/src/cocoa/choice.mm b/src/cocoa/choice.mm index 91ca7a94b9..578cbec40c 100644 --- a/src/cocoa/choice.mm +++ b/src/cocoa/choice.mm @@ -122,7 +122,7 @@ void wxChoice::CocoaNotification_menuDidSendAction(WX_NSNotification notificatio NSMenuItem *menuitem = [userInfo objectForKey:@"MenuItem"]; int index = [[(NSPopUpButton*)m_cocoaNSView menu] indexOfItem: menuitem]; int selectedItem = [(NSPopUpButton*)m_cocoaNSView indexOfSelectedItem]; - wxLogDebug(wxT("menuDidSendAction, index=%d, selectedItem=%d"), index, selectedItem); + wxLogTrace(wxTRACE_COCOA,wxT("menuDidSendAction, index=%d, selectedItem=%d"), index, selectedItem); wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId); event.SetInt(index); event.SetEventObject(this); diff --git a/src/cocoa/control.mm b/src/cocoa/control.mm index c8215a75f5..d43d8a1112 100644 --- a/src/cocoa/control.mm +++ b/src/cocoa/control.mm @@ -45,10 +45,10 @@ bool wxControl::Create(wxWindow *parent, wxWindowID winid, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { - wxLogDebug(wxT("Creating control with id=%d"),winid); + wxLogTrace(wxTRACE_COCOA,wxT("Creating control with id=%d"),winid); if(!CreateControl(parent,winid,pos,size,style,validator,name)) return false; - wxLogDebug(wxT("Created control with id=%d"),GetId()); + wxLogTrace(wxTRACE_COCOA,wxT("Created control with id=%d"),GetId()); m_cocoaNSView = NULL; SetNSControl([[wxNonControlNSControl alloc] initWithFrame: MakeDefaultNSRect(size)]); // NOTE: YES we want to release this (to match the alloc). @@ -78,7 +78,7 @@ wxSize wxControl::DoGetBestSize() const NSRect cocoaRect = [m_cocoaNSView frame]; wxSize size((int)cocoaRect.size.width+10,(int)cocoaRect.size.height); [m_cocoaNSView setFrame: storedRect]; - wxLogDebug(wxT("wxControl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y); + wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("wxControl=%p::DoGetBestSize()==(%d,%d)"),this,size.x,size.y); return size; } diff --git a/src/cocoa/dc.mm b/src/cocoa/dc.mm index 660658dadc..3a0e7c3657 100644 --- a/src/cocoa/dc.mm +++ b/src/cocoa/dc.mm @@ -275,7 +275,7 @@ void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y) [flipTransform concat]; #if 0 // Draw+fill a rectangle so we can see where the shit is supposed to be. - wxLogDebug(wxT("(%f,%f) (%fx%f)"),usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height); + wxLogTrace(wxTRACE_COCOA,wxT("(%f,%f) (%fx%f)"),usedRect.origin.x,usedRect.origin.y,usedRect.size.width,usedRect.size.height); NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(0,0,usedRect.size.width,usedRect.size.height)]; [[NSColor blackColor] set]; [bezpath stroke]; @@ -455,7 +455,7 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) #if 0 // Draw a rect so we can see where it's supposed to be - wxLogDebug(wxT("image at (%d,%d) size %dx%d"),x,y,bmp.GetWidth(),bmp.GetHeight()); + wxLogTrace(wxTRACE_COCOA,wxT("image at (%d,%d) size %dx%d"),x,y,bmp.GetWidth(),bmp.GetHeight()); NSBezierPath *bezpath = [NSBezierPath bezierPathWithRect:NSMakeRect(x,y,bmp.GetWidth(),bmp.GetHeight())]; [[NSColor blackColor] set]; [bezpath stroke]; diff --git a/src/cocoa/dcclient.mm b/src/cocoa/dcclient.mm index 56c9b7f7c1..2f2f8ddf59 100644 --- a/src/cocoa/dcclient.mm +++ b/src/cocoa/dcclient.mm @@ -71,13 +71,13 @@ bool wxWindowDC::CocoaUnlockFocusOnNSView() bool wxWindowDC::CocoaLockFocus() { - wxLogDebug(wxT("Locking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView()); + wxLogTrace(wxTRACE_COCOA,wxT("Locking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView()); return CocoaLockFocusOnNSView(m_window->GetNonClientNSView()); } bool wxWindowDC::CocoaUnlockFocus() { - wxLogDebug(wxT("Unlocking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView()); + wxLogTrace(wxTRACE_COCOA,wxT("Unlocking focus on wxWindowDC=%p, NSView=%p"),this, m_window->GetNonClientNSView()); return CocoaUnlockFocusOnNSView(); } @@ -115,13 +115,13 @@ wxClientDC::~wxClientDC(void) bool wxClientDC::CocoaLockFocus() { - wxLogDebug(wxT("Locking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView()); + wxLogTrace(wxTRACE_COCOA,wxT("Locking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView()); return CocoaLockFocusOnNSView(m_window->GetNSView()); } bool wxClientDC::CocoaUnlockFocus() { - wxLogDebug(wxT("Unlocking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView()); + wxLogTrace(wxTRACE_COCOA,wxT("Unlocking focus on wxClientDC=%p, NSView=%p"),this, m_window->GetNSView()); return CocoaUnlockFocusOnNSView(); } diff --git a/src/cocoa/dcmemory.mm b/src/cocoa/dcmemory.mm index 3e8d16339c..dc526fba9c 100644 --- a/src/cocoa/dcmemory.mm +++ b/src/cocoa/dcmemory.mm @@ -135,7 +135,7 @@ bool wxMemoryDC::CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, [transform concat]; [flipTransform concat]; - wxLogDebug(wxT("[m_cocoaNSImage isFlipped]=%d"), [m_cocoaNSImage isFlipped]); + wxLogTrace(wxTRACE_COCOA,wxT("[m_cocoaNSImage isFlipped]=%d"), [m_cocoaNSImage isFlipped]); [m_cocoaNSImage drawAtPoint: NSMakePoint(0,0) fromRect: NSMakeRect(xsrc, m_selectedBitmap.GetHeight()-height-ysrc, diff --git a/src/cocoa/dialog.mm b/src/cocoa/dialog.mm index 4a13a49a95..d490c8edc5 100644 --- a/src/cocoa/dialog.mm +++ b/src/cocoa/dialog.mm @@ -75,7 +75,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid, // Because we do not release on close, the following release matches the // above alloc and thus the retain count will be 1. [m_cocoaNSWindow release]; - wxLogDebug(wxT("wxDialog m_cocoaNSWindow retainCount=%d"),[m_cocoaNSWindow retainCount]); + wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxDialog m_cocoaNSWindow retainCount=%d"),[m_cocoaNSWindow retainCount]); [m_cocoaNSWindow setTitle:wxNSStringWithWxString(title)]; [m_cocoaNSWindow setHidesOnDeactivate:NO]; @@ -84,7 +84,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID winid, wxDialog::~wxDialog() { - wxLogDebug(wxT("Destroying")); + wxLogTrace(wxTRACE_COCOA,wxT("Destroying")); // setReleasedWhenClosed: NO [m_cocoaNSWindow close]; DisassociateNSPanel(GetNSPanel()); @@ -94,7 +94,7 @@ void wxDialog::CocoaDelegate_windowWillClose(void) { m_closed = true; /* Actually, this isn't true anymore */ - wxLogDebug(wxT("Woah: Dialogs are not generally closed")); + wxLogTrace(wxTRACE_COCOA,wxT("Woah: Dialogs are not generally closed")); } void wxDialog::SetModal(bool flag) @@ -124,7 +124,7 @@ bool wxDialog::Show(bool show) { wxAutoNSAutoreleasePool pool; wxModalDialogs.Append(this); - wxLogDebug(wxT("runModal")); + wxLogTrace(wxTRACE_COCOA,wxT("runModal")); NSApplication *theNSApp = wxTheApp->GetNSApplication(); // If the app hasn't started, flush the event queue // If we don't do this, the Dock doesn't get the message that @@ -141,11 +141,11 @@ bool wxDialog::Show(bool show) } } [wxTheApp->GetNSApplication() runModalForWindow:m_cocoaNSWindow]; - wxLogDebug(wxT("runModal END")); + wxLogTrace(wxTRACE_COCOA,wxT("runModal END")); } else { - wxLogDebug(wxT("abortModal")); + wxLogTrace(wxTRACE_COCOA,wxT("abortModal")); [wxTheApp->GetNSApplication() abortModal]; wxModalDialogs.DeleteObject(this); } @@ -204,7 +204,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& event) closing.Append(this); - wxLogDebug(wxT("Sending Cancel Event")); + wxLogTrace(wxTRACE_COCOA,wxT("Sending Cancel Event")); wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); cancelEvent.SetEventObject( this ); GetEventHandler()->ProcessEvent(cancelEvent); // This may close the dialog @@ -230,7 +230,7 @@ void wxDialog::OnApply(wxCommandEvent& event) void wxDialog::OnCancel(wxCommandEvent& event) { - wxLogDebug(wxT("Cancelled!")); + wxLogTrace(wxTRACE_COCOA,wxT("Cancelled!")); EndModal(wxID_CANCEL); } diff --git a/src/cocoa/evtloop.mm b/src/cocoa/evtloop.mm index 00e19abb62..32f9ccbfa1 100644 --- a/src/cocoa/evtloop.mm +++ b/src/cocoa/evtloop.mm @@ -88,7 +88,7 @@ void wxEventLoop::Exit(int rc) m_impl->SetExitCode(rc); NSApplication *cocoaApp = [NSApplication sharedApplication]; - wxLogDebug(wxT("wxEventLoop::Exit isRunning=%d"), (int)[cocoaApp isRunning]); + wxLogTrace(wxTRACE_COCOA,wxT("wxEventLoop::Exit isRunning=%d"), (int)[cocoaApp isRunning]); wxTheApp->WakeUpIdle(); /* Notes: If we're being called from idle time (which occurs while checking the diff --git a/src/cocoa/frame.mm b/src/cocoa/frame.mm index ca12e36e29..7ed2c50c8f 100644 --- a/src/cocoa/frame.mm +++ b/src/cocoa/frame.mm @@ -165,7 +165,7 @@ void wxFrame::UpdateFrameNSView() [sbarNSView setAutoresizingMask: NSViewWidthSizable|NSViewMaxYMargin]; sbarheight = sbarRect.size.height; } - wxLogDebug(wxT("frame height=%f, tbar=%f, sbar=%f"),frameRect.size.height,tbarheight,sbarheight); + wxLogTrace(wxTRACE_COCOA,wxT("frame height=%f, tbar=%f, sbar=%f"),frameRect.size.height,tbarheight,sbarheight); NSRect innerRect = [m_cocoaNSView frame]; innerRect.size.height = frameRect.size.height - tbarheight - sbarheight; innerRect.origin.y = sbarheight; diff --git a/src/cocoa/mbarman.mm b/src/cocoa/mbarman.mm index 0935ec6e97..77fea84ec6 100644 --- a/src/cocoa/mbarman.mm +++ b/src/cocoa/mbarman.mm @@ -273,7 +273,7 @@ void wxMenuBarManager::InstallMenuBarForWindow(wxCocoaNSWindow *win) wxASSERT(win); m_windowCurrent = win; wxMenuBar *menubar = win->GetAppMenuBar(win); - wxLogDebug(wxT("Found menubar=%p for window=%p."),menubar,win); + wxLogTrace(wxTRACE_COCOA,wxT("Found menubar=%p for window=%p."),menubar,win); SetMenuBar(menubar); } diff --git a/src/cocoa/mdi.mm b/src/cocoa/mdi.mm index 7a3f68a8f1..fdac990686 100644 --- a/src/cocoa/mdi.mm +++ b/src/cocoa/mdi.mm @@ -158,7 +158,7 @@ wxMenuBar *wxMDIParentFrame::GetAppMenuBar(wxCocoaNSWindow *win) void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void) { - wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidBecomeKey"),this); if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_currentChild) { sm_cocoaDeactivateWindow = NULL; @@ -183,7 +183,7 @@ void wxMDIParentFrame::CocoaDelegate_windowDidBecomeKey(void) void wxMDIParentFrame::CocoaDelegate_windowDidResignKey(void) { - wxLogDebug(wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxMDIParentFrame=%p::CocoaDelegate_windowDidResignKey"),this); if(m_closed) wxFrame::CocoaDelegate_windowDidResignKey(); else @@ -280,7 +280,7 @@ void wxMDIChildFrame::Activate() void wxMDIChildFrame::CocoaDelegate_windowDidBecomeKey(void) { - wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidBecomeKey"),this); if(sm_cocoaDeactivateWindow && sm_cocoaDeactivateWindow==m_mdiParent) { sm_cocoaDeactivateWindow = NULL; @@ -299,7 +299,7 @@ void wxMDIChildFrame::CocoaDelegate_windowDidBecomeMain(void) void wxMDIChildFrame::CocoaDelegate_windowDidResignKey(void) { - wxLogDebug(wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxMDIChildFrame=%p::CocoaDelegate_windowDidResignKey"),this); sm_cocoaDeactivateWindow = this; } diff --git a/src/cocoa/menu.mm b/src/cocoa/menu.mm index d8ed61c0a7..2d662e4111 100644 --- a/src/cocoa/menu.mm +++ b/src/cocoa/menu.mm @@ -106,7 +106,7 @@ wxMenuBar::~wxMenuBar() bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) { wxAutoNSAutoreleasePool pool; - wxLogDebug(wxT("append menu=%p, title=%s"),menu,title.c_str()); + wxLogTrace(wxTRACE_COCOA,wxT("append menu=%p, title=%s"),menu,title.c_str()); if(!wxMenuBarBase::Append(menu,title)) return false; wxASSERT(menu); @@ -126,7 +126,7 @@ bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { wxAutoNSAutoreleasePool pool; - wxLogDebug(wxT("insert pos=%lu, menu=%p, title=%s"),pos,menu,title.c_str()); + wxLogTrace(wxTRACE_COCOA,wxT("insert pos=%lu, menu=%p, title=%s"),pos,menu,title.c_str()); // Get the current menu at this position wxMenu *nextmenu = GetMenu(pos); if(!wxMenuBarBase::Insert(pos,menu,title)) diff --git a/src/cocoa/menuitem.mm b/src/cocoa/menuitem.mm index a8795fe053..fdc0620a3e 100644 --- a/src/cocoa/menuitem.mm +++ b/src/cocoa/menuitem.mm @@ -55,7 +55,7 @@ - (void)wxMenuItemAction: (id)sender { - wxLogDebug(wxT("wxMenuItemAction")); + wxLogTrace(wxTRACE_COCOA,wxT("wxMenuItemAction")); wxMenuItem *item = wxMenuItem::GetFromCocoa(sender); wxCHECK_RET(item,wxT("wxMenuItemAction received but no wxMenuItem exists!")); @@ -73,7 +73,7 @@ - (BOOL)validateMenuItem: (id)menuItem { // TODO: Do wxWindows validation here and avoid sending during idle time - wxLogDebug(wxT("wxMenuItemAction")); + wxLogTrace(wxTRACE_COCOA,wxT("wxMenuItemAction")); wxMenuItem *item = wxMenuItem::GetFromCocoa(menuItem); wxCHECK_MSG(item,NO,wxT("validateMenuItem received but no wxMenuItem exists!")); return item->IsEnabled(); diff --git a/src/cocoa/radiobut.mm b/src/cocoa/radiobut.mm index 5ceef75f99..ab8197bd60 100644 --- a/src/cocoa/radiobut.mm +++ b/src/cocoa/radiobut.mm @@ -140,7 +140,7 @@ bool wxRadioButton::GetValue() const void wxRadioButton::Cocoa_wxNSButtonAction(void) { - wxLogDebug(wxT("wxRadioButton")); + wxLogTrace(wxTRACE_COCOA,wxT("wxRadioButton")); if(m_radioMaster && ([GetNSButton() state] == NSOnState)) { for(wxRadioButtonList::compatibility_iterator slaveNode = diff --git a/src/cocoa/toolbar.mm b/src/cocoa/toolbar.mm index 0f7e02c01d..94407fff8e 100644 --- a/src/cocoa/toolbar.mm +++ b/src/cocoa/toolbar.mm @@ -71,7 +71,7 @@ protected: - (void)wxNSActionCellAction: (id)sender { - wxLogDebug(wxT("wxNSActionCellAction")); + wxLogTrace(wxTRACE_COCOA,wxT("wxNSActionCellAction")); wxCocoaNSActionCell *wxcontrol = wxCocoaNSActionCell::GetFromCocoa(sender); wxCHECK_RET(wxcontrol,wxT("wxNSActionCellAction received but no wxCocoaNSActionCell exists!")); wxcontrol->CocoaTarget_wxNSActionCellAction(); @@ -297,7 +297,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent) untilMouseUp:NO]) { m_mouseDownTool = NULL; - wxLogDebug(wxT("Button was clicked after drag!")); + wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked after drag!")); } [buttonCell setHighlighted: NO]; } @@ -320,7 +320,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent) untilMouseUp:NO]) { m_mouseDownTool = NULL; - wxLogDebug(wxT("Button was clicked!")); + wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked!")); } [buttonCell setHighlighted: NO]; } diff --git a/src/cocoa/toplevel.mm b/src/cocoa/toplevel.mm index 9bb32c828a..9cdfa7a783 100644 --- a/src/cocoa/toplevel.mm +++ b/src/cocoa/toplevel.mm @@ -168,7 +168,7 @@ wxMenuBar* wxTopLevelWindowCocoa::GetAppMenuBar(wxCocoaNSWindow *win) void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow) { bool need_debug = cocoaNSWindow || m_cocoaNSWindow; - if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d"),this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]); + if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [m_cocoaNSWindow=%p retainCount]=%d"),this,m_cocoaNSWindow,[m_cocoaNSWindow retainCount]); DisassociateNSWindow(m_cocoaNSWindow); [cocoaNSWindow retain]; [m_cocoaNSWindow release]; @@ -178,7 +178,7 @@ void wxTopLevelWindowCocoa::SetNSWindow(WX_NSWindow cocoaNSWindow) else SetNSView(NULL); AssociateNSWindow(m_cocoaNSWindow); - if(need_debug) wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d"),this,cocoaNSWindow,[cocoaNSWindow retainCount]); + if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxTopLevelWindowCocoa=%p::SetNSWindow [cocoaNSWindow=%p retainCount]=%d"),this,cocoaNSWindow,[cocoaNSWindow retainCount]); } void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newView) @@ -197,7 +197,7 @@ void wxTopLevelWindowCocoa::CocoaReplaceView(WX_NSView oldView, WX_NSView newVie void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void) { DeactivatePendingWindow(); - wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey"),this); wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId()); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); @@ -205,7 +205,7 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void) void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void) { - wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey"),this); wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId()); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); @@ -213,12 +213,12 @@ void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void) void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void) { - wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeMain"),this); } void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignMain(void) { - wxLogDebug(wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain"),this); + wxLogTrace(wxTRACE_COCOA,wxT("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignMain"),this); } void wxTopLevelWindowCocoa::CocoaDelegate_windowWillClose(void) @@ -336,7 +336,7 @@ void wxTopLevelWindowCocoa::CocoaSetWxWindowSize(int width, int height) void wxTopLevelWindowCocoa::DoMoveWindow(int x, int y, int width, int height) { -// wxLogDebug("wxTopLevelWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height); + wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,"wxTopLevelWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height); NSRect cocoaRect = NSMakeRect(x,y,width,height); [m_cocoaNSWindow setFrame: cocoaRect display:NO]; @@ -349,7 +349,7 @@ void wxTopLevelWindowCocoa::DoGetSize(int *w, int *h) const *w=(int)cocoaRect.size.width; if(h) *h=(int)cocoaRect.size.height; -// wxLogDebug("wxTopLevelWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height); + wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,"wxTopLevelWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height); } void wxTopLevelWindowCocoa::DoGetPosition(int *x, int *y) const @@ -359,6 +359,6 @@ void wxTopLevelWindowCocoa::DoGetPosition(int *x, int *y) const *x=(int)cocoaRect.origin.x; if(y) *y=(int)cocoaRect.origin.y; -// wxLogDebug("wxTopLevelWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y); + wxLogTrace(wxTRACE_COCOA_TopLevelWindow_Size,"wxTopLevelWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y); } diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index 7ae5fdf02a..2bcdeb8c73 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -216,7 +216,7 @@ void wxWindowCocoaScroller::DoGetClientSize(int *x, int *y) const void wxWindowCocoaScroller::Cocoa_FrameChanged(void) { - wxLogDebug(wxT("Cocoa_FrameChanged")); + wxLogTrace(wxTRACE_COCOA,wxT("Cocoa_FrameChanged")); wxSizeEvent event(m_owner->GetSize(), m_owner->GetId()); event.SetEventObject(m_owner); m_owner->GetEventHandler()->ProcessEvent(event); @@ -302,13 +302,13 @@ void wxWindowCocoa::CocoaRemoveFromParent(void) void wxWindowCocoa::SetNSView(WX_NSView cocoaNSView) { bool need_debug = cocoaNSView || m_cocoaNSView; - if(need_debug) wxLogDebug(wxT("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d"),this,m_cocoaNSView,[m_cocoaNSView retainCount]); + if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxWindowCocoa=%p::SetNSView [m_cocoaNSView=%p retainCount]=%d"),this,m_cocoaNSView,[m_cocoaNSView retainCount]); DisassociateNSView(m_cocoaNSView); [cocoaNSView retain]; [m_cocoaNSView release]; m_cocoaNSView = cocoaNSView; AssociateNSView(m_cocoaNSView); - if(need_debug) wxLogDebug(wxT("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d"),this,cocoaNSView,[cocoaNSView retainCount]); + if(need_debug) wxLogTrace(wxTRACE_COCOA_RetainRelease,wxT("wxWindowCocoa=%p::SetNSView [cocoaNSView=%p retainCount]=%d"),this,cocoaNSView,[cocoaNSView retainCount]); } WX_NSView wxWindowCocoa::GetNSViewForSuperview() const @@ -329,7 +329,7 @@ WX_NSView wxWindowCocoa::GetNSViewForHiding() const bool wxWindowCocoa::Cocoa_drawRect(const NSRect &rect) { - wxLogDebug(wxT("Cocoa_drawRect")); + wxLogTrace(wxTRACE_COCOA,wxT("Cocoa_drawRect")); // Recursion can happen if the event loop runs from within the paint // handler. For instance, if an assertion dialog is shown. // FIXME: This seems less than ideal. @@ -370,7 +370,7 @@ bool wxWindowCocoa::Cocoa_mouseMoved(WX_NSEvent theEvent) { wxMouseEvent event(wxEVT_MOTION); InitMouseEvent(event,theEvent); - wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); + wxLogTrace(wxTRACE_COCOA,wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); return GetEventHandler()->ProcessEvent(event); } @@ -388,7 +388,7 @@ bool wxWindowCocoa::Cocoa_mouseDown(WX_NSEvent theEvent) { wxMouseEvent event([theEvent clickCount]<2?wxEVT_LEFT_DOWN:wxEVT_LEFT_DCLICK); InitMouseEvent(event,theEvent); - wxLogDebug(wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]); + wxLogTrace(wxTRACE_COCOA,wxT("Mouse Down @%d,%d num clicks=%d"),event.m_x,event.m_y,[theEvent clickCount]); return GetEventHandler()->ProcessEvent(event); } @@ -397,7 +397,7 @@ bool wxWindowCocoa::Cocoa_mouseDragged(WX_NSEvent theEvent) wxMouseEvent event(wxEVT_MOTION); InitMouseEvent(event,theEvent); event.m_leftDown = true; - wxLogDebug(wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); + wxLogTrace(wxTRACE_COCOA,wxT("Mouse Drag @%d,%d"),event.m_x,event.m_y); return GetEventHandler()->ProcessEvent(event); } @@ -405,7 +405,7 @@ bool wxWindowCocoa::Cocoa_mouseUp(WX_NSEvent theEvent) { wxMouseEvent event(wxEVT_LEFT_UP); InitMouseEvent(event,theEvent); - wxLogDebug(wxT("Mouse Up @%d,%d"),event.m_x,event.m_y); + wxLogTrace(wxTRACE_COCOA,wxT("Mouse Up @%d,%d"),event.m_x,event.m_y); return GetEventHandler()->ProcessEvent(event); } @@ -441,7 +441,7 @@ bool wxWindowCocoa::Cocoa_otherMouseUp(WX_NSEvent theEvent) void wxWindowCocoa::Cocoa_FrameChanged(void) { - wxLogDebug(wxT("Cocoa_FrameChanged")); + wxLogTrace(wxTRACE_COCOA,wxT("Cocoa_FrameChanged")); wxSizeEvent event(GetSize(), m_windowId); event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); @@ -528,7 +528,7 @@ bool wxWindow::Show(bool show) void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags) { -// wxLogDebug("wxWindow=%p::DoSetSizeWindow(%d,%d,%d,%d,Auto: %s%s)",this,x,y,width,height,(sizeFlags&wxSIZE_AUTO_WIDTH)?"W":".",sizeFlags&wxSIZE_AUTO_HEIGHT?"H":"."); + wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoSetSizeWindow(%d,%d,%d,%d,Auto: %s%s)",this,x,y,width,height,(sizeFlags&wxSIZE_AUTO_WIDTH)?"W":".",sizeFlags&wxSIZE_AUTO_HEIGHT?"H":"."); int currentX, currentY; int currentW, currentH; DoGetPosition(¤tX, ¤tY); @@ -569,7 +569,7 @@ void wxWindowCocoa::DoSetSize(int x, int y, int width, int height, int sizeFlags void wxWindowCocoa::DoMoveWindow(int x, int y, int width, int height) { wxAutoNSAutoreleasePool pool; -// wxLogDebug("wxWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height); + wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoMoveWindow(%d,%d,%d,%d)",this,x,y,width,height); NSView *nsview = GetNSViewForSuperview(); NSView *superview = [nsview superview]; @@ -614,7 +614,7 @@ void wxWindow::DoGetSize(int *w, int *h) const *w=(int)cocoaRect.size.width; if(h) *h=(int)cocoaRect.size.height; -// wxLogDebug("wxWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height); + wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoGetSize = (%d,%d)",this,(int)cocoaRect.size.width,(int)cocoaRect.size.height); } void wxWindow::DoGetPosition(int *x, int *y) const @@ -629,7 +629,7 @@ void wxWindow::DoGetPosition(int *x, int *y) const *x=(int)cocoaRect.origin.x; if(y) *y=(int)(parentRect.size.height-(cocoaRect.origin.y+cocoaRect.size.height)); -// wxLogDebug("wxWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y); + wxLogTrace(wxTRACE_COCOA_Window_Size,"wxWindow=%p::DoGetPosition = (%d,%d)",this,(int)cocoaRect.origin.x,(int)cocoaRect.origin.y); } WXWidget wxWindow::GetHandle() const @@ -672,7 +672,7 @@ void wxWindow::DoClientToScreen(int *x, int *y) const // Get size *available for subwindows* i.e. excluding menu bar etc. void wxWindow::DoGetClientSize(int *x, int *y) const { - wxLogDebug(wxT("DoGetClientSize:")); + wxLogTrace(wxTRACE_COCOA,wxT("DoGetClientSize:")); if(m_cocoaScroller) m_cocoaScroller->DoGetClientSize(x,y); else @@ -681,7 +681,7 @@ void wxWindow::DoGetClientSize(int *x, int *y) const void wxWindow::DoSetClientSize(int width, int height) { - wxLogDebug(wxT("DoSetClientSize=(%d,%d)"),width,height); + wxLogTrace(wxTRACE_COCOA_Window_Size,wxT("DoSetClientSize=(%d,%d)"),width,height); if(m_cocoaScroller) m_cocoaScroller->ClientSizeToSize(width,height); CocoaSetWxWindowSize(width,height); -- 2.45.2