Ejemplo n.º 1
0
NS_IMETHODIMP
nsIdleServiceOS2::GetIdleTime(PRUint32 *aIdleTime)
{
  if (!mInitialized)
    return NS_ERROR_NOT_INITIALIZED;

  ULONG mouse, keyboard;
  if (DSSaver_GetInactivityTime(&mouse, &keyboard) != SSCORE_NOERROR) {
    return NS_ERROR_FAILURE;
  }

  // we are only interested in activity in general, so take the minimum
  // of both timers
  *aIdleTime = PR_MIN(mouse, keyboard);
  return NS_OK;
}
bool
nsIdleServiceOS2::PollIdleTime(uint32_t *aIdleTime)
{
  if (!mInitialized)
    return false;

  ULONG mouse, keyboard;
  if (DSSaver_GetInactivityTime(&mouse, &keyboard) != SSCORE_NOERROR) {
    return false;
  }

  // we are only interested in activity in general, so take the minimum
  // of both timers
  *aIdleTime = NS_MIN(mouse, keyboard);
  return true;
}