зеркало из https://github.com/mozilla/gecko-dev.git
r=pedemont, sr=blizzard (platform specific) OS/2 only - Fix all our warning errors in widget
This commit is contained in:
Родитель
63d29ad2cd
Коммит
c177c2d634
|
@ -279,7 +279,7 @@ void nsClipboard::SetClipboardData(const char *aFlavor)
|
|||
PAG_WRITE | PAG_COMMIT | OBJ_GIVEABLE ) == NO_ERROR)
|
||||
{
|
||||
PRUnichar* uchtemp = (PRUnichar*)pMozData;
|
||||
for (int i=0;i<NumOfChars;i++) {
|
||||
for (PRUint32 i=0;i<NumOfChars;i++) {
|
||||
switch (uchtemp[i]) {
|
||||
case 0x2018:
|
||||
case 0x2019:
|
||||
|
|
|
@ -1625,8 +1625,8 @@ int CodepageToUnicode(const nsACString& aString, PRUnichar **aResult)
|
|||
{
|
||||
nsAutoChar16Buffer buffer;
|
||||
PRInt32 bufLength;
|
||||
nsresult rv = MultiByteToWideChar(0, PromiseFlatCString(aString).get(),
|
||||
aString.Length(), buffer, bufLength);
|
||||
MultiByteToWideChar(0, PromiseFlatCString(aString).get(),
|
||||
aString.Length(), buffer, bufLength);
|
||||
*aResult = ToNewUnicode(nsDependentString(buffer.get()));
|
||||
return bufLength;
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
|||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
if (filedlg.papszFQFilename) {
|
||||
for (int i=0;i<filedlg.ulFQFCount;i++) {
|
||||
for (ULONG i=0;i<filedlg.ulFQFCount;i++) {
|
||||
nsCOMPtr<nsILocalFile> file = do_CreateInstance("@mozilla.org/file/local;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv,rv);
|
||||
|
||||
|
|
|
@ -342,10 +342,10 @@ MRESULT EXPENTRY fnwpFrame( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
// Process messages from the frame
|
||||
MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
{
|
||||
MRESULT mRC = 0;
|
||||
MRESULT mresult = 0;
|
||||
BOOL bDone = FALSE;
|
||||
|
||||
switch( msg)
|
||||
switch (msg)
|
||||
{
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
{
|
||||
|
@ -365,7 +365,7 @@ MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
// When the frame is sized, do stuff to recalculate client size.
|
||||
if( pSwp->fl & SWP_SIZE && !(pSwp->fl & SWP_MINIMIZE))
|
||||
{
|
||||
mRC = (*fnwpDefFrame)( mFrameWnd, msg, mp1, mp2);
|
||||
mresult = (*fnwpDefFrame)( mFrameWnd, msg, mp1, mp2);
|
||||
bDone = TRUE;
|
||||
|
||||
mBounds.width = pSwp->cx;
|
||||
|
@ -375,11 +375,11 @@ MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
DispatchResizeEvent( mSizeClient.width, mSizeClient.height);
|
||||
}
|
||||
|
||||
if ( pSwp->fl & (SWP_MAXIMIZE | SWP_MINIMIZE | SWP_RESTORE)) {
|
||||
if (pSwp->fl & (SWP_MAXIMIZE | SWP_MINIMIZE | SWP_RESTORE)) {
|
||||
nsSizeModeEvent event(NS_SIZEMODE, this);
|
||||
if ( pSwp->fl & SWP_MAXIMIZE)
|
||||
if (pSwp->fl & SWP_MAXIMIZE)
|
||||
event.mSizeMode = nsSizeMode_Maximized;
|
||||
else if ( pSwp->fl & SWP_MINIMIZE)
|
||||
else if (pSwp->fl & SWP_MINIMIZE)
|
||||
event.mSizeMode = nsSizeMode_Minimized;
|
||||
else
|
||||
event.mSizeMode = nsSizeMode_Normal;
|
||||
|
@ -426,7 +426,7 @@ MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
if (SHORT1FROMMP(mp1) == SC_SYSMENU) {
|
||||
MENUITEM menuitem;
|
||||
WinSendMsg(WinWindowFromID(mFrameWnd, FID_SYSMENU), MM_QUERYITEM, MPFROM2SHORT(SC_SYSMENU, FALSE), MPARAM(&menuitem));
|
||||
mRC = (*fnwpDefFrame)( mFrameWnd, msg, mp1, mp2);
|
||||
mresult = (*fnwpDefFrame)( mFrameWnd, msg, mp1, mp2);
|
||||
WinEnableMenuItem(menuitem.hwndSubMenu, SC_MAXIMIZE, FALSE);
|
||||
bDone = TRUE;
|
||||
}
|
||||
|
@ -454,13 +454,13 @@ MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
#ifdef DEBUG_FOCUS
|
||||
printf("[%x] NS_GOTFOCUS (%d)\n", this, mWindowIdentifier);
|
||||
#endif
|
||||
mRC = DispatchFocus(NS_GOTFOCUS, PR_TRUE);
|
||||
bDone = DispatchFocus(NS_GOTFOCUS, PR_TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if( !bDone)
|
||||
mRC = (*fnwpDefFrame)( mFrameWnd, msg, mp1, mp2);
|
||||
mresult = (*fnwpDefFrame)( mFrameWnd, msg, mp1, mp2);
|
||||
|
||||
return mRC;
|
||||
return mresult;
|
||||
}
|
||||
|
|
|
@ -414,6 +414,13 @@ NS_IMETHODIMP nsLookAndFeel::GetNavSize(const nsMetricNavWidgetID aWidgetID,
|
|||
aSize.width = kTextAreaWidths[aFontID][aFontSize-1];
|
||||
aSize.height = kTextAreaHeights[aFontID][aFontSize-1];
|
||||
break;
|
||||
/* Added to avoid warning errors - these are not used right now */
|
||||
case eMetricSize_ListBox:
|
||||
case eMetricSize_ComboBox:
|
||||
case eMetricSize_Radio:
|
||||
case eMetricSize_CheckBox:
|
||||
case eMetricSize_Button:
|
||||
break;
|
||||
} //switch
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -203,5 +203,6 @@ NS_IMETHODIMP nsSound::PlaySystemSound(const char *aSoundAlias)
|
|||
else
|
||||
Beep();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
#include "nsToolkit.h"
|
||||
#include "nsSwitchToUIThread.h"
|
||||
|
||||
// Window procedure for the internal window
|
||||
static MRESULT EXPENTRY nsToolkitWindowProc(HWND, ULONG, MPARAM, MPARAM);
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsToolkit, nsIToolkit)
|
||||
|
||||
//
|
||||
|
@ -205,27 +208,10 @@ MRESULT EXPENTRY nsToolkitWindowProc(HWND hWnd, ULONG msg, MPARAM mp1,
|
|||
case WM_CALLMETHOD:
|
||||
{
|
||||
MethodInfo *info = (MethodInfo *)mp2;
|
||||
PRMonitor *monitor = (PRMonitor *)mp1;
|
||||
info->Invoke();
|
||||
PR_EnterMonitor(monitor);
|
||||
PR_Notify(monitor);
|
||||
PR_ExitMonitor(monitor);
|
||||
break;
|
||||
return (MRESULT)info->Invoke();
|
||||
}
|
||||
case WM_SENDMSG:
|
||||
{
|
||||
SendMsgStruct *pData = (SendMsgStruct*) mp1;
|
||||
// send the message
|
||||
pData->rc = WinSendMsg( pData->hwnd, pData->msg, pData->mp1, pData->mp2);
|
||||
// signal the monitor to let the caller continue
|
||||
PR_EnterMonitor( pData->pMonitor);
|
||||
PR_Notify( pData->pMonitor);
|
||||
PR_ExitMonitor( pData->pMonitor);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return ::WinDefWindowProc(hWnd, msg, mp1, mp2);
|
||||
}
|
||||
return ::WinDefWindowProc(hWnd, msg, mp1, mp2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -278,38 +264,3 @@ NS_METHOD NS_GetCurrentToolkit(nsIToolkit* *aResult)
|
|||
|
||||
return rv;
|
||||
}
|
||||
|
||||
void nsToolkit::CallMethod(MethodInfo *info)
|
||||
{
|
||||
PR_EnterMonitor(mMonitor);
|
||||
|
||||
::WinPostMsg(mDispatchWnd, WM_CALLMETHOD, MPFROMP(mMonitor), MPFROMP(info));
|
||||
|
||||
PR_Wait(mMonitor, PR_INTERVAL_NO_TIMEOUT);
|
||||
PR_ExitMonitor( mMonitor);
|
||||
}
|
||||
|
||||
MRESULT nsToolkit::SendMsg( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
{
|
||||
MRESULT rc = 0;
|
||||
|
||||
if( hwnd && IsGuiThread())
|
||||
rc = WinSendMsg( hwnd, msg, mp1, mp2);
|
||||
else if( hwnd)
|
||||
{
|
||||
PR_EnterMonitor( mMonitor);
|
||||
|
||||
SendMsgStruct data( hwnd, msg, mp1, mp2, mMonitor);
|
||||
|
||||
// post a message to the window
|
||||
WinPostMsg( mDispatchWnd, WM_SENDMSG, MPFROMP(&data), 0);
|
||||
|
||||
// wait for it to complete...
|
||||
PR_Wait( mMonitor, PR_INTERVAL_NO_TIMEOUT);
|
||||
PR_ExitMonitor( mMonitor);
|
||||
|
||||
rc = data.rc;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,9 @@
|
|||
#include "nsdefs.h"
|
||||
#include "prmon.h"
|
||||
#include "nsIToolkit.h"
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
struct MethodInfo;
|
||||
|
||||
|
@ -83,24 +86,12 @@ protected:
|
|||
PRMonitor *mMonitor;
|
||||
};
|
||||
|
||||
// Window procedure for the internal window
|
||||
static MRESULT EXPENTRY nsToolkitWindowProc(HWND, ULONG, MPARAM, MPARAM);
|
||||
|
||||
#define WM_CALLMETHOD (WM_USER+1)
|
||||
#define WM_SENDMSG (WM_USER+2)
|
||||
|
||||
struct SendMsgStruct
|
||||
inline void nsToolkit::CallMethod(MethodInfo *info)
|
||||
{
|
||||
HWND hwnd;
|
||||
ULONG msg;
|
||||
MPARAM mp1, mp2;
|
||||
MRESULT rc;
|
||||
|
||||
PRMonitor *pMonitor;
|
||||
|
||||
SendMsgStruct( HWND h, ULONG m, MPARAM p1, MPARAM p2, PRMonitor *pMon)
|
||||
: hwnd( h), msg( m), mp1( p1), mp2( p2), rc( 0), pMonitor( pMon)
|
||||
{}
|
||||
};
|
||||
NS_PRECONDITION(::WinIsWindow((HAB)0, mDispatchWnd), "Invalid window handle");
|
||||
::WinSendMsg(mDispatchWnd, WM_CALLMETHOD, (MPARAM)0, MPFROMP(info));
|
||||
}
|
||||
|
||||
#endif // TOOLKIT_H
|
||||
|
|
|
@ -136,9 +136,6 @@ PRBool gJustGotDeactivate = PR_FALSE;
|
|||
// Mouse Clicks - static variable defintions
|
||||
// for figuring out 1 - 3 Clicks
|
||||
////////////////////////////////////////////////////
|
||||
static POINTL gLastMousePoint;
|
||||
static LONG gLastMsgTime = 0;
|
||||
static LONG gLastClickCount = 0;
|
||||
static POINTS gLastButton1Down = {0,0};
|
||||
|
||||
#define XFROMMP(m) (SHORT(LOUSHORT(m)))
|
||||
|
@ -766,21 +763,21 @@ MRESULT EXPENTRY fnwpNSWindow( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
|
|||
if (!wnd->mIsDestroying) // not if we're in the destructor!
|
||||
kungFuDeathGrip = do_QueryInterface((nsBaseWidget*)wnd);
|
||||
|
||||
MRESULT mRC = 0;
|
||||
MRESULT mresult = 0;
|
||||
|
||||
if( wnd)
|
||||
if (wnd)
|
||||
{
|
||||
if( PR_FALSE == wnd->ProcessMessage( msg, mp1, mp2, mRC) &&
|
||||
if( PR_FALSE == wnd->ProcessMessage( msg, mp1, mp2, mresult) &&
|
||||
WinIsWindow( (HAB)0, hwnd) && wnd->GetPrevWP())
|
||||
{
|
||||
mRC = (wnd->GetPrevWP())( hwnd, msg, mp1, mp2);
|
||||
mresult = (wnd->GetPrevWP())( hwnd, msg, mp1, mp2);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
/* erm */ mRC = WinDefWindowProc( hwnd, msg, mp1, mp2);
|
||||
/* erm */ mresult = WinDefWindowProc( hwnd, msg, mp1, mp2);
|
||||
|
||||
return mRC;
|
||||
return mresult;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
@ -1637,8 +1634,8 @@ NS_METHOD nsWindow::SetFont(const nsFont &aFont)
|
|||
char *buffer = new char[fontnameLength + 6];
|
||||
if (buffer) {
|
||||
sprintf(buffer, "%d.%s", points, fontname.get());
|
||||
BOOL rc = ::WinSetPresParam(mWnd, PP_FONTNAMESIZE,
|
||||
strlen(buffer) + 1, buffer);
|
||||
::WinSetPresParam(mWnd, PP_FONTNAMESIZE,
|
||||
strlen(buffer) + 1, buffer);
|
||||
delete [] buffer;
|
||||
}
|
||||
}
|
||||
|
@ -2150,8 +2147,7 @@ PRBool nsWindow::OnKey( MPARAM mp1, MPARAM mp2)
|
|||
USHORT fsFlags = SHORT1FROMMP(mp1);
|
||||
USHORT usVKey = SHORT2FROMMP(mp2);
|
||||
USHORT usChar = SHORT1FROMMP(mp2);
|
||||
UCHAR uchScan = CHAR4FROMMP(mp1);
|
||||
int unirc = ULS_SUCCESS;
|
||||
// UCHAR uchScan = CHAR4FROMMP(mp1);
|
||||
|
||||
// It appears we're not supposed to transmit shift, control & alt events
|
||||
// to gecko. Shrug.
|
||||
|
@ -3305,10 +3301,10 @@ NS_METHOD nsWindow::SetTitle(const nsAString& aTitle)
|
|||
MethodInfo info( this, nsWindow::SET_TITLE, 1, &ulong);
|
||||
mOS2Toolkit->CallMethod( &info);
|
||||
}
|
||||
else if( mWnd)
|
||||
else if (mWnd)
|
||||
{
|
||||
PRUnichar* uchtemp = ToNewUnicode(aTitle);
|
||||
for (int i=0;i<aTitle.Length();i++) {
|
||||
for (PRUint32 i=0;i<aTitle.Length();i++) {
|
||||
switch (uchtemp[i]) {
|
||||
case 0x2018:
|
||||
case 0x2019:
|
||||
|
|
Загрузка…
Ссылка в новой задаче