diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 005d96fb0b12..cc27e36d65f6 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -216,7 +216,6 @@ PRUint32 nsChildView::sLastInputEventCount = 0; - (void)initTSMDocument; @end - #pragma mark - // Key code constants @@ -306,7 +305,6 @@ enum kDownArrowKeyCode = 0x7D }; - /* Convenience routines to go from a gecko rect to cocoa NSRects and back * * Gecko rects (nsRect) contain an origin (x,y) in a coordinate @@ -318,7 +316,6 @@ enum * convert coordinate systems. */ - static inline void GeckoRectToNSRect(const nsIntRect & inGeckoRect, NSRect & outCocoaRect) { @@ -353,7 +350,6 @@ FlipCocoaScreenCoordinate(NSPoint &inPoint) { inPoint.y = nsCocoaUtils::FlippedScreenY(inPoint.y); } - static PRUint32 UnderlineAttributeToTextRangeType(PRUint32 aUnderlineStyle, NSRange selRange) @@ -397,7 +393,6 @@ UnderlineAttributeToTextRangeType(PRUint32 aUnderlineStyle, NSRange selRange) return attr; } - static PRUint32 CountRanges(NSAttributedString *aString) { @@ -422,7 +417,6 @@ CountRanges(NSAttributedString *aString) NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0); } - static void ConvertAttributeToGeckoRange(NSAttributedString *aString, NSRange markRange, NSRange selRange, PRUint32 inCount, nsTextRange* aRanges) { @@ -455,7 +449,6 @@ ConvertAttributeToGeckoRange(NSAttributedString *aString, NSRange markRange, NSR NS_OBJC_END_TRY_ABORT_BLOCK; } - static void FillTextRangeInTextEvent(nsTextEvent *aTextEvent, NSAttributedString* aString, NSRange markRange, NSRange selRange) { @@ -476,7 +469,6 @@ FillTextRangeInTextEvent(nsTextEvent *aTextEvent, NSAttributedString* aString, N #pragma mark - - nsChildView::nsChildView() : nsBaseWidget() , mView(nsnull) , mParentView(nsnull) @@ -534,7 +526,6 @@ nsChildView::nsChildView() : nsBaseWidget() } } - nsChildView::~nsChildView() { // notify the children that we're gone @@ -557,10 +548,8 @@ nsChildView::~nsChildView() TearDownView(); // Safe if called twice. } - NS_IMPL_ISUPPORTS_INHERITED1(nsChildView, nsBaseWidget, nsIPluginWidget) - // Utility method for implementing both Create(nsIWidget ...) // and Create(nsNativeWidget...) nsresult nsChildView::StandardCreate(nsIWidget *aParent, @@ -639,7 +628,6 @@ nsresult nsChildView::StandardCreate(nsIWidget *aParent, NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // Creates the appropriate child view. Override to create something other than // our |ChildView| object. Autoreleases, so caller must retain. NSView* @@ -652,7 +640,6 @@ nsChildView::CreateCocoaView(NSRect inFrame) NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - void nsChildView::TearDownView() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -691,7 +678,6 @@ void nsChildView::TearDownView() NS_OBJC_END_TRY_ABORT_BLOCK; } - // create a nsChildView NS_IMETHODIMP nsChildView::Create(nsIWidget *aParent, const nsIntRect &aRect, @@ -705,7 +691,6 @@ NS_IMETHODIMP nsChildView::Create(nsIWidget *aParent, aAppShell, aToolkit, aInitData, nsnull)); } - // Creates a main nsChildView using a native widget (an NSView) NS_IMETHODIMP nsChildView::Create(nsNativeWidget aNativeParent, const nsIntRect &aRect, @@ -720,7 +705,6 @@ NS_IMETHODIMP nsChildView::Create(nsNativeWidget aNativeParent, aAppShell, aToolkit, aInitData, aNativeParent)); } - NS_IMETHODIMP nsChildView::Destroy() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -745,10 +729,8 @@ NS_IMETHODIMP nsChildView::Destroy() NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - #pragma mark - - #if 0 static void PrintViewHierarchy(NSView *view) { @@ -759,8 +741,6 @@ static void PrintViewHierarchy(NSView *view) } #endif - - // Return native data according to aDataType void* nsChildView::GetNativeData(PRUint32 aDataType) { @@ -860,7 +840,6 @@ nsTransparencyMode nsChildView::GetTransparencyMode() return eTransparencyOpaque; } - // This is called by nsContainerFrame on the root widget for all window types // except popup windows (when nsCocoaWindow::SetTransparencyMode is used instead). void nsChildView::SetTransparencyMode(nsTransparencyMode aMode) @@ -885,7 +864,6 @@ void nsChildView::SetTransparencyMode(nsTransparencyMode aMode) NS_OBJC_END_TRY_ABORT_BLOCK; } - // This is called by nsContainerFrame on the root widget for all window types // except popup windows (when nsCocoaWindow::SetWindowShadowStyle is used instead). NS_IMETHODIMP nsChildView::SetWindowShadowStyle(PRInt32 aStyle) @@ -907,7 +885,6 @@ NS_IMETHODIMP nsChildView::SetWindowShadowStyle(PRInt32 aStyle) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::IsVisible(PRBool& outState) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -930,7 +907,6 @@ NS_IMETHODIMP nsChildView::IsVisible(PRBool& outState) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - void nsChildView::HidePlugin() { NS_ASSERTION(mIsPluginView, "HidePlugin called on non-plugin view"); @@ -950,7 +926,6 @@ void nsChildView::HidePlugin() } } - static void HideChildPluginViews(NSView* aView) { NSArray* subviews = [aView subviews]; @@ -973,7 +948,6 @@ static void HideChildPluginViews(NSView* aView) } } - // Hide or show this component NS_IMETHODIMP nsChildView::Show(PRBool aState) { @@ -1040,13 +1014,11 @@ nsChildView::GetParent(void) return mParentWidget; } - NS_IMETHODIMP nsChildView::Enable(PRBool aState) { return NS_OK; } - NS_IMETHODIMP nsChildView::IsEnabled(PRBool *aState) { // unimplemented @@ -1055,7 +1027,6 @@ NS_IMETHODIMP nsChildView::IsEnabled(PRBool *aState) return NS_OK; } - NS_IMETHODIMP nsChildView::SetFocus(PRBool aRaise) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -1068,7 +1039,6 @@ NS_IMETHODIMP nsChildView::SetFocus(PRBool aRaise) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // Override to set the cursor on the mac NS_IMETHODIMP nsChildView::SetCursor(nsCursor aCursor) { @@ -1081,7 +1051,6 @@ NS_IMETHODIMP nsChildView::SetCursor(nsCursor aCursor) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // implement to fix "hidden virtual function" warning NS_IMETHODIMP nsChildView::SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY) @@ -1089,10 +1058,8 @@ NS_IMETHODIMP nsChildView::SetCursor(imgIContainer* aCursor, return nsBaseWidget::SetCursor(aCursor, aHotspotX, aHotspotY); } - #pragma mark - - // Get this component dimension NS_IMETHODIMP nsChildView::GetBounds(nsIntRect &aRect) { @@ -1100,7 +1067,6 @@ NS_IMETHODIMP nsChildView::GetBounds(nsIntRect &aRect) return NS_OK; } - NS_IMETHODIMP nsChildView::SetBounds(const nsIntRect &aRect) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -1117,14 +1083,12 @@ NS_IMETHODIMP nsChildView::SetBounds(const nsIntRect &aRect) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY) { return NS_OK; } - // Move this component, aX and aY are in the parent widget coordinate system NS_IMETHODIMP nsChildView::Move(PRInt32 aX, PRInt32 aY) { @@ -1150,7 +1114,6 @@ NS_IMETHODIMP nsChildView::Move(PRInt32 aX, PRInt32 aY) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -1175,7 +1138,6 @@ NS_IMETHODIMP nsChildView::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepai NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -1214,7 +1176,6 @@ NS_IMETHODIMP nsChildView::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt3 NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::BeginResizingChildren(void) { return NS_OK; @@ -1226,7 +1187,6 @@ NS_IMETHODIMP nsChildView::EndResizingChildren(void) return NS_OK; } - static const PRInt32 resizeIndicatorWidth = 15; static const PRInt32 resizeIndicatorHeight = 15; PRBool nsChildView::ShowsResizeIndicator(nsIntRect* aResizerRect) @@ -1249,7 +1209,6 @@ PRBool nsChildView::ShowsResizeIndicator(nsIntRect* aResizerRect) return PR_TRUE; } - // In QuickDraw mode the coordinate system used here should be that of the // browser window's content region (defined as everything but the 22-pixel // high titlebar). But in CoreGraphics mode the coordinate system should be @@ -1311,7 +1270,6 @@ NS_IMETHODIMP nsChildView::GetPluginClipRect(nsIntRect& outClipRect, nsIntPoint& NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::StartDrawPlugin() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -1384,7 +1342,6 @@ NS_IMETHODIMP nsChildView::StartDrawPlugin() NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::EndDrawPlugin() { NS_ASSERTION(mIsPluginView, "EndDrawPlugin must only be called on a plugin widget"); @@ -1394,7 +1351,6 @@ NS_IMETHODIMP nsChildView::EndDrawPlugin() return NS_OK; } - NS_IMETHODIMP nsChildView::SetPluginInstanceOwner(nsIPluginInstanceOwner* aInstanceOwner) { mPluginInstanceOwner = aInstanceOwner; @@ -1402,14 +1358,12 @@ NS_IMETHODIMP nsChildView::SetPluginInstanceOwner(nsIPluginInstanceOwner* aInsta return NS_OK; } - void nsChildView::LiveResizeStarted() { // XXX todo. Use this to disable Java async redraw during resize mLiveResizeInProgress = PR_TRUE; } - void nsChildView::LiveResizeEnded() { mLiveResizeInProgress = PR_FALSE; @@ -1503,7 +1457,6 @@ nsresult nsChildView::SynthesizeNativeKeyEvent(PRInt32 aNativeKeyboardLayout, NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // First argument has to be an NSMenu representing the application's top-level // menu bar. The returned item is *not* retained. static NSMenuItem* NativeMenuItemWithLocation(NSMenu* menubar, NSString* locationString) @@ -1538,7 +1491,6 @@ static NSMenuItem* NativeMenuItemWithLocation(NSMenu* menubar, NSString* locatio return nil; } - // Used for testing native menu system structure and event handling. NS_IMETHODIMP nsChildView::ActivateNativeMenuItemAt(const nsAString& indexString) { @@ -1562,7 +1514,6 @@ NS_IMETHODIMP nsChildView::ActivateNativeMenuItemAt(const nsAString& indexString NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // Used for testing native menu system structure and event handling. NS_IMETHODIMP nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString) { @@ -1586,10 +1537,8 @@ NS_IMETHODIMP nsChildView::ForceUpdateNativeMenuAt(const nsAString& indexString) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - #pragma mark - - #ifdef INVALIDATE_DEBUGGING static Boolean KeyDown(const UInt8 theKey) @@ -1638,7 +1587,6 @@ static void blinkRgn(RgnHandle rgn) #endif - // Invalidate this component's visible area NS_IMETHODIMP nsChildView::Invalidate(PRBool aIsSynchronous) { @@ -1664,7 +1612,6 @@ NS_IMETHODIMP nsChildView::Invalidate(PRBool aIsSynchronous) NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // Invalidate this component's visible area NS_IMETHODIMP nsChildView::Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous) { @@ -1693,7 +1640,6 @@ NS_IMETHODIMP nsChildView::Invalidate(const nsIntRect &aRect, PRBool aIsSynchron NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // Validate the widget NS_IMETHODIMP nsChildView::Validate() { @@ -1705,14 +1651,12 @@ NS_IMETHODIMP nsChildView::Validate() NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - inline PRUint16 COLOR8TOCOLOR16(PRUint8 color8) { // return (color8 == 0xFF ? 0xFFFF : (color8 << 8)); return (color8 << 8) | color8; /* (color8 * 257) == (color8 * 0x0101) */ } - // Dummy impl, meant to be overridden PRBool nsChildView::OnPaint(nsPaintEvent &event) @@ -1720,7 +1664,6 @@ nsChildView::OnPaint(nsPaintEvent &event) return PR_TRUE; } - // The OS manages repaints well enough on its own, so we don't have to // flush them out here. In other words, the OS will automatically call // displayIfNeeded at the appropriate times, so we don't need to do it @@ -1730,10 +1673,8 @@ NS_IMETHODIMP nsChildView::Update() return NS_OK; } - #pragma mark - - // Scroll the bits of a view and its children // FIXME: I'm sure the invalidating can be optimized, just no time now. NS_IMETHODIMP nsChildView::Scroll(PRInt32 aDx, PRInt32 aDy, nsIntRect *aClipRect) @@ -1873,7 +1814,6 @@ NS_IMETHODIMP nsChildView::Scroll(PRInt32 aDx, PRInt32 aDy, nsIntRect *aClipRect NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - // Invokes callback and ProcessEvent methods on Event Listener object NS_IMETHODIMP nsChildView::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus) { @@ -1910,7 +1850,6 @@ NS_IMETHODIMP nsChildView::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStat return NS_OK; } - PRBool nsChildView::DispatchWindowEvent(nsGUIEvent &event) { nsEventStatus status; @@ -1918,10 +1857,8 @@ PRBool nsChildView::DispatchWindowEvent(nsGUIEvent &event) return ConvertStatus(status); } - #pragma mark - - PRBool nsChildView::ReportDestroyEvent() { nsGUIEvent event(PR_TRUE, NS_DESTROY, this); @@ -1929,7 +1866,6 @@ PRBool nsChildView::ReportDestroyEvent() return DispatchWindowEvent(event); } - PRBool nsChildView::ReportMoveEvent() { nsGUIEvent moveEvent(PR_TRUE, NS_MOVE, this); @@ -1939,7 +1875,6 @@ PRBool nsChildView::ReportMoveEvent() return DispatchWindowEvent(moveEvent); } - PRBool nsChildView::ReportSizeEvent() { nsSizeEvent sizeEvent(PR_TRUE, NS_SIZE, this); @@ -1950,10 +1885,8 @@ PRBool nsChildView::ReportSizeEvent() return DispatchWindowEvent(sizeEvent); } - #pragma mark - - // Return the offset between this child view and the screen. // @return -- widget origin in screen coordinates nsIntPoint nsChildView::WidgetToScreenOffset() @@ -1980,7 +1913,6 @@ nsIntPoint nsChildView::WidgetToScreenOffset() NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsIntPoint(0,0)); } - NS_IMETHODIMP nsChildView::CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent) @@ -1989,14 +1921,12 @@ NS_IMETHODIMP nsChildView::CaptureRollupEvents(nsIRollupListener * aListener, return NS_OK; } - NS_IMETHODIMP nsChildView::SetTitle(const nsAString& title) { // child views don't have titles return NS_OK; } - NS_IMETHODIMP nsChildView::GetAttention(PRInt32 aCycleCount) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; @@ -2058,7 +1988,6 @@ PRBool nsChildView::HasPendingInputEvent() #pragma mark - - // Force Input Method Editor to commit the uncommitted input // Note that this and other IME methods don't necessarily // get called on the same ChildView that input is going through. @@ -2072,7 +2001,6 @@ NS_IMETHODIMP nsChildView::ResetInputState() return NS_OK; } - // 'open' means that it can take non-ASCII chars NS_IMETHODIMP nsChildView::SetIMEOpenState(PRBool aState) { @@ -2084,7 +2012,6 @@ NS_IMETHODIMP nsChildView::SetIMEOpenState(PRBool aState) return NS_OK; } - // 'open' means that it can take non-ASCII chars NS_IMETHODIMP nsChildView::GetIMEOpenState(PRBool* aState) { @@ -2096,7 +2023,6 @@ NS_IMETHODIMP nsChildView::GetIMEOpenState(PRBool* aState) return NS_OK; } - NS_IMETHODIMP nsChildView::SetIMEEnabled(PRUint32 aState) { #ifdef DEBUG_IME @@ -2123,7 +2049,6 @@ NS_IMETHODIMP nsChildView::SetIMEEnabled(PRUint32 aState) return NS_OK; } - NS_IMETHODIMP nsChildView::GetIMEEnabled(PRUint32* aState) { #ifdef DEBUG_IME @@ -2139,7 +2064,6 @@ NS_IMETHODIMP nsChildView::GetIMEEnabled(PRUint32* aState) return NS_OK; } - // Destruct and don't commit the IME composition string. NS_IMETHODIMP nsChildView::CancelIMEComposition() { @@ -2151,7 +2075,6 @@ NS_IMETHODIMP nsChildView::CancelIMEComposition() return NS_OK; } - NS_IMETHODIMP nsChildView::GetToggledKeyState(PRUint32 aKeyCode, PRBool* aLEDState) { @@ -2180,10 +2103,8 @@ NS_IMETHODIMP nsChildView::GetToggledKeyState(PRUint32 aKeyCode, NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - #pragma mark - - gfxASurface* nsChildView::GetThebesSurface() { @@ -2194,7 +2115,6 @@ nsChildView::GetThebesSurface() return mTempThebesSurface; } - NS_IMETHODIMP nsChildView::BeginSecureKeyboardInput() { @@ -2208,7 +2128,6 @@ nsChildView::BeginSecureKeyboardInput() NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - NS_IMETHODIMP nsChildView::EndSecureKeyboardInput() { @@ -2222,7 +2141,6 @@ nsChildView::EndSecureKeyboardInput() NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } - #ifdef ACCESSIBILITY void nsChildView::GetDocumentAccessible(nsIAccessible** aAccessible) @@ -2249,20 +2167,16 @@ nsChildView::GetDocumentAccessible(nsIAccessible** aAccessible) } #endif - #pragma mark - - @implementation ChildView - // globalDragPboard is non-null during native drag sessions that did not originate // in our native NSView (it is set in |draggingEntered:|). It is unset when the // drag session ends for this view, either with the mouse exiting or when a drop // occurs in this view. NSPasteboard* globalDragPboard = nil; - // gLastDragView and gLastDragEvent are only non-null during calls to |mouseDragged:| // in our native NSView. They are used to communicate information to the drag service // during drag invocation (starting a drag in from the view). All drag service drag @@ -2271,7 +2185,6 @@ NSPasteboard* globalDragPboard = nil; NSView* gLastDragView = nil; NSEvent* gLastDragEvent = nil; - + (void)initialize { static BOOL initialized = NO; @@ -2292,7 +2205,6 @@ NSEvent* gLastDragEvent = nil; } } - // initWithFrame:geckoChild: - (id)initWithFrame:(NSRect)inFrame geckoChild:(nsChildView*)inChild { @@ -2353,7 +2265,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - - (void)dealloc { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2378,7 +2289,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)widgetDestroyed { nsTSMManager::OnDestroyView(self); @@ -2390,14 +2300,12 @@ NSEvent* gLastDragEvent = nil; NS_IF_RELEASE(mDragService); } - // mozView method, return our gecko child view widget. Note this does not AddRef. - (nsIWidget*) widget { return static_cast(mGeckoChild); } - // mozView method, get the window that this view is associated with - (NSWindow*)nativeWindow { @@ -2412,7 +2320,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - // mozView method, set the NSWindow that this view is associated with (even when // not in the view hierarchy). - (void)setNativeWindow:(NSWindow*)aWindow @@ -2420,7 +2327,6 @@ NSEvent* gLastDragEvent = nil; mWindow = aWindow; } - - (void)systemMetricsChanged { if (!mGeckoChild) @@ -2430,7 +2336,6 @@ NSEvent* gLastDragEvent = nil; mGeckoChild->DispatchWindowEvent(guiEvent); } - - (void)setNeedsPendingDisplay { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2441,7 +2346,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)setNeedsPendingDisplayInRect:(NSRect)invalidRect { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2454,7 +2358,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - // Clears the queue of any pending invalides - (void)processPendingRedraws { @@ -2476,7 +2379,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (NSString*)description { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; @@ -2486,7 +2388,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - // Find the nearest scrollable view for this ChildView // (recall that views are not refcounted) - (nsIScrollableView*) getScrollableView @@ -2525,7 +2426,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK_NSNULL; } - // set the closed hand cursor and record the starting scroll positions - (void) startHandScroll:(NSEvent*)theEvent { @@ -2548,7 +2448,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - // update the scroll position based on the new mouse coordinates - (void) updateHandScroll:(NSEvent*)theEvent { @@ -2575,7 +2474,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - // Return true if the correct modifiers are pressed to perform hand scrolling. + (BOOL) areHandScrollModifiers:(unsigned int)modifiers { @@ -2586,7 +2484,6 @@ NSEvent* gLastDragEvent = nil; (NSAlphaShiftKeyMask | NSCommandKeyMask | NSAlternateKeyMask); } - // If the user is pressing the hand scroll modifiers, then set // the hand scroll cursor. - (void) setHandScrollCursor:(NSEvent*)theEvent @@ -2619,7 +2516,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - // reset the scroll flag and cursor - (void) stopHandScroll:(NSEvent*)theEvent { @@ -2631,7 +2527,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - // When smooth scrolling is turned on on panther, the parent of a scrollbar (which // I guess they assume is a NSScrollView) gets called with this method. I have no // idea what the correct return value is, but we have to have this otherwise the scrollbar @@ -2645,7 +2540,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0.0); } - // Make the origin of this view the topLeft corner (gecko origin) rather // than the bottomLeft corner (standard cocoa origin). - (BOOL)isFlipped @@ -2653,19 +2547,16 @@ NSEvent* gLastDragEvent = nil; return YES; } - - (void)setTransparent:(BOOL)transparent { mIsTransparent = transparent; } - - (BOOL)isOpaque { return !mIsTransparent; } - -(void)setIsPluginView:(BOOL)aIsPlugin { mIsPluginView = aIsPlugin; @@ -2677,7 +2568,6 @@ NSEvent* gLastDragEvent = nil; return mIsPluginView; } - - (BOOL)childViewHasPlugin { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -2694,7 +2584,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); } - - (void)sendFocusEvent:(PRUint32)eventType { if (!mGeckoChild) @@ -2706,7 +2595,6 @@ NSEvent* gLastDragEvent = nil; mGeckoChild->DispatchEvent(&focusGuiEvent, status); } - // We accept key and mouse events, so don't keep passing them up the chain. Allow // this to be a 'focussed' widget for event dispatch - (BOOL)acceptsFirstResponder @@ -2714,7 +2602,6 @@ NSEvent* gLastDragEvent = nil; return YES; } - - (void)viewWillMoveToWindow:(NSWindow *)newWindow { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2727,7 +2614,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)viewWillStartLiveResize { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2740,7 +2626,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)viewDidEndLiveResize { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2753,7 +2638,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - // Needed to deal with the consequences of calling [NSCell // drawWithFrame:inView:] with a ChildView object as the inView parameter // (this can happen in nsNativeThemeCocoa.mm): drawWithFrame:inView: @@ -2769,7 +2653,6 @@ NSEvent* gLastDragEvent = nil; return nil; } - - (void)scrollRect:(NSRect)aRect by:(NSSize)offset { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2789,13 +2672,11 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (BOOL)mouseDownCanMoveWindow { return NO; } - - (void)lockFocus { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -2809,7 +2690,6 @@ NSEvent* gLastDragEvent = nil; NS_OBJC_END_TRY_ABORT_BLOCK; } - // Limit shadow invalidation to 10 times per second. static const PRInt32 sShadowInvalidationInterval = 100; - (void)maybeInvalidateShadow @@ -2832,7 +2712,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; } } - - (void)invalidateShadow { if (!mWindow || !mNeedsShadowInvalidation) @@ -2841,7 +2720,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; mNeedsShadowInvalidation = NO; } - - (BOOL)isPaintingSuppressed { NSWindow* win = [self window]; @@ -2849,7 +2727,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; [(ToolbarWindow*)win isPaintingSuppressed]); } - // The display system has told us that a portion of our view is dirty. Tell // gecko to paint it - (void)drawRect:(NSRect)aRect @@ -2959,7 +2836,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - // Allows us to turn off setting up the clip region // before each drawRect. We already clip within gecko. - (BOOL)wantsDefaultClipping @@ -2967,7 +2843,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; return NO; } - #if USE_CLICK_HOLD_CONTEXTMENU // // -clickHoldCallback: @@ -3004,7 +2879,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; } #endif - // We sometimes need to reroute events when there is a rollup widget and the // event isn't targeted at it. // @@ -3085,7 +2959,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); } - // If we've just created a non-native context menu, we need to mark it as // such and let the OS (and other programs) know when it opens and closes // (this is how the OS knows to close other programs' context menus when @@ -3118,7 +2991,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - // Returns true if the event should no longer be processed, false otherwise. // This does not return whether or not anything was rolled up. - (BOOL)maybeRollup:(NSEvent*)theEvent @@ -3181,7 +3053,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); } - /* * XXX - The swipeWithEvent, beginGestureWithEvent, magnifyWithEvent, * rotateWithEvent, and endGestureWithEvent methods are part of a @@ -3227,7 +3098,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)beginGestureWithEvent:(NSEvent *)anEvent { NS_ASSERTION(mGestureState == eGestureState_None, "mGestureState should be eGestureState_None"); @@ -3240,7 +3110,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; mCumulativeRotation = 0.0; } - - (void)magnifyWithEvent:(NSEvent *)anEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3282,7 +3151,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)rotateWithEvent:(NSEvent *)anEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3330,7 +3198,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)endGestureWithEvent:(NSEvent *)anEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3389,7 +3256,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)mouseDown:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3458,7 +3324,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)mouseUp:(NSEvent *)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3496,7 +3361,6 @@ static const PRInt32 sShadowInvalidationInterval = 100; NS_OBJC_END_TRY_ABORT_BLOCK; } - // sends a mouse enter or exit event into gecko static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, PRUint32 msg, @@ -3539,7 +3403,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsEventStatus_eIgnore); } - - (void)mouseMoved:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3665,7 +3528,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)mouseDragged:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3709,7 +3571,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)rightMouseDown:(NSEvent *)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3748,7 +3609,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)rightMouseUp:(NSEvent *)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3779,7 +3639,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)rightMouseDragged:(NSEvent*)theEvent { if (![self ensureCorrectMouseEventTarget:theEvent]) @@ -3797,7 +3656,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, mGeckoChild->DispatchWindowEvent(geckoEvent); } - - (void)otherMouseDown:(NSEvent *)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -3823,7 +3681,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)otherMouseUp:(NSEvent *)theEvent { if (!mGeckoChild) @@ -3836,7 +3693,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, mGeckoChild->DispatchWindowEvent(geckoEvent); } - - (void)otherMouseDragged:(NSEvent*)theEvent { if (!mGeckoChild) @@ -3851,7 +3707,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, mGeckoChild->DispatchWindowEvent(geckoEvent); } - // Handle an NSScrollWheel event for a single axis only. -(void)scrollWheel:(NSEvent*)theEvent forAxis:(enum nsMouseScrollEvent::nsMouseScrollFlags)inAxis { @@ -3978,7 +3833,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK; } - -(void)scrollWheel:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -4003,7 +3857,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK; } - -(NSMenu*)menuForEvent:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; @@ -4042,7 +3895,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - - (NSMenu*)contextMenu { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; @@ -4056,7 +3908,6 @@ static nsEventStatus SendGeckoMouseEnterOrExitEvent(PRBool isTrusted, NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - static PRBool ConvertUnicodeToCharCode(PRUnichar inUniChar, unsigned char* outChar) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -4087,7 +3938,6 @@ static PRBool ConvertUnicodeToCharCode(PRUnichar inUniChar, unsigned char* outCh NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(PR_FALSE); } - static void ConvertCocoaKeyEventToCarbonEvent(NSEvent* cocoaEvent, EventRecord& pluginEvent, PRUint32 keyType = 0) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -4187,7 +4037,6 @@ static PRUint32 GetGeckoKeyCodeFromChar(PRUnichar aChar) } } - static PRUint32 ConvertMacToGeckoKeyCode(UInt32 keyCode, nsKeyEvent* aKeyEvent, NSString* characters) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -4283,7 +4132,6 @@ static PRUint32 ConvertMacToGeckoKeyCode(UInt32 keyCode, nsKeyEvent* aKeyEvent, NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0); } - static PRBool IsSpecialGeckoKey(UInt32 macKeyCode) { PRBool isSpecial; @@ -4348,7 +4196,6 @@ static PRBool IsSpecialGeckoKey(UInt32 macKeyCode) return isSpecial; } - static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) { // this is not character inputting event, simply. @@ -4362,7 +4209,6 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) return !aEvent.isControl && !aEvent.isAlt && !aEvent.isMeta; } - // Basic conversion for cocoa to gecko events, common to all conversions. // Note that it is OK for inEvent to be nil. - (void) convertGenericCocoaEvent:(NSEvent*)inEvent toGeckoEvent:(nsInputEvent*)outGeckoEvent @@ -4388,7 +4234,6 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void) convertCocoaMouseEvent:(NSEvent*)aMouseEvent toGeckoEvent:(nsInputEvent*)outGeckoEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -4407,7 +4252,6 @@ static PRBool IsNormalCharInputtingEvent(const nsKeyEvent& aEvent) NS_OBJC_END_TRY_ABORT_BLOCK; } - #define CHARCODE_MASK_1 0x00FF0000 #define CHARCODE_MASK_2 0x000000FF #define CHARCODE_MASK 0x00FF00FF @@ -4870,7 +4714,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK; } - // Called from PluginKeyEventsHandler() (a handler for Carbon TSM events) to // process a Carbon key event for the currently focused plugin. Both Unicode // characters and "Mac encoding characters" (in the MBCS or "multibyte @@ -4948,7 +4791,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK; } - - (nsIntRect)sendCompositionEvent:(PRInt32) aEventType { #ifdef DEBUG_IME @@ -4968,7 +4810,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) return event.theReply.mCursorPosition; } - - (void)sendTextEvent:(PRUnichar*) aBuffer attributedString:(NSAttributedString*) aString selectedRange:(NSRange) selRange @@ -4994,13 +4835,11 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) delete [] textEvent.rangeArray; } - #pragma mark - // NSTextInput implementation #define MAX_BUFFER_SIZE 32 - - (void)insertText:(id)insertString { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -5109,13 +4948,11 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)insertNewline:(id)sender { [self insertText:@"\n"]; } - - (void) doCommandBySelector:(SEL)aSelector { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -5130,7 +4967,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void) setMarkedText:(id)aString selectedRange:(NSRange)selRange { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -5197,7 +5033,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void) unmarkText { #if DEBUG_IME @@ -5207,7 +5042,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) nsTSMManager::CommitIME(); } - - (BOOL) hasMarkedText { #if DEBUG_IME @@ -5217,7 +5051,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) return (mMarkedRange.location != NSNotFound) && (mMarkedRange.length != 0); } - - (long) conversationIdentifier { #if DEBUG_IME @@ -5236,7 +5069,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) return (long)textContent.mReply.mContentsRoot; } - - (NSAttributedString *) attributedSubstringFromRange:(NSRange)theRange { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; @@ -5266,7 +5098,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - - (NSRange) markedRange { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -5285,7 +5116,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSMakeRange(0, 0)); } - - (NSRange) selectedRange { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -5311,7 +5141,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSMakeRange(0, 0)); } - - (NSRect) firstRectForCharacterRange:(NSRange)theRange { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -5370,7 +5199,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSMakeRect(0.0, 0.0, 0.0, 0.0)); } - - (unsigned int)characterIndexForPoint:(NSPoint)thePoint { #if DEBUG_IME @@ -5382,7 +5210,6 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) return 0; } - - (NSArray*) validAttributesForMarkedText { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; @@ -5398,10 +5225,8 @@ GetUSLayoutCharFromKeyTranslate(UInt32 aKeyCode, UInt32 aModifiers) NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - #pragma mark - - + (NSEvent*)makeNewCocoaEventWithType:(NSEventType)type fromEvent:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL; @@ -5596,7 +5421,6 @@ static const char* ToEscapedString(NSString* aString, nsCAutoString& aBuf) nsTSMManager::InitTSMDocument(focusedView); } - // Create a TSM document for use with plugins, so that we can support IME in // them. Once it's created, if need be (re)activate it. Some plugins (e.g. // the Flash plugin running in Camino) don't create their own TSM document -- @@ -5627,7 +5451,6 @@ static const char* ToEscapedString(NSString* aString, nsCAutoString& aBuf) } } - - (void)keyDown:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -5656,7 +5479,6 @@ static const char* ToEscapedString(NSString* aString, nsCAutoString& aBuf) NS_OBJC_END_TRY_ABORT_BLOCK; } - static BOOL keyUpAlreadySentKeyDown = NO; - (void)keyUp:(NSEvent*)theEvent @@ -5780,7 +5602,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (BOOL)performKeyEquivalent:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -5873,7 +5694,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); } - - (void)flagsChanged:(NSEvent*)theEvent { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -5976,7 +5796,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); } - - (void)viewsWindowDidBecomeKey { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; @@ -6002,7 +5821,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK; } - - (void)viewsWindowDidResignKey { if (!mGeckoChild) @@ -6013,7 +5831,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; [self sendFocusEvent:NS_DEACTIVATE]; } - // If the call to removeFromSuperview isn't delayed from nsChildView:: // TearDownView(), the NSView hierarchy might get changed during calls to // [ChildView drawRect:], which leads to "beyond bounds" exceptions in @@ -6033,14 +5850,11 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK; } - #pragma mark - - // drag'n'drop stuff #define kDragServiceContractID "@mozilla.org/widget/dragservice;1" - // This is a utility function used by NSView drag event methods // to send events. It contains all of the logic needed for Gecko // dragging to work. Returns YES if the event was handled, NO @@ -6133,7 +5947,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); } - - (NSDragOperation)draggingEntered:(id )sender { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -6156,7 +5969,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSDragOperationNone); } - - (NSDragOperation)draggingUpdated:(id )sender { PR_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView draggingUpdated: entered\n")); @@ -6165,7 +5977,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; return handled ? NSDragOperationGeneric : NSDragOperationNone; } - - (void)draggingExited:(id )sender { PR_LOG(sCocoaLog, PR_LOG_ALWAYS, ("ChildView draggingExited: entered\n")); @@ -6175,7 +5986,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_IF_RELEASE(mDragService); } - - (BOOL)performDragOperation:(id )sender { nsAutoRetainCocoaObject kungFuDeathGrip(self); @@ -6184,7 +5994,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; return handled; } - // NSDraggingSource - (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation { @@ -6236,7 +6045,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK; } - // NSDraggingSource // this is just implemented so we comply with the NSDraggingSource informal protocol - (unsigned int)draggingSourceOperationMaskForLocal:(BOOL)isLocal @@ -6307,7 +6115,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - #pragma mark - // Support for the "Services" menu. We currently only support sending strings @@ -6351,7 +6158,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK_NIL; } - - (BOOL)writeSelectionToPasteboard:(NSPasteboard *)pboard types:(NSArray *)types { @@ -6411,7 +6217,6 @@ static BOOL keyUpAlreadySentKeyDown = NO; NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO); } - // Called if the service wants us to replace the current selection. We do // not currently support replacing the current selection so just return NO. - (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pboard @@ -6419,10 +6224,8 @@ static BOOL keyUpAlreadySentKeyDown = NO; return NO; } - #pragma mark - - #ifdef ACCESSIBILITY /* Every ChildView has a corresponding mozDocAccessible object that is doing all @@ -6552,10 +6355,8 @@ static BOOL keyUpAlreadySentKeyDown = NO; @end - #pragma mark - - void nsTSMManager::OnDestroyView(NSView* aDestroyingView) { @@ -6567,14 +6368,12 @@ nsTSMManager::OnDestroyView(NSView* aDestroyingView) } } - PRBool nsTSMManager::GetIMEOpenState() { return GetScriptManagerVariable(smKeyScript) != smRoman ? PR_TRUE : PR_FALSE; } - static const NSString* GetCurrentIMELanguage() { if (!nsToolkit::OnLeopardOrLater()) { @@ -6603,7 +6402,6 @@ static const NSString* GetCurrentIMELanguage() return static_cast(CFArrayGetValueAtIndex(langs, 0)); } - void nsTSMManager::InitTSMDocument(NSView* aViewForCaret) { @@ -6645,7 +6443,6 @@ nsTSMManager::InitTSMDocument(NSView* aViewForCaret) NS_OBJC_END_TRY_ABORT_BLOCK; } - void nsTSMManager::StartComposing(NSView* aComposingView) { @@ -6656,7 +6453,6 @@ nsTSMManager::StartComposing(NSView* aComposingView) "We didn't initialize the TSMDocument"); } - void nsTSMManager::UpdateComposing(NSString* aComposingString) { @@ -6669,7 +6465,6 @@ nsTSMManager::UpdateComposing(NSString* aComposingString) NS_OBJC_END_TRY_ABORT_BLOCK; } - void nsTSMManager::EndComposing() { @@ -6684,7 +6479,6 @@ nsTSMManager::EndComposing() NS_OBJC_END_TRY_ABORT_BLOCK; } - void nsTSMManager::EnableIME(PRBool aEnable) { @@ -6694,7 +6488,6 @@ nsTSMManager::EnableIME(PRBool aEnable) sIsIMEEnabled = aEnable; } - void nsTSMManager::SetIMEOpenState(PRBool aOpen) { @@ -6704,7 +6497,6 @@ nsTSMManager::SetIMEOpenState(PRBool aOpen) KeyScript(aOpen ? smKeySwapScript : smKeyRoman); } - #define ENABLE_ROMAN_KYBDS_ONLY -23 void nsTSMManager::SetRomanKeyboardsOnly(PRBool aRomanOnly) @@ -6716,7 +6508,6 @@ nsTSMManager::SetRomanKeyboardsOnly(PRBool aRomanOnly) sIsRomanKeyboardsOnly = aRomanOnly; } - void nsTSMManager::KillComposing() { @@ -6731,7 +6522,6 @@ nsTSMManager::KillComposing() NS_OBJC_END_TRY_ABORT_BLOCK; } - void nsTSMManager::CommitIME() { @@ -6752,7 +6542,6 @@ nsTSMManager::CommitIME() NS_OBJC_END_TRY_ABORT_BLOCK; } - void nsTSMManager::CancelIME() { @@ -6776,7 +6565,6 @@ nsTSMManager::CancelIME() NS_OBJC_END_TRY_ABORT_BLOCK; } - // Target for text services events sent as the result of calls made to // TSMProcessRawKeyEvent() in [ChildView keyDown:] (above) when a plugin has // the focus. The calls to TSMProcessRawKeyEvent() short-circuit Cocoa-based