From 6b92c617cad1dd4e2f8aaa1268e33c9a0217bdd8 Mon Sep 17 00:00:00 2001 From: "joshmoz@gmail.com" Date: Wed, 18 Jul 2007 17:56:33 -0700 Subject: [PATCH] assorted code style and comment changes, no actual code changes. no bug. sr=sparky --- widget/src/cocoa/nsChildView.h | 2 -- widget/src/cocoa/nsChildView.mm | 37 +++++++------------------------ widget/src/cocoa/nsCocoaWindow.mm | 6 +++++ widget/src/cocoa/nsWindowMap.mm | 3 --- 4 files changed, 14 insertions(+), 34 deletions(-) diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index 181518459d6..913d8f62bdc 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -301,8 +301,6 @@ public: NS_IMETHOD EndDrawPlugin(); // Mac specific methods - virtual void CalcWindowRegions(); - virtual PRBool PointInWidget(Point aThePoint); virtual PRBool DispatchWindowEvent(nsGUIEvent& event); diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 9671c5944bd..e9bcb031716 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -707,7 +707,6 @@ NS_IMETHODIMP nsChildView::ModalEventFilter(PRBool aRealEvent, void *aEvent, } -// Enable/disable this view NS_IMETHODIMP nsChildView::Enable(PRBool aState) { return NS_OK; @@ -723,24 +722,21 @@ NS_IMETHODIMP nsChildView::IsEnabled(PRBool *aState) } -// Set the focus on this component NS_IMETHODIMP nsChildView::SetFocus(PRBool aRaise) { NSWindow* window = [mView window]; if (window) - [window makeFirstResponder: mView]; + [window makeFirstResponder:mView]; return NS_OK; } -// Get this component font nsIFontMetrics* nsChildView::GetFont(void) { return nsnull; } -// Set this component font NS_IMETHODIMP nsChildView::SetFont(const nsFont &aFont) { return NS_ERROR_NOT_IMPLEMENTED; @@ -1405,53 +1401,36 @@ PRBool nsChildView::DispatchMouseEvent(nsMouseEvent &aEvent) PRBool nsChildView::ReportDestroyEvent() { - // nsEvent nsGUIEvent event(PR_TRUE, NS_DESTROY, this); event.time = PR_IntervalNow(); - - // dispatch event - return (DispatchWindowEvent(event)); + return DispatchWindowEvent(event); } PRBool nsChildView::ReportMoveEvent() { - // nsEvent nsGUIEvent moveEvent(PR_TRUE, NS_MOVE, this); - moveEvent.refPoint.x = mBounds.x; - moveEvent.refPoint.y = mBounds.y; - moveEvent.time = PR_IntervalNow(); - - // dispatch event - return (DispatchWindowEvent(moveEvent)); + moveEvent.refPoint.x = mBounds.x; + moveEvent.refPoint.y = mBounds.y; + moveEvent.time = PR_IntervalNow(); + return DispatchWindowEvent(moveEvent); } PRBool nsChildView::ReportSizeEvent() { - // nsEvent nsSizeEvent sizeEvent(PR_TRUE, NS_SIZE, this); sizeEvent.time = PR_IntervalNow(); - - // nsSizeEvent sizeEvent.windowSize = &mBounds; sizeEvent.mWinWidth = mBounds.width; sizeEvent.mWinHeight = mBounds.height; - - // dispatch event - return(DispatchWindowEvent(sizeEvent)); + return DispatchWindowEvent(sizeEvent); } #pragma mark - -void nsChildView::CalcWindowRegions() -{ - // i don't think this is necessary anymore... -} - - /* Calculate the x and y offsets for this particular widget * @update ps 09/22/98 * @param aX -- x offset amount @@ -1567,7 +1546,7 @@ NS_IMETHODIMP nsChildView::CaptureRollupEvents(nsIRollupListener * aListener, NS_IMETHODIMP nsChildView::SetTitle(const nsAString& title) { - // nothing to do here + // child views don't have titles return NS_OK; } diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index d74fbbb69a3..db62cf7e851 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -1202,6 +1202,7 @@ NS_IMETHODIMP nsCocoaWindow::GetAnimatedResize(PRUint16* aAnimation) RollUpPopups(); } + - (void)windowDidMove:(NSNotification *)aNotification { // Dispatch the move event to Gecko @@ -1215,6 +1216,7 @@ NS_IMETHODIMP nsCocoaWindow::GetAnimatedResize(PRUint16* aAnimation) mGeckoWindow->DispatchEvent(&guiEvent, status); } + - (BOOL)windowShouldClose:(id)sender { // We only want to send NS_XUL_CLOSE and let gecko close the window @@ -1300,6 +1302,7 @@ NS_IMETHODIMP nsCocoaWindow::GetAnimatedResize(PRUint16* aAnimation) return YES; } + // Dispatch a toolbar pill button clicked message to Gecko - (void)_toolbarPillButtonClicked:(id)sender { @@ -1423,6 +1426,7 @@ NS_IMETHODIMP nsCocoaWindow::GetAnimatedResize(PRUint16* aAnimation) } } + - (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation { @@ -1431,11 +1435,13 @@ NS_IMETHODIMP nsCocoaWindow::GetAnimatedResize(PRUint16* aAnimation) backing:bufferingType defer:deferCreation]; } + - (BOOL)isContextMenu { return mIsContextMenu; } + - (void)setIsContextMenu:(BOOL)flag { mIsContextMenu = flag; diff --git a/widget/src/cocoa/nsWindowMap.mm b/widget/src/cocoa/nsWindowMap.mm index ed60ac09f12..150235b20bd 100644 --- a/widget/src/cocoa/nsWindowMap.mm +++ b/widget/src/cocoa/nsWindowMap.mm @@ -106,12 +106,10 @@ @end -// // TopLevelWindowData // // This class holds data about top-level windows. We can't use a window // delegate, because an embedder may already have one. -// @implementation TopLevelWindowData @@ -180,4 +178,3 @@ } @end -