diff --git a/accessible/src/base/nsCaretAccessible.cpp b/accessible/src/base/nsCaretAccessible.cpp index 5f7b26f07c98..3aa147e4ddb0 100644 --- a/accessible/src/base/nsCaretAccessible.cpp +++ b/accessible/src/base/nsCaretAccessible.cpp @@ -51,7 +51,8 @@ #include "nsISelection2.h" #include "nsServiceManagerUtils.h" #include "nsIViewManager.h" -#include "nsIWidget.h" + +class nsIWidget; NS_IMPL_ISUPPORTS1(nsCaretAccessible, nsISelectionListener) diff --git a/accessible/src/msaa/nsDocAccessibleWrap.cpp b/accessible/src/msaa/nsDocAccessibleWrap.cpp index a1913263b013..9efd1e0128fa 100644 --- a/accessible/src/msaa/nsDocAccessibleWrap.cpp +++ b/accessible/src/msaa/nsDocAccessibleWrap.cpp @@ -49,7 +49,6 @@ #include "nsIURI.h" #include "nsIViewManager.h" #include "nsIWebNavigation.h" -#include "nsIWidget.h" /* For documentation of the accessibility architecture, * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html diff --git a/accessible/src/msaa/nsTextAccessibleWrap.cpp b/accessible/src/msaa/nsTextAccessibleWrap.cpp index 2da66e36b262..e93004ef6446 100644 --- a/accessible/src/msaa/nsTextAccessibleWrap.cpp +++ b/accessible/src/msaa/nsTextAccessibleWrap.cpp @@ -45,7 +45,6 @@ #include "nsPresContext.h" #include "nsIPresShell.h" #include "nsIRenderingContext.h" -#include "nsIWidget.h" #include "nsIComponentManager.h" // -------------------------------------------------------- @@ -212,9 +211,6 @@ nsresult nsTextAccessibleWrap::GetCharacterExtents(PRInt32 aStartOffset, PRInt32 nsIFrame *frame = GetFrame(); NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE); - nsIWidget *widget = frame->GetWindow(); - NS_ENSURE_TRUE(widget, NS_ERROR_FAILURE); - nsPoint startPoint, endPoint; nsIFrame *startFrame = GetPointFromOffset(frame, aStartOffset, PR_TRUE, startPoint); nsIFrame *endFrame = GetPointFromOffset(frame, aEndOffset, PR_FALSE, endPoint); diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp index bc4ebff77883..51cf63ef9273 100644 --- a/content/base/src/nsContentSink.cpp +++ b/content/base/src/nsContentSink.cpp @@ -89,6 +89,7 @@ #include "nsNodeInfoManager.h" #include "nsTimer.h" #include "nsIAppShell.h" +#include "nsIWidget.h" #include "nsWidgetsCID.h" #include "nsIDOMNSDocument.h" #include "nsIRequest.h" diff --git a/content/events/public/nsEventDispatcher.h b/content/events/public/nsEventDispatcher.h index 6647d1a3bc5f..6c5391faa0a5 100644 --- a/content/events/public/nsEventDispatcher.h +++ b/content/events/public/nsEventDispatcher.h @@ -39,11 +39,13 @@ #ifndef nsEventDispatcher_h___ #define nsEventDispatcher_h___ -#include "nsGUIEvent.h" +#include "nsCOMPtr.h" +#include "nsEvent.h" class nsIContent; class nsIDocument; class nsPresContext; +class nsIDOMEvent; class nsPIDOMEventTarget; class nsIScriptGlobalObject; class nsEventTargetChainItem; diff --git a/content/events/src/nsEventStateManager.h b/content/events/src/nsEventStateManager.h index e4e3c2b1d727..35da3b069f8d 100644 --- a/content/events/src/nsEventStateManager.h +++ b/content/events/src/nsEventStateManager.h @@ -40,7 +40,7 @@ #define nsEventStateManager_h__ #include "nsIEventStateManager.h" -#include "nsGUIEvent.h" +#include "nsEvent.h" #include "nsIContent.h" #include "nsIObserver.h" #include "nsWeakReference.h" diff --git a/content/events/src/nsIMEStateManager.h b/content/events/src/nsIMEStateManager.h index 9fec1c2ff2a7..1c80693643fd 100644 --- a/content/events/src/nsIMEStateManager.h +++ b/content/events/src/nsIMEStateManager.h @@ -40,7 +40,6 @@ #define nsIMEStateManager_h__ #include "nscore.h" -#include "nsGUIEvent.h" class nsIContent; class nsPIDOMWindow; diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h index ed9130000927..8cbb7e7dadfb 100644 --- a/docshell/base/nsDocShell.h +++ b/docshell/base/nsDocShell.h @@ -108,6 +108,7 @@ #include "nsIURIClassifier.h" #include "nsIChannelClassifier.h" #include "nsILoadContext.h" +#include "nsIWidget.h" class nsIScrollableView; class nsDocShell; diff --git a/dom/base/nsWindowRoot.cpp b/dom/base/nsWindowRoot.cpp index 3ffdd6b59533..7ca6d5c3d6a2 100644 --- a/dom/base/nsWindowRoot.cpp +++ b/dom/base/nsWindowRoot.cpp @@ -54,6 +54,7 @@ #include "nsString.h" #include "nsEventDispatcher.h" #include "nsIProgrammingLanguage.h" +#include "nsGUIEvent.h" #include "nsCycleCollectionParticipant.h" diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index a16858c83308..5dede6c5a75c 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -128,7 +128,6 @@ #include "nsIFrame.h" #include "nsIView.h" -#include "nsIWidget.h" #include "nsIParserService.h" #include "nsIEventStateManager.h" diff --git a/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp b/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp index d744980e9157..e1b5e6f70b75 100644 --- a/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp +++ b/embedding/components/printingui/src/win/nsPrintDialogUtil.cpp @@ -71,7 +71,6 @@ WIN_LIBS= \ #include "nsString.h" #include "nsIServiceManager.h" #include "nsReadableUtils.h" -#include "nsIWidget.h" #include "nsIPrintSettings.h" #include "nsIPrintSettingsWin.h" #include "nsIPrintOptions.h" diff --git a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp index f8eb9b6fd35c..4f2d6004a83f 100644 --- a/embedding/components/windowwatcher/src/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/src/nsWindowWatcher.cpp @@ -87,6 +87,7 @@ #include "nsIDeviceContext.h" #include "nsIDOMStorage.h" #include "nsPIDOMStorage.h" +#include "nsIWidget.h" #include "nsIPrefBranch.h" #include "nsIPrefService.h" diff --git a/embedding/qa/testembed/BrowserView.cpp b/embedding/qa/testembed/BrowserView.cpp index d0cb82eff95b..efb3353374f1 100644 --- a/embedding/qa/testembed/BrowserView.cpp +++ b/embedding/qa/testembed/BrowserView.cpp @@ -77,9 +77,6 @@ #include "PrintProgressDialog.h" //#include "PrintSetupDialog.h" -// Mozilla Includes -#include "nsIWidget.h" - #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE diff --git a/embedding/qa/testembed/BrowserView.h b/embedding/qa/testembed/BrowserView.h index 9e8d9e6dbd16..76560b7bde06 100644 --- a/embedding/qa/testembed/BrowserView.h +++ b/embedding/qa/testembed/BrowserView.h @@ -105,8 +105,6 @@ public: nsCOMPtr mBaseWindow; nsCOMPtr mWebNav; - typedef void* nsNativeWidget; - //nsCOMPtr mSessionHistory; // de: added in 5/11/01 void UpdateBusyState(PRBool aBusy); diff --git a/gfx/public/nsIDeviceContext.h b/gfx/public/nsIDeviceContext.h index 6ab0973a782d..9be3213a2953 100644 --- a/gfx/public/nsIDeviceContext.h +++ b/gfx/public/nsIDeviceContext.h @@ -42,10 +42,10 @@ #include "nsISupports.h" #include "nsCoord.h" #include "nsRect.h" -#include "nsIWidget.h" #include "nsIRenderingContext.h" // XXX we need only gfxTypes.h, but we cannot include it directly. #include "gfxPoint.h" +#include "nsNativeWidget.h" class nsIView; class nsIFontMetrics; diff --git a/gfx/src/thebes/nsThebesDeviceContext.cpp b/gfx/src/thebes/nsThebesDeviceContext.cpp index 124c40bafb1e..f2b7eec31a37 100644 --- a/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -44,6 +44,7 @@ #include "nsThebesDeviceContext.h" #include "nsThebesRenderingContext.h" +#include "nsIWidget.h" #include "nsIView.h" #include "nsILookAndFeel.h" diff --git a/gfx/tests/coverage/main.cpp b/gfx/tests/coverage/main.cpp index 3daa83821424..cd6f85bb68af 100644 --- a/gfx/tests/coverage/main.cpp +++ b/gfx/tests/coverage/main.cpp @@ -34,7 +34,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "nsIWidget.h" extern nsresult CoverageTest(int * argc, char **argv); diff --git a/layout/base/nsStyleConsts.h b/layout/base/nsStyleConsts.h index c6e656277f1c..fa38abe8c3a7 100644 --- a/layout/base/nsStyleConsts.h +++ b/layout/base/nsStyleConsts.h @@ -42,7 +42,6 @@ #define nsStyleConsts_h___ #include "nsFont.h" -#include "nsIWidget.h" // cairo doesn't support invert // #define GFX_HAS_INVERT diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 1964b9c0bc18..2a22dc375c39 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -54,7 +54,6 @@ #include "nsCSSAnonBoxes.h" #include "nsIImage.h" #include "nsStyleConsts.h" -#include "nsIWidget.h" #include "nsIComponentManager.h" #include "nsIDocument.h" #include "nsButtonFrameRenderer.h" diff --git a/layout/generic/nsFrameFrame.cpp b/layout/generic/nsFrameFrame.cpp index 54f26aab7f1a..ad291a5a84dd 100644 --- a/layout/generic/nsFrameFrame.cpp +++ b/layout/generic/nsFrameFrame.cpp @@ -79,7 +79,6 @@ #include "nsXPIDLString.h" #include "nsIScrollable.h" #include "nsINameSpaceManager.h" -#include "nsIWidget.h" #include "nsWeakReference.h" #include "nsIDOMWindow.h" #include "nsIDOMDocument.h" diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index fed84dd7d9a3..3c2a45451158 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -46,7 +46,6 @@ #include "nsIScrollableFrame.h" #include "nsIScrollPositionListener.h" #include "nsIStatefulFrame.h" -#include "nsGUIEvent.h" #include "nsThreadUtils.h" #include "nsIScrollableView.h" #include "nsIView.h" diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index 0d5ccc862d34..17df23a7961b 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -49,7 +49,6 @@ #include "nsGkAtoms.h" #include "nsLayoutUtils.h" #include "nsCSSAnonBoxes.h" -#include "nsIWidget.h" #include "nsILinkHandler.h" #include "nsGUIEvent.h" #include "nsIDocument.h" diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index b066ec28c261..d7ebd44e1ff3 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -48,7 +48,6 @@ #include "nsIRenderingContext.h" #include "nsIPresShell.h" #include "nsIImage.h" -#include "nsIWidget.h" #include "nsGkAtoms.h" #include "nsIDocument.h" #include "nsINodeInfo.h" diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index baba0ebe527b..9c489ec36f5b 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -44,6 +44,7 @@ #include "nsCSSProps.h" #include "nsCSSKeywords.h" #include "nsStyleConsts.h" +#include "nsIWidget.h" #include "nsThemeConstants.h" // For system widget appearance types #include "nsILookAndFeel.h" // for system colors diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 01638b953a22..16c43b00a5dd 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -52,6 +52,7 @@ #include "nscore.h" #include "nsIServiceManager.h" #include "nsIDeviceContext.h" +#include "nsIWidget.h" #include "nsILookAndFeel.h" #include "nsIPresShell.h" #include "nsIThebesFontMetrics.h" diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 918811abe64f..4e092dcc6570 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -50,6 +50,7 @@ #include "nsString.h" #include "nsPresContext.h" #include "nsIDeviceContext.h" +#include "nsIWidget.h" #include "nsIStyleRule.h" #include "nsCRT.h" diff --git a/layout/xul/base/public/nsXULPopupManager.h b/layout/xul/base/public/nsXULPopupManager.h index 30dca1ffa43f..cf39ccdc7c91 100644 --- a/layout/xul/base/public/nsXULPopupManager.h +++ b/layout/xul/base/public/nsXULPopupManager.h @@ -44,7 +44,6 @@ #include "prlog.h" #include "nsGUIEvent.h" #include "nsIContent.h" -#include "nsIWidget.h" #include "nsIRollupListener.h" #include "nsIMenuRollup.h" #include "nsIDOMKeyListener.h" diff --git a/layout/xul/base/src/nsBox.cpp b/layout/xul/base/src/nsBox.cpp index f23eab955473..c8a0bd545897 100644 --- a/layout/xul/base/src/nsBox.cpp +++ b/layout/xul/base/src/nsBox.cpp @@ -51,7 +51,6 @@ #include "nsIDOMNode.h" #include "nsIDOMNamedNodeMap.h" #include "nsIDOMAttr.h" -#include "nsIWidget.h" #include "nsIRenderingContext.h" #include "nsIDocument.h" #include "nsIDeviceContext.h" diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index 9808e412f082..6c8af8e2bec9 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -87,7 +87,6 @@ #include "nsCSSAnonBoxes.h" #include "nsIScrollableView.h" #include "nsHTMLContainerFrame.h" -#include "nsIWidget.h" #include "nsIEventStateManager.h" #include "nsIDOMDocument.h" #include "nsIDOMElement.h" diff --git a/layout/xul/base/src/nsBoxObject.cpp b/layout/xul/base/src/nsBoxObject.cpp index 8e4d7386d806..88dbce94f640 100644 --- a/layout/xul/base/src/nsBoxObject.cpp +++ b/layout/xul/base/src/nsBoxObject.cpp @@ -48,7 +48,6 @@ #include "nsReadableUtils.h" #include "nsIDOMClassInfo.h" #include "nsIView.h" -#include "nsIWidget.h" #ifdef MOZ_XUL #include "nsIDOMXULElement.h" #else diff --git a/layout/xul/base/src/nsDocElementBoxFrame.cpp b/layout/xul/base/src/nsDocElementBoxFrame.cpp index f2d80a89553a..03de7d6eaced 100644 --- a/layout/xul/base/src/nsDocElementBoxFrame.cpp +++ b/layout/xul/base/src/nsDocElementBoxFrame.cpp @@ -39,7 +39,6 @@ #include "nsCSSRendering.h" #include "nsIDocument.h" #include "nsPresContext.h" -#include "nsIWidget.h" #include "nsPageFrame.h" #include "nsIRenderingContext.h" #include "nsGUIEvent.h" diff --git a/layout/xul/base/src/nsMenuBarFrame.h b/layout/xul/base/src/nsMenuBarFrame.h index d766176914ad..4160e72b838e 100644 --- a/layout/xul/base/src/nsMenuBarFrame.h +++ b/layout/xul/base/src/nsMenuBarFrame.h @@ -52,7 +52,6 @@ #include "nsMenuFrame.h" #include "nsMenuBarListener.h" #include "nsMenuParent.h" -#include "nsIWidget.h" class nsIContent; diff --git a/layout/xul/base/src/nsMenuFrame.cpp b/layout/xul/base/src/nsMenuFrame.cpp index 2427c7c46752..60494f162e22 100644 --- a/layout/xul/base/src/nsMenuFrame.cpp +++ b/layout/xul/base/src/nsMenuFrame.cpp @@ -54,7 +54,6 @@ #include "nsMenuPopupFrame.h" #include "nsMenuBarFrame.h" #include "nsIView.h" -#include "nsIWidget.h" #include "nsIDocument.h" #include "nsIDOMNSDocument.h" #include "nsIDOMDocument.h" diff --git a/layout/xul/base/src/nsMenuPopupFrame.h b/layout/xul/base/src/nsMenuPopupFrame.h index 63f9248411a9..4a0025b3f5b6 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.h +++ b/layout/xul/base/src/nsMenuPopupFrame.h @@ -54,10 +54,11 @@ #include "nsBoxFrame.h" #include "nsMenuParent.h" -#include "nsIWidget.h" #include "nsITimer.h" +class nsIWidget; + // XUL popups can be in several different states. When opening a popup, the // state changes as follows: // ePopupClosed - initial state diff --git a/layout/xul/base/src/nsResizerFrame.cpp b/layout/xul/base/src/nsResizerFrame.cpp index 59aa35eb6aeb..6329b8f24786 100644 --- a/layout/xul/base/src/nsResizerFrame.cpp +++ b/layout/xul/base/src/nsResizerFrame.cpp @@ -45,7 +45,6 @@ #include "nsGkAtoms.h" #include "nsINameSpaceManager.h" -#include "nsIWidget.h" #include "nsPresContext.h" #include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" diff --git a/view/public/nsIView.h b/view/public/nsIView.h index b0e7e5c1bcca..9b6117ca8cff 100644 --- a/view/public/nsIView.h +++ b/view/public/nsIView.h @@ -38,16 +38,19 @@ #ifndef nsIView_h___ #define nsIView_h___ +#include "nsISupports.h" #include "nsCoord.h" #include "nsRect.h" #include "nsPoint.h" -#include "nsIWidget.h" +#include "nsNativeWidget.h" +#include "nsWidgetInitData.h" class nsIViewManager; class nsIScrollableView; class nsViewManager; class nsView; class nsWeakView; +class nsIWidget; // Enumerated type to indicate the visibility of a layer. // hide - the layer is not shown. diff --git a/view/src/nsView.h b/view/src/nsView.h index 4e23dd89119e..8baf66500c5f 100644 --- a/view/src/nsView.h +++ b/view/src/nsView.h @@ -39,7 +39,6 @@ #define nsView_h___ #include "nsIView.h" -#include "nsIWidget.h" #include "nsRegion.h" #include "nsRect.h" #include "nsCRT.h" diff --git a/view/src/nsViewManager.h b/view/src/nsViewManager.h index d252bd1ab045..c34ed20a93a2 100644 --- a/view/src/nsViewManager.h +++ b/view/src/nsViewManager.h @@ -40,7 +40,6 @@ #include "nsCOMPtr.h" #include "nsIViewManager.h" #include "nsCRT.h" -#include "nsIWidget.h" #include "nsITimer.h" #include "prtime.h" #include "prinrval.h" diff --git a/widget/public/Makefile.in b/widget/public/Makefile.in index 377a38daa885..3dfad713dfc8 100644 --- a/widget/public/Makefile.in +++ b/widget/public/Makefile.in @@ -50,6 +50,8 @@ EXPORTS = \ nsIWidget.h \ nsGUIEvent.h \ nsEvent.h \ + nsNativeWidget.h \ + nsWidgetInitData.h \ nsIEventListener.h \ nsWidgetsCID.h \ nsILookAndFeel.h \ diff --git a/widget/public/nsEvent.h b/widget/public/nsEvent.h index 96b19c732384..e960f92c42cd 100644 --- a/widget/public/nsEvent.h +++ b/widget/public/nsEvent.h @@ -57,6 +57,15 @@ enum nsEventStatus { nsEventStatus_eConsumeDoDefault }; +/** + * sizemode is an adjunct to widget size + */ +enum nsSizeMode { + nsSizeMode_Normal = 0, + nsSizeMode_Minimized, + nsSizeMode_Maximized +}; + class nsEvent; class nsGUIEvent; @@ -68,6 +77,7 @@ class nsScrollbarEvent; class nsScrollPortEvent; class nsInputEvent; class nsMouseEvent; +class nsDragEvent; class nsAccessibleEvent; class nsKeyEvent; class nsTextEvent; diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h index 40c5e049e4b3..730417c27dd1 100644 --- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -425,15 +425,6 @@ class nsHashKey; * nsEvent.h. */ -/** - * sizemode is an adjunct to widget size - */ -enum nsSizeMode { - nsSizeMode_Normal = 0, - nsSizeMode_Minimized, - nsSizeMode_Maximized -}; - /** * different types of (top-level) window z-level positioning */ diff --git a/widget/public/nsIEventListener.h b/widget/public/nsIEventListener.h index 059ccd3756db..6a35014ba6b3 100644 --- a/widget/public/nsIEventListener.h +++ b/widget/public/nsIEventListener.h @@ -39,8 +39,7 @@ #define nsIEventListener_h__ #include "nsISupports.h" - -class nsGUIEvent; +#include "nsEvent.h" /** * Event listener interface. diff --git a/widget/public/nsIMenuRollup.h b/widget/public/nsIMenuRollup.h index b20e6a1691ac..b852149e4c31 100644 --- a/widget/public/nsIMenuRollup.h +++ b/widget/public/nsIMenuRollup.h @@ -40,9 +40,10 @@ #define nsIMenuRollup_h___ #include "nsISupports.h" -#include "nsIWidget.h" #include "nsTArray.h" +class nsIWidget; + #define NS_IMENUROLLUP_IID \ {0x2b65d177, 0xc3e4, 0x4564, \ { 0x8d, 0xed, 0x86, 0xd2, 0xfa, 0x2f, 0x65, 0x9a }} diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index 503db2bb950d..fcc15c7f4610 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -47,6 +47,8 @@ #include "nsEvent.h" #include "nsCOMPtr.h" #include "nsITheme.h" +#include "nsNativeWidget.h" +#include "nsWidgetInitData.h" // forward declarations class nsIAppShell; @@ -66,12 +68,14 @@ class nsIContent; /** * Callback function that processes events. + * * The argument is actually a subtype (subclass) of nsEvent which carries - * platform specific information about the event. Platform specific code knows - * how to deal with it. - * The return value determines whether or not the default action should take place. + * platform specific information about the event. Platform specific code + * knows how to deal with it. + * + * The return value determines whether or not the default action should take + * place. */ - typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event); /** @@ -117,70 +121,6 @@ typedef void* nsNativeWidget; #define NS_STYLE_WINDOW_SHADOW_NONE 0 #define NS_STYLE_WINDOW_SHADOW_DEFAULT 1 -/** - * Border styles - */ - -enum nsWindowType { // Don't alter previously encoded enum values - 3rd party apps may look at these - // default top level window - eWindowType_toplevel, - // top level window but usually handled differently by the OS - eWindowType_dialog, - // used for combo boxes, etc - eWindowType_popup, - // child windows (contained inside a window on the desktop (has no border)) - eWindowType_child, - // windows that are invisible or offscreen - eWindowType_invisible, - // plugin window - eWindowType_plugin, - // java plugin window - eWindowType_java, - // MacOSX sheet (special dialog class) - eWindowType_sheet -}; - -enum nsPopupType { - ePopupTypePanel, - ePopupTypeMenu, - ePopupTypeTooltip, - ePopupTypeAny = 0xF000 // used only to pass to nsXULPopupManager::GetTopPopup -}; - -enum nsBorderStyle -{ - // no border, titlebar, etc.. opposite of all - eBorderStyle_none = 0, - - // all window decorations - eBorderStyle_all = 1 << 0, - - // enables the border on the window. these are only for decoration and are not resize hadles - eBorderStyle_border = 1 << 1, - - // enables the resize handles for the window. if this is set, border is implied to also be set - eBorderStyle_resizeh = 1 << 2, - - // enables the titlebar for the window - eBorderStyle_title = 1 << 3, - - // enables the window menu button on the title bar. this being on should force the title bar to display - eBorderStyle_menu = 1 << 4, - - // enables the minimize button so the user can minimize the window. - // turned off for tranient windows since they can not be minimized separate from their parent - eBorderStyle_minimize = 1 << 5, - - // enables the maxmize button so the user can maximize the window - eBorderStyle_maximize = 1 << 6, - - // show the close button - eBorderStyle_close = 1 << 7, - - // whatever the OS wants... i.e. don't do anything - eBorderStyle_default = -1 -}; - /** * Cursor types. */ @@ -230,47 +170,12 @@ enum nsCursor { ///(normal cursor, usually rendered as an arrow) eCursorCount }; -enum nsContentType { - eContentTypeInherit = -1, - eContentTypeUI = 0, - eContentTypeContent = 1, - eContentTypeContentFrame = 2 -}; - enum nsTopLevelWidgetZPlacement { // for PlaceBehind() eZPlacementBottom = 0, // bottom of the window stack eZPlacementBelow, // just below another widget eZPlacementTop // top of the window stack }; -/** - * Basic struct for widget initialization data. - * @see Create member function of nsIWidget - */ - -struct nsWidgetInitData { - nsWidgetInitData() - : clipChildren(PR_FALSE), - clipSiblings(PR_FALSE), - mDropShadow(PR_FALSE), - mListenForResizes(PR_FALSE), - mWindowType(eWindowType_child), - mBorderStyle(eBorderStyle_default), - mContentType(eContentTypeInherit), - mUnicode(PR_TRUE), - mPopupHint(ePopupTypePanel) - { - } - - // when painting exclude area occupied by child windows and sibling windows - PRPackedBool clipChildren, clipSiblings, mDropShadow; - PRPackedBool mListenForResizes; - nsWindowType mWindowType; - nsBorderStyle mBorderStyle; - nsContentType mContentType; // Exposed so screen readers know what's UI - PRPackedBool mUnicode; - nsPopupType mPopupHint; -}; /** * The base class for all the widgets. It provides the interface for diff --git a/widget/public/nsNativeWidget.h b/widget/public/nsNativeWidget.h new file mode 100644 index 000000000000..732f6754ca7c --- /dev/null +++ b/widget/public/nsNativeWidget.h @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** 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): + * + * 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 nsNativeWidget_h__ +#define nsNativeWidget_h__ + +// Hide the native window systems real window type so as to avoid +// including native window system types and APIs. This is necessary +// to ensure cross-platform code. +typedef void* nsNativeWidget; + +#endif // nsNativeWidget_h__ diff --git a/widget/public/nsWidgetInitData.h b/widget/public/nsWidgetInitData.h new file mode 100644 index 000000000000..9fa686479e17 --- /dev/null +++ b/widget/public/nsWidgetInitData.h @@ -0,0 +1,144 @@ +/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* ***** 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): + * + * 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 nsWidgetInitData_h__ +#define nsWidgetInitData_h__ + +#include "prtypes.h" + +/** + * Window types + * + * Don't alter previously encoded enum values - 3rd party apps may look at + * these. + */ +enum nsWindowType { + eWindowType_toplevel, // default top level window + eWindowType_dialog, // top level window but usually handled differently + // by the OS + eWindowType_popup, // used for combo boxes, etc + eWindowType_child, // child windows (contained inside a window on the + // desktop (has no border)) + eWindowType_invisible, // windows that are invisible or offscreen + eWindowType_plugin, // plugin window + eWindowType_java, // java plugin window + eWindowType_sheet // MacOSX sheet (special dialog class) +}; + +/** + * Popup types + * + * For eWindowType_popup + */ +enum nsPopupType { + ePopupTypePanel, + ePopupTypeMenu, + ePopupTypeTooltip, + ePopupTypeAny = 0xF000 // used only to pass to + // nsXULPopupManager::GetTopPopup +}; + +/** + * Border styles + */ +enum nsBorderStyle { + eBorderStyle_none = 0, // no border, titlebar, etc.. opposite of + // all + eBorderStyle_all = 1 << 0, // all window decorations + eBorderStyle_border = 1 << 1, // enables the border on the window. these + // are only for decoration and are not + // resize handles + eBorderStyle_resizeh = 1 << 2, // enables the resize handles for the + // window. if this is set, border is + // implied to also be set + eBorderStyle_title = 1 << 3, // enables the titlebar for the window + eBorderStyle_menu = 1 << 4, // enables the window menu button on the + // title bar. this being on should force + // the title bar to display + eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user + // can minimize the window. turned off for + // tranient windows since they can not be + // minimized separate from their parent + eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user + // can maximize the window + eBorderStyle_close = 1 << 7, // show the close button + eBorderStyle_default = -1 // whatever the OS wants... i.e. don't do + // anything +}; + +/** + * Content types + * + * Exposed so screen readers know what's UI + */ +enum nsContentType { + eContentTypeInherit = -1, + eContentTypeUI = 0, + eContentTypeContent = 1, + eContentTypeContentFrame = 2 +}; + +/** + * Basic struct for widget initialization data. + * @see Create member function of nsIWidget + */ + +struct nsWidgetInitData { + nsWidgetInitData() : + mWindowType(eWindowType_child), + mBorderStyle(eBorderStyle_default), + mContentType(eContentTypeInherit), + mPopupHint(ePopupTypePanel), + clipChildren(PR_FALSE), + clipSiblings(PR_FALSE), + mDropShadow(PR_FALSE), + mListenForResizes(PR_FALSE), + mUnicode(PR_TRUE) + { + } + + nsWindowType mWindowType; + nsBorderStyle mBorderStyle; + nsContentType mContentType; // Exposed so screen readers know what's UI + nsPopupType mPopupHint; + // when painting exclude area occupied by child windows and sibling windows + PRPackedBool clipChildren, clipSiblings, mDropShadow; + PRPackedBool mListenForResizes; + PRPackedBool mUnicode; +}; + +#endif // nsWidgetInitData_h__ diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index a30371640a0d..4516b654af32 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -54,7 +54,6 @@ #include "nsIScrollableView.h" #include "nsWeakPtr.h" -#include "nsIWidget.h" #include "nsIAppShell.h" #include "nsIEventListener.h" diff --git a/widget/src/cocoa/nsCocoaUtils.h b/widget/src/cocoa/nsCocoaUtils.h index 66c9b964e123..7b36cf8328b8 100644 --- a/widget/src/cocoa/nsCocoaUtils.h +++ b/widget/src/cocoa/nsCocoaUtils.h @@ -44,9 +44,10 @@ #import #include "nsRect.h" -#include "nsIWidget.h" #include "nsObjCExceptions.h" +class nsIWidget; + // "Borrowed" in part from the QTKit framework's QTKitDefines.h. This is // needed when building on OS X Tiger (10.4.X) or with a 10.4 SDK. It won't // be used when building on Leopard (10.5.X) or higher (or with a 10.5 or diff --git a/widget/src/cocoa/nsDragService.mm b/widget/src/cocoa/nsDragService.mm index ab30466470c2..867002082d18 100644 --- a/widget/src/cocoa/nsDragService.mm +++ b/widget/src/cocoa/nsDragService.mm @@ -50,7 +50,6 @@ #include "nsIDOMNode.h" #include "nsRect.h" #include "nsPoint.h" -#include "nsIWidget.h" #include "nsIImage.h" #include "nsICharsetConverterManager.h" #include "nsIIOService.h" diff --git a/widget/src/cocoa/nsMenuUtilsX.h b/widget/src/cocoa/nsMenuUtilsX.h index 97646e7d57d4..00200820adc6 100644 --- a/widget/src/cocoa/nsMenuUtilsX.h +++ b/widget/src/cocoa/nsMenuUtilsX.h @@ -40,7 +40,7 @@ #define nsMenuUtilsX_h_ #include "nscore.h" -#include "nsGUIEvent.h" +#include "nsEvent.h" #include "nsMenuBaseX.h" #import diff --git a/widget/src/qt/nsFilePicker.cpp b/widget/src/qt/nsFilePicker.cpp index 3b1e9d8d7f05..3f1529baddc5 100644 --- a/widget/src/qt/nsFilePicker.cpp +++ b/widget/src/qt/nsFilePicker.cpp @@ -46,6 +46,7 @@ #include "nsEnumeratorUtils.h" #include "nsNetUtil.h" #include "nsReadableUtils.h" +#include "nsIWidget.h" #include #include diff --git a/widget/src/windows/nsDeviceContextSpecWin.h b/widget/src/windows/nsDeviceContextSpecWin.h index f8ff426f2a2c..ff28210ef426 100644 --- a/widget/src/windows/nsDeviceContextSpecWin.h +++ b/widget/src/windows/nsDeviceContextSpecWin.h @@ -42,10 +42,11 @@ #include "nsIDeviceContextSpec.h" #include "nsIPrintOptions.h" // For nsIPrinterEnumerator #include "nsIPrintSettings.h" -#include "nsIWidget.h" #include "nsISupportsPrimitives.h" #include +class nsIWidget; + class nsDeviceContextSpecWin : public nsIDeviceContextSpec { public: diff --git a/widget/src/windows/nsNativeDragTarget.h b/widget/src/windows/nsNativeDragTarget.h index 90b84c185974..42bdb110bff8 100644 --- a/widget/src/windows/nsNativeDragTarget.h +++ b/widget/src/windows/nsNativeDragTarget.h @@ -37,7 +37,6 @@ #ifndef _nsNativeDragTarget_h_ #define _nsNativeDragTarget_h_ -#include "nsGUIEvent.h" #include "nsCOMPtr.h" #include "nsIDragSession.h" #include diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index 7805b2d57e7a..6a057f84498c 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -49,8 +49,6 @@ #include "nsSwitchToUIThread.h" #include "nsToolkit.h" -#include "nsIWidget.h" - #include "nsIEventListener.h" #include "nsString.h" diff --git a/widget/src/xpwidgets/nsBaseFilePicker.h b/widget/src/xpwidgets/nsBaseFilePicker.h index edaa7646514a..145f95f89934 100644 --- a/widget/src/xpwidgets/nsBaseFilePicker.h +++ b/widget/src/xpwidgets/nsBaseFilePicker.h @@ -41,10 +41,13 @@ #ifndef nsBaseFilePicker_h__ #define nsBaseFilePicker_h__ +#include "nsISupports.h" #include "nsIFilePicker.h" -#include "nsIWidget.h" #include "nsISimpleEnumerator.h" #include "nsArrayEnumerator.h" +#include "nsCOMPtr.h" + +class nsIWidget; #define BASEFILEPICKER_HAS_DISPLAYDIRECTORY 1 diff --git a/widget/src/xpwidgets/nsNativeTheme.cpp b/widget/src/xpwidgets/nsNativeTheme.cpp index 1bd56bc90577..2c4c9336cf00 100644 --- a/widget/src/xpwidgets/nsNativeTheme.cpp +++ b/widget/src/xpwidgets/nsNativeTheme.cpp @@ -37,6 +37,7 @@ * ***** END LICENSE BLOCK ***** */ #include "nsNativeTheme.h" +#include "nsIWidget.h" #include "nsIDocument.h" #include "nsIContent.h" #include "nsIFrame.h" diff --git a/xpfe/appshell/src/nsAppShellService.cpp b/xpfe/appshell/src/nsAppShellService.cpp index c36f21f43a8c..3ffccd687f88 100644 --- a/xpfe/appshell/src/nsAppShellService.cpp +++ b/xpfe/appshell/src/nsAppShellService.cpp @@ -51,7 +51,6 @@ #include "nsIPrefBranch.h" #include "nsIPrefService.h" -#include "nsIWidget.h" #include "nsIWindowMediator.h" #include "nsIWindowWatcher.h" #include "nsPIWindowWatcher.h" diff --git a/xpfe/appshell/src/nsWebShellWindow.h b/xpfe/appshell/src/nsWebShellWindow.h index a12507cafc91..3fccada50c39 100644 --- a/xpfe/appshell/src/nsWebShellWindow.h +++ b/xpfe/appshell/src/nsWebShellWindow.h @@ -38,7 +38,7 @@ #ifndef nsWebShellWindow_h__ #define nsWebShellWindow_h__ -#include "nsGUIEvent.h" +#include "nsEvent.h" #include "nsIWebProgressListener.h" #include "nsITimer.h" diff --git a/xpfe/appshell/src/nsXULWindow.h b/xpfe/appshell/src/nsXULWindow.h index d16b25c33d3a..21b2879add16 100644 --- a/xpfe/appshell/src/nsXULWindow.h +++ b/xpfe/appshell/src/nsXULWindow.h @@ -58,7 +58,6 @@ #include "nsIDOMWindowInternal.h" #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsIWidget.h" #include "nsIXULWindow.h" #include "nsIPrompt.h" #include "nsIAuthPrompt.h"