зеркало из https://github.com/mozilla/gecko-dev.git
r=mkaply, sr=blizzard (platform specific), a=mkaply (OS/2 only) Patch from dainis jonitis - add support for mouse back and forward buttons on OS/2
This commit is contained in:
Родитель
603031452f
Коммит
7e9935d0db
|
@ -25,6 +25,7 @@
|
|||
* IBM Corp.
|
||||
* Rich Walsh <dragtext@e-vertise.com>
|
||||
* Dan Rosen <dr@netscape.com>
|
||||
* Dainis Jonitis <Dainis_Jonitis@swh-t.lv>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -181,6 +182,20 @@ static int currentWindowIdentifier = 0;
|
|||
// set when any nsWindow is being dragged over
|
||||
static PRUint32 gDragStatus = 0;
|
||||
|
||||
|
||||
//
|
||||
// App Command messages for IntelliMouse and Natural Keyboard Pro
|
||||
//
|
||||
#define WM_APPCOMMAND 0x0319
|
||||
|
||||
#define APPCOMMAND_BROWSER_BACKWARD 1
|
||||
#define APPCOMMAND_BROWSER_FORWARD 2
|
||||
#define APPCOMMAND_BROWSER_REFRESH 3
|
||||
#define APPCOMMAND_BROWSER_STOP 4
|
||||
|
||||
#define FAPPCOMMAND_MASK 0xF000
|
||||
#define GET_APPCOMMAND_LPARAM(lParam) ((USHORT)(HIUSHORT(lParam) & ~FAPPCOMMAND_MASK))
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// nsWindow constructor
|
||||
|
@ -515,6 +530,24 @@ PRBool nsWindow::DispatchStandardEvent(PRUint32 aMsg)
|
|||
return result;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Dispatch app command event
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
PRBool nsWindow::DispatchAppCommandEvent(PRUint32 aEventCommand)
|
||||
{
|
||||
nsAppCommandEvent event(NS_APPCOMMAND_START, this);
|
||||
|
||||
InitEvent(event);
|
||||
event.appCommand = NS_APPCOMMAND_START + aEventCommand;
|
||||
|
||||
DispatchWindowEvent(&event);
|
||||
NS_RELEASE(event.widget);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
NS_IMETHODIMP nsWindow::CaptureRollupEvents(nsIRollupListener * aListener,
|
||||
PRBool aDoCapture,
|
||||
|
@ -2575,6 +2608,30 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc)
|
|||
case WM_MOUSELEAVE:
|
||||
result = DispatchMouseEvent( NS_MOUSE_EXIT, mp1, mp2);
|
||||
break;
|
||||
|
||||
case WM_APPCOMMAND:
|
||||
{
|
||||
PRUint32 appCommand = GET_APPCOMMAND_LPARAM(mp2);
|
||||
|
||||
switch (appCommand)
|
||||
{
|
||||
case APPCOMMAND_BROWSER_BACKWARD:
|
||||
case APPCOMMAND_BROWSER_FORWARD:
|
||||
case APPCOMMAND_BROWSER_REFRESH:
|
||||
case APPCOMMAND_BROWSER_STOP:
|
||||
DispatchAppCommandEvent(appCommand);
|
||||
// tell the driver that we handled the event
|
||||
rc = (MRESULT)1;
|
||||
result = PR_TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
rc = (MRESULT)0;
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_HSCROLL:
|
||||
case WM_VSCROLL:
|
||||
|
|
|
@ -308,6 +308,7 @@ protected:
|
|||
virtual PRBool DispatchWindowEvent(nsGUIEvent* event);
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent*event, nsEventStatus &aStatus);
|
||||
PRBool DispatchStandardEvent( PRUint32 aMsg);
|
||||
PRBool DispatchAppCommandEvent(PRUint32 aEventCommand);
|
||||
virtual PRBool DispatchMouseEvent( PRUint32 aEventType, MPARAM mp1, MPARAM mp2);
|
||||
virtual PRBool DispatchResizeEvent( PRInt32 aClientX, PRInt32 aClientY);
|
||||
void GetNonClientBounds(nsRect &aRect);
|
||||
|
|
Загрузка…
Ссылка в новой задаче