Backed out changeset 037a5d6b376a

This commit is contained in:
Chris Jones 2010-08-19 19:01:55 -05:00
parent 28e0aa1f45
commit 58435c58ba
5 changed files with 2 additions and 101 deletions

View File

@ -111,8 +111,8 @@ typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event);
#endif
#define NS_IWIDGET_IID \
{ 0xe1dda370, 0xdf16, 0x4c92, \
{ 0x9b, 0x86, 0x4b, 0xd9, 0xcf, 0xff, 0x4e, 0xb1 } }
{ 0x193fcc7a, 0x2456, 0x4625, \
{ 0x85, 0x40, 0x38, 0xed, 0x00, 0x69, 0x93, 0xf5 } }
/*
* Window shadow styles
@ -237,31 +237,6 @@ class nsIWidget : public nsISupports {
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull) = 0;
/**
* Allocate, initialize, and return a widget that is a child of
* |this|. The returned widget (if nonnull) has gone through the
* equivalent of CreateInstance(widgetCID) + Create(...).
*
* |CreateChild()| lets widget backends decide whether to parent
* the new child widget to this, nonnatively parent it, or both.
* This interface exists to support the PuppetWidget backend,
* which is entirely non-native. All other params are the same as
* for |Create()|.
*
* |aForceUseIWidgetParent| forces |CreateChild()| to only use the
* |nsIWidget*| this, not its native widget (if it exists), when
* calling |Create()|. This is a timid hack around poorly
* understood code, and shouldn't be used in new code.
*/
virtual already_AddRefed<nsIWidget>
CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull,
PRBool aForceUseIWidgetParent = PR_FALSE) = 0;
/**
* Attach to a top level widget.
*
@ -1237,8 +1212,6 @@ class nsIWidget : public nsISupports {
PRBool aIsHorizontal,
PRInt32 &aOverriddenDelta) = 0;
protected:
// keep the list of children. We also keep track of our siblings.
// The ownership model is as follows: parent holds a strong ref to

View File

@ -193,13 +193,6 @@ protected:
PRBool DispatchWindowEvent(nsGUIEvent* event);
void HideKids(PRBool state);
virtual already_AddRefed<nsIWidget>
AllocateChildPopupWidget()
{
static NS_DEFINE_IID(kCPopUpCID, NS_POPUP_CID);
nsCOMPtr<nsIWidget> widget = do_CreateInstance(kCPopUpCID);
return widget.forget();
}
nsCOMPtr<nsIWidget> mParent;
nsWindow* mWindowParent;

View File

@ -313,14 +313,6 @@ protected:
void SetUpWindowFilter();
void CleanUpWindowFilter();
virtual already_AddRefed<nsIWidget>
AllocateChildPopupWidget()
{
static NS_DEFINE_IID(kCPopUpCID, NS_POPUP_CID);
nsCOMPtr<nsIWidget> widget = do_CreateInstance(kCPopUpCID);
return widget.forget();
}
nsIWidget* mParent; // if we're a popup, this is our parent [WEAK]
BaseWindow* mWindow; // our cocoa window [STRONG]
WindowDelegate* mDelegate; // our delegate for processing window msgs [STRONG]

View File

@ -246,46 +246,6 @@ NS_IMETHODIMP nsBaseWidget::SetClientData(void* aClientData)
return NS_OK;
}
already_AddRefed<nsIWidget>
nsBaseWidget::CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
nsIToolkit *aToolkit,
nsWidgetInitData *aInitData,
PRBool aForceUseIWidgetParent)
{
nsIWidget* parent = this;
nsNativeWidget nativeParent = nsnull;
if (!aForceUseIWidgetParent) {
// Use only either parent or nativeParent, not both, to match
// existing code. Eventually Create() should be divested of its
// nativeWidget parameter.
nativeParent = parent ? parent->GetNativeData(NS_NATIVE_WIDGET) : nsnull;
parent = nativeParent ? nsnull : parent;
NS_ABORT_IF_FALSE(!parent || !nativeParent, "messed up logic");
}
nsCOMPtr<nsIWidget> widget;
if (aInitData && aInitData->mWindowType == eWindowType_popup) {
widget = AllocateChildPopupWidget();
} else {
static NS_DEFINE_IID(kCChildCID, NS_CHILD_CID);
widget = do_CreateInstance(kCChildCID);
}
if (widget &&
NS_SUCCEEDED(widget->Create(parent, nativeParent, aRect,
aHandleEventFunction,
aContext, aAppShell, aToolkit,
aInitData))) {
return widget.forget();
}
return nsnull;
}
// Attach a view to our widget which we'll send events to.
NS_IMETHODIMP
nsBaseWidget::AttachViewToTopLevel(EVENT_CALLBACK aViewEventFunction,

View File

@ -39,7 +39,6 @@
#include "nsRect.h"
#include "nsIWidget.h"
#include "nsWidgetsCID.h"
#include "nsIToolkit.h"
#include "nsIAppShell.h"
#include "nsILocalFile.h"
@ -152,14 +151,6 @@ public:
NS_IMETHOD OnIMESelectionChange(void) { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD OnDefaultButtonLoaded(const nsIntRect &aButtonRect) { return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD OverrideSystemMouseScrollSpeed(PRInt32 aOriginalDelta, PRBool aIsHorizontal, PRInt32 &aOverriddenDelta);
virtual already_AddRefed<nsIWidget>
CreateChild(const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull,
PRBool aForceUseIWidgetParent = PR_FALSE);
NS_IMETHOD AttachViewToTopLevel(EVENT_CALLBACK aViewEventFunction, nsIDeviceContext *aContext);
virtual ViewWrapper* GetAttachedViewPtr();
NS_IMETHOD SetAttachedViewPtr(ViewWrapper* aViewWrapper);
@ -234,14 +225,6 @@ protected:
// if the new rectangles are different from the old rectangles.
PRBool StoreWindowClipRegion(const nsTArray<nsIntRect>& aRects);
virtual already_AddRefed<nsIWidget>
AllocateChildPopupWidget()
{
static NS_DEFINE_IID(kCPopUpCID, NS_CHILD_CID);
nsCOMPtr<nsIWidget> widget = do_CreateInstance(kCPopUpCID);
return widget.forget();
}
protected:
void* mClientData;
ViewWrapper* mViewWrapperPtr;