зеркало из https://github.com/mozilla/pjs.git
Formatting cleanup part 2, moving module to 1 blank line between functions/methods.
This commit is contained in:
Родитель
9077ba502b
Коммит
c5296754fc
|
@ -42,16 +42,10 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
class nsIWidget;
|
||||
|
||||
|
||||
//
|
||||
// protocol mozView
|
||||
//
|
||||
// A protocol listing all the methods that an object which wants
|
||||
// to live in gecko's widget hierarchy must implement. |nsChildView|
|
||||
// makes assumptions that any NSView with which it comes in contact will
|
||||
// implement this protocol.
|
||||
//
|
||||
|
||||
@protocol mozView
|
||||
|
||||
// access the nsIWidget associated with this view. DOES NOT ADDREF.
|
||||
|
@ -78,15 +72,11 @@ class nsIWidget;
|
|||
|
||||
@end
|
||||
|
||||
|
||||
//
|
||||
// An informal protocol implemented by the NSWindow of the host application.
|
||||
//
|
||||
// It's used to prevent re-entrant calls to -makeKeyAndOrderFront: when gecko
|
||||
// focus/activate events propagate out to the embedder's
|
||||
// nsIEmbeddingSiteWindow::SetFocus implementation.
|
||||
//
|
||||
|
||||
@interface NSObject(mozWindow)
|
||||
|
||||
- (BOOL)suppressMakeKeyFront;
|
||||
|
|
|
@ -78,7 +78,6 @@ private:
|
|||
nsTArray<nsCocoaAppModalWindowListItem> mList;
|
||||
};
|
||||
|
||||
|
||||
@class AppShellDelegate;
|
||||
|
||||
class nsAppShell : public nsBaseAppShell
|
||||
|
|
|
@ -53,5 +53,4 @@ public:
|
|||
virtual ~nsBidiKeyboard();
|
||||
};
|
||||
|
||||
|
||||
#endif // nsBidiKeyboard_h_
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
class nsITransferable;
|
||||
|
||||
|
||||
class nsClipboard : public nsBaseClipboard
|
||||
{
|
||||
|
||||
|
|
|
@ -63,18 +63,15 @@
|
|||
extern PRLogModuleInfo* sCocoaLog;
|
||||
#endif
|
||||
|
||||
|
||||
nsClipboard::nsClipboard() : nsBaseClipboard()
|
||||
{
|
||||
mChangeCount = 0;
|
||||
}
|
||||
|
||||
|
||||
nsClipboard::~nsClipboard()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// We separate this into its own function because after an @try, all local
|
||||
// variables within that function get marked as volatile, and our C++ type
|
||||
// system doesn't like volatile things.
|
||||
|
@ -91,7 +88,6 @@ GetDataFromPasteboard(NSPasteboard* aPasteboard, NSString* aType)
|
|||
return data;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard)
|
||||
{
|
||||
|
@ -136,7 +132,6 @@ nsClipboard::SetNativeClipboardData(PRInt32 aWhichClipboard)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsClipboard::GetNativeClipboardData(nsITransferable* aTransferable, PRInt32 aWhichClipboard)
|
||||
{
|
||||
|
@ -302,7 +297,6 @@ nsClipboard::GetNativeClipboardData(nsITransferable* aTransferable, PRInt32 aWhi
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// returns true if we have *any* of the passed in flavors available for pasting
|
||||
NS_IMETHODIMP
|
||||
nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength,
|
||||
|
@ -370,7 +364,6 @@ nsClipboard::HasDataMatchingFlavors(const char** aFlavorList, PRUint32 aLength,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// This function converts anything that other applications might understand into the system format
|
||||
// and puts it into a dictionary which it returns.
|
||||
// static
|
||||
|
@ -542,7 +535,6 @@ nsClipboard::PasteboardDictFromTransferable(nsITransferable* aTransferable)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsClipboard::IsStringType(const nsCString& aMIMEType, const NSString** aPasteboardType)
|
||||
{
|
||||
if (aMIMEType.EqualsLiteral(kUnicodeMime) ||
|
||||
|
@ -557,7 +549,6 @@ PRBool nsClipboard::IsStringType(const nsCString& aMIMEType, const NSString** aP
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NSString* nsClipboard::WrapHtmlForSystemPasteboard(NSString* aString)
|
||||
{
|
||||
NSString* wrapped =
|
||||
|
|
|
@ -69,7 +69,6 @@ typedef unsigned int NSUInteger;
|
|||
|
||||
#endif /* NSINTEGER_DEFINED */
|
||||
|
||||
|
||||
// Used to retain a Cocoa object for the remainder of a method's execution.
|
||||
class nsAutoRetainCocoaObject {
|
||||
public:
|
||||
|
@ -85,7 +84,6 @@ private:
|
|||
id mObject; // [STRONG]
|
||||
};
|
||||
|
||||
|
||||
@interface NSApplication (Undocumented)
|
||||
|
||||
// Present in all versions of OS X from (at least) 10.2.8 through 10.5.
|
||||
|
|
|
@ -63,13 +63,11 @@ float nsCocoaUtils::MenuBarScreenHeight()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0.0);
|
||||
}
|
||||
|
||||
|
||||
float nsCocoaUtils::FlippedScreenY(float y)
|
||||
{
|
||||
return MenuBarScreenHeight() - y;
|
||||
}
|
||||
|
||||
|
||||
NSRect nsCocoaUtils::GeckoRectToCocoaRect(const nsIntRect &geckoRect)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -84,7 +82,6 @@ NSRect nsCocoaUtils::GeckoRectToCocoaRect(const nsIntRect &geckoRect)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSMakeRect(0.0, 0.0, 0.0, 0.0));
|
||||
}
|
||||
|
||||
|
||||
nsIntRect nsCocoaUtils::CocoaRectToGeckoRect(const NSRect &cocoaRect)
|
||||
{
|
||||
// We only need to change the Y coordinate by starting with the primary screen
|
||||
|
@ -98,7 +95,6 @@ nsIntRect nsCocoaUtils::CocoaRectToGeckoRect(const NSRect &cocoaRect)
|
|||
return rect;
|
||||
}
|
||||
|
||||
|
||||
NSPoint nsCocoaUtils::ScreenLocationForEvent(NSEvent* anEvent)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -108,7 +104,6 @@ NSPoint nsCocoaUtils::ScreenLocationForEvent(NSEvent* anEvent)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSMakePoint(0.0, 0.0));
|
||||
}
|
||||
|
||||
|
||||
BOOL nsCocoaUtils::IsEventOverWindow(NSEvent* anEvent, NSWindow* aWindow)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -118,7 +113,6 @@ BOOL nsCocoaUtils::IsEventOverWindow(NSEvent* anEvent, NSWindow* aWindow)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO);
|
||||
}
|
||||
|
||||
|
||||
NSPoint nsCocoaUtils::EventLocationForWindow(NSEvent* anEvent, NSWindow* aWindow)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -128,7 +122,6 @@ NSPoint nsCocoaUtils::EventLocationForWindow(NSEvent* anEvent, NSWindow* aWindow
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSMakePoint(0.0, 0.0));
|
||||
}
|
||||
|
||||
|
||||
NSWindow* nsCocoaUtils::FindWindowUnderPoint(NSPoint aPoint)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
@ -155,7 +148,6 @@ NSWindow* nsCocoaUtils::FindWindowUnderPoint(NSPoint aPoint)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
#define NS_APPSHELLSERVICE_CONTRACTID "@mozilla.org/appshell/appShellService;1"
|
||||
nsIWidget* nsCocoaUtils::GetHiddenWindowWidget()
|
||||
{
|
||||
|
@ -188,7 +180,6 @@ nsIWidget* nsCocoaUtils::GetHiddenWindowWidget()
|
|||
return hiddenWindowWidget;
|
||||
}
|
||||
|
||||
|
||||
void nsCocoaUtils::PrepareForNativeAppModalDialog()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -225,7 +216,6 @@ void nsCocoaUtils::PrepareForNativeAppModalDialog()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void nsCocoaUtils::CleanUpAfterNativeAppModalDialog()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -296,4 +286,3 @@ NSUInteger nsCocoaUtils::GetCocoaEventModifierFlags(NSEvent *theEvent)
|
|||
}
|
||||
return modifierFlags;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,6 @@ typedef struct _nsCocoaWindowList {
|
|||
nsCocoaWindow *window; // Weak
|
||||
} nsCocoaWindowList;
|
||||
|
||||
|
||||
@interface NSWindow (Undocumented)
|
||||
|
||||
// If a window has been explicitly removed from the "window cache" (to
|
||||
|
@ -75,7 +74,6 @@ typedef struct _nsCocoaWindowList {
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@interface PopupWindow : NSWindow
|
||||
{
|
||||
@private
|
||||
|
@ -89,7 +87,6 @@ typedef struct _nsCocoaWindowList {
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@interface BorderlessWindow : NSWindow
|
||||
{
|
||||
}
|
||||
|
@ -99,7 +96,6 @@ typedef struct _nsCocoaWindowList {
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@interface WindowDelegate : NSObject
|
||||
{
|
||||
nsCocoaWindow* mGeckoWindow; // [WEAK] (we are owned by the window)
|
||||
|
@ -308,5 +304,4 @@ protected:
|
|||
PRInt32 mNumModalDescendents;
|
||||
};
|
||||
|
||||
|
||||
#endif // nsCocoaWindow_h_
|
||||
|
|
|
@ -97,13 +97,11 @@ extern BOOL gSomeMenuBarPainted;
|
|||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsCocoaWindow, Inherited, nsPIWidgetCocoa)
|
||||
|
||||
|
||||
// A note on testing to see if your object is a sheet...
|
||||
// |mWindowType == eWindowType_sheet| is true if your gecko nsIWidget is a sheet
|
||||
// widget - whether or not the sheet is showing. |[mWindow isSheet]| will return
|
||||
// true *only when the sheet is actually showing*. Choose your test wisely.
|
||||
|
||||
|
||||
// roll up any popup windows
|
||||
static void RollUpPopups()
|
||||
{
|
||||
|
@ -111,7 +109,6 @@ static void RollUpPopups()
|
|||
gRollupListener->Rollup(nsnull, nsnull);
|
||||
}
|
||||
|
||||
|
||||
nsCocoaWindow::nsCocoaWindow()
|
||||
: mParent(nsnull)
|
||||
, mWindow(nil)
|
||||
|
@ -127,7 +124,6 @@ nsCocoaWindow::nsCocoaWindow()
|
|||
|
||||
}
|
||||
|
||||
|
||||
// Under unusual circumstances, an nsCocoaWindow object can be destroyed
|
||||
// before the nsChildView objects it contains are destroyed. But this will
|
||||
// invalidate the (weak) mWindow variable in these nsChildView objects
|
||||
|
@ -146,7 +142,6 @@ static void TellNativeViewsGoodbye(NSView *aNativeView)
|
|||
TellNativeViewsGoodbye((NSView *)[immediateSubviews objectAtIndex:i]);
|
||||
}
|
||||
|
||||
|
||||
void nsCocoaWindow::DestroyNativeWindow()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -160,7 +155,6 @@ void nsCocoaWindow::DestroyNativeWindow()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsCocoaWindow::~nsCocoaWindow()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -199,7 +193,6 @@ nsCocoaWindow::~nsCocoaWindow()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// Very large windows work in Cocoa, but can take a long time to
|
||||
// process (multiple minutes), during which time the system is
|
||||
// unresponsive and seems hung. Although it's likely that windows
|
||||
|
@ -221,7 +214,6 @@ static bool WindowSizeAllowed(PRInt32 aWidth, PRInt32 aHeight)
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Some applications like Camino use native popup windows
|
||||
// (native context menus, native tooltips)
|
||||
static PRBool UseNativePopupWindows()
|
||||
|
@ -235,7 +227,6 @@ static PRBool UseNativePopupWindows()
|
|||
return (NS_SUCCEEDED(rv) && useNativePopupWindows);
|
||||
}
|
||||
|
||||
|
||||
// Utility method for implementing both Create(nsIWidget ...) and
|
||||
// Create(nsNativeWidget...)
|
||||
nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent,
|
||||
|
@ -279,7 +270,6 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
static unsigned int WindowMaskForBorderStyle(nsBorderStyle aBorderStyle)
|
||||
{
|
||||
PRBool allOrDefault = (aBorderStyle == eBorderStyle_all ||
|
||||
|
@ -302,7 +292,6 @@ static unsigned int WindowMaskForBorderStyle(nsBorderStyle aBorderStyle)
|
|||
return mask;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsCocoaWindow::CreateNativeWindow(const nsIntRect &aRect,
|
||||
nsBorderStyle aBorderStyle)
|
||||
{
|
||||
|
@ -412,7 +401,6 @@ nsresult nsCocoaWindow::CreateNativeWindow(const nsIntRect &aRect,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::CreatePopupContentView(const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -440,7 +428,6 @@ NS_IMETHODIMP nsCocoaWindow::CreatePopupContentView(const nsIntRect &aRect,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// Create a nsCocoaWindow using a native window provided by the application
|
||||
NS_IMETHODIMP nsCocoaWindow::Create(nsNativeWidget aNativeWindow,
|
||||
const nsIntRect &aRect,
|
||||
|
@ -454,7 +441,6 @@ NS_IMETHODIMP nsCocoaWindow::Create(nsNativeWidget aNativeWindow,
|
|||
aAppShell, aToolkit, aInitData, aNativeWindow));
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Create(nsIWidget* aParent,
|
||||
const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
|
@ -467,7 +453,6 @@ NS_IMETHODIMP nsCocoaWindow::Create(nsIWidget* aParent,
|
|||
aAppShell, aToolkit, aInitData, nsnull));
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Destroy()
|
||||
{
|
||||
if (mPopupContentView)
|
||||
|
@ -479,7 +464,6 @@ NS_IMETHODIMP nsCocoaWindow::Destroy()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsIWidget* nsCocoaWindow::GetSheetWindowParent(void)
|
||||
{
|
||||
if (mWindowType != eWindowType_sheet)
|
||||
|
@ -490,7 +474,6 @@ nsIWidget* nsCocoaWindow::GetSheetWindowParent(void)
|
|||
return parent;
|
||||
}
|
||||
|
||||
|
||||
void* nsCocoaWindow::GetNativeData(PRUint32 aDataType)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSNULL;
|
||||
|
@ -521,7 +504,6 @@ void* nsCocoaWindow::GetNativeData(PRUint32 aDataType)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSNULL;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::IsVisible(PRBool & aState)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -532,7 +514,6 @@ NS_IMETHODIMP nsCocoaWindow::IsVisible(PRBool & aState)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::SetModal(PRBool aState)
|
||||
{
|
||||
mModal = aState;
|
||||
|
@ -602,7 +583,6 @@ NS_IMETHODIMP nsCocoaWindow::SetModal(PRBool aState)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Hide or show this window
|
||||
NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState)
|
||||
{
|
||||
|
@ -839,7 +819,6 @@ NS_IMETHODIMP nsCocoaWindow::Show(PRBool bState)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
void nsCocoaWindow::MakeBackgroundTransparent(PRBool aTransparent)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -853,7 +832,6 @@ void nsCocoaWindow::MakeBackgroundTransparent(PRBool aTransparent)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsTransparencyMode nsCocoaWindow::GetTransparencyMode()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -863,7 +841,6 @@ nsTransparencyMode nsCocoaWindow::GetTransparencyMode()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(eTransparencyOpaque);
|
||||
}
|
||||
|
||||
|
||||
// This is called from nsMenuPopupFrame when making a popup transparent.
|
||||
// For other window types, nsChildView::SetTransparencyMode is used.
|
||||
void nsCocoaWindow::SetTransparencyMode(nsTransparencyMode aMode)
|
||||
|
@ -888,7 +865,6 @@ void nsCocoaWindow::SetTransparencyMode(nsTransparencyMode aMode)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
NS_METHOD nsCocoaWindow::AddEventListener(nsIEventListener * aListener)
|
||||
{
|
||||
nsBaseWidget::AddEventListener(aListener);
|
||||
|
@ -899,13 +875,11 @@ NS_METHOD nsCocoaWindow::AddEventListener(nsIEventListener * aListener)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Enable(PRBool aState)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::IsEnabled(PRBool *aState)
|
||||
{
|
||||
if (aState)
|
||||
|
@ -913,14 +887,12 @@ NS_IMETHODIMP nsCocoaWindow::IsEnabled(PRBool *aState)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::ConstrainPosition(PRBool aAllowSlop,
|
||||
PRInt32 *aX, PRInt32 *aY)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Move(PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
if (!mWindow || (mBounds.x == aX && mBounds.y == aY))
|
||||
|
@ -934,7 +906,6 @@ NS_IMETHODIMP nsCocoaWindow::Move(PRInt32 aX, PRInt32 aY)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Position the window behind the given window
|
||||
NS_METHOD nsCocoaWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
|
||||
nsIWidget *aWidget, PRBool aActivate)
|
||||
|
@ -942,7 +913,6 @@ NS_METHOD nsCocoaWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Note bug 278777, we need to update state when the window is unminimized
|
||||
// from the dock by users.
|
||||
NS_METHOD nsCocoaWindow::SetSizeMode(PRInt32 aMode)
|
||||
|
@ -977,7 +947,6 @@ NS_METHOD nsCocoaWindow::SetSizeMode(PRInt32 aMode)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1024,7 +993,6 @@ NS_IMETHODIMP nsCocoaWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRIn
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1038,7 +1006,6 @@ NS_IMETHODIMP nsCocoaWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRep
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::GetScreenBounds(nsIntRect &aRect)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1050,13 +1017,11 @@ NS_IMETHODIMP nsCocoaWindow::GetScreenBounds(nsIntRect &aRect)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsCocoaWindow::OnPaint(nsPaintEvent &event)
|
||||
{
|
||||
return PR_TRUE; // don't dispatch the update event
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::SetTitle(const nsAString& aTitle)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1070,7 +1035,6 @@ NS_IMETHODIMP nsCocoaWindow::SetTitle(const nsAString& aTitle)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Invalidate(const nsIntRect & aRect, PRBool aIsSynchronous)
|
||||
{
|
||||
if (mPopupContentView)
|
||||
|
@ -1079,7 +1043,6 @@ NS_IMETHODIMP nsCocoaWindow::Invalidate(const nsIntRect & aRect, PRBool aIsSynch
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
if (mPopupContentView)
|
||||
|
@ -1088,7 +1051,6 @@ NS_IMETHODIMP nsCocoaWindow::Invalidate(PRBool aIsSynchronous)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::Update()
|
||||
{
|
||||
if (mPopupContentView)
|
||||
|
@ -1097,7 +1059,6 @@ NS_IMETHODIMP nsCocoaWindow::Update()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Pass notification of some drag event to Gecko
|
||||
//
|
||||
// The drag manager has let us know that something related to a drag has
|
||||
|
@ -1110,7 +1071,6 @@ PRBool nsCocoaWindow::DragEvent(unsigned int aMessage, Point aMouseGlobal, UInt1
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::SendSetZLevelEvent()
|
||||
{
|
||||
nsZLevelEvent event(PR_TRUE, NS_SETZLEVEL, this);
|
||||
|
@ -1127,7 +1087,6 @@ NS_IMETHODIMP nsCocoaWindow::SendSetZLevelEvent()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::GetChildSheet(PRBool aShown, nsCocoaWindow** _retval)
|
||||
{
|
||||
nsIWidget* child = GetFirstChild();
|
||||
|
@ -1151,34 +1110,29 @@ NS_IMETHODIMP nsCocoaWindow::GetChildSheet(PRBool aShown, nsCocoaWindow** _retva
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::GetRealParent(nsIWidget** parent)
|
||||
{
|
||||
*parent = mParent;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::GetIsSheet(PRBool* isSheet)
|
||||
{
|
||||
mWindowType == eWindowType_sheet ? *isSheet = PR_TRUE : *isSheet = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::GetSheetWindowParent(NSWindow** sheetWindowParent)
|
||||
{
|
||||
*sheetWindowParent = mSheetWindowParent;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::ResetInputState()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Invokes callback and ProcessEvent methods on Event Listener object
|
||||
NS_IMETHODIMP
|
||||
nsCocoaWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus)
|
||||
|
@ -1200,7 +1154,6 @@ nsCocoaWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus& aStatus)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsCocoaWindow::DispatchSizeModeEvent(nsSizeMode aSizeMode)
|
||||
{
|
||||
|
@ -1238,7 +1191,6 @@ nsCocoaWindow::ReportSizeEvent(NSRect *r)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void nsCocoaWindow::SetMenuBar(nsMenuBarX *aMenuBar)
|
||||
{
|
||||
if (mMenuBar)
|
||||
|
@ -1255,7 +1207,6 @@ void nsCocoaWindow::SetMenuBar(nsMenuBarX *aMenuBar)
|
|||
mMenuBar->Paint();
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::SetFocus(PRBool aState)
|
||||
{
|
||||
if (mPopupContentView) {
|
||||
|
@ -1271,7 +1222,6 @@ NS_IMETHODIMP nsCocoaWindow::SetFocus(PRBool aState)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsIntPoint nsCocoaWindow::WidgetToScreenOffset()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -1283,13 +1233,11 @@ nsIntPoint nsCocoaWindow::WidgetToScreenOffset()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsIntPoint(0,0));
|
||||
}
|
||||
|
||||
|
||||
nsMenuBarX* nsCocoaWindow::GetMenuBar()
|
||||
{
|
||||
return mMenuBar;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::CaptureRollupEvents(nsIRollupListener * aListener,
|
||||
PRBool aDoCapture,
|
||||
PRBool aConsumeRollupEvent)
|
||||
|
@ -1332,7 +1280,6 @@ NS_IMETHODIMP nsCocoaWindow::CaptureRollupEvents(nsIRollupListener * aListener,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::GetAttention(PRInt32 aCycleCount)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1360,7 +1307,6 @@ NS_IMETHODIMP nsCocoaWindow::SetWindowShadowStyle(PRInt32 aStyle)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::SetWindowTitlebarColor(nscolor aColor, PRBool aActive)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1404,7 +1350,6 @@ NS_IMETHODIMP nsCocoaWindow::SetWindowTitlebarColor(nscolor aColor, PRBool aActi
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
gfxASurface* nsCocoaWindow::GetThebesSurface()
|
||||
{
|
||||
if (mPopupContentView)
|
||||
|
@ -1412,7 +1357,6 @@ gfxASurface* nsCocoaWindow::GetThebesSurface()
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::BeginSecureKeyboardInput()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1425,7 +1369,6 @@ NS_IMETHODIMP nsCocoaWindow::BeginSecureKeyboardInput()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsCocoaWindow::EndSecureKeyboardInput()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -1438,7 +1381,6 @@ NS_IMETHODIMP nsCocoaWindow::EndSecureKeyboardInput()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// Callback used by the default titlebar and toolbar shading.
|
||||
// *aIn == 0 at the top of the titlebar/toolbar, *aIn == 1 at the bottom
|
||||
/* static */ void
|
||||
|
@ -1459,10 +1401,8 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
aOut[3] = 1.0f;
|
||||
}
|
||||
|
||||
|
||||
@implementation WindowDelegate
|
||||
|
||||
|
||||
// We try to find a gecko menu bar to paint. If one does not exist, just paint
|
||||
// the application menu by itself so that a window doesn't have some other
|
||||
// window's menu bar.
|
||||
|
@ -1510,7 +1450,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (id)initWithGeckoWindow:(nsCocoaWindow*)geckoWind
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
@ -1523,7 +1462,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)proposedFrameSize
|
||||
{
|
||||
RollUpPopups();
|
||||
|
@ -1531,7 +1469,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
return proposedFrameSize;
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidResize:(NSNotification *)aNotification
|
||||
{
|
||||
if (!mGeckoWindow || mGeckoWindow->IsResizing())
|
||||
|
@ -1540,7 +1477,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
mGeckoWindow->ReportSizeEvent();
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidBecomeMain:(NSNotification *)aNotification
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -1558,7 +1494,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidResignMain:(NSNotification *)aNotification
|
||||
{
|
||||
RollUpPopups();
|
||||
|
@ -1574,7 +1509,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidBecomeKey:(NSNotification *)aNotification
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -1586,7 +1520,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidResignKey:(NSNotification *)aNotification
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -1600,13 +1533,11 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (void)windowWillMove:(NSNotification *)aNotification
|
||||
{
|
||||
RollUpPopups();
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidMove:(NSNotification *)aNotification
|
||||
{
|
||||
// Dispatch the move event to Gecko
|
||||
|
@ -1620,7 +1551,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
mGeckoWindow->DispatchEvent(&guiEvent, status);
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)windowShouldClose:(id)sender
|
||||
{
|
||||
// We only want to send NS_XUL_CLOSE and let gecko close the window
|
||||
|
@ -1631,33 +1561,28 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
return NO; // gecko will do it
|
||||
}
|
||||
|
||||
|
||||
- (void)windowWillClose:(NSNotification *)aNotification
|
||||
{
|
||||
RollUpPopups();
|
||||
}
|
||||
|
||||
|
||||
- (void)windowWillMiniaturize:(NSNotification *)aNotification
|
||||
{
|
||||
RollUpPopups();
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidMiniaturize:(NSNotification *)aNotification
|
||||
{
|
||||
if (mGeckoWindow)
|
||||
mGeckoWindow->DispatchSizeModeEvent(nsSizeMode_Minimized);
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidDeminiaturize:(NSNotification *)aNotification
|
||||
{
|
||||
if (mGeckoWindow)
|
||||
mGeckoWindow->DispatchSizeModeEvent(nsSizeMode_Normal);
|
||||
}
|
||||
|
||||
|
||||
- (void)sendFocusEvent:(PRUint32)eventType
|
||||
{
|
||||
if (!mGeckoWindow)
|
||||
|
@ -1669,7 +1594,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
mGeckoWindow->DispatchEvent(&focusGuiEvent, status);
|
||||
}
|
||||
|
||||
|
||||
- (void)didEndSheet:(NSWindow*)sheet returnCode:(int)returnCode contextInfo:(void*)contextInfo
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -1689,19 +1613,16 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (nsCocoaWindow*)geckoWidget
|
||||
{
|
||||
return mGeckoWindow;
|
||||
}
|
||||
|
||||
|
||||
- (PRBool)toplevelActiveState
|
||||
{
|
||||
return mToplevelActiveState;
|
||||
}
|
||||
|
||||
|
||||
- (void)sendToplevelActivateEvents
|
||||
{
|
||||
if (!mToplevelActiveState) {
|
||||
|
@ -1710,7 +1631,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)sendToplevelDeactivateEvents
|
||||
{
|
||||
if (mToplevelActiveState) {
|
||||
|
@ -1721,7 +1641,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
|
||||
@end
|
||||
|
||||
|
||||
// Category on NSWindow so callers can use the same method on both ToolbarWindows
|
||||
// and NSWindows for accessing the background color.
|
||||
@implementation NSWindow(ToolbarWindowCompat)
|
||||
|
@ -1737,14 +1656,12 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@interface ToolbarWindow(Private)
|
||||
|
||||
- (void)redrawTitlebar;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
// This class allows us to have a "unified toolbar" style window. It works like this:
|
||||
// 1) We set the window's style to textured.
|
||||
// 2) Because of this, the background color applies to the entire window, including
|
||||
|
@ -1805,7 +1722,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -1816,7 +1732,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// We don't provide our own implementation of -backgroundColor because NSWindow
|
||||
// looks at it, apparently. This is here to keep someone from messing with our
|
||||
// custom NSColor subclass.
|
||||
|
@ -1829,7 +1744,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// If you need to get at the background color of the window (in the traditional
|
||||
// sense) use this method instead.
|
||||
- (NSColor*)windowBackgroundColor
|
||||
|
@ -1841,7 +1755,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
// Pass nil here to get the default appearance.
|
||||
- (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive
|
||||
{
|
||||
|
@ -1864,7 +1777,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
[self redrawTitlebar];
|
||||
}
|
||||
|
||||
|
||||
- (float)unifiedToolbarHeight
|
||||
{
|
||||
return mUnifiedToolbarHeight;
|
||||
|
@ -1887,7 +1799,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
return YES;
|
||||
}
|
||||
|
||||
|
||||
// Dispatch a toolbar pill button clicked message to Gecko.
|
||||
- (void)_toolbarPillButtonClicked:(id)sender
|
||||
{
|
||||
|
@ -1997,7 +1908,6 @@ nsCocoaWindow::UnifiedShading(void* aInfo, const float* aIn, float* aOut)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -2068,7 +1978,6 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (void)setFill
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -2094,7 +2003,6 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// Pass nil here to get the default appearance.
|
||||
- (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive
|
||||
{
|
||||
|
@ -2111,19 +2019,16 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (NSColor*)activeTitlebarColor
|
||||
{
|
||||
return mActiveTitlebarColor;
|
||||
}
|
||||
|
||||
|
||||
- (NSColor*)inactiveTitlebarColor
|
||||
{
|
||||
return mInactiveTitlebarColor;
|
||||
}
|
||||
|
||||
|
||||
- (void)setBackgroundColor:(NSColor*)aColor
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -2134,25 +2039,21 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (NSColor*)backgroundColor
|
||||
{
|
||||
return mBackgroundColor;
|
||||
}
|
||||
|
||||
|
||||
- (NSWindow*)window
|
||||
{
|
||||
return mWindow;
|
||||
}
|
||||
|
||||
|
||||
- (NSString*)colorSpaceName
|
||||
{
|
||||
return NSDeviceRGBColorSpace;
|
||||
}
|
||||
|
||||
|
||||
- (void)set
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -2164,7 +2065,6 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@implementation PopupWindow
|
||||
|
||||
// The OS treats our custom popup windows very strangely -- many mouse events
|
||||
|
@ -2295,7 +2195,6 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask
|
||||
backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
|
||||
{
|
||||
|
@ -2308,19 +2207,16 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)isContextMenu
|
||||
{
|
||||
return mIsContextMenu;
|
||||
}
|
||||
|
||||
|
||||
- (void)setIsContextMenu:(BOOL)flag
|
||||
{
|
||||
mIsContextMenu = flag;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
// According to Apple's docs on [NSWindow canBecomeKeyWindow] and [NSWindow
|
||||
|
@ -2336,7 +2232,6 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (void)sendEvent:(NSEvent *)anEvent
|
||||
{
|
||||
NSEventType type = [anEvent type];
|
||||
|
@ -2376,7 +2271,6 @@ void patternDraw(void* aInfo, CGContextRef aContext)
|
|||
[super sendEvent:anEvent];
|
||||
}
|
||||
|
||||
|
||||
// Apple's doc on this method says that the NSWindow class's default is not to
|
||||
// become main if the window isn't "visible" -- so we should replicate that
|
||||
// behavior here. As best I can tell, the [NSWindow isVisible] method is an
|
||||
|
|
|
@ -46,10 +46,6 @@
|
|||
class nsDeviceContextSpecX : public nsIDeviceContextSpec
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Construct a nsDeviceContextSpecX, which is an object which contains and manages a mac printrecord
|
||||
* @update dc 12/02/98
|
||||
*/
|
||||
nsDeviceContextSpecX();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
@ -64,7 +60,6 @@ public:
|
|||
|
||||
/**
|
||||
* Initialize the nsDeviceContextSpecX for use. This will allocate a printrecord for use
|
||||
* @update dc 12/02/98
|
||||
* @param aWidget Unused
|
||||
* @param aPS Settings for this print job
|
||||
* @param aIsPrintPreview TRUE if doing print preview, FALSE if normal printing.
|
||||
|
@ -75,14 +70,9 @@ public:
|
|||
void GetPaperRect(double* aTop, double* aLeft, double* aBottom, double* aRight);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Destructor for nsDeviceContextSpecX, this will release the printrecord
|
||||
* @update dc 12/02/98
|
||||
*/
|
||||
virtual ~nsDeviceContextSpecX();
|
||||
|
||||
protected:
|
||||
|
||||
PMPrintSession mPrintSession; // printing context.
|
||||
PMPageFormat mPageFormat; // page format.
|
||||
PMPrintSettings mPrintSettings; // print settings.
|
||||
|
|
|
@ -53,11 +53,6 @@
|
|||
#include "gfxQuartzSurface.h"
|
||||
#include "gfxImageSurface.h"
|
||||
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Construct the nsDeviceContextSpecX
|
||||
* @update dc 12/02/98
|
||||
*/
|
||||
nsDeviceContextSpecX::nsDeviceContextSpecX()
|
||||
: mPrintSession(NULL)
|
||||
, mPageFormat(kPMNoPageFormat)
|
||||
|
@ -65,10 +60,6 @@ nsDeviceContextSpecX::nsDeviceContextSpecX()
|
|||
{
|
||||
}
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Destroy the nsDeviceContextSpecX
|
||||
* @update dc 12/02/98
|
||||
*/
|
||||
nsDeviceContextSpecX::~nsDeviceContextSpecX()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -81,10 +72,6 @@ nsDeviceContextSpecX::~nsDeviceContextSpecX()
|
|||
|
||||
NS_IMPL_ISUPPORTS1(nsDeviceContextSpecX, nsIDeviceContextSpec)
|
||||
|
||||
/** -------------------------------------------------------
|
||||
* Initialize the nsDeviceContextSpecMac
|
||||
* @update dc 12/02/98
|
||||
*/
|
||||
NS_IMETHODIMP nsDeviceContextSpecX::Init(nsIWidget *aWidget,
|
||||
nsIPrintSettings* aPS,
|
||||
PRBool aIsPrintPreview)
|
||||
|
|
|
@ -94,7 +94,6 @@ nsDragService::nsDragService()
|
|||
mNativeDragEvent = nil;
|
||||
}
|
||||
|
||||
|
||||
nsDragService::~nsDragService()
|
||||
{
|
||||
}
|
||||
|
@ -161,7 +160,6 @@ static nsresult SetUpDragClipboard(nsISupportsArray* aTransferableArray)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NSImage*
|
||||
nsDragService::ConstructDragImage(nsIDOMNode* aDOMNode,
|
||||
nsIntRect* aDragRect,
|
||||
|
@ -326,7 +324,6 @@ nsDragService::InvokeDragSession(nsIDOMNode* aDOMNode, nsISupportsArray* aTransf
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::GetData(nsITransferable* aTransferable, PRUint32 aItemIndex)
|
||||
{
|
||||
|
@ -470,7 +467,6 @@ nsDragService::GetData(nsITransferable* aTransferable, PRUint32 aItemIndex)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PRBool *_retval)
|
||||
{
|
||||
|
@ -543,7 +539,6 @@ nsDragService::IsDataFlavorSupported(const char *aDataFlavor, PRBool *_retval)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::GetNumDropItems(PRUint32* aNumItems)
|
||||
{
|
||||
|
@ -574,7 +569,6 @@ nsDragService::GetNumDropItems(PRUint32* aNumItems)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDragService::EndDragSession(PRBool aDoneDrag)
|
||||
{
|
||||
|
|
|
@ -53,11 +53,6 @@
|
|||
class nsILocalFileMac;
|
||||
@class NSArray;
|
||||
|
||||
|
||||
/**
|
||||
* Native Mac Cocoa FileSelector wrapper
|
||||
*/
|
||||
|
||||
class nsFilePicker : public nsBaseFilePicker
|
||||
{
|
||||
public:
|
||||
|
@ -65,8 +60,8 @@ public:
|
|||
virtual ~nsFilePicker();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIFilePicker (less what's in nsBaseFilePicker)
|
||||
|
||||
// nsIFilePicker (less what's in nsBaseFilePicker)
|
||||
NS_IMETHOD GetDefaultString(nsAString& aDefaultString);
|
||||
NS_IMETHOD SetDefaultString(const nsAString& aDefaultString);
|
||||
NS_IMETHOD GetDefaultExtension(nsAString& aDefaultExtension);
|
||||
|
@ -81,13 +76,12 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle,
|
||||
PRInt16 aMode);
|
||||
virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle, PRInt16 aMode);
|
||||
|
||||
// actual implementations of get/put dialogs using NSOpenPanel & NSSavePanel
|
||||
// aFile is an existing but unspecified file. These functions must specify it.
|
||||
//
|
||||
// will return |returnCancel| or |returnOK| as result.
|
||||
// actual implementations of get/put dialogs using NSOpenPanel & NSSavePanel
|
||||
// aFile is an existing but unspecified file. These functions must specify it.
|
||||
//
|
||||
// will return |returnCancel| or |returnOK| as result.
|
||||
PRInt16 GetLocalFiles(const nsString& inTitle, const nsString& inDefaultName, PRBool inAllowMultiple, nsCOMArray<nsILocalFile>& outFiles);
|
||||
PRInt16 GetLocalFolder(const nsString& inTitle, nsILocalFile** outFile);
|
||||
PRInt16 PutLocalFile(const nsString& inTitle, const nsString& inDefaultName, nsILocalFile** outFile);
|
||||
|
|
|
@ -119,12 +119,10 @@ nsFilePicker::nsFilePicker()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
nsFilePicker::~nsFilePicker()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsFilePicker::InitNative(nsIWidget *aParent, const nsAString& aTitle,
|
||||
PRInt16 aMode)
|
||||
|
@ -141,7 +139,6 @@ nsFilePicker::InitNative(nsIWidget *aParent, const nsAString& aTitle,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NSView* nsFilePicker::GetAccessoryView()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
@ -221,7 +218,6 @@ NSView* nsFilePicker::GetAccessoryView()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
// Display the file dialog
|
||||
NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
||||
{
|
||||
|
@ -274,7 +270,6 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Use OpenPanel to do a GetFile. Returns |returnOK| if the user presses OK in the dialog.
|
||||
PRInt16
|
||||
nsFilePicker::GetLocalFiles(const nsString& inTitle, const nsString& inDefaultName, PRBool inAllowMultiple, nsCOMArray<nsILocalFile>& outFiles)
|
||||
|
@ -343,7 +338,6 @@ nsFilePicker::GetLocalFiles(const nsString& inTitle, const nsString& inDefaultNa
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
// Use OpenPanel to do a GetFolder. Returns |returnOK| if the user presses OK in the dialog.
|
||||
PRInt16
|
||||
nsFilePicker::GetLocalFolder(const nsString& inTitle, nsILocalFile** outFile)
|
||||
|
@ -397,7 +391,6 @@ nsFilePicker::GetLocalFolder(const nsString& inTitle, nsILocalFile** outFile)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
// Returns |returnOK| if the user presses OK in the dialog.
|
||||
PRInt16
|
||||
nsFilePicker::PutLocalFile(const nsString& inTitle, const nsString& inDefaultName, nsILocalFile** outFile)
|
||||
|
@ -463,7 +456,6 @@ nsFilePicker::PutLocalFile(const nsString& inTitle, const nsString& inDefaultNam
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
// Take the list of file types (in a nice win32-specific format) and fills up
|
||||
// an NSArray of them for the Open Panel. Note: Will return nil if we should allow
|
||||
// all file types.
|
||||
|
@ -522,7 +514,6 @@ nsFilePicker::GenerateFilterList()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
// Sets the dialog title to whatever it should be. If it fails, eh,
|
||||
// the OS will provide a sensible default.
|
||||
void
|
||||
|
@ -535,7 +526,6 @@ nsFilePicker::SetDialogTitle(const nsString& inTitle, id aPanel)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// Converts path from an nsILocalFile into a NSString path
|
||||
// If it fails, returns an empty string.
|
||||
NSString *
|
||||
|
@ -554,7 +544,6 @@ nsFilePicker::PanelDefaultDirectory()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsFilePicker::GetFile(nsILocalFile **aFile)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFile);
|
||||
|
@ -569,7 +558,6 @@ NS_IMETHODIMP nsFilePicker::GetFile(nsILocalFile **aFile)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsFilePicker::GetFileURL(nsIURI **aFileURL)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFileURL);
|
||||
|
@ -581,13 +569,11 @@ NS_IMETHODIMP nsFilePicker::GetFileURL(nsIURI **aFileURL)
|
|||
return NS_NewFileURI(aFileURL, mFiles.ObjectAt(0));
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsFilePicker::GetFiles(nsISimpleEnumerator **aFiles)
|
||||
{
|
||||
return NS_NewArrayEnumerator(aFiles, mFiles);
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsFilePicker::SetDefaultString(const nsAString& aString)
|
||||
{
|
||||
mDefault = aString;
|
||||
|
@ -599,7 +585,6 @@ NS_IMETHODIMP nsFilePicker::GetDefaultString(nsAString& aString)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
// The default extension to use for files
|
||||
NS_IMETHODIMP nsFilePicker::GetDefaultExtension(nsAString& aExtension)
|
||||
{
|
||||
|
@ -607,13 +592,11 @@ NS_IMETHODIMP nsFilePicker::GetDefaultExtension(nsAString& aExtension)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsFilePicker::SetDefaultExtension(const nsAString& aExtension)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Append an entry to the filters array
|
||||
NS_IMETHODIMP
|
||||
nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter)
|
||||
|
@ -624,7 +607,6 @@ nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Get the filter index - do we still need this?
|
||||
NS_IMETHODIMP nsFilePicker::GetFilterIndex(PRInt32 *aFilterIndex)
|
||||
{
|
||||
|
@ -632,7 +614,6 @@ NS_IMETHODIMP nsFilePicker::GetFilterIndex(PRInt32 *aFilterIndex)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Set the filter index - do we still need this?
|
||||
NS_IMETHODIMP nsFilePicker::SetFilterIndex(PRInt32 aFilterIndex)
|
||||
{
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
#include "nsAutoPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
|
||||
class nsMenuX;
|
||||
class nsMenuItemX;
|
||||
class nsChangeObserver;
|
||||
|
@ -56,7 +55,6 @@ class nsIWidget;
|
|||
class nsIContent;
|
||||
class nsIDocument;
|
||||
|
||||
|
||||
// The native menu service for creating native menu bars.
|
||||
class nsNativeMenuServiceX : public nsINativeMenuService
|
||||
{
|
||||
|
@ -65,7 +63,6 @@ public:
|
|||
NS_IMETHOD CreateNativeMenuBar(nsIWidget* aParent, nsIContent* aMenuBarNode);
|
||||
};
|
||||
|
||||
|
||||
// Objective-C class used to allow us to have keyboard commands
|
||||
// look like they are doing something but actually do nothing.
|
||||
// We allow mouse actions to work normally.
|
||||
|
@ -77,7 +74,6 @@ public:
|
|||
- (void)performMenuUserInterfaceEffectsForEvent:(NSEvent*)theEvent;
|
||||
@end
|
||||
|
||||
|
||||
// Objective-C class used as action target for menu items
|
||||
@interface NativeMenuItemTarget : NSObject
|
||||
{
|
||||
|
@ -85,7 +81,6 @@ public:
|
|||
-(IBAction)menuItemHit:(id)sender;
|
||||
@end
|
||||
|
||||
|
||||
// Once instantiated, this object lives until its DOM node or its parent window is destroyed.
|
||||
// Do not hold references to this, they can become invalid any time the DOM node can be destroyed.
|
||||
class nsMenuBarX : public nsMenuObjectX,
|
||||
|
|
|
@ -82,7 +82,6 @@ enum {
|
|||
eCommand_ID_Last = 4
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsNativeMenuServiceX, nsINativeMenuService)
|
||||
|
||||
NS_IMETHODIMP nsNativeMenuServiceX::CreateNativeMenuBar(nsIWidget* aParent, nsIContent* aMenuBarNode)
|
||||
|
@ -96,7 +95,6 @@ NS_IMETHODIMP nsNativeMenuServiceX::CreateNativeMenuBar(nsIWidget* aParent, nsIC
|
|||
return mb->Create(aParent, aMenuBarNode);
|
||||
}
|
||||
|
||||
|
||||
nsMenuBarX::nsMenuBarX()
|
||||
: mParentWindow(nsnull),
|
||||
mCurrentCommandID(eCommand_ID_Last),
|
||||
|
@ -109,7 +107,6 @@ nsMenuBarX::nsMenuBarX()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsMenuBarX::~nsMenuBarX()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -141,7 +138,6 @@ nsMenuBarX::~nsMenuBarX()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuBarX::Create(nsIWidget* aParent, nsIContent* aContent)
|
||||
{
|
||||
if (!aParent || !aContent)
|
||||
|
@ -166,7 +162,6 @@ nsresult nsMenuBarX::Create(nsIWidget* aParent, nsIContent* aContent)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::ConstructNativeMenus()
|
||||
{
|
||||
PRUint32 count = mContent->GetChildCount();
|
||||
|
@ -187,13 +182,11 @@ void nsMenuBarX::ConstructNativeMenus()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
PRUint32 nsMenuBarX::GetMenuCount()
|
||||
{
|
||||
return mMenuArray.Length();
|
||||
}
|
||||
|
||||
|
||||
bool nsMenuBarX::MenuContainsAppMenu()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -204,7 +197,6 @@ bool nsMenuBarX::MenuContainsAppMenu()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuBarX::InsertMenuAtIndex(nsMenuX* aMenu, PRUint32 aIndex)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -239,7 +231,6 @@ nsresult nsMenuBarX::InsertMenuAtIndex(nsMenuX* aMenu, PRUint32 aIndex)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::RemoveMenuAtIndex(PRUint32 aIndex)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -259,7 +250,6 @@ void nsMenuBarX::RemoveMenuAtIndex(PRUint32 aIndex)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::ForceUpdateNativeMenuAt(const nsAString& indexString)
|
||||
{
|
||||
NSString* locationString = [NSString stringWithCharacters:indexString.BeginReading() length:indexString.Length()];
|
||||
|
@ -320,7 +310,6 @@ void nsMenuBarX::ForceUpdateNativeMenuAt(const nsAString& indexString)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Calling this forces a full reload of the menu system, reloading all native
|
||||
// menus and their items.
|
||||
// Without this testing is hard because changes to the DOM affect the native
|
||||
|
@ -335,7 +324,6 @@ void nsMenuBarX::ForceNativeMenuReload()
|
|||
ConstructNativeMenus();
|
||||
}
|
||||
|
||||
|
||||
nsMenuX* nsMenuBarX::GetMenuAt(PRUint32 aIndex)
|
||||
{
|
||||
if (mMenuArray.Length() <= aIndex) {
|
||||
|
@ -345,7 +333,6 @@ nsMenuX* nsMenuBarX::GetMenuAt(PRUint32 aIndex)
|
|||
return mMenuArray[aIndex];
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuBarX::Paint()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -375,7 +362,6 @@ nsresult nsMenuBarX::Paint()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// Hide the item in the menu by setting the 'hidden' attribute. Returns it in |outHiddenNode| so
|
||||
// the caller can hang onto it if they so choose. It is acceptable to pass nsull
|
||||
// for |outHiddenNode| if the caller doesn't care about the hidden node.
|
||||
|
@ -393,7 +379,6 @@ void nsMenuBarX::HideItem(nsIDOMDocument* inDoc, const nsAString & inID, nsICont
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Do what is necessary to conform to the Aqua guidelines for menus.
|
||||
void nsMenuBarX::AquifyMenuBar()
|
||||
{
|
||||
|
@ -426,7 +411,6 @@ void nsMenuBarX::AquifyMenuBar()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// for creating menu items destined for the Application menu
|
||||
NSMenuItem* nsMenuBarX::CreateNativeAppMenuItem(nsMenuX* inMenu, const nsAString& nodeID, SEL action,
|
||||
int tag, NativeMenuItemTarget* target)
|
||||
|
@ -498,7 +482,6 @@ NSMenuItem* nsMenuBarX::CreateNativeAppMenuItem(nsMenuX* inMenu, const nsAString
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
// build the Application menu shared by all menu bars
|
||||
nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
|
||||
{
|
||||
|
@ -652,32 +635,27 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::SetParent(nsIWidget* aParent)
|
||||
{
|
||||
mParentWindow = aParent;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// nsIMutationObserver
|
||||
//
|
||||
|
||||
|
||||
void nsMenuBarX::CharacterDataWillChange(nsIDocument* aDocument,
|
||||
nsIContent* aContent,
|
||||
CharacterDataChangeInfo* aInfo)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::CharacterDataChanged(nsIDocument* aDocument,
|
||||
nsIContent* aContent,
|
||||
CharacterDataChangeInfo* aInfo)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::ContentAppended(nsIDocument* aDocument, nsIContent* aContainer,
|
||||
PRInt32 aNewIndexInContainer)
|
||||
{
|
||||
|
@ -689,14 +667,12 @@ void nsMenuBarX::ContentAppended(nsIDocument* aDocument, nsIContent* aContainer,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::NodeWillBeDestroyed(const nsINode * aNode)
|
||||
{
|
||||
// our menu bar node is being destroyed
|
||||
mDocument = nsnull;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::AttributeWillChange(nsIDocument* aDocument,
|
||||
nsIContent* aContent, PRInt32 aNameSpaceID,
|
||||
nsIAtom* aAttribute, PRInt32 aModType)
|
||||
|
@ -712,7 +688,6 @@ void nsMenuBarX::AttributeChanged(nsIDocument * aDocument, nsIContent * aContent
|
|||
obs->ObserveAttributeChanged(aDocument, aContent, aAttribute);
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::ContentRemoved(nsIDocument * aDocument, nsIContent * aContainer,
|
||||
nsIContent * aChild, PRInt32 aIndexInContainer)
|
||||
{
|
||||
|
@ -738,7 +713,6 @@ void nsMenuBarX::ContentRemoved(nsIDocument * aDocument, nsIContent * aContainer
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::ContentInserted(nsIDocument * aDocument, nsIContent * aContainer,
|
||||
nsIContent * aChild, PRInt32 aIndexInContainer)
|
||||
{
|
||||
|
@ -770,12 +744,10 @@ void nsMenuBarX::ContentInserted(nsIDocument * aDocument, nsIContent * aContaine
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::ParentChainChanged(nsIContent *aContent)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// For change management, we don't use a |nsSupportsHashtable| because we know that the
|
||||
// lifetime of all these items is bounded by the lifetime of the menubar. No need to add
|
||||
// any more strong refs to the picture because the containment hierarchy already uses
|
||||
|
@ -786,21 +758,18 @@ void nsMenuBarX::RegisterForContentChanges(nsIContent *aContent, nsChangeObserve
|
|||
mObserverTable.Put(&key, aMenuObject);
|
||||
}
|
||||
|
||||
|
||||
void nsMenuBarX::UnregisterForContentChanges(nsIContent *aContent)
|
||||
{
|
||||
nsVoidKey key(aContent);
|
||||
mObserverTable.Remove(&key);
|
||||
}
|
||||
|
||||
|
||||
nsChangeObserver* nsMenuBarX::LookupContentChangeObserver(nsIContent* aContent)
|
||||
{
|
||||
nsVoidKey key(aContent);
|
||||
return reinterpret_cast<nsChangeObserver*>(mObserverTable.Get(&key));
|
||||
}
|
||||
|
||||
|
||||
// Given a menu item, creates a unique 4-character command ID and
|
||||
// maps it to the item. Returns the id for use by the client.
|
||||
PRUint32 nsMenuBarX::RegisterForCommand(nsMenuItemX* inMenuItem)
|
||||
|
@ -820,7 +789,6 @@ PRUint32 nsMenuBarX::RegisterForCommand(nsMenuItemX* inMenuItem)
|
|||
return mCurrentCommandID;
|
||||
}
|
||||
|
||||
|
||||
// Removes the mapping between the given 4-character command ID
|
||||
// and its associated menu item.
|
||||
void nsMenuBarX::UnregisterCommand(PRUint32 inCommandID)
|
||||
|
@ -829,21 +797,18 @@ void nsMenuBarX::UnregisterCommand(PRUint32 inCommandID)
|
|||
mObserverTable.Remove(&key);
|
||||
}
|
||||
|
||||
|
||||
nsMenuItemX* nsMenuBarX::GetMenuItemForCommandID(PRUint32 inCommandID)
|
||||
{
|
||||
nsPRUint32Key key(inCommandID);
|
||||
return reinterpret_cast<nsMenuItemX*>(mObserverTable.Get(&key));
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Objective-C class used to allow us to have keyboard commands
|
||||
// look like they are doing something but actually do nothing.
|
||||
// We allow mouse actions to work normally.
|
||||
//
|
||||
|
||||
|
||||
// This tells us whether or not pKE is on the stack from a GeckoNSMenu. If it
|
||||
// is nil, it is not on the stack. The non-nil value is the object that put it
|
||||
// on the stack first.
|
||||
|
@ -876,7 +841,6 @@ static BOOL gActOnSpecialCommands = YES;
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO);
|
||||
}
|
||||
|
||||
|
||||
-(void)actOnKeyEquivalent:(NSEvent *)theEvent
|
||||
{
|
||||
gActOnKeyEquiv = YES;
|
||||
|
@ -884,7 +848,6 @@ static BOOL gActOnSpecialCommands = YES;
|
|||
gActOnKeyEquiv = NO;
|
||||
}
|
||||
|
||||
|
||||
- (void)performMenuUserInterfaceEffectsForEvent:(NSEvent*)theEvent
|
||||
{
|
||||
gActOnSpecialCommands = NO;
|
||||
|
@ -894,12 +857,10 @@ static BOOL gActOnSpecialCommands = YES;
|
|||
|
||||
@end
|
||||
|
||||
|
||||
//
|
||||
// Objective-C class used as action target for menu items
|
||||
//
|
||||
|
||||
|
||||
@implementation NativeMenuItemTarget
|
||||
|
||||
// called when some menu item in this menu gets hit
|
||||
|
|
|
@ -40,11 +40,9 @@
|
|||
* Retrieves and displays icons in native menu items on Mac OS X.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef nsMenuItemIconX_h_
|
||||
#define nsMenuItemIconX_h_
|
||||
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "imgIDecoderObserver.h"
|
||||
|
||||
|
@ -56,7 +54,6 @@ class nsMenuObjectX;
|
|||
#import <Carbon/Carbon.h>
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
|
||||
class nsMenuItemIconX : public imgIDecoderObserver
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
* Retrieves and displays icons in native menu items on Mac OS X.
|
||||
*/
|
||||
|
||||
|
||||
#include "nsMenuItemIconX.h"
|
||||
|
||||
#include "nsObjCExceptions.h"
|
||||
|
@ -73,13 +72,11 @@ static const PRUint32 kIconBitsPerPixel = kIconBitsPerComponent *
|
|||
static const PRUint32 kIconBytesPerRow = kIconWidth * kIconBitsPerPixel / 8;
|
||||
static const PRUint32 kIconBytes = kIconBytesPerRow * kIconHeight;
|
||||
|
||||
|
||||
static void
|
||||
PRAllocCGFree(void* aInfo, const void* aData, size_t aSize) {
|
||||
free((void*)aData);
|
||||
}
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsMenuItemIconX, imgIContainerObserver, imgIDecoderObserver)
|
||||
|
||||
nsMenuItemIconX::nsMenuItemIconX(nsMenuObjectX* aMenuItem,
|
||||
|
@ -94,14 +91,12 @@ nsMenuItemIconX::nsMenuItemIconX(nsMenuObjectX* aMenuItem,
|
|||
// printf("Creating icon for menu item %d, menu %d, native item is %d\n", aMenuItem, aMenu, aNativeMenuItem);
|
||||
}
|
||||
|
||||
|
||||
nsMenuItemIconX::~nsMenuItemIconX()
|
||||
{
|
||||
if (mIconRequest)
|
||||
mIconRequest->CancelAndForgetObserver(NS_BINDING_ABORTED);
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsMenuItemIconX::SetupIcon()
|
||||
{
|
||||
|
@ -128,7 +123,6 @@ nsMenuItemIconX::SetupIcon()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsMenuItemIconX::GetIconURI(nsIURI** aIconURI)
|
||||
{
|
||||
|
@ -208,7 +202,6 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIconURI)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsMenuItemIconX::LoadIcon(nsIURI* aIconURI)
|
||||
{
|
||||
|
@ -266,12 +259,10 @@ nsMenuItemIconX::LoadIcon(nsIURI* aIconURI)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// imgIContainerObserver
|
||||
//
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::FrameChanged(imgIContainer* aContainer,
|
||||
gfxIImageFrame* aFrame,
|
||||
|
@ -280,26 +271,22 @@ nsMenuItemIconX::FrameChanged(imgIContainer* aContainer,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// imgIDecoderObserver
|
||||
//
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStartRequest(imgIRequest* aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStartDecode(imgIRequest* aRequest)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStartContainer(imgIRequest* aRequest,
|
||||
imgIContainer* aContainer)
|
||||
|
@ -307,14 +294,12 @@ nsMenuItemIconX::OnStartContainer(imgIRequest* aRequest,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStartFrame(imgIRequest* aRequest, gfxIImageFrame* aFrame)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnDataAvailable(imgIRequest* aRequest,
|
||||
gfxIImageFrame* aFrame,
|
||||
|
@ -323,7 +308,6 @@ nsMenuItemIconX::OnDataAvailable(imgIRequest* aRequest,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStopFrame(imgIRequest* aRequest,
|
||||
gfxIImageFrame* aFrame)
|
||||
|
@ -456,7 +440,6 @@ nsMenuItemIconX::OnStopFrame(imgIRequest* aRequest,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStopContainer(imgIRequest* aRequest,
|
||||
imgIContainer* aContainer)
|
||||
|
@ -464,7 +447,6 @@ nsMenuItemIconX::OnStopContainer(imgIRequest* aRequest,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStopDecode(imgIRequest* aRequest,
|
||||
nsresult status,
|
||||
|
@ -473,7 +455,6 @@ nsMenuItemIconX::OnStopDecode(imgIRequest* aRequest,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsMenuItemIconX::OnStopRequest(imgIRequest* aRequest,
|
||||
PRBool aIsLastPart)
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
|
||||
nsMenuItemX::nsMenuItemX()
|
||||
{
|
||||
mType = eRegularMenuItemType;
|
||||
|
@ -69,7 +68,6 @@ nsMenuItemX::nsMenuItemX()
|
|||
MOZ_COUNT_CTOR(nsMenuItemX);
|
||||
}
|
||||
|
||||
|
||||
nsMenuItemX::~nsMenuItemX()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -88,7 +86,6 @@ nsMenuItemX::~nsMenuItemX()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItemType aItemType,
|
||||
nsMenuBarX* aMenuBar, nsIContent* aNode)
|
||||
{
|
||||
|
@ -175,7 +172,6 @@ nsresult nsMenuItemX::Create(nsMenuX* aParent, const nsString& aLabel, EMenuItem
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuItemX::SetChecked(PRBool aIsChecked)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -198,13 +194,11 @@ nsresult nsMenuItemX::SetChecked(PRBool aIsChecked)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
EMenuItemType nsMenuItemX::GetMenuItemType()
|
||||
{
|
||||
return mType;
|
||||
}
|
||||
|
||||
|
||||
// Executes the "cached" javaScript command.
|
||||
// Returns NS_OK if the command was executed properly, otherwise an error code.
|
||||
void nsMenuItemX::DoCommand()
|
||||
|
@ -220,7 +214,6 @@ void nsMenuItemX::DoCommand()
|
|||
|
||||
nsMenuUtilsX::DispatchCommandTo(mContent);
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuItemX::DispatchDOMEvent(const nsString &eventName, PRBool *preventDefaultCalled)
|
||||
{
|
||||
|
@ -265,7 +258,6 @@ nsresult nsMenuItemX::DispatchDOMEvent(const nsString &eventName, PRBool *preven
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Walk the sibling list looking for nodes with the same name and
|
||||
// uncheck them all.
|
||||
void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent)
|
||||
|
@ -294,7 +286,6 @@ void nsMenuItemX::UncheckRadioSiblings(nsIContent* inCheckedContent)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void nsMenuItemX::SetKeyEquiv(PRUint8 aModifiers, const nsString &aText)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -312,12 +303,10 @@ void nsMenuItemX::SetKeyEquiv(PRUint8 aModifiers, const nsString &aText)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// nsChangeObserver
|
||||
//
|
||||
|
||||
|
||||
void
|
||||
nsMenuItemX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent, nsIAtom *aAttribute)
|
||||
{
|
||||
|
@ -379,7 +368,6 @@ nsMenuItemX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConten
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuItemX::ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild, PRInt32 aIndexInContainer)
|
||||
{
|
||||
if (aChild == mCommandContent) {
|
||||
|
@ -390,13 +378,11 @@ void nsMenuItemX::ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChi
|
|||
mMenuParent->SetRebuild(PR_TRUE);
|
||||
}
|
||||
|
||||
|
||||
void nsMenuItemX::ObserveContentInserted(nsIDocument *aDocument, nsIContent *aChild, PRInt32 aIndexInContainer)
|
||||
{
|
||||
mMenuParent->SetRebuild(PR_TRUE);
|
||||
}
|
||||
|
||||
|
||||
void nsMenuItemX::SetupIcon()
|
||||
{
|
||||
if (mIcon)
|
||||
|
|
|
@ -81,7 +81,6 @@ void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NSString* nsMenuUtilsX::GetTruncatedCocoaLabel(const nsString& itemLabel)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
@ -104,7 +103,6 @@ NSString* nsMenuUtilsX::GetTruncatedCocoaLabel(const nsString& itemLabel)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
PRUint8 nsMenuUtilsX::GeckoModifiersForNodeAttribute(const nsString& modifiersAttribute)
|
||||
{
|
||||
PRUint8 modifiers = knsMenuItemNoModifier;
|
||||
|
@ -129,7 +127,6 @@ PRUint8 nsMenuUtilsX::GeckoModifiersForNodeAttribute(const nsString& modifiersAt
|
|||
return modifiers;
|
||||
}
|
||||
|
||||
|
||||
unsigned int nsMenuUtilsX::MacModifiersForGeckoModifiers(PRUint8 geckoModifiers)
|
||||
{
|
||||
unsigned int macModifiers = 0;
|
||||
|
@ -146,7 +143,6 @@ unsigned int nsMenuUtilsX::MacModifiersForGeckoModifiers(PRUint8 geckoModifiers)
|
|||
return macModifiers;
|
||||
}
|
||||
|
||||
|
||||
nsMenuBarX* nsMenuUtilsX::GetHiddenWindowMenuBar()
|
||||
{
|
||||
nsIWidget* hiddenWindowWidgetNoCOMPtr = nsCocoaUtils::GetHiddenWindowWidget();
|
||||
|
@ -156,7 +152,6 @@ nsMenuBarX* nsMenuUtilsX::GetHiddenWindowMenuBar()
|
|||
return nsnull;
|
||||
}
|
||||
|
||||
|
||||
// It would be nice if we could localize these edit menu names.
|
||||
NSMenuItem* nsMenuUtilsX::GetStandardEditMenuItem()
|
||||
{
|
||||
|
@ -216,7 +211,6 @@ NSMenuItem* nsMenuUtilsX::GetStandardEditMenuItem()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsMenuUtilsX::NodeIsHiddenOrCollapsed(nsIContent* inContent)
|
||||
{
|
||||
return (inContent->AttrValueIs(kNameSpaceID_None, nsWidgetAtoms::hidden,
|
||||
|
@ -225,7 +219,6 @@ PRBool nsMenuUtilsX::NodeIsHiddenOrCollapsed(nsIContent* inContent)
|
|||
nsWidgetAtoms::_true, eCaseMatters));
|
||||
}
|
||||
|
||||
|
||||
// Determines how many items are visible among the siblings in a menu that are
|
||||
// before the given child. This will not count the application menu.
|
||||
int nsMenuUtilsX::CalculateNativeInsertionPoint(nsMenuObjectX* aParent,
|
||||
|
|
|
@ -53,7 +53,6 @@ class nsMenuItemIconX;
|
|||
class nsMenuItemX;
|
||||
class nsIWidget;
|
||||
|
||||
|
||||
// MenuDelegate is used to receive Cocoa notifications for
|
||||
// setting up carbon events
|
||||
@interface MenuDelegate : NSObject
|
||||
|
@ -65,7 +64,6 @@ class nsIWidget;
|
|||
- (id)initWithGeckoMenu:(nsMenuX*)geckoMenu;
|
||||
@end
|
||||
|
||||
|
||||
// Once instantiated, this object lives until its DOM node or its parent window is destroyed.
|
||||
// Do not hold references to this, they can become invalid any time the DOM node can be destroyed.
|
||||
class nsMenuX : public nsMenuObjectX,
|
||||
|
|
|
@ -79,7 +79,6 @@ static PRBool gMenuMethodsSwizzled = PR_FALSE;
|
|||
|
||||
PRInt32 nsMenuX::sIndexingMenuLevel = 0;
|
||||
|
||||
|
||||
nsMenuX::nsMenuX()
|
||||
: mVisibleItemsCount(0), mParent(nsnull), mMenuBar(nsnull),
|
||||
mNativeMenu(nil), mNativeMenuItem(nil), mIsEnabled(PR_TRUE),
|
||||
|
@ -114,7 +113,6 @@ nsMenuX::nsMenuX()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsMenuX::~nsMenuX()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -137,7 +135,6 @@ nsMenuX::~nsMenuX()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuX::Create(nsMenuObjectX* aParent, nsMenuBarX* aMenuBar, nsIContent* aNode)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -182,7 +179,6 @@ nsresult nsMenuX::Create(nsMenuObjectX* aParent, nsMenuBarX* aMenuBar, nsIConten
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuX::AddMenuItem(nsMenuItemX* aMenuItem)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -212,7 +208,6 @@ nsresult nsMenuX::AddMenuItem(nsMenuItemX* aMenuItem)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuX::AddMenu(nsMenuX* aMenu)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -239,14 +234,12 @@ nsresult nsMenuX::AddMenu(nsMenuX* aMenu)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// Includes all items, including hidden/collapsed ones
|
||||
PRUint32 nsMenuX::GetItemCount()
|
||||
{
|
||||
return mMenuObjectsArray.Length();
|
||||
}
|
||||
|
||||
|
||||
// Includes all items, including hidden/collapsed ones
|
||||
nsMenuObjectX* nsMenuX::GetItemAt(PRUint32 aPos)
|
||||
{
|
||||
|
@ -256,7 +249,6 @@ nsMenuObjectX* nsMenuX::GetItemAt(PRUint32 aPos)
|
|||
return mMenuObjectsArray[aPos];
|
||||
}
|
||||
|
||||
|
||||
// Only includes visible items
|
||||
nsresult nsMenuX::GetVisibleItemCount(PRUint32 &aCount)
|
||||
{
|
||||
|
@ -264,7 +256,6 @@ nsresult nsMenuX::GetVisibleItemCount(PRUint32 &aCount)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Only includes visible items. Note that this is provides O(N) access
|
||||
// If you need to iterate or search, consider using GetItemAt and doing your own filtering
|
||||
nsMenuObjectX* nsMenuX::GetVisibleItemAt(PRUint32 aPos)
|
||||
|
@ -295,7 +286,6 @@ nsMenuObjectX* nsMenuX::GetVisibleItemAt(PRUint32 aPos)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuX::RemoveAll()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -318,7 +308,6 @@ nsresult nsMenuX::RemoveAll()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
nsEventStatus nsMenuX::MenuOpened(const nsMenuEvent & aMenuEvent)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -368,7 +357,6 @@ nsEventStatus nsMenuX::MenuOpened(const nsMenuEvent & aMenuEvent)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsEventStatus_eIgnore);
|
||||
}
|
||||
|
||||
|
||||
void nsMenuX::MenuClosed(const nsMenuEvent & aMenuEvent)
|
||||
{
|
||||
if (mConstructed) {
|
||||
|
@ -387,7 +375,6 @@ void nsMenuX::MenuClosed(const nsMenuEvent & aMenuEvent)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void nsMenuX::MenuConstruct()
|
||||
{
|
||||
mConstructed = false;
|
||||
|
@ -450,14 +437,12 @@ void nsMenuX::MenuConstruct()
|
|||
// printf("Done building, mMenuObjectsArray.Count() = %d \n", mMenuObjectsArray.Count());
|
||||
}
|
||||
|
||||
|
||||
void nsMenuX::SetRebuild(PRBool aNeedsRebuild)
|
||||
{
|
||||
if (!gConstructingMenu)
|
||||
mNeedsRebuild = aNeedsRebuild;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuX::SetEnabled(PRBool aIsEnabled)
|
||||
{
|
||||
if (aIsEnabled != mIsEnabled) {
|
||||
|
@ -468,7 +453,6 @@ nsresult nsMenuX::SetEnabled(PRBool aIsEnabled)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuX::GetEnabled(PRBool* aIsEnabled)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aIsEnabled);
|
||||
|
@ -476,7 +460,6 @@ nsresult nsMenuX::GetEnabled(PRBool* aIsEnabled)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& menuTitle)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
@ -499,7 +482,6 @@ GeckoNSMenu* nsMenuX::CreateMenuWithGeckoString(nsString& menuTitle)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent)
|
||||
{
|
||||
if (!inMenuItemContent)
|
||||
|
@ -542,7 +524,6 @@ void nsMenuX::LoadMenuItem(nsIContent* inMenuItemContent)
|
|||
menuItem->SetupIcon();
|
||||
}
|
||||
|
||||
|
||||
void nsMenuX::LoadSubMenu(nsIContent* inMenuContent)
|
||||
{
|
||||
nsAutoPtr<nsMenuX> menu(new nsMenuX());
|
||||
|
@ -562,7 +543,6 @@ void nsMenuX::LoadSubMenu(nsIContent* inMenuContent)
|
|||
menu.forget();
|
||||
}
|
||||
|
||||
|
||||
// This menu is about to open. Returns TRUE if we should keep processing the event,
|
||||
// FALSE if the handler wants to stop the opening of the menu.
|
||||
PRBool nsMenuX::OnOpen()
|
||||
|
@ -645,7 +625,6 @@ PRBool nsMenuX::OnOpen()
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsMenuX::OnOpened()
|
||||
{
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
@ -663,7 +642,6 @@ PRBool nsMenuX::OnOpened()
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Returns TRUE if we should keep processing the event, FALSE if the handler
|
||||
// wants to stop the closing of the menu.
|
||||
PRBool nsMenuX::OnClose()
|
||||
|
@ -690,7 +668,6 @@ PRBool nsMenuX::OnClose()
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
PRBool nsMenuX::OnClosed()
|
||||
{
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
|
@ -712,7 +689,6 @@ PRBool nsMenuX::OnClosed()
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Find the |menupopup| child in the |popup| representing this menu. It should be one
|
||||
// of a very few children so we won't be iterating over a bazillion menu items to find
|
||||
// it (so the strcmp won't kill us).
|
||||
|
@ -740,21 +716,17 @@ void nsMenuX::GetMenuPopupContent(nsIContent** aResult)
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
NSMenuItem* nsMenuX::NativeMenuItem()
|
||||
{
|
||||
return mNativeMenuItem;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// nsChangeObserver
|
||||
//
|
||||
|
||||
|
||||
void nsMenuX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aContent,
|
||||
nsIAtom *aAttribute)
|
||||
{
|
||||
|
@ -829,7 +801,6 @@ void nsMenuX::ObserveAttributeChanged(nsIDocument *aDocument, nsIContent *aConte
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void nsMenuX::ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild,
|
||||
PRInt32 aIndexInContainer)
|
||||
{
|
||||
|
@ -840,7 +811,6 @@ void nsMenuX::ObserveContentRemoved(nsIDocument *aDocument, nsIContent *aChild,
|
|||
mMenuBar->UnregisterForContentChanges(aChild);
|
||||
}
|
||||
|
||||
|
||||
void nsMenuX::ObserveContentInserted(nsIDocument *aDocument, nsIContent *aChild,
|
||||
PRInt32 aIndexInContainer)
|
||||
{
|
||||
|
@ -850,7 +820,6 @@ void nsMenuX::ObserveContentInserted(nsIDocument *aDocument, nsIContent *aChild,
|
|||
SetRebuild(PR_TRUE);
|
||||
}
|
||||
|
||||
|
||||
nsresult nsMenuX::SetupIcon()
|
||||
{
|
||||
// In addition to out-of-memory, menus that are children of the menu bar
|
||||
|
@ -861,12 +830,10 @@ nsresult nsMenuX::SetupIcon()
|
|||
return mIcon->SetupIcon();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Carbon event support
|
||||
//
|
||||
|
||||
|
||||
static pascal OSStatus MyMenuEventHandler(EventHandlerCallRef myHandler, EventRef event, void* userData)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -926,7 +893,6 @@ static pascal OSStatus MyMenuEventHandler(EventHandlerCallRef myHandler, EventRe
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(noErr);
|
||||
}
|
||||
|
||||
|
||||
static OSStatus InstallMyMenuEventHandler(MenuRef menuRef, void* userData, EventHandlerRef* outHandler)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -947,15 +913,12 @@ static OSStatus InstallMyMenuEventHandler(MenuRef menuRef, void* userData, Event
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(noErr);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// MenuDelegate Objective-C class, used to set up Carbon events
|
||||
//
|
||||
|
||||
|
||||
@implementation MenuDelegate
|
||||
|
||||
|
||||
- (id)initWithGeckoMenu:(nsMenuX*)geckoMenu
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
@ -980,7 +943,6 @@ static OSStatus InstallMyMenuEventHandler(MenuRef menuRef, void* userData, Event
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// You can get a MenuRef from an NSMenu*, but not until it has been made visible
|
||||
// or added to the main menu bar. Basically, Cocoa is attempting lazy loading,
|
||||
// and that doesn't work for us. We don't need any carbon events until after the
|
||||
|
@ -1004,7 +966,6 @@ static OSStatus InstallMyMenuEventHandler(MenuRef menuRef, void* userData, Event
|
|||
|
||||
@end
|
||||
|
||||
|
||||
// OS X Leopard (at least as of 10.5.2) has an obscure bug triggered by some
|
||||
// behavior that's present in Mozilla.org browsers but not (as best I can
|
||||
// tell) in Apple products like Safari. (It's not yet clear exactly what this
|
||||
|
@ -1119,7 +1080,6 @@ static NSMutableDictionary *gShadowKeyEquivDB = nil;
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@interface NSMenu (MethodSwizzling)
|
||||
+ (void)nsMenuX_NSMenu_addItem:(NSMenuItem *)aItem toTable:(NSMapTable *)aTable;
|
||||
+ (void)nsMenuX_NSMenu_removeItem:(NSMenuItem *)aItem fromTable:(NSMapTable *)aTable;
|
||||
|
|
|
@ -670,7 +670,6 @@ nsNativeThemeCocoa::DrawSearchField(CGContextRef cgContext, const HIRect& inBoxR
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
static const CellRenderSettings pushButtonSettings = {
|
||||
{
|
||||
NSMakeSize(0, 16), // mini
|
||||
|
@ -696,7 +695,6 @@ static const CellRenderSettings pushButtonSettings = {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
// The height at which we start doing square buttons instead of rounded buttons
|
||||
// Rounded buttons look bad if drawn at a height greater than 26, so at that point
|
||||
// we switch over to doing square buttons which looks fine at any size.
|
||||
|
@ -738,7 +736,6 @@ nsNativeThemeCocoa::DrawPushButton(CGContextRef cgContext, const HIRect& inBoxRe
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind,
|
||||
const HIRect& inBoxRect, PRBool inIsDefault, PRBool inDisabled,
|
||||
|
@ -817,7 +814,6 @@ nsNativeThemeCocoa::DrawButton(CGContextRef cgContext, ThemeButtonKind inKind,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
static const CellRenderSettings dropdownSettings = {
|
||||
{
|
||||
NSMakeSize(0, 16), // mini
|
||||
|
@ -843,7 +839,6 @@ static const CellRenderSettings dropdownSettings = {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
static const CellRenderSettings editableMenulistSettings = {
|
||||
{
|
||||
NSMakeSize(0, 15), // mini
|
||||
|
@ -869,7 +864,6 @@ static const CellRenderSettings editableMenulistSettings = {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawDropdown(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||
PRInt32 inState, PRBool aIsEditable, nsIFrame* aFrame)
|
||||
|
@ -889,7 +883,6 @@ nsNativeThemeCocoa::DrawDropdown(CGContextRef cgContext, const HIRect& inBoxRect
|
|||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKind,
|
||||
|
@ -916,7 +909,6 @@ nsNativeThemeCocoa::DrawSpinButtons(CGContextRef cgContext, ThemeButtonKind inKi
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawFrame(CGContextRef cgContext, HIThemeFrameKind inKind,
|
||||
const HIRect& inBoxRect, PRBool inIsDisabled, PRInt32 inState)
|
||||
|
@ -968,7 +960,6 @@ nsNativeThemeCocoa::DrawFrame(CGContextRef cgContext, HIThemeFrameKind inKind,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||
PRBool inIsIndeterminate, PRBool inIsHorizontal,
|
||||
|
@ -998,7 +989,6 @@ nsNativeThemeCocoa::DrawProgress(CGContextRef cgContext, const HIRect& inBoxRect
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawTabPanel(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||
nsIFrame* aFrame)
|
||||
|
@ -1018,7 +1008,6 @@ nsNativeThemeCocoa::DrawTabPanel(CGContextRef cgContext, const HIRect& inBoxRect
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawScale(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||
PRBool inIsDisabled, PRInt32 inState,
|
||||
|
@ -1055,12 +1044,10 @@ nsNativeThemeCocoa::DrawScale(CGContextRef cgContext, const HIRect& inBoxRect,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
#define NATURAL_MINI_TAB_BUTTON_HEIGHT 17
|
||||
#define NATURAL_SMALL_TAB_BUTTON_HEIGHT 20
|
||||
#define NATURAL_REGULAR_TAB_BUTTON_HEIGHT 23
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawTab(CGContextRef cgContext, HIRect inBoxRect,
|
||||
PRInt32 inState, nsIFrame* aFrame)
|
||||
|
@ -1142,7 +1129,6 @@ nsNativeThemeCocoa::DrawTab(CGContextRef cgContext, HIRect inBoxRect,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
static inline UInt8
|
||||
ConvertToPressState(PRInt32 aButtonState, UInt8 aPressState)
|
||||
{
|
||||
|
@ -1150,7 +1136,6 @@ ConvertToPressState(PRInt32 aButtonState, UInt8 aPressState)
|
|||
return ((aButtonState & NS_EVENT_STATE_ACTIVE) && (aButtonState & NS_EVENT_STATE_HOVER)) ? aPressState : 0;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::GetScrollbarPressStates(nsIFrame *aFrame, PRInt32 aButtonStates[])
|
||||
{
|
||||
|
@ -1178,7 +1163,6 @@ nsNativeThemeCocoa::GetScrollbarPressStates(nsIFrame *aFrame, PRInt32 aButtonSta
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Both of the following sets of numbers were derived by loading the testcase in
|
||||
// bmo bug 380185 in Safari and observing its behavior for various heights of scrollbar.
|
||||
// These magic numbers are the minimum sizes we can draw a scrollbar and still
|
||||
|
@ -1261,7 +1245,6 @@ nsNativeThemeCocoa::GetScrollbarDrawInfo(HIThemeTrackDrawInfo& aTdi, nsIFrame *a
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawScrollbar(CGContextRef aCGContext, const HIRect& aBoxRect, nsIFrame *aFrame)
|
||||
{
|
||||
|
@ -1329,7 +1312,6 @@ nsNativeThemeCocoa::DrawScrollbar(CGContextRef aCGContext, const HIRect& aBoxRec
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsIFrame*
|
||||
nsNativeThemeCocoa::GetParentScrollbarFrame(nsIFrame *aFrame)
|
||||
{
|
||||
|
@ -1343,7 +1325,6 @@ nsNativeThemeCocoa::GetParentScrollbarFrame(nsIFrame *aFrame)
|
|||
return scrollbarFrame;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawUnifiedToolbar(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||
nsIFrame *aFrame)
|
||||
|
@ -1391,13 +1372,11 @@ nsNativeThemeCocoa::DrawUnifiedToolbar(CGContextRef cgContext, const HIRect& inB
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
struct GreyGradientInfo {
|
||||
float startGrey;
|
||||
float endGrey;
|
||||
};
|
||||
|
||||
|
||||
static void GreyGradientCallback(void* aInfo, const float* aIn, float* aOut)
|
||||
{
|
||||
GreyGradientInfo* info = static_cast<GreyGradientInfo*>(aInfo);
|
||||
|
@ -1408,7 +1387,6 @@ static void GreyGradientCallback(void* aInfo, const float* aIn, float* aOut)
|
|||
aOut[3] = 1.0f;
|
||||
}
|
||||
|
||||
|
||||
static void DrawGreyGradient(CGContextRef cgContext, const HIRect& rect,
|
||||
float startGrey, float endGrey)
|
||||
{
|
||||
|
@ -1432,7 +1410,6 @@ static void DrawGreyGradient(CGContextRef cgContext, const HIRect& rect,
|
|||
CGShadingRelease(shading);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsNativeThemeCocoa::DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRect,
|
||||
nsIFrame *aFrame)
|
||||
|
@ -1461,7 +1438,6 @@ nsNativeThemeCocoa::DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRec
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType, const nsRect& aRect,
|
||||
|
@ -1882,7 +1858,6 @@ nsNativeThemeCocoa::DrawWidgetBackground(nsIRenderingContext* aContext, nsIFrame
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
nsIntMargin
|
||||
nsNativeThemeCocoa::RTLAwareMargin(const nsIntMargin& aMargin, nsIFrame* aFrame)
|
||||
{
|
||||
|
@ -1892,7 +1867,6 @@ nsNativeThemeCocoa::RTLAwareMargin(const nsIntMargin& aMargin, nsIFrame* aFrame)
|
|||
return aMargin;
|
||||
}
|
||||
|
||||
|
||||
static const nsIntMargin kAquaDropdownBorder(5, 1, 22, 2);
|
||||
static const nsIntMargin kAquaComboboxBorder(4, 3, 20, 3);
|
||||
static const nsIntMargin kAquaSearchfieldBorder(19, 3, 5, 2);
|
||||
|
@ -1997,7 +1971,6 @@ nsNativeThemeCocoa::GetWidgetBorder(nsIDeviceContext* aContext,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// Return PR_FALSE here to indicate that CSS padding values should be used. There is
|
||||
// no reason to make a distinction between padding and border values, just specify
|
||||
// whatever values you want in GetWidgetBorder and only use this to return PR_TRUE
|
||||
|
@ -2023,7 +1996,6 @@ nsNativeThemeCocoa::GetWidgetPadding(nsIDeviceContext* aContext,
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsNativeThemeCocoa::GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType, nsRect* aOverflowRect)
|
||||
|
@ -2057,7 +2029,6 @@ nsNativeThemeCocoa::GetWidgetOverflow(nsIDeviceContext* aContext, nsIFrame* aFra
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeCocoa::GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
|
@ -2266,7 +2237,6 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeCocoa::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
nsIAtom* aAttribute, PRBool* aShouldRepaint)
|
||||
|
@ -2322,7 +2292,6 @@ nsNativeThemeCocoa::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNativeThemeCocoa::ThemeChanged()
|
||||
{
|
||||
|
@ -2331,7 +2300,6 @@ nsNativeThemeCocoa::ThemeChanged()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType)
|
||||
|
@ -2420,7 +2388,6 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsNativeThemeCocoa::WidgetIsContainer(PRUint8 aWidgetType)
|
||||
{
|
||||
|
@ -2436,7 +2403,6 @@ nsNativeThemeCocoa::WidgetIsContainer(PRUint8 aWidgetType)
|
|||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
||||
PRBool
|
||||
nsNativeThemeCocoa::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType)
|
||||
{
|
||||
|
|
|
@ -65,7 +65,6 @@ static const int sLeopardThemeColors[][2] = {
|
|||
{ 0x96, 0xCF } // gradient end
|
||||
};
|
||||
|
||||
|
||||
static int NativeGreyColorAsInt(ColorName name, BOOL isMain)
|
||||
{
|
||||
return sLeopardThemeColors[name][isMain ? 0 : 1];
|
||||
|
|
|
@ -71,4 +71,3 @@ interface nsPIWidgetCocoa : nsISupports
|
|||
readonly attribute boolean isSheet;
|
||||
|
||||
}; // nsPIWidgetCocoa
|
||||
|
||||
|
|
|
@ -45,24 +45,20 @@
|
|||
#include "plbase64.h"
|
||||
#include "prmem.h"
|
||||
|
||||
|
||||
nsPrintOptionsX::nsPrintOptionsX()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
nsPrintOptionsX::~nsPrintOptionsX()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintOptionsX::ShowPrintSetupDialog(nsIPrintSettings *aThePrintSettings)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsPrintOptionsX::GetNativeData(PRInt16 aDataType, void **_retval)
|
||||
{
|
||||
|
@ -72,7 +68,6 @@ nsPrintOptionsX::GetNativeData(PRInt16 aDataType, void **_retval)
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsPrintOptionsX::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName, PRUint32 aFlags)
|
||||
{
|
||||
|
@ -90,7 +85,6 @@ nsPrintOptionsX::ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsPrintOptionsX::_CreatePrintSettings(nsIPrintSettings **_retval)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -110,7 +104,6 @@ nsresult nsPrintOptionsX::_CreatePrintSettings(nsIPrintSettings **_retval)
|
|||
return rv;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsPrintOptionsX::WritePrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName, PRUint32 aFlags)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsPrintSession.h"
|
||||
#include "nsIPrintSessionX.h"
|
||||
|
||||
|
||||
class nsPrintSessionX : public nsPrintSession,
|
||||
public nsIPrintSessionX
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#include "nsPrintSessionX.h"
|
||||
#include "nsObjCExceptions.h"
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsPrintSessionX,
|
||||
nsPrintSession,
|
||||
nsIPrintSessionX)
|
||||
|
@ -48,7 +47,6 @@ nsPrintSessionX::nsPrintSessionX()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
nsPrintSessionX::~nsPrintSessionX()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -61,7 +59,6 @@ nsPrintSessionX::~nsPrintSessionX()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsPrintSessionX::Init()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -79,7 +76,6 @@ nsresult nsPrintSessionX::Init()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSessionX::GetNativeSession(PMPrintSession *aNativeSession)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNativeSession);
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsPrintSettingsImpl.h"
|
||||
#include "nsIPrintSettingsX.h"
|
||||
|
||||
|
||||
class nsPrintSettingsX : public nsPrintSettings,
|
||||
public nsIPrintSettingsX
|
||||
{
|
||||
|
|
|
@ -59,11 +59,9 @@ struct FrozenHandle {
|
|||
char data[0];
|
||||
};
|
||||
|
||||
|
||||
#define PRINTING_PREF_BRANCH "print."
|
||||
#define MAC_OS_X_PAGE_SETUP_PREFNAME "macosx.pagesetup-2"
|
||||
|
||||
|
||||
// Utility class stack-based handle ownership
|
||||
class StHandleOwner
|
||||
{
|
||||
|
@ -101,7 +99,6 @@ protected:
|
|||
Handle mHandle;
|
||||
};
|
||||
|
||||
|
||||
// Utility class for saving, locking, and restoring handle state.
|
||||
// Ok with null handle.
|
||||
class StHandleLocker
|
||||
|
@ -135,7 +132,6 @@ protected:
|
|||
SInt8 mOldHandleState;
|
||||
};
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED1(nsPrintSettingsX, nsPrintSettings, nsIPrintSettingsX)
|
||||
|
||||
nsPrintSettingsX::nsPrintSettingsX() :
|
||||
|
@ -144,7 +140,6 @@ nsPrintSettingsX::nsPrintSettingsX() :
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
nsPrintSettingsX::nsPrintSettingsX(const nsPrintSettingsX& src) :
|
||||
mPageFormat(kPMNoPageFormat),
|
||||
mPrintSettings(kPMNoPrintSettings)
|
||||
|
@ -152,7 +147,6 @@ nsPrintSettingsX::nsPrintSettingsX(const nsPrintSettingsX& src) :
|
|||
*this = src;
|
||||
}
|
||||
|
||||
|
||||
nsPrintSettingsX::~nsPrintSettingsX()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
@ -169,7 +163,6 @@ nsPrintSettingsX::~nsPrintSettingsX()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsPrintSettingsX& nsPrintSettingsX::operator=(const nsPrintSettingsX& rhs)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -223,7 +216,6 @@ nsPrintSettingsX& nsPrintSettingsX::operator=(const nsPrintSettingsX& rhs)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(*this);
|
||||
}
|
||||
|
||||
|
||||
nsresult nsPrintSettingsX::Init()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -251,7 +243,6 @@ nsresult nsPrintSettingsX::Init()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
// Should be called whenever mPageFormat changes.
|
||||
NS_IMETHODIMP nsPrintSettingsX::InitUnwriteableMargin()
|
||||
{
|
||||
|
@ -274,7 +265,6 @@ NS_IMETHODIMP nsPrintSettingsX::InitUnwriteableMargin()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::GetNativePrintSession(PMPrintSession *aNativePrintSession)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aNativePrintSession);
|
||||
|
@ -291,7 +281,6 @@ NS_IMETHODIMP nsPrintSettingsX::GetNativePrintSession(PMPrintSession *aNativePri
|
|||
return printSessionX->GetNativeSession(aNativePrintSession);
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::GetPMPageFormat(PMPageFormat *aPMPageFormat)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPMPageFormat);
|
||||
|
@ -304,7 +293,6 @@ NS_IMETHODIMP nsPrintSettingsX::GetPMPageFormat(PMPageFormat *aPMPageFormat)
|
|||
return (status == noErr) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::SetPMPageFormat(PMPageFormat aPMPageFormat)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -323,7 +311,6 @@ NS_IMETHODIMP nsPrintSettingsX::SetPMPageFormat(PMPageFormat aPMPageFormat)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::GetPMPrintSettings(PMPrintSettings *aPMPrintSettings)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPMPrintSettings);
|
||||
|
@ -335,7 +322,6 @@ NS_IMETHODIMP nsPrintSettingsX::GetPMPrintSettings(PMPrintSettings *aPMPrintSett
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::SetPMPrintSettings(PMPrintSettings aPMPrintSettings)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -353,7 +339,6 @@ NS_IMETHODIMP nsPrintSettingsX::SetPMPrintSettings(PMPrintSettings aPMPrintSetti
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::ReadPageFormatFromPrefs()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -417,7 +402,6 @@ NS_IMETHODIMP nsPrintSettingsX::ReadPageFormatFromPrefs()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::WritePageFormatToPrefs()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
|
||||
|
@ -468,7 +452,6 @@ NS_IMETHODIMP nsPrintSettingsX::WritePageFormatToPrefs()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsPrintSettingsX::_Clone(nsIPrintSettings **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
@ -482,7 +465,6 @@ nsresult nsPrintSettingsX::_Clone(nsIPrintSettings **_retval)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsPrintSettingsX::_Assign(nsIPrintSettings *aPS)
|
||||
{
|
||||
nsPrintSettingsX *printSettingsX = static_cast<nsPrintSettingsX*>(aPS);
|
||||
|
@ -492,7 +474,6 @@ NS_IMETHODIMP nsPrintSettingsX::_Assign(nsIPrintSettings *aPS)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
OSStatus nsPrintSettingsX::CreateDefaultPageFormat(PMPrintSession aSession, PMPageFormat& outFormat)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -514,7 +495,6 @@ OSStatus nsPrintSettingsX::CreateDefaultPageFormat(PMPrintSession aSession, PMPa
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(noErr);
|
||||
}
|
||||
|
||||
|
||||
OSStatus nsPrintSettingsX::CreateDefaultPrintSettings(PMPrintSession aSession, PMPrintSettings& outSettings)
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -551,4 +531,3 @@ NS_IMETHODIMP nsPrintSettingsX::CleanUpAfterCarbonDialog()
|
|||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,9 +42,7 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "nsCOMArray.h"
|
||||
|
||||
#include "nsIScreenManager.h"
|
||||
|
||||
#include "nsScreenCocoa.h"
|
||||
|
||||
class nsScreenManagerCocoa : public nsIScreenManager
|
||||
|
|
|
@ -74,7 +74,6 @@ static io_connect_t gRootPort = MACH_PORT_NULL;
|
|||
// object associated with a given thread...
|
||||
static PRUintn gToolkitTLSIndex = 0;
|
||||
|
||||
|
||||
nsToolkit::nsToolkit()
|
||||
: mInited(false)
|
||||
, mSleepWakeNotificationRLS(nsnull)
|
||||
|
@ -84,7 +83,6 @@ nsToolkit::nsToolkit()
|
|||
{
|
||||
}
|
||||
|
||||
|
||||
nsToolkit::~nsToolkit()
|
||||
{
|
||||
RemoveSleepWakeNotifcations();
|
||||
|
@ -93,10 +91,8 @@ nsToolkit::~nsToolkit()
|
|||
PR_SetThreadPrivate(gToolkitTLSIndex, nsnull);
|
||||
}
|
||||
|
||||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsToolkit, nsIToolkit);
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsToolkit::Init(PRThread * aThread)
|
||||
{
|
||||
|
@ -110,13 +106,11 @@ nsToolkit::Init(PRThread * aThread)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsToolkit* NS_CreateToolkitInstance()
|
||||
{
|
||||
return new nsToolkit();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsToolkit::PostSleepWakeNotification(const char* aNotification)
|
||||
{
|
||||
|
@ -125,7 +119,6 @@ nsToolkit::PostSleepWakeNotification(const char* aNotification)
|
|||
observerService->NotifyObservers(nsnull, aNotification, nsnull);
|
||||
}
|
||||
|
||||
|
||||
// http://developer.apple.com/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/PowerMgmt/chapter_10_section_3.html
|
||||
static void ToolkitSleepWakeCallback(void *refCon, io_service_t service, natural_t messageType, void * messageArgument)
|
||||
{
|
||||
|
@ -157,7 +150,6 @@ static void ToolkitSleepWakeCallback(void *refCon, io_service_t service, natural
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
nsresult
|
||||
nsToolkit::RegisterForSleepWakeNotifcations()
|
||||
{
|
||||
|
@ -183,7 +175,6 @@ nsToolkit::RegisterForSleepWakeNotifcations()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsToolkit::RemoveSleepWakeNotifcations()
|
||||
{
|
||||
|
@ -201,7 +192,6 @@ nsToolkit::RemoveSleepWakeNotifcations()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// We shouldn't do anything here. See RegisterForAllProcessMouseEvents() for
|
||||
// the reason why.
|
||||
static OSStatus EventMonitorHandler(EventHandlerCallRef aCaller, EventRef aEvent, void* aRefcon)
|
||||
|
@ -221,7 +211,6 @@ static NSPoint ConvertCGGlobalToCocoaScreen(CGPoint aPoint)
|
|||
return cocoaPoint;
|
||||
}
|
||||
|
||||
|
||||
// Since our event tap is "listen only", events arrive here a little after
|
||||
// they've already been processed.
|
||||
static CGEventRef EventTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
|
||||
|
@ -254,7 +243,6 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy, CGEventType type, CGEv
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NULL);
|
||||
}
|
||||
|
||||
|
||||
// Cocoa Firefox's use of custom context menus requires that we explicitly
|
||||
// handle mouse events from other processes that the OS handles
|
||||
// "automatically" for native context menus -- mouseMoved events so that
|
||||
|
@ -326,7 +314,6 @@ nsToolkit::RegisterForAllProcessMouseEvents()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsToolkit::UnregisterAllProcessMouseEventHandlers()
|
||||
{
|
||||
|
@ -354,7 +341,6 @@ nsToolkit::UnregisterAllProcessMouseEventHandlers()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
// Return the nsIToolkit for the current thread. If a toolkit does not
|
||||
// yet exist, then one will be created...
|
||||
NS_IMETHODIMP NS_GetCurrentToolkit(nsIToolkit* *aResult)
|
||||
|
@ -395,7 +381,6 @@ NS_IMETHODIMP NS_GetCurrentToolkit(nsIToolkit* *aResult)
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
|
||||
}
|
||||
|
||||
|
||||
long nsToolkit::OSXVersion()
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
@ -414,13 +399,11 @@ long nsToolkit::OSXVersion()
|
|||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
PRBool nsToolkit::OnLeopardOrLater()
|
||||
{
|
||||
return (OSXVersion() >= MAC_OS_X_VERSION_10_5_HEX) ? PR_TRUE : PR_FALSE;
|
||||
}
|
||||
|
||||
|
||||
// An alternative to [NSObject poseAsClass:] that isn't deprecated on OS X
|
||||
// Leopard and is available to 64-bit binaries on Leopard and above. Based on
|
||||
// ideas and code from http://www.cocoadev.com/index.pl?MethodSwizzling.
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
//
|
||||
// WindowDataMap
|
||||
//
|
||||
// In both mozilla and embedding apps, we need to have a place to put
|
||||
|
@ -53,7 +52,6 @@
|
|||
//
|
||||
// So we have a global map of NSWindow -> TopLevelWindowData, and set
|
||||
// up TopLevelWindowData as a notification observer etc.
|
||||
//
|
||||
|
||||
@interface WindowDataMap : NSObject
|
||||
{
|
||||
|
@ -75,14 +73,11 @@
|
|||
|
||||
@end
|
||||
|
||||
|
||||
@class ChildView;
|
||||
|
||||
//
|
||||
// TopLevelWindowData
|
||||
//
|
||||
// Class to hold per-window data, and handle window state changes.
|
||||
//
|
||||
|
||||
@interface TopLevelWindowData : NSObject
|
||||
{
|
||||
|
|
|
@ -147,7 +147,6 @@
|
|||
|
||||
@end
|
||||
|
||||
|
||||
// TopLevelWindowData
|
||||
//
|
||||
// This class holds data about top-level windows. We can't use a window
|
||||
|
|
Загрузка…
Ссылка в новой задаче