Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
EventQueueAutoPopper Class Reference
Collaboration diagram for EventQueueAutoPopper:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EventQueueAutoPopper ()
 ~EventQueueAutoPopper ()
nsresult Push ()

Protected Attributes

nsCOMPtr< nsIEventQueueServicemService
nsCOMPtr< nsIEventQueuemQueue

Detailed Description

Definition at line 285 of file nsWindowWatcher.cpp.


Constructor & Destructor Documentation

Definition at line 300 of file nsWindowWatcher.cpp.

                                           : mQueue(nsnull)
{
}

Definition at line 304 of file nsWindowWatcher.cpp.

{
#ifdef HAVE_LAME_APPSHELL
  if (mAppShell) {
    if (mQueue)
      mAppShell->ListenToEventQueue(mQueue, PR_FALSE);
    mAppShell->Spindown();
    mAppShell = nsnull;
  }
#endif

  if(mQueue)
    mService->PopThreadEventQueue(mQueue);
}

Member Function Documentation

Definition at line 319 of file nsWindowWatcher.cpp.

{
  if (mQueue) // only once
    return NS_ERROR_FAILURE;

  mService = do_GetService(NS_EVENTQUEUESERVICE_CONTRACTID);
  if (!mService)
    return NS_ERROR_FAILURE;

  // push a new queue onto it
  mService->PushThreadEventQueue(getter_AddRefs(mQueue));
  if (!mQueue)
    return NS_ERROR_FAILURE;

#ifdef HAVE_LAME_APPSHELL
  // listen to the event queue
  mAppShell = do_CreateInstance(kAppShellCID);
  if (!mAppShell)
    return NS_ERROR_FAILURE;

  mAppShell->Create(0, nsnull);
  mAppShell->Spinup();

  // listen to the new queue
  mAppShell->ListenToEventQueue(mQueue, PR_TRUE);
#endif

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 294 of file nsWindowWatcher.cpp.

Definition at line 293 of file nsWindowWatcher.cpp.


The documentation for this class was generated from the following file: