зеркало из https://github.com/mozilla/pjs.git
Changed all the signatures to NS_IMETHOD and NS_METHOD
This commit is contained in:
Родитель
71f7cb27f3
Коммит
599ae67b33
|
@ -30,9 +30,11 @@ XtAppContext gAppContext;
|
|||
NS_DEFINE_IID(kIAppShellIID, NS_IAPPSHELL_IID);
|
||||
NS_IMPL_ISUPPORTS(nsAppShell,kIAppShellIID);
|
||||
|
||||
void nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
|
||||
{
|
||||
mDispatchListener = aDispatchListener;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -41,12 +43,13 @@ void nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsAppShell::Create(int* argc, char ** argv)
|
||||
NS_METHOD nsAppShell::Create(int* argc, char ** argv)
|
||||
{
|
||||
XtSetLanguageProc(NULL, NULL, NULL);
|
||||
mTopLevel = XtVaAppInitialize(&mAppContext, "nsAppShell", NULL,
|
||||
0, argc, argv, NULL, NULL);
|
||||
gAppContext = mAppContext;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -55,7 +58,7 @@ void nsAppShell::Create(int* argc, char ** argv)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
nsresult nsAppShell::Run()
|
||||
NS_METHOD nsAppShell::Run()
|
||||
{
|
||||
XtRealizeWidget(mTopLevel);
|
||||
|
||||
|
@ -77,9 +80,10 @@ nsresult nsAppShell::Run()
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsAppShell::Exit()
|
||||
NS_METHOD nsAppShell::Exit()
|
||||
{
|
||||
exit(0);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -42,11 +42,11 @@ class nsAppShell : public nsIAppShell
|
|||
|
||||
// nsIAppShellInterface
|
||||
|
||||
virtual void Create(int* argc, char ** argv);
|
||||
virtual nsresult Run();
|
||||
virtual void Exit();
|
||||
NS_IMETHOD Create(int* argc, char ** argv);
|
||||
NS_IMETHOD Run();
|
||||
NS_IMETHOD Exit();
|
||||
|
||||
virtual void SetDispatchListener(nsDispatchListener* aDispatchListener);
|
||||
NS_IMETHOD SetDispatchListener(nsDispatchListener* aDispatchListener);
|
||||
|
||||
virtual void* GetNativeData(PRUint32 aDataType);
|
||||
|
||||
|
|
|
@ -38,12 +38,11 @@ NS_IMPL_RELEASE(nsButton)
|
|||
//-------------------------------------------------------------------------
|
||||
nsButton::nsButton() : nsWindow() , nsIButton()
|
||||
{
|
||||
printf("BUTTON CONSTRUCTED\n");
|
||||
NS_INIT_REFCNT();
|
||||
}
|
||||
|
||||
|
||||
void nsButton::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsButton::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -51,7 +50,6 @@ void nsButton::Create(nsIWidget *aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
printf("BUTTON CREATED\n");
|
||||
aParent->AddChild(this);
|
||||
Widget parentWidget = nsnull;
|
||||
|
||||
|
@ -79,10 +77,11 @@ printf("BUTTON CREATED\n");
|
|||
mEventCallback = aHandleEventFunction;
|
||||
|
||||
InitCallbacks("nsButton");
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
void nsButton::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsButton::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -90,7 +89,7 @@ void nsButton::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
printf("BAD BUTTON CREATE\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -52,7 +52,7 @@ nsCheckButton::~nsCheckButton()
|
|||
// nsCheckButton Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsCheckButton::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsCheckButton::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -113,7 +113,7 @@ void nsCheckButton::Create(nsIWidget *aParent,
|
|||
this);
|
||||
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -121,7 +121,7 @@ void nsCheckButton::Create(nsIWidget *aParent,
|
|||
// nsCheckButton Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsCheckButton::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsCheckButton::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -129,6 +129,7 @@ void nsCheckButton::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -47,14 +47,14 @@ public:
|
|||
|
||||
|
||||
|
||||
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,
|
||||
|
|
|
@ -67,12 +67,13 @@ nsComboBox::~nsComboBox()
|
|||
// Set the foreground color
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::SetForegroundColor(const nscolor &aColor)
|
||||
NS_METHOD nsComboBox::SetForegroundColor(const nscolor &aColor)
|
||||
{
|
||||
nsWindow::SetForegroundColor(aColor);
|
||||
PRUint32 pixel;
|
||||
mContext->ConvertPixel(aColor, pixel);
|
||||
XtVaSetValues(mOptionMenu, XtNforeground, pixel, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -80,12 +81,13 @@ void nsComboBox::SetForegroundColor(const nscolor &aColor)
|
|||
// Set the background color
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::SetBackgroundColor(const nscolor &aColor)
|
||||
NS_METHOD nsComboBox::SetBackgroundColor(const nscolor &aColor)
|
||||
{
|
||||
nsWindow::SetForegroundColor(aColor);
|
||||
PRUint32 pixel;
|
||||
mContext->ConvertPixel(aColor, pixel);
|
||||
XtVaSetValues(mOptionMenu, XtNbackground, pixel, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -94,9 +96,10 @@ void nsComboBox::SetBackgroundColor(const nscolor &aColor)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsComboBox::SetMultipleSelection(PRBool aMultipleSelections)
|
||||
NS_METHOD nsComboBox::SetMultipleSelection(PRBool aMultipleSelections)
|
||||
{
|
||||
mMultiSelect = aMultipleSelections;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -106,7 +109,7 @@ void nsComboBox::SetMultipleSelection(PRBool aMultipleSelections)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsComboBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
||||
NS_METHOD nsComboBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
||||
{
|
||||
NS_ALLOC_STR_BUF(val, aItem, 256);
|
||||
|
||||
|
@ -127,6 +130,7 @@ void nsComboBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
|||
mItems[mNumItems++] = btn;
|
||||
|
||||
NS_FREE_STR_BUF(val);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -218,7 +222,7 @@ PRBool nsComboBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
|
|||
// Gets the selected of selected item
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::GetSelectedItem(nsString& aItem)
|
||||
NS_METHOD nsComboBox::GetSelectedItem(nsString& aItem)
|
||||
{
|
||||
Widget w;
|
||||
XtVaGetValues(mWidget, XmNmenuHistory, &w, NULL);
|
||||
|
@ -228,6 +232,7 @@ void nsComboBox::GetSelectedItem(nsString& aItem)
|
|||
GetItemAt(aItem, i);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -257,7 +262,7 @@ PRInt32 nsComboBox::GetSelectedIndex()
|
|||
// SelectItem
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::SelectItem(PRInt32 aPosition)
|
||||
NS_METHOD nsComboBox::SelectItem(PRInt32 aPosition)
|
||||
{
|
||||
if (!mMultiSelect) {
|
||||
if (aPosition >= 0 && aPosition < mNumItems) {
|
||||
|
@ -267,7 +272,9 @@ void nsComboBox::SelectItem(PRInt32 aPosition)
|
|||
}
|
||||
} else {
|
||||
// this is an error
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -290,9 +297,10 @@ PRInt32 nsComboBox::GetSelectedCount()
|
|||
// GetSelectedIndices
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
||||
NS_METHOD nsComboBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
||||
{
|
||||
// this is an error
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -300,14 +308,16 @@ void nsComboBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
|||
// Deselect
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::Deselect()
|
||||
NS_METHOD nsComboBox::Deselect()
|
||||
{
|
||||
if (!mMultiSelect) {
|
||||
//::SendMessage(mWnd, LB_SETCURSEL, (WPARAM)-1, (LPARAM)0);
|
||||
} else {
|
||||
// this is an error
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -340,7 +350,7 @@ nsresult nsComboBox::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
// nsComboBox Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsComboBox::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -424,6 +434,7 @@ void nsComboBox::Create(nsIWidget *aParent,
|
|||
mEventCallback = aHandleEventFunction;
|
||||
|
||||
//InitCallbacks();
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
|
@ -432,7 +443,7 @@ void nsComboBox::Create(nsIWidget *aParent,
|
|||
// nsComboBox Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsComboBox::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsComboBox::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -440,6 +451,7 @@ void nsComboBox::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -40,17 +40,17 @@ public:
|
|||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
||||
// nsIComboBox interface
|
||||
virtual void AddItemAt(nsString &aItem, PRInt32 aPosition);
|
||||
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition);
|
||||
virtual PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos);
|
||||
virtual PRInt32 GetItemCount();
|
||||
virtual PRBool RemoveItemAt(PRInt32 aPosition);
|
||||
virtual PRBool GetItemAt(nsString& anItem, PRInt32 aPosition);
|
||||
virtual void GetSelectedItem(nsString& aItem);
|
||||
NS_IMETHOD GetSelectedItem(nsString& aItem);
|
||||
virtual PRInt32 GetSelectedIndex();
|
||||
virtual void SelectItem(PRInt32 aPosition);
|
||||
virtual void Deselect() ;
|
||||
NS_IMETHOD SelectItem(PRInt32 aPosition);
|
||||
NS_IMETHOD Deselect() ;
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -58,7 +58,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,
|
||||
|
@ -66,17 +66,17 @@ public:
|
|||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
|
||||
virtual void SetForegroundColor(const nscolor &aColor);
|
||||
virtual void SetBackgroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetForegroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
|
||||
virtual PRBool OnMove(PRInt32 aX, PRInt32 aY);
|
||||
virtual PRBool OnPaint(nsPaintEvent & aEvent);
|
||||
virtual PRBool OnResize(nsSizeEvent &aEvent);
|
||||
|
||||
// nsIComboBox interface
|
||||
void SetMultipleSelection(PRBool aMultipleSelections);
|
||||
NS_IMETHOD SetMultipleSelection(PRBool aMultipleSelections);
|
||||
PRInt32 GetSelectedCount();
|
||||
void GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
|
||||
NS_IMETHOD GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
|
||||
|
||||
protected:
|
||||
Widget mPullDownMenu;
|
||||
|
|
|
@ -42,7 +42,7 @@ nsDialog::nsDialog() : nsWindow(), nsIDialog()
|
|||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsDialog::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsDialog::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -92,10 +92,11 @@ void nsDialog::Create(nsIWidget *aParent,
|
|||
mEventCallback = aHandleEventFunction;
|
||||
|
||||
InitCallbacks("nsDialog");
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
void nsDialog::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsDialog::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -103,6 +104,7 @@ void nsDialog::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERORR_FAILURE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -44,14 +44,14 @@ public:
|
|||
NS_IMETHOD GetLabel(nsString& aBuffer);
|
||||
|
||||
|
||||
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,
|
||||
|
|
|
@ -38,7 +38,7 @@ nsFileWidget::nsFileWidget() : nsWindow(), nsIFileWidget()
|
|||
mNumberOfFilters = 0;
|
||||
}
|
||||
|
||||
void nsFileWidget::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsFileWidget::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -48,11 +48,12 @@ void nsFileWidget::Create(nsIWidget *aParent,
|
|||
{
|
||||
nsString title("Load");
|
||||
Create(aParent, title, eMode_load, aContext, aAppShell, aToolkit, aInitData);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsFileWidget:: Create(nsIWidget *aParent,
|
||||
NS_METHOD nsFileWidget:: Create(nsIWidget *aParent,
|
||||
nsString& aTitle,
|
||||
nsMode aMode,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -90,9 +91,10 @@ void nsFileWidget:: Create(nsIWidget *aParent,
|
|||
XtAddCallback(mWidget, XmNokCallback, nsXtWidget_FSBOk_Callback, this);
|
||||
|
||||
//XtManageChild(mWidget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsFileWidget::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsFileWidget::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -100,6 +102,7 @@ void nsFileWidget::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -129,11 +132,12 @@ nsresult nsFileWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
// Ok's the dialog
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsFileWidget::OnOk()
|
||||
NS_METHOD nsFileWidget::OnOk()
|
||||
{
|
||||
XtUnmanageChild(mWidget);
|
||||
mWasCancelled = PR_FALSE;
|
||||
mIOwnEventLoop = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -141,11 +145,12 @@ void nsFileWidget::OnOk()
|
|||
// Cancel the dialog
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsFileWidget::OnCancel()
|
||||
NS_METHOD nsFileWidget::OnCancel()
|
||||
{
|
||||
XtUnmanageChild(mWidget);
|
||||
mWasCancelled = PR_TRUE;
|
||||
mIOwnEventLoop = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -236,7 +241,7 @@ PRBool nsFileWidget::Show()
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsFileWidget::GetFilterListArray(nsString& aFilterList)
|
||||
NS_METHOD nsFileWidget::GetFilterListArray(nsString& aFilterList)
|
||||
{
|
||||
aFilterList.SetLength(0);
|
||||
for (PRUint32 i = 0; i < mNumberOfFilters; i++) {
|
||||
|
@ -249,6 +254,7 @@ void nsFileWidget::GetFilterListArray(nsString& aFilterList)
|
|||
aFilterList.Append('\0');
|
||||
}
|
||||
aFilterList.Append('\0');
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -257,11 +263,12 @@ void nsFileWidget::GetFilterListArray(nsString& aFilterList)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[])
|
||||
NS_METHOD nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitles[],const nsString aFilters[])
|
||||
{
|
||||
mNumberOfFilters = aNumberOfFilters;
|
||||
mTitles = aTitles;
|
||||
mFilters = aFilters;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -270,10 +277,11 @@ void nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters,const nsString aTitle
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsFileWidget::GetFile(nsString& aFile)
|
||||
NS_METHOD nsFileWidget::GetFile(nsString& aFile)
|
||||
{
|
||||
aFile.SetLength(0);
|
||||
aFile.Append(mFile);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -282,9 +290,10 @@ void nsFileWidget::GetFile(nsString& aFile)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsFileWidget::SetDefaultString(nsString& aString)
|
||||
NS_METHOD nsFileWidget::SetDefaultString(nsString& aString)
|
||||
{
|
||||
mDefault = aString;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class nsFileWidget : public nsWindow, public nsIFileWidget
|
|||
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,
|
||||
|
@ -48,7 +48,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,
|
||||
|
@ -58,7 +58,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,
|
||||
|
@ -68,13 +68,13 @@ class nsFileWidget : public nsWindow, public nsIFileWidget
|
|||
|
||||
// nsIFileWidget part
|
||||
virtual PRBool Show();
|
||||
virtual void GetFile(nsString& aFile);
|
||||
virtual void SetDefaultString(nsString& aString);
|
||||
virtual void SetFilterList(PRUint32 aNumberOfFilters,
|
||||
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();
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ nsLabel::nsLabel() : nsWindow(), nsILabel()
|
|||
}
|
||||
|
||||
|
||||
void nsLabel::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsLabel::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -81,10 +81,10 @@ void nsLabel::Create(nsIWidget *aParent,
|
|||
mEventCallback = aHandleEventFunction;
|
||||
|
||||
InitCallbacks("nsLabel");
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsLabel::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsLabel::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -92,18 +92,20 @@ void nsLabel::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsLabel::PreCreateWidget(nsWidgetInitData *aInitData)
|
||||
NS_METHOD nsLabel::PreCreateWidget(nsWidgetInitData *aInitData)
|
||||
{
|
||||
if (nsnull != aInitData) {
|
||||
nsLabelInitData* data = (nsLabelInitData *) aInitData;
|
||||
mAlignment = data->mAlignment;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -45,16 +45,16 @@ public:
|
|||
NS_IMETHOD GetLabel(nsString &aBuffer);
|
||||
NS_IMETHOD SetAlignment(nsLabelAlignment aAlignment);
|
||||
|
||||
virtual void PreCreateWidget(nsWidgetInitData *aInitData);
|
||||
NS_IMETHOD PreCreateWidget(nsWidgetInitData *aInitData);
|
||||
|
||||
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,
|
||||
|
|
|
@ -82,9 +82,10 @@ nsresult nsListBox::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsListBox::SetMultipleSelection(PRBool aMultipleSelections)
|
||||
NS_METHOD nsListBox::SetMultipleSelection(PRBool aMultipleSelections)
|
||||
{
|
||||
mMultiSelect = aMultipleSelections;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,7 +95,7 @@ void nsListBox::SetMultipleSelection(PRBool aMultipleSelections)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
||||
NS_METHOD nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
||||
{
|
||||
NS_ALLOC_STR_BUF(val, aItem, 256);
|
||||
|
||||
|
@ -104,6 +105,7 @@ void nsListBox::AddItemAt(nsString &aItem, PRInt32 aPosition)
|
|||
|
||||
XmListAddItem(mWidget, str, (int)aPosition+1);
|
||||
NS_FREE_STR_BUF(val);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -187,7 +189,7 @@ PRBool nsListBox::GetItemAt(nsString& anItem, PRInt32 aPosition)
|
|||
// Gets the selected of selected item
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsListBox::GetSelectedItem(nsString& aItem)
|
||||
NS_METHOD nsListBox::GetSelectedItem(nsString& aItem)
|
||||
{
|
||||
int * list;
|
||||
int count;
|
||||
|
@ -196,6 +198,7 @@ void nsListBox::GetSelectedItem(nsString& aItem)
|
|||
GetItemAt(aItem, list[0]-1);
|
||||
XtFree((char *)list);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -228,13 +231,14 @@ PRInt32 nsListBox::GetSelectedIndex()
|
|||
// SelectItem
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsListBox::SelectItem(PRInt32 aPosition)
|
||||
NS_METHOD nsListBox::SelectItem(PRInt32 aPosition)
|
||||
{
|
||||
int count = 0;
|
||||
XtVaGetValues(mWidget, XmNitemCount, &count, nsnull);
|
||||
if (aPosition >= 0 && aPosition < count) {
|
||||
XmListSelectPos(mWidget, aPosition+1, FALSE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -254,7 +258,7 @@ PRInt32 nsListBox::GetSelectedCount()
|
|||
// GetSelectedIndices
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
||||
NS_METHOD nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
||||
{
|
||||
int * list;
|
||||
int count;
|
||||
|
@ -267,6 +271,7 @@ void nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
|||
}
|
||||
XtFree((char *)list);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -274,7 +279,7 @@ void nsListBox::GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
|||
// SetSelectedIndices
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
||||
NS_METHOD nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
||||
{
|
||||
if (GetSelectedCount() > 0) {
|
||||
XtVaSetValues(mWidget, XmNselectedItemCount, 0, NULL);
|
||||
|
@ -283,6 +288,7 @@ void nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
|||
for (i=0;i<aSize;i++) {
|
||||
SelectItem(aIndices[i]);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -290,9 +296,10 @@ void nsListBox::SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize)
|
|||
// Deselect
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsListBox::Deselect()
|
||||
NS_METHOD nsListBox::Deselect()
|
||||
{
|
||||
XtVaSetValues(mWidget, XmNselectedItemCount, 0, NULL);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -300,7 +307,7 @@ void nsListBox::Deselect()
|
|||
// nsListBox Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsListBox::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsListBox::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -361,6 +368,7 @@ void nsListBox::Create(nsIWidget *aParent,
|
|||
mEventCallback = aHandleEventFunction;
|
||||
|
||||
//InitCallbacks();
|
||||
return NS_OK;
|
||||
|
||||
}
|
||||
|
||||
|
@ -369,7 +377,7 @@ void nsListBox::Create(nsIWidget *aParent,
|
|||
// nsListBox Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsListBox::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsListBox::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -377,6 +385,7 @@ void nsListBox::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
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,
|
||||
|
@ -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,
|
||||
|
@ -64,19 +64,19 @@ public:
|
|||
|
||||
|
||||
// nsIListBox interface
|
||||
void SetMultipleSelection(PRBool aMultipleSelections);
|
||||
void AddItemAt(nsString &aItem, PRInt32 aPosition);
|
||||
NS_IMETHOD SetMultipleSelection(PRBool aMultipleSelections);
|
||||
NS_IMETHOD AddItemAt(nsString &aItem, PRInt32 aPosition);
|
||||
PRInt32 FindItem(nsString &aItem, PRInt32 aStartPos);
|
||||
PRInt32 GetItemCount();
|
||||
PRBool RemoveItemAt(PRInt32 aPosition);
|
||||
PRBool GetItemAt(nsString& anItem, PRInt32 aPosition);
|
||||
void GetSelectedItem(nsString& aItem);
|
||||
NS_IMETHOD GetSelectedItem(nsString& aItem);
|
||||
PRInt32 GetSelectedIndex();
|
||||
PRInt32 GetSelectedCount();
|
||||
void GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
|
||||
void SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
|
||||
void SelectItem(PRInt32 aPosition);
|
||||
void Deselect() ;
|
||||
NS_IMETHOD GetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
|
||||
NS_IMETHOD SetSelectedIndices(PRInt32 aIndices[], PRInt32 aSize);
|
||||
NS_IMETHOD SelectItem(PRInt32 aPosition);
|
||||
NS_IMETHOD Deselect() ;
|
||||
|
||||
protected:
|
||||
PRBool mMultiSelect;
|
||||
|
|
|
@ -74,7 +74,7 @@ nsresult nsRadioButton::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
// nsRadioButton Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsRadioButton::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsRadioButton::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -158,6 +158,7 @@ void nsRadioButton::Create(nsIWidget *aParent,
|
|||
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -165,7 +166,7 @@ void nsRadioButton::Create(nsIWidget *aParent,
|
|||
// nsRadioButton Creator
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsRadioButton::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsRadioButton::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -173,6 +174,7 @@ void nsRadioButton::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
NS_IMETHOD GetState(PRBool& aState);
|
||||
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
@ -53,7 +53,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,
|
||||
|
|
|
@ -46,7 +46,7 @@ nsScrollbar::nsScrollbar(PRBool aIsVertical) : nsWindow(), nsIScrollbar()
|
|||
// Create
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsScrollbar::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsScrollbar::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -103,10 +103,11 @@ void nsScrollbar::Create(nsNativeWidget aParent,
|
|||
nsXtWidget_Resize_Callback,
|
||||
this);*/
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
void nsScrollbar::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsScrollbar::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -123,7 +124,7 @@ void nsScrollbar::Create(nsIWidget *aParent,
|
|||
}
|
||||
|
||||
Create((nsNativeWidget)parentWidget, aRect, aHandleEventFunction, aContext, aAppShell, aToolkit, aInitData);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
PRUint32 aPosition, PRUint32 aLineIncrement);
|
||||
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
@ -61,7 +61,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,
|
||||
|
|
|
@ -51,7 +51,7 @@ nsTextAreaWidget::~nsTextAreaWidget()
|
|||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsTextAreaWidget::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsTextAreaWidget::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -102,7 +102,7 @@ void nsTextAreaWidget::Create(nsIWidget *aParent,
|
|||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsTextAreaWidget::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsTextAreaWidget::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
|
|
@ -40,7 +40,7 @@ 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,
|
||||
|
@ -48,7 +48,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,
|
||||
|
|
|
@ -54,7 +54,7 @@ nsTextWidget::~nsTextWidget()
|
|||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsTextWidget::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsTextWidget::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -117,6 +117,7 @@ void nsTextWidget::Create(nsIWidget *aParent,
|
|||
data->mPassword = "";
|
||||
XtVaSetValues(mWidget, XmNuserData, data, NULL);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -140,7 +141,7 @@ nsresult nsTextWidget::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void nsTextWidget::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsTextWidget::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -148,6 +149,7 @@ void nsTextWidget::Create(nsNativeWidget aParent,
|
|||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
||||
void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext = nsnull,
|
||||
|
@ -52,7 +52,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,
|
||||
|
|
|
@ -82,8 +82,9 @@ NS_IMPL_ISUPPORTS(nsToolkit,kIToolkitIID);
|
|||
//
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsToolkit::Init(PRThread *aThread)
|
||||
NS_METHOD nsToolkit::Init(PRThread *aThread)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsToolkit::SetSharedGC(GC aGC)
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual void Init(PRThread *aThread);
|
||||
NS_IMETHOD Init(PRThread *aThread);
|
||||
|
||||
public:
|
||||
NS_IMETHOD_(GC) GetSharedGC();
|
||||
|
|
|
@ -65,43 +65,6 @@ static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
|||
NS_IMPL_ADDREF(nsWindow)
|
||||
NS_IMPL_RELEASE(nsWindow)
|
||||
|
||||
void nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
{
|
||||
}
|
||||
|
||||
void nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Setup initial tooltip rectangles
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[])
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Update all tooltip rectangles
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsWindow::UpdateTooltips(nsRect* aNewTips[])
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Remove all tooltip rectangles
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsWindow::RemoveTooltips()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
|
@ -149,6 +112,50 @@ nsWindow::~nsWindow()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
NS_METHOD nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Setup initial tooltip rectangles
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[])
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Update all tooltip rectangles
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
NS_METHOD nsWindow::UpdateTooltips(nsRect* aNewTips[])
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Remove all tooltip rectangles
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
NS_METHOD nsWindow::RemoveTooltips()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
|
@ -511,7 +518,7 @@ nsresult nsWindow::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsWindow::Create(nsIWidget *aParent,
|
||||
NS_METHOD nsWindow::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -524,6 +531,7 @@ void nsWindow::Create(nsIWidget *aParent,
|
|||
CreateWindow((nsNativeWidget)((aParent) ? aParent->GetNativeData(NS_NATIVE_WIDGET) : 0),
|
||||
aParent, aRect, aHandleEventFunction, aContext, aAppShell, aToolkit,
|
||||
aInitData);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -531,7 +539,7 @@ void nsWindow::Create(nsIWidget *aParent,
|
|||
// create with a native parent
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Create(nsNativeWidget aParent,
|
||||
NS_METHOD nsWindow::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -540,6 +548,7 @@ void nsWindow::Create(nsNativeWidget aParent,
|
|||
nsWidgetInitData *aInitData)
|
||||
{
|
||||
CreateWindow(aParent, 0, aRect, aHandleEventFunction, aContext, aAppShell, aToolkit, aInitData);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -548,8 +557,9 @@ void nsWindow::Create(nsNativeWidget aParent,
|
|||
// Close this nsWindow
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Destroy()
|
||||
NS_METHOD nsWindow::Destroy()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -598,8 +608,9 @@ nsIEnumerator* nsWindow::GetChildren()
|
|||
// Add a child to the list of children
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::AddChild(nsIWidget* aChild)
|
||||
NS_METHOD nsWindow::AddChild(nsIWidget* aChild)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -608,8 +619,9 @@ void nsWindow::AddChild(nsIWidget* aChild)
|
|||
// Remove a child from the list of children
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::RemoveChild(nsIWidget* aChild)
|
||||
NS_METHOD nsWindow::RemoveChild(nsIWidget* aChild)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -618,7 +630,7 @@ void nsWindow::RemoveChild(nsIWidget* aChild)
|
|||
// Hide or show this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Show(PRBool bState)
|
||||
NS_METHOD nsWindow::Show(PRBool bState)
|
||||
{
|
||||
mShown = bState;
|
||||
if (bState) {
|
||||
|
@ -627,6 +639,7 @@ void nsWindow::Show(PRBool bState)
|
|||
else
|
||||
XtUnmanageChild(mWidget);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -634,7 +647,7 @@ void nsWindow::Show(PRBool bState)
|
|||
// Move this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Move(PRUint32 aX, PRUint32 aY)
|
||||
NS_METHOD nsWindow::Move(PRUint32 aX, PRUint32 aY)
|
||||
{
|
||||
mBounds.x = aX;
|
||||
mBounds.y = aY;
|
||||
|
@ -644,6 +657,7 @@ void nsWindow::Move(PRUint32 aX, PRUint32 aY)
|
|||
#else
|
||||
XtMoveWidget(mWidget, (Position)aX, (Position)GetYCoord(aY));
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -651,7 +665,7 @@ void nsWindow::Move(PRUint32 aX, PRUint32 aY)
|
|||
// Resize this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
|
||||
NS_METHOD nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
|
||||
{
|
||||
if (DBG) printf("$$$$$$$$$ %s::Resize %d %d Repaint: %s\n",
|
||||
gInstanceClassName, aWidth, aHeight, (aRepaint?"true":"false"));
|
||||
|
@ -664,6 +678,7 @@ void nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
|
|||
#else
|
||||
XtConfigureWidget(mWidget, mBounds.x, mBounds.y, aWidth, aHeight, 0);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -672,7 +687,7 @@ void nsWindow::Resize(PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
|
|||
// Resize this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
|
||||
NS_METHOD nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeight, PRBool aRepaint)
|
||||
{
|
||||
mBounds.x = aX;
|
||||
mBounds.y = aY;
|
||||
|
@ -685,6 +700,7 @@ void nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeigh
|
|||
#else
|
||||
XtConfigureWidget(mWidget, aX, GetYCoord(aY), aWidth, aHeight, 0);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -693,9 +709,10 @@ void nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 aHeigh
|
|||
// Enable/disable this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Enable(PRBool bState)
|
||||
NS_METHOD nsWindow::Enable(PRBool bState)
|
||||
{
|
||||
XtVaSetValues(mWidget, XmNsensitive, bState, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -704,7 +721,7 @@ void nsWindow::Enable(PRBool bState)
|
|||
// Give the focus to this component
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetFocus(void)
|
||||
NS_METHOD nsWindow::SetFocus(void)
|
||||
{
|
||||
// Go get the parent of all widget's to determine which widget
|
||||
// tree to use to set the focus.
|
||||
|
@ -714,6 +731,7 @@ void nsWindow::SetFocus(void)
|
|||
}
|
||||
|
||||
XtSetKeyboardFocus(w, mWidget);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -722,9 +740,10 @@ void nsWindow::SetFocus(void)
|
|||
// Get this component dimension
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetBounds(const nsRect &aRect)
|
||||
NS_METHOD nsWindow::SetBounds(const nsRect &aRect)
|
||||
{
|
||||
mBounds = aRect;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -732,9 +751,10 @@ void nsWindow::SetBounds(const nsRect &aRect)
|
|||
// Get this component dimension
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::GetBounds(nsRect &aRect)
|
||||
NS_METHOD nsWindow::GetBounds(nsRect &aRect)
|
||||
{
|
||||
aRect = mBounds;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -745,6 +765,7 @@ void nsWindow::GetBounds(nsRect &aRect)
|
|||
nscolor nsWindow::GetForegroundColor(void)
|
||||
{
|
||||
return (mForeground);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -753,13 +774,14 @@ nscolor nsWindow::GetForegroundColor(void)
|
|||
// Set the foreground color
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetForegroundColor(const nscolor &aColor)
|
||||
NS_METHOD nsWindow::SetForegroundColor(const nscolor &aColor)
|
||||
{
|
||||
mForeground = aColor;
|
||||
|
||||
PRUint32 pixel;
|
||||
mContext->ConvertPixel(aColor, pixel);
|
||||
XtVaSetValues(mWidget, XtNforeground, pixel, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -771,6 +793,7 @@ void nsWindow::SetForegroundColor(const nscolor &aColor)
|
|||
nscolor nsWindow::GetBackgroundColor(void)
|
||||
{
|
||||
return (mBackground);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -779,12 +802,13 @@ nscolor nsWindow::GetBackgroundColor(void)
|
|||
// Set the background color
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetBackgroundColor(const nscolor &aColor)
|
||||
NS_METHOD nsWindow::SetBackgroundColor(const nscolor &aColor)
|
||||
{
|
||||
mBackground = aColor ;
|
||||
PRUint32 pixel;
|
||||
mContext->ConvertPixel(aColor, pixel);
|
||||
XtVaSetValues(mWidget, XtNbackground, pixel, nsnull);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -805,10 +829,10 @@ nsIFontMetrics* nsWindow::GetFont(void)
|
|||
// Set this component font
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetFont(const nsFont &aFont)
|
||||
NS_METHOD nsWindow::SetFont(const nsFont &aFont)
|
||||
{
|
||||
if (mContext == nsnull) {
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nsIFontCache* fontCache;
|
||||
mContext->GetFontCache(fontCache);
|
||||
|
@ -837,11 +861,14 @@ void nsWindow::SetFont(const nsFont &aFont)
|
|||
NS_RELEASE(metrics);
|
||||
} else {
|
||||
printf("****** Error: Metrics is NULL!\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
NS_RELEASE(fontCache);
|
||||
} else {
|
||||
printf("****** Error: FontCache is NULL!\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -862,11 +889,11 @@ nsCursor nsWindow::GetCursor()
|
|||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
void nsWindow::SetCursor(nsCursor aCursor)
|
||||
NS_METHOD nsWindow::SetCursor(nsCursor aCursor)
|
||||
{
|
||||
Window window = ::XtWindow(mWidget);
|
||||
if (nsnull==window)
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// Only change cursor if it's changing
|
||||
if (aCursor != mCursor) {
|
||||
|
@ -920,6 +947,7 @@ void nsWindow::SetCursor(nsCursor aCursor)
|
|||
::XDefineCursor(display, window, newCursor);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -927,10 +955,10 @@ void nsWindow::SetCursor(nsCursor aCursor)
|
|||
// Invalidate this component visible area
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Invalidate(PRBool aIsSynchronous)
|
||||
NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous)
|
||||
{
|
||||
if (mWidget == nsnull) {
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
Window win = XtWindow(mWidget);
|
||||
|
@ -949,6 +977,7 @@ void nsWindow::Invalidate(PRBool aIsSynchronous)
|
|||
evt.xgraphicsexpose.count = 0;
|
||||
XSendEvent(display, win, False, ExposureMask, &evt);
|
||||
XFlush(display);
|
||||
return NS_OK;
|
||||
|
||||
|
||||
}
|
||||
|
@ -1038,8 +1067,9 @@ nsIToolkit* nsWindow::GetToolkit()
|
|||
// Set the colormap of the window
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::SetColorMap(nsColorMap *aColorMap)
|
||||
NS_METHOD nsWindow::SetColorMap(nsColorMap *aColorMap)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -1069,10 +1099,10 @@ nsIAppShell* nsWindow::GetAppShell()
|
|||
// Scroll the bits of a window
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
||||
NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
||||
{
|
||||
if (mWidget == nsnull) {
|
||||
return;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
// Scroll all of the child widgets
|
||||
|
@ -1129,14 +1159,17 @@ void nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
|||
|
||||
XSendEvent(display, win, False, ExposureMask, &evt);
|
||||
XFlush(display);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsWindow::SetBorderStyle(nsBorderStyle aBorderStyle)
|
||||
NS_METHOD nsWindow::SetBorderStyle(nsBorderStyle aBorderStyle)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsWindow::SetTitle(const nsString& aTitle)
|
||||
NS_METHOD nsWindow::SetTitle(const nsString& aTitle)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1144,16 +1177,18 @@ void nsWindow::SetTitle(const nsString& aTitle)
|
|||
* Processes a mouse pressed event
|
||||
*
|
||||
**/
|
||||
void nsWindow::AddMouseListener(nsIMouseListener * aListener)
|
||||
NS_METHOD nsWindow::AddMouseListener(nsIMouseListener * aListener)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes a mouse pressed event
|
||||
*
|
||||
**/
|
||||
void nsWindow::AddEventListener(nsIEventListener * aListener)
|
||||
NS_METHOD nsWindow::AddEventListener(nsIEventListener * aListener)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsWindow::ConvertStatus(nsEventStatus aStatus)
|
||||
|
@ -1296,12 +1331,14 @@ PRBool nsWindow::OnPaint(nsPaintEvent &event)
|
|||
}
|
||||
|
||||
|
||||
void nsWindow::BeginResizingChildren(void)
|
||||
NS_METHOD nsWindow::BeginResizingChildren(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsWindow::EndResizingChildren(void)
|
||||
NS_METHOD nsWindow::EndResizingChildren(void)
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -55,20 +55,20 @@ public:
|
|||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
void ConvertToDeviceCoordinates(nscoord &aX, nscoord &aY) {};
|
||||
NS_IMETHOD ConvertToDeviceCoordinates(nscoord &aX, nscoord &aY) {};
|
||||
|
||||
|
||||
|
||||
virtual void PreCreateWidget(nsWidgetInitData *aWidgetInitData) {}
|
||||
NS_IMETHOD PreCreateWidget(nsWidgetInitData *aWidgetInitData) {}
|
||||
// nsIWidget interface
|
||||
virtual void Create(nsIWidget *aParent,
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell = nsnull,
|
||||
nsIToolkit *aToolkit = nsnull,
|
||||
nsWidgetInitData *aInitData = nsnull);
|
||||
virtual void Create(nsNativeWidget aParent,
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
|
@ -77,51 +77,51 @@ public:
|
|||
nsWidgetInitData *aInitData = nsnull);
|
||||
NS_IMETHOD GetClientData(void*& aClientData);
|
||||
NS_IMETHOD SetClientData(void* aClientData);
|
||||
virtual void Destroy();
|
||||
NS_IMETHOD Destroy();
|
||||
virtual nsIWidget* GetParent(void);
|
||||
virtual nsIEnumerator* GetChildren();
|
||||
virtual void AddChild(nsIWidget* aChild);
|
||||
virtual void RemoveChild(nsIWidget* aChild);
|
||||
virtual void Show(PRBool bState);
|
||||
virtual void Move(PRUint32 aX, PRUint32 aY);
|
||||
virtual void Resize(PRUint32 aWidth,
|
||||
NS_IMETHOD AddChild(nsIWidget* aChild);
|
||||
NS_IMETHOD RemoveChild(nsIWidget* aChild);
|
||||
NS_IMETHOD Show(PRBool bState);
|
||||
NS_IMETHOD Move(PRUint32 aX, PRUint32 aY);
|
||||
NS_IMETHOD Resize(PRUint32 aWidth,
|
||||
PRUint32 aHeight,
|
||||
PRBool aRepaint);
|
||||
virtual void Resize(PRUint32 aX,
|
||||
NS_IMETHOD Resize(PRUint32 aX,
|
||||
PRUint32 aY,
|
||||
PRUint32 aWidth,
|
||||
PRUint32 aHeight,
|
||||
PRBool aRepaint);
|
||||
virtual void Enable(PRBool bState);
|
||||
virtual void SetFocus(void);
|
||||
virtual void GetBounds(nsRect &aRect);
|
||||
NS_IMETHOD Enable(PRBool bState);
|
||||
NS_IMETHOD SetFocus(void);
|
||||
NS_IMETHOD GetBounds(nsRect &aRect);
|
||||
virtual nscolor GetForegroundColor(void);
|
||||
virtual void SetForegroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetForegroundColor(const nscolor &aColor);
|
||||
virtual nscolor GetBackgroundColor(void);
|
||||
virtual void SetBackgroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
virtual nsIFontMetrics* GetFont(void);
|
||||
virtual void SetFont(const nsFont &aFont);
|
||||
NS_IMETHOD SetFont(const nsFont &aFont);
|
||||
virtual nsCursor GetCursor();
|
||||
virtual void SetCursor(nsCursor aCursor);
|
||||
virtual void Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
virtual void* GetNativeData(PRUint32 aDataType);
|
||||
virtual nsIRenderingContext* GetRenderingContext();
|
||||
virtual void SetColorMap(nsColorMap *aColorMap);
|
||||
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
||||
virtual nsIDeviceContext* GetDeviceContext();
|
||||
virtual nsIAppShell * GetAppShell();
|
||||
virtual void Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
|
||||
NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
|
||||
virtual nsIToolkit* GetToolkit();
|
||||
virtual void SetBorderStyle(nsBorderStyle aBorderStyle);
|
||||
virtual void SetTitle(const nsString& aTitle);
|
||||
virtual void SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
|
||||
virtual void RemoveTooltips();
|
||||
virtual void UpdateTooltips(nsRect* aNewTips[]);
|
||||
virtual void WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
virtual void ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
virtual void AddMouseListener(nsIMouseListener * aListener);
|
||||
virtual void AddEventListener(nsIEventListener * aListener);
|
||||
virtual void BeginResizingChildren(void);
|
||||
virtual void EndResizingChildren(void);
|
||||
NS_IMETHOD SetBorderStyle(nsBorderStyle aBorderStyle);
|
||||
NS_IMETHOD SetTitle(const nsString& aTitle);
|
||||
NS_IMETHOD SetTooltips(PRUint32 aNumberOfTips,nsRect* aTooltipAreas[]);
|
||||
NS_IMETHOD RemoveTooltips();
|
||||
NS_IMETHOD UpdateTooltips(nsRect* aNewTips[]);
|
||||
NS_IMETHOD WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
NS_IMETHOD ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect);
|
||||
NS_IMETHOD AddMouseListener(nsIMouseListener * aListener);
|
||||
NS_IMETHOD AddEventListener(nsIEventListener * aListener);
|
||||
NS_IMETHOD BeginResizingChildren(void);
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
|
||||
virtual PRBool IsChild() { return(PR_FALSE); };
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче