2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Josh Aas <josh@mozilla.com>
|
2007-10-29 21:03:42 -07:00
|
|
|
* Colin Barrett <cbarrett@mozilla.com>
|
2007-03-22 10:30:00 -07:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef nsCocoaWindow_h_
|
|
|
|
#define nsCocoaWindow_h_
|
|
|
|
|
|
|
|
#undef DARWIN
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
|
|
|
#include "nsBaseWidget.h"
|
|
|
|
#include "nsPIWidgetCocoa.h"
|
2008-06-28 00:55:30 -07:00
|
|
|
#include "nsAutoPtr.h"
|
2009-08-13 23:35:32 -07:00
|
|
|
#include "nsCocoaUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsCocoaWindow;
|
|
|
|
class nsChildView;
|
2008-06-28 00:55:30 -07:00
|
|
|
class nsMenuBarX;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-03-23 15:30:56 -07:00
|
|
|
typedef struct _nsCocoaWindowList {
|
|
|
|
_nsCocoaWindowList() : prev(NULL), window(NULL) {}
|
|
|
|
struct _nsCocoaWindowList *prev;
|
|
|
|
nsCocoaWindow *window; // Weak
|
|
|
|
} nsCocoaWindowList;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-11-02 11:07:57 -08:00
|
|
|
// NSWindow subclass that is the base class for all of our own window classes.
|
2009-12-11 13:53:22 -08:00
|
|
|
// Among other things, this class handles the storage of those settings that
|
|
|
|
// need to be persisted across window destruction and reconstruction, i.e. when
|
|
|
|
// switching to and from fullscreen mode.
|
2009-11-02 11:07:57 -08:00
|
|
|
// We don't save shadow, transparency mode or background color because it's not
|
|
|
|
// worth the hassle - Gecko will reset them anyway as soon as the window is
|
|
|
|
// resized.
|
|
|
|
@interface BaseWindow : NSWindow
|
|
|
|
{
|
2009-12-11 13:53:22 -08:00
|
|
|
// Data Storage
|
2009-11-02 11:07:57 -08:00
|
|
|
NSMutableDictionary* mState;
|
|
|
|
BOOL mDrawsIntoWindowFrame;
|
|
|
|
NSColor* mActiveTitlebarColor;
|
|
|
|
NSColor* mInactiveTitlebarColor;
|
2009-12-11 13:53:22 -08:00
|
|
|
|
|
|
|
// Shadow
|
|
|
|
BOOL mScheduledShadowInvalidation;
|
2010-08-19 02:35:08 -07:00
|
|
|
|
|
|
|
// DPI cache. Getting the physical screen size (CGDisplayScreenSize)
|
|
|
|
// is ridiculously slow, so we cache it in the toplevel window for all
|
|
|
|
// descendants to use.
|
|
|
|
float mDPI;
|
2009-11-02 11:07:57 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)importState:(NSDictionary*)aState;
|
|
|
|
- (NSMutableDictionary*)exportState;
|
|
|
|
- (void)setDrawsContentsIntoWindowFrame:(BOOL)aState;
|
|
|
|
- (BOOL)drawsContentsIntoWindowFrame;
|
|
|
|
- (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive;
|
|
|
|
- (NSColor*)titlebarColorForActiveWindow:(BOOL)aActive;
|
|
|
|
|
2009-12-11 13:53:22 -08:00
|
|
|
- (void)deferredInvalidateShadow;
|
|
|
|
- (void)invalidateShadow;
|
2010-08-19 02:35:08 -07:00
|
|
|
- (float)getDPI;
|
2009-12-11 13:53:22 -08:00
|
|
|
|
2009-11-02 11:07:57 -08:00
|
|
|
@end
|
|
|
|
|
2007-07-17 13:29:39 -07:00
|
|
|
@interface NSWindow (Undocumented)
|
|
|
|
|
|
|
|
// If a window has been explicitly removed from the "window cache" (to
|
|
|
|
// deactivate it), it's sometimes necessary to "reset" it to reactivate it
|
|
|
|
// (and put it back in the "window cache"). One way to do this, which Apple
|
|
|
|
// often uses, is to set the "window number" to '-1' and then back to its
|
|
|
|
// original value.
|
2009-09-24 21:00:28 -07:00
|
|
|
- (void)_setWindowNumber:(NSInteger)aNumber;
|
2007-07-17 13:29:39 -07:00
|
|
|
|
2007-10-29 21:03:42 -07:00
|
|
|
// If we set the window's stylemask to be textured, the corners on the bottom of
|
|
|
|
// the window are rounded by default. We use this private method to make
|
|
|
|
// the corners square again, a la Safari.
|
|
|
|
- (void)setBottomCornerRounded:(BOOL)rounded;
|
|
|
|
|
2007-07-17 13:29:39 -07:00
|
|
|
@end
|
|
|
|
|
2009-11-02 11:07:57 -08:00
|
|
|
@interface PopupWindow : BaseWindow
|
2007-07-17 13:29:39 -07:00
|
|
|
{
|
|
|
|
@private
|
|
|
|
BOOL mIsContextMenu;
|
|
|
|
}
|
|
|
|
|
2009-08-13 23:35:32 -07:00
|
|
|
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask
|
2007-07-17 13:29:39 -07:00
|
|
|
backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation;
|
|
|
|
- (BOOL)isContextMenu;
|
|
|
|
- (void)setIsContextMenu:(BOOL)flag;
|
2010-07-27 06:38:03 -07:00
|
|
|
- (BOOL)canBecomeMainWindow;
|
2007-07-17 13:29:39 -07:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
2009-11-02 11:07:57 -08:00
|
|
|
@interface BorderlessWindow : BaseWindow
|
2007-10-19 08:47:58 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)canBecomeKeyWindow;
|
|
|
|
- (BOOL)canBecomeMainWindow;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
2010-11-17 13:48:11 -08:00
|
|
|
#if defined( MAC_OS_X_VERSION_10_6 ) && ( MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 )
|
|
|
|
@interface WindowDelegate : NSObject <NSWindowDelegate>
|
|
|
|
#else
|
2007-03-22 10:30:00 -07:00
|
|
|
@interface WindowDelegate : NSObject
|
2010-11-17 13:48:11 -08:00
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2007-04-05 17:26:53 -07:00
|
|
|
nsCocoaWindow* mGeckoWindow; // [WEAK] (we are owned by the window)
|
Bug 178324, refactor focus by moving all focus handling into one place and simplifying it, add many tests, fixes many other bugs too numerous to mention in this small checkin comment, r=josh,smichaud,ere,dbaron,marco,neil,gavin,smaug,sr=smaug (CLOSED TREE)
2009-06-10 11:00:39 -07:00
|
|
|
// Used to avoid duplication when we send NS_ACTIVATE and
|
|
|
|
// NS_DEACTIVATE to Gecko for toplevel widgets. Starts out
|
2008-05-02 03:40:49 -07:00
|
|
|
// PR_FALSE.
|
|
|
|
PRBool mToplevelActiveState;
|
2009-08-13 15:02:54 -07:00
|
|
|
BOOL mHasEverBeenZoomed;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2008-03-26 20:42:57 -07:00
|
|
|
+ (void)paintMenubarForWindow:(NSWindow*)aWindow;
|
2007-03-22 10:30:00 -07:00
|
|
|
- (id)initWithGeckoWindow:(nsCocoaWindow*)geckoWind;
|
|
|
|
- (void)windowDidResize:(NSNotification*)aNotification;
|
2007-08-02 16:01:32 -07:00
|
|
|
- (void)sendFocusEvent:(PRUint32)eventType;
|
2007-03-22 10:30:00 -07:00
|
|
|
- (nsCocoaWindow*)geckoWidget;
|
2008-05-02 03:40:49 -07:00
|
|
|
- (PRBool)toplevelActiveState;
|
|
|
|
- (void)sendToplevelActivateEvents;
|
|
|
|
- (void)sendToplevelDeactivateEvents;
|
2007-03-22 10:30:00 -07:00
|
|
|
@end
|
|
|
|
|
2008-09-16 01:21:06 -07:00
|
|
|
struct UnifiedGradientInfo {
|
|
|
|
float titlebarHeight;
|
|
|
|
float toolbarHeight;
|
|
|
|
BOOL windowIsMain;
|
|
|
|
BOOL drawTitlebar; // NO for toolbar, YES for titlebar
|
|
|
|
};
|
|
|
|
|
2009-10-21 00:05:39 -07:00
|
|
|
@class ToolbarWindow;
|
|
|
|
|
2007-10-29 21:03:42 -07:00
|
|
|
// NSColor subclass that allows us to draw separate colors both in the titlebar
|
|
|
|
// and for background of the window.
|
|
|
|
@interface TitlebarAndBackgroundColor : NSColor
|
|
|
|
{
|
2009-10-21 00:05:39 -07:00
|
|
|
ToolbarWindow *mWindow; // [WEAK] (we are owned by the window)
|
2007-10-29 21:03:42 -07:00
|
|
|
}
|
|
|
|
|
2009-11-02 11:07:57 -08:00
|
|
|
- (id)initWithWindow:(ToolbarWindow*)aWindow;
|
2007-10-29 21:03:42 -07:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
// NSWindow subclass for handling windows with toolbars.
|
2009-11-02 11:07:57 -08:00
|
|
|
@interface ToolbarWindow : BaseWindow
|
2007-05-30 22:07:18 -07:00
|
|
|
{
|
2007-10-29 21:03:42 -07:00
|
|
|
TitlebarAndBackgroundColor *mColor;
|
2008-09-16 01:21:06 -07:00
|
|
|
float mUnifiedToolbarHeight;
|
2010-07-24 02:35:29 -07:00
|
|
|
BOOL mInUnifiedToolbarReset;
|
2009-11-02 11:07:57 -08:00
|
|
|
NSColor *mBackgroundColor;
|
2007-05-30 22:07:18 -07:00
|
|
|
}
|
2009-11-02 11:07:57 -08:00
|
|
|
// Pass nil here to get the default appearance.
|
2008-05-02 04:32:50 -07:00
|
|
|
- (void)setTitlebarColor:(NSColor*)aColor forActiveWindow:(BOOL)aActive;
|
2010-07-24 02:35:29 -07:00
|
|
|
- (void)notifyToolbarAt:(float)aY height:(float)aHeight;
|
2008-09-16 01:21:06 -07:00
|
|
|
- (float)unifiedToolbarHeight;
|
2010-07-24 02:35:29 -07:00
|
|
|
- (float)beginMaybeResetUnifiedToolbar;
|
|
|
|
- (void)endMaybeResetUnifiedToolbar:(float)aOldHeight;
|
2008-09-16 01:21:06 -07:00
|
|
|
- (float)titlebarHeight;
|
2009-10-21 00:05:39 -07:00
|
|
|
- (NSRect)titlebarRect;
|
|
|
|
- (void)setTitlebarNeedsDisplayInRect:(NSRect)aRect sync:(BOOL)aSync;
|
|
|
|
- (void)setTitlebarNeedsDisplayInRect:(NSRect)aRect;
|
|
|
|
- (void)setDrawsContentsIntoWindowFrame:(BOOL)aState;
|
2007-05-30 22:07:18 -07:00
|
|
|
@end
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsCocoaWindow : public nsBaseWidget, public nsPIWidgetCocoa
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
typedef nsBaseWidget Inherited;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
nsCocoaWindow();
|
|
|
|
virtual ~nsCocoaWindow();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_NSPIWIDGETCOCOA
|
|
|
|
|
|
|
|
NS_IMETHOD Create(nsIWidget* aParent,
|
2009-09-23 23:18:10 -07:00
|
|
|
nsNativeWidget aNativeParent,
|
2009-01-14 19:27:09 -08:00
|
|
|
const nsIntRect &aRect,
|
2007-03-22 10:30:00 -07:00
|
|
|
EVENT_CALLBACK aHandleEventFunction,
|
|
|
|
nsIDeviceContext *aContext,
|
|
|
|
nsIAppShell *aAppShell = nsnull,
|
|
|
|
nsIToolkit *aToolkit = nsnull,
|
|
|
|
nsWidgetInitData *aInitData = nsnull);
|
|
|
|
|
|
|
|
NS_IMETHOD Destroy();
|
|
|
|
|
|
|
|
NS_IMETHOD Show(PRBool aState);
|
2008-05-02 04:32:50 -07:00
|
|
|
virtual nsIWidget* GetSheetWindowParent(void);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Enable(PRBool aState);
|
|
|
|
NS_IMETHOD IsEnabled(PRBool *aState);
|
2007-09-19 12:17:06 -07:00
|
|
|
NS_IMETHOD SetModal(PRBool aState);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD IsVisible(PRBool & aState);
|
|
|
|
NS_IMETHOD SetFocus(PRBool aState=PR_FALSE);
|
2009-02-18 16:11:49 -08:00
|
|
|
virtual nsIntPoint WidgetToScreenOffset();
|
2010-07-27 06:38:03 -07:00
|
|
|
virtual nsIntPoint GetClientOffset();
|
|
|
|
virtual nsIntSize ClientToWindowSize(const nsIntSize& aClientSize);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
virtual void* GetNativeData(PRUint32 aDataType) ;
|
|
|
|
|
|
|
|
NS_IMETHOD ConstrainPosition(PRBool aAllowSlop,
|
|
|
|
PRInt32 *aX, PRInt32 *aY);
|
|
|
|
NS_IMETHOD Move(PRInt32 aX, PRInt32 aY);
|
|
|
|
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
|
|
|
|
nsIWidget *aWidget, PRBool aActivate);
|
|
|
|
NS_IMETHOD SetSizeMode(PRInt32 aMode);
|
2009-07-22 01:57:39 -07:00
|
|
|
NS_IMETHOD HideWindowChrome(PRBool aShouldHide);
|
2009-07-22 02:01:37 -07:00
|
|
|
NS_IMETHOD MakeFullScreen(PRBool aFullScreen);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Resize(PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint);
|
|
|
|
NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint);
|
2009-01-14 19:27:09 -08:00
|
|
|
NS_IMETHOD GetScreenBounds(nsIntRect &aRect);
|
2010-07-27 06:38:04 -07:00
|
|
|
void ReportMoveEvent();
|
2007-11-26 16:24:13 -08:00
|
|
|
void ReportSizeEvent(NSRect *overrideRect = nsnull);
|
2009-09-27 14:04:16 -07:00
|
|
|
NS_IMETHOD SetCursor(nsCursor aCursor);
|
|
|
|
NS_IMETHOD SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_IMETHOD SetTitle(const nsAString& aTitle);
|
|
|
|
|
2009-01-14 19:27:09 -08:00
|
|
|
NS_IMETHOD Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD Update();
|
2009-07-21 17:44:55 -07:00
|
|
|
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
|
2010-12-06 20:39:19 -08:00
|
|
|
virtual LayerManager* GetLayerManager(bool* aAllowRetaining = nsnull);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) ;
|
2009-12-22 15:49:33 -08:00
|
|
|
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, nsIMenuRollup * aMenuRollup,
|
|
|
|
PRBool aDoCapture, PRBool aConsumeRollupEvent);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
|
2009-04-21 16:53:52 -07:00
|
|
|
virtual PRBool HasPendingInputEvent();
|
2008-08-12 17:44:14 -07:00
|
|
|
virtual nsTransparencyMode GetTransparencyMode();
|
|
|
|
virtual void SetTransparencyMode(nsTransparencyMode aMode);
|
2008-10-14 08:33:40 -07:00
|
|
|
NS_IMETHOD SetWindowShadowStyle(PRInt32 aStyle);
|
2009-08-05 13:49:59 -07:00
|
|
|
virtual void SetShowsToolbarButton(PRBool aShow);
|
2008-05-02 04:32:50 -07:00
|
|
|
NS_IMETHOD SetWindowTitlebarColor(nscolor aColor, PRBool aActive);
|
2009-10-21 00:05:39 -07:00
|
|
|
virtual void SetDrawsInTitlebar(PRBool aState);
|
2009-09-22 19:31:37 -07:00
|
|
|
virtual nsresult SynthesizeNativeMouseEvent(nsIntPoint aPoint,
|
|
|
|
PRUint32 aNativeMessage,
|
|
|
|
PRUint32 aModifierFlags);
|
2007-04-05 17:11:41 -07:00
|
|
|
|
2009-08-13 15:02:54 -07:00
|
|
|
void DispatchSizeModeEvent();
|
2008-09-10 09:57:57 -07:00
|
|
|
|
2007-08-02 11:48:28 -07:00
|
|
|
virtual gfxASurface* GetThebesSurface();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// be notified that a some form of drag event needs to go into Gecko
|
|
|
|
virtual PRBool DragEvent(unsigned int aMessage, Point aMouseGlobal, UInt16 aKeyModifiers);
|
|
|
|
|
2008-03-23 15:30:56 -07:00
|
|
|
PRBool HasModalDescendents() { return mNumModalDescendents > 0; }
|
|
|
|
NSWindow *GetCocoaWindow() { return mWindow; }
|
|
|
|
|
2009-04-08 11:39:58 -07:00
|
|
|
void SetMenuBar(nsMenuBarX* aMenuBar);
|
|
|
|
nsMenuBarX *GetMenuBar();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// nsIKBStateControl interface
|
|
|
|
NS_IMETHOD ResetInputState();
|
2007-12-19 11:40:18 -08:00
|
|
|
|
2007-09-27 09:01:32 -07:00
|
|
|
NS_IMETHOD BeginSecureKeyboardInput();
|
|
|
|
NS_IMETHOD EndSecureKeyboardInput();
|
|
|
|
|
2009-08-13 23:35:32 -07:00
|
|
|
static void UnifiedShading(void* aInfo, const CGFloat* aIn, CGFloat* aOut);
|
2008-10-15 06:01:10 -07:00
|
|
|
|
2010-07-27 06:38:03 -07:00
|
|
|
void SetPopupWindowLevel();
|
|
|
|
|
2010-11-15 13:12:50 -08:00
|
|
|
PRBool IsChildInFailingLeftClickThrough(NSView *aChild);
|
|
|
|
PRBool ShouldFocusPlugin();
|
|
|
|
|
2010-09-18 04:28:50 -07:00
|
|
|
NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent);
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
2009-06-24 08:15:32 -07:00
|
|
|
|
2009-07-22 01:57:39 -07:00
|
|
|
nsresult CreateNativeWindow(const NSRect &aRect,
|
|
|
|
nsBorderStyle aBorderStyle,
|
|
|
|
PRBool aRectIsFrameRect);
|
2009-06-24 08:15:32 -07:00
|
|
|
nsresult CreatePopupContentView(const nsIntRect &aRect,
|
|
|
|
EVENT_CALLBACK aHandleEventFunction,
|
|
|
|
nsIDeviceContext *aContext,
|
|
|
|
nsIAppShell *aAppShell,
|
|
|
|
nsIToolkit *aToolkit);
|
|
|
|
void DestroyNativeWindow();
|
2009-12-30 07:24:08 -08:00
|
|
|
void AdjustWindowShadow();
|
2010-01-13 08:10:25 -08:00
|
|
|
void SetUpWindowFilter();
|
|
|
|
void CleanUpWindowFilter();
|
2009-06-24 08:15:32 -07:00
|
|
|
|
2010-08-20 12:29:02 -07:00
|
|
|
virtual already_AddRefed<nsIWidget>
|
|
|
|
AllocateChildPopupWidget()
|
|
|
|
{
|
|
|
|
static NS_DEFINE_IID(kCPopUpCID, NS_POPUP_CID);
|
|
|
|
nsCOMPtr<nsIWidget> widget = do_CreateInstance(kCPopUpCID);
|
|
|
|
return widget.forget();
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIWidget* mParent; // if we're a popup, this is our parent [WEAK]
|
2009-11-02 11:07:57 -08:00
|
|
|
BaseWindow* mWindow; // our cocoa window [STRONG]
|
2007-03-22 10:30:00 -07:00
|
|
|
WindowDelegate* mDelegate; // our delegate for processing window msgs [STRONG]
|
2008-06-28 00:55:30 -07:00
|
|
|
nsRefPtr<nsMenuBarX> mMenuBar;
|
2007-03-22 10:30:00 -07:00
|
|
|
NSWindow* mSheetWindowParent; // if this is a sheet, this is the NSWindow it's attached to
|
2007-08-24 18:55:28 -07:00
|
|
|
nsChildView* mPopupContentView; // if this is a popup, this is its content widget
|
2009-12-30 07:24:08 -08:00
|
|
|
PRInt32 mShadowStyle;
|
2010-01-13 08:10:25 -08:00
|
|
|
NSUInteger mWindowFilter;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
PRPackedBool mWindowMadeHere; // true if we created the window, false for embedding
|
|
|
|
PRPackedBool mSheetNeedsShow; // if this is a sheet, are we waiting to be shown?
|
2008-02-19 18:30:24 -08:00
|
|
|
// this is used for sibling sheet contention only
|
2009-07-22 02:01:37 -07:00
|
|
|
PRPackedBool mFullScreen;
|
2007-09-19 12:17:06 -07:00
|
|
|
PRPackedBool mModal;
|
2008-03-23 15:30:56 -07:00
|
|
|
|
|
|
|
PRInt32 mNumModalDescendents;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsCocoaWindow_h_
|