Synch with Rod's new nsIWidget changes
git-svn-id: svn://10.0.0.236/trunk@11308 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f189c3d804
commit
478b06a76b
@ -32,9 +32,10 @@
|
||||
NS_DEFINE_IID(kIAppShellIID, NS_IAPPSHELL_IID);
|
||||
NS_IMPL_ISUPPORTS(nsAppShell,kIAppShellIID);
|
||||
|
||||
void nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
|
||||
NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
|
||||
{
|
||||
mDispatchListener = aDispatchListener;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -43,9 +44,10 @@ void nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsAppShell::Create(int* argc, char ** argv)
|
||||
NS_IMETHODIMP nsAppShell::Create(int* argc, char ** argv)
|
||||
{
|
||||
mToolKit = new nsToolkit();
|
||||
mToolKit = new nsToolkit();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -72,10 +74,11 @@ nsresult nsAppShell::Run()
|
||||
// nsAppShell constructor
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsAppShell::Exit()
|
||||
NS_IMETHODIMP nsAppShell::Exit()
|
||||
{
|
||||
if (mMacPump)
|
||||
mMacPump->StopRunning();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@ -53,10 +53,10 @@ class nsAppShell : public nsIAppShell
|
||||
|
||||
// nsIAppShellInterface
|
||||
|
||||
virtual void Create(int* argc, char ** argv);
|
||||
NS_IMETHOD Create(int* argc, char ** argv);
|
||||
virtual nsresult Run();
|
||||
virtual void Exit();
|
||||
virtual void SetDispatchListener(nsDispatchListener* aDispatchListener);
|
||||
NS_IMETHOD Exit();
|
||||
NS_IMETHOD SetDispatchListener(nsDispatchListener* aDispatchListener);
|
||||
|
||||
virtual void* GetNativeData(PRUint32 aDataType);
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ nsresult nsButton::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
}
|
||||
|
||||
|
||||
void nsButton::Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP nsButton::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext */*aContext*/,
|
||||
@ -115,9 +115,10 @@ void nsButton::Create(nsIWidget *aParent,
|
||||
//InitCallbacks("nsButton");
|
||||
InitDeviceContext(mContext, (nsNativeWidget)mWindowPtr);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsButton::Create(nsNativeWidget /*aParent*/,
|
||||
NS_IMETHODIMP nsButton::Create(nsNativeWidget /*aParent*/,
|
||||
const nsRect &/*aRect*/,
|
||||
EVENT_CALLBACK /*aHandleEventFunction*/,
|
||||
nsIDeviceContext */*aContext*/,
|
||||
@ -126,6 +127,7 @@ void nsButton::Create(nsNativeWidget /*aParent*/,
|
||||
nsWidgetInitData */*aInitData*/)
|
||||
{
|
||||
NS_ERROR("This Widget must not use this Create method");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@ -39,14 +39,14 @@ public:
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
void Create(nsNativeWidget aParent,
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
||||
@ -75,7 +75,7 @@ void nsCheckButton::LocalToWindowCoordinate(nsRect& aRect)
|
||||
}
|
||||
|
||||
|
||||
void nsCheckButton::Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP nsCheckButton::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext */*aContext*/,
|
||||
@ -130,9 +130,10 @@ void nsCheckButton::Create(nsIWidget *aParent,
|
||||
//InitCallbacks("nsButton");
|
||||
InitDeviceContext(mContext, (nsNativeWidget)mWindowPtr);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsCheckButton::Create(nsNativeWidget /*aParent*/,
|
||||
NS_IMETHODIMP nsCheckButton::Create(nsNativeWidget /*aParent*/,
|
||||
const nsRect &/*aRect*/,
|
||||
EVENT_CALLBACK /*aHandleEventFunction*/,
|
||||
nsIDeviceContext */*aContext*/,
|
||||
@ -141,6 +142,7 @@ void nsCheckButton::Create(nsNativeWidget /*aParent*/,
|
||||
nsWidgetInitData */*aInitData*/)
|
||||
{
|
||||
NS_ERROR("This Widget must not use this Create method");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@ -40,14 +40,14 @@ public:
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
void Create(nsNativeWidget aParent,
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
||||
@ -37,7 +37,7 @@ nsFileWidget::nsFileWidget()
|
||||
mNumberOfFilters = 0;
|
||||
}
|
||||
|
||||
void nsFileWidget::Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP nsFileWidget::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
@ -47,11 +47,12 @@ void nsFileWidget::Create(nsIWidget *aParent,
|
||||
{
|
||||
nsString title("Open");
|
||||
Create(aParent, title, eMode_load, aContext, aAppShell, aToolkit, aInitData);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsFileWidget:: Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP nsFileWidget:: Create(nsIWidget *aParent,
|
||||
nsString& aTitle,
|
||||
nsMode aMode,
|
||||
nsIDeviceContext *aContext,
|
||||
@ -73,6 +74,7 @@ void nsFileWidget:: Create(nsIWidget *aParent,
|
||||
|
||||
InitToolkit(aToolkit, aParent);
|
||||
InitDeviceContext(aContext, (nsNativeWidget)mWindowPtr);
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
@ -101,7 +103,7 @@ nsresult nsFileWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
|
||||
|
||||
|
||||
void nsFileWidget::Create(nsNativeWidget aParent,
|
||||
NS_IMETHODIMP nsFileWidget::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
@ -109,6 +111,7 @@ void nsFileWidget::Create(nsNativeWidget aParent,
|
||||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -117,10 +120,11 @@ void nsFileWidget::Create(nsNativeWidget aParent,
|
||||
// Ok's the dialog
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsFileWidget::OnOk()
|
||||
NS_IMETHODIMP nsFileWidget::OnOk()
|
||||
{
|
||||
mWasCancelled = PR_FALSE;
|
||||
mIOwnEventLoop = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -128,10 +132,11 @@ void nsFileWidget::OnOk()
|
||||
// Cancel the dialog
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsFileWidget::OnCancel()
|
||||
NS_IMETHODIMP nsFileWidget::OnCancel()
|
||||
{
|
||||
mWasCancelled = PR_TRUE;
|
||||
mIOwnEventLoop = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -200,11 +205,12 @@ void nsFileWidget::GetFilterListArray(nsString& aFilterList)
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[])
|
||||
NS_IMETHODIMP nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[])
|
||||
{
|
||||
mNumberOfFilters = aNumberOfFilters;
|
||||
mTitles = aTitles;
|
||||
mFilters = aFilters;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -213,10 +219,11 @@ void nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitle
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsFileWidget::GetFile(nsString& aFile)
|
||||
NS_IMETHODIMP nsFileWidget::GetFile(nsString& aFile)
|
||||
{
|
||||
aFile.SetLength(0);
|
||||
aFile.Append(mFile);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -225,9 +232,10 @@ void nsFileWidget::GetFile(nsString& aFile)
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsFileWidget::SetDefaultString(nsString& aString)
|
||||
NS_IMETHODIMP nsFileWidget::SetDefaultString(nsString& aString)
|
||||
{
|
||||
mDefault = aString;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ class nsFileWidget : public nsWindow, public nsIFileWidget
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
@ -45,7 +45,7 @@ class nsFileWidget : public nsWindow, public nsIFileWidget
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
|
||||
void Create(nsNativeWidget aParent,
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
@ -55,7 +55,7 @@ class nsFileWidget : public nsWindow, public nsIFileWidget
|
||||
|
||||
// nsIWidget interface
|
||||
|
||||
virtual void Create( nsIWidget *aParent,
|
||||
NS_IMETHOD Create( nsIWidget *aParent,
|
||||
nsString& aTitle,
|
||||
nsMode aMode,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
@ -64,14 +64,14 @@ class nsFileWidget : public nsWindow, public nsIFileWidget
|
||||
void *aInitData = nsnull);
|
||||
|
||||
// nsIFileWidget part
|
||||
virtual PRBool Show();
|
||||
virtual void GetFile(nsString& aFile);
|
||||
virtual void SetDefaultString(nsString& aString);
|
||||
virtual void SetFilterList(PRUint32 aNumberOfFilters,
|
||||
virtual PRBool Show();
|
||||
NS_IMETHOD GetFile(nsString& aFile);
|
||||
NS_IMETHOD SetDefaultString(nsString& aString);
|
||||
NS_IMETHOD SetFilterList(PRUint32 aNumberOfFilters,
|
||||
const nsString aTitles[],
|
||||
const nsString aFilters[]);
|
||||
virtual void OnOk();
|
||||
virtual void OnCancel();
|
||||
NS_IMETHOD OnOk();
|
||||
NS_IMETHOD OnCancel();
|
||||
|
||||
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ void nsRadioButton::LocalToWindowCoordinate(nsRect& aRect)
|
||||
}
|
||||
|
||||
|
||||
void nsRadioButton::Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP nsRadioButton::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext */*aContext*/,
|
||||
@ -144,9 +144,10 @@ void nsRadioButton::Create(nsIWidget *aParent,
|
||||
//InitCallbacks("nsButton");
|
||||
InitDeviceContext(mContext, (nsNativeWidget)mWindowPtr);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsRadioButton::Create(nsNativeWidget /*aParent*/,
|
||||
NS_IMETHODIMP nsRadioButton::Create(nsNativeWidget /*aParent*/,
|
||||
const nsRect &/*aRect*/,
|
||||
EVENT_CALLBACK /*aHandleEventFunction*/,
|
||||
nsIDeviceContext */*aContext*/,
|
||||
@ -155,6 +156,7 @@ void nsRadioButton::Create(nsNativeWidget /*aParent*/,
|
||||
nsWidgetInitData */*aInitData*/)
|
||||
{
|
||||
NS_ERROR("This Widget must not use this Create method");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@ -35,14 +35,14 @@ public:
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
void Create(nsNativeWidget aParent,
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
||||
@ -49,7 +49,7 @@ nsScrollbar::nsScrollbar(PRBool aIsVertical)
|
||||
* @param aInitData --
|
||||
* @return nothing
|
||||
*/
|
||||
void nsScrollbar::Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP nsScrollbar::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
@ -102,7 +102,7 @@ void nsScrollbar::Create(nsIWidget *aParent,
|
||||
//InitCallbacks("nsButton");
|
||||
InitDeviceContext(mContext, (nsNativeWidget)mWindowPtr);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//=================================================================
|
||||
@ -115,7 +115,7 @@ void nsScrollbar::Create(nsIWidget *aParent,
|
||||
* @param aInitData --
|
||||
* @return nothing
|
||||
*/
|
||||
void nsScrollbar::Create(nsNativeWidget aParent,
|
||||
NS_IMETHODIMP nsScrollbar::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
@ -136,6 +136,7 @@ nsRefData *theRefData;
|
||||
Create(theNsWindow, aRect,aHandleEventFunction, aContext, aAppShell, aToolkit, aInitData);
|
||||
|
||||
//NS_ERROR("This Widget must not use this Create method");
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ public:
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHODIMP Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
@ -48,7 +48,7 @@ public:
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
|
||||
void Create(nsNativeWidget aParent,
|
||||
NS_IMETHODIMP Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
||||
@ -68,7 +68,7 @@ nsTextWidget::~nsTextWidget()
|
||||
* @param aInitData --
|
||||
* @return NONE
|
||||
*/
|
||||
void nsTextWidget::Create(nsIWidget *aParent,const nsRect &aRect,EVENT_CALLBACK aHandleEventFunction,
|
||||
NS_IMETHODIMP nsTextWidget::Create(nsIWidget *aParent,const nsRect &aRect,EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,nsIAppShell *aAppShell,nsIToolkit *aToolkit, nsWidgetInitData *aInitData)
|
||||
{
|
||||
LongRect destRect,viewRect;
|
||||
@ -134,7 +134,7 @@ nsWindow *thewindow;
|
||||
|
||||
InitDeviceContext(mContext, (nsNativeWidget)mWindowPtr);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
@ -149,7 +149,7 @@ nsWindow *thewindow;
|
||||
* @param aInitData --
|
||||
* @return NONE
|
||||
*/
|
||||
void nsTextWidget::Create(nsNativeWidget aParent,
|
||||
NS_IMETHODIMP nsTextWidget::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
@ -157,6 +157,7 @@ void nsTextWidget::Create(nsNativeWidget aParent,
|
||||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ public:
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
@ -49,7 +49,7 @@ public:
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
|
||||
void Create(nsNativeWidget aParent,
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user