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


git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@161869 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com
2004-09-07 19:49:49 +00:00
parent b5a1979aad
commit 3d15e97ed1
2 changed files with 58 additions and 0 deletions

View File

@@ -21,6 +21,7 @@
* Pierre Phaneuf <pp@ludusdesign.com>
* IBM Corp.
* Rich Walsh <dragtext@e-vertise.com>
* Dainis Jonitis <Dainis_Jonitis@swh-t.lv>
*
*/
@@ -168,6 +169,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
@@ -502,6 +517,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,
@@ -2568,6 +2601,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:

View File

@@ -291,6 +291,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);