r=pedemont, sr=blizzard (platform specific)
OS/2 only - Implement GetLastInputEventTime


git-svn-id: svn://10.0.0.236/trunk@140338 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mkaply%us.ibm.com
2003-03-26 05:23:13 +00:00
parent f1e46c61a4
commit d67db4e384
2 changed files with 22 additions and 0 deletions

View File

@@ -140,6 +140,11 @@ extern "C" {
ULONG Address);
}
// The last user input event time in milliseconds. If there are any pending
// native toolkit input events it returns the current time. The value is
// compatible with PR_IntervalToMicroseconds(PR_IntervalNow()).
static PRUint32 gLastInputEventTime = 0;
#ifdef DEBUG_FOCUS
static int currentWindowIdentifier = 0;
#endif
@@ -3327,6 +3332,21 @@ NS_METHOD nsWindow::SetPreferredSize(PRInt32 aWidth, PRInt32 aHeight)
return NS_OK;
}
NS_IMETHODIMP
nsWindow::GetLastInputEventTime(PRUint32& aTime)
{
ULONG ulStatus = WinQueryQueueStatus(HWND_DESKTOP);
// If there is pending input then return the current time.
if (ulStatus && (QS_KEY | QS_MOUSE | QS_MOUSEBUTTON | QS_MOUSEMOVE)) {
gLastInputEventTime = PR_IntervalToMicroseconds(PR_IntervalNow());
}
aTime = gLastInputEventTime;
return NS_OK;
}
// --------------------------------------------------------------------------
// OS2-specific routines to emulate Windows behaviors
// --------------------------------------------------------------------------

View File

@@ -137,6 +137,8 @@ class nsWindow : public nsBaseWidget,
NS_IMETHOD DispatchEvent( struct nsGUIEvent *event, nsEventStatus &aStatus);
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent);
NS_IMETHOD GetLastInputEventTime(PRUint32& aTime);
// Widget appearance
virtual nsIFontMetrics *GetFont();
NS_IMETHOD SetFont( const nsFont &aFont);