Bug 198333: Get rid of nsDispatchListener. r=darin, sr=bryner, a=Asa

This commit is contained in:
jaggernaut%netscape.com 2003-05-13 04:25:01 +00:00
Родитель cbd531541a
Коммит 4002381d41
18 изменённых файлов: 3 добавлений и 124 удалений

Просмотреть файл

@ -316,7 +316,6 @@ nsViewerApp::Initialize(int argc, char** argv)
return rv;
}
mAppShell->Create(&argc, argv);
mAppShell->SetDispatchListener((nsDispatchListener*) this);
// Load preferences
rv = CallGetService(NS_PREFSERVICE_CONTRACTID, &mPrefService);
@ -751,15 +750,6 @@ nsViewerApp::OpenWindow(PRUint32 aNewChromeMask, nsBrowserWindow*& aNewWindow)
//----------------------------------------
// nsDispatchListener implementation
void
nsViewerApp::AfterDispatch()
{
}
//----------------------------------------
#include "prenv.h"
#include "resources.h"
#include "nsIPresShell.h"

Просмотреть файл

@ -47,7 +47,7 @@ class nsIEventQueueService;
class nsIPrefService;
class nsBrowserWindow;
class nsViewerApp : public nsISupports, public nsDispatchListener
class nsViewerApp : public nsISupports
{
public:
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
@ -57,9 +57,6 @@ public:
// nsISupports
NS_DECL_ISUPPORTS
// nsDispatchListener
virtual void AfterDispatch();
// nsViewerApp
NS_IMETHOD SetupRegistry();
NS_IMETHOD Initialize(int argc, char** argv);

Просмотреть файл

@ -25,7 +25,6 @@
#include "nsISupports.idl"
native int(int);
[ptr] native nsDispatchListener(nsDispatchListener);
[ptr] native nsIEventQueue(nsIEventQueue);
[ptr] native UndefinednsIWidget(nsIWidget);
[ref] native PRBoolRef(PRBool);
@ -40,16 +39,6 @@ class nsIEventQueue;
*/
#define NS_NATIVE_SHELL 0
/**
* During the nsIAppShell Run method notify this listener
* after each message dispatch.
* @see SetDispatchListener member function of nsIAppShell
*/
class nsDispatchListener {
public:
virtual void AfterDispatch() = 0;
};
class nsIWidget;
%}
@ -104,14 +93,8 @@ interface nsIAppShell : nsISupports
void DispatchNativeEvent(in PRBool aRealEvent, in voidPtr aEvent);
/**
* After event dispatch execute app specific code
* Exit the handle event loop
*/
void SetDispatchListener(in nsDispatchListener aDispatchListener);
/**
* Exit the handle event loop
*/
void Exit();

Просмотреть файл

@ -102,8 +102,6 @@ NS_IMPL_THREADSAFE_ISUPPORTS1(nsAppShell, nsIAppShell)
nsAppShell::nsAppShell()
: is_port_error(false)
{
mDispatchListener = 0;
gBAppCount++;
}
@ -140,13 +138,6 @@ NS_IMETHODIMP nsAppShell::Create(int* argc, char ** argv)
return NS_OK;
}
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
mDispatchListener = aDispatchListener;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Enter a message handler loop
@ -203,8 +194,6 @@ NS_IMETHODIMP nsAppShell::Run()
break;
}
if(mDispatchListener)
mDispatchListener->AfterDispatch();
if(id.sync)
release_sem(syncsem);
@ -401,12 +390,6 @@ NS_IMETHODIMP nsAppShell::DispatchNativeEvent(PRBool aRealEvent, void *aEvent)
} while (!gotMessage);
// no need to do this?
//if(mDispatchListener)
//{
// mDispatchListener->AfterDispatch();
//}
return NS_OK;
}

Просмотреть файл

@ -79,7 +79,6 @@ class nsAppShell : public nsIAppShell
int CountStoredEvents();
void *GetNextEvent();
nsDispatchListener *mDispatchListener;
port_id eventport;
sem_id syncsem;
BList events[PRIORITY_LEVELS];

Просмотреть файл

@ -115,14 +115,6 @@ nsAppShellCocoa::Exit(void)
}
NS_IMETHODIMP
nsAppShellCocoa::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
// nobody uses this except viewer
return NS_OK;
}
//-------------------------------------------------------------------------
//
// respond to notifications that an event queue has come or gone

Просмотреть файл

@ -179,12 +179,6 @@ nsAppShell::ReleaseGlobals()
NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
return NS_OK;
}
static void event_processor_callback(gpointer data,
gint source,
GdkInputCondition condition)

Просмотреть файл

@ -266,12 +266,6 @@ nsAppShell::DispatchNativeEvent(PRBool aRealEvent, void *aEvent)
return NS_OK;
}
NS_IMETHODIMP
nsAppShell::SetDispatchListener(nsDispatchListener *aDispatchListener)
{
return NS_OK;
}
NS_IMETHODIMP
nsAppShell::Exit(void)
{

Просмотреть файл

@ -75,16 +75,8 @@ PRBool nsAppShell::mInitializedToolbox = PR_FALSE;
// nsISupports implementation macro
//
//-------------------------------------------------------------------------
NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
NS_IMPL_THREADSAFE_ISUPPORTS1(nsAppShell, nsIAppShell)
NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
mDispatchListener = aDispatchListener;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Create the application shell
@ -119,9 +111,6 @@ NS_IMETHODIMP nsAppShell::Run(void)
mMacPump->StartRunning();
mMacPump->DoMessagePump();
//if (mDispatchListener)
//mDispatchListener->AfterDispatch();
if (mExitCalled) // hack: see below
{
--mRefCnt;

Просмотреть файл

@ -67,11 +67,10 @@ class nsAppShell : public nsIAppShell
NS_DECL_NSIAPPSHELL
private:
nsDispatchListener *mDispatchListener; // note: we don't own this, but it can be NULL
nsCOMPtr<nsIToolkit> mToolkit;
auto_ptr<nsMacMessagePump> mMacPump;
PRBool mExitCalled;
static PRBool mInitializedToolbox;
static PRBool mInitializedToolbox;
};
#endif // nsAppShell_h__

Просмотреть файл

@ -105,18 +105,11 @@ NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell)
// nsAppShell constructor
nsAppShell::nsAppShell()
{
mDispatchListener = 0;
mHab = 0; mHmq = 0;
mQuitNow = FALSE;
memset( &mQmsg, 0, sizeof mQmsg);
}
nsresult nsAppShell::SetDispatchListener( nsDispatchListener *aDispatchListener)
{
mDispatchListener = aDispatchListener;
return NS_OK;
}
// Create the application shell
nsresult nsAppShell::Create( int */*argc*/, char **/*argv*/)
{
@ -160,8 +153,6 @@ nsresult nsAppShell::Run()
if (mQmsg.msg != WM_QUIT) {
WinDispatchMsg((HAB)0, &mQmsg);
if (mDispatchListener)
mDispatchListener->AfterDispatch();
} else {
if ((mQmsg.hwnd) && (mQmsg.mp1 || mQmsg.mp2)) {
// send WM_SYSCOMMAND, SC_CLOSE to window (tasklist close)

Просмотреть файл

@ -37,7 +37,6 @@ class nsAppShell : public nsIAppShell
// nsIAppShell
NS_IMETHOD Create( int *argc, char **argv);
NS_IMETHOD SetDispatchListener( nsDispatchListener *aDispatchListener);
NS_IMETHOD Spinup() { return NS_OK; }
NS_IMETHOD Run();
NS_IMETHOD Spindown() { return NS_OK; }
@ -52,7 +51,6 @@ class nsAppShell : public nsIAppShell
virtual void *GetNativeData( PRUint32 aDataType);
private:
nsDispatchListener *mDispatchListener;
HAB mHab;
HMQ mHmq;
BOOL mQuitNow;

Просмотреть файл

@ -109,12 +109,6 @@ nsAppShell::~nsAppShell()
//-------------------------------------------------------------------------
NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell)
//-------------------------------------------------------------------------
NS_IMETHODIMP nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Enter a message handler loop

Просмотреть файл

@ -73,7 +73,6 @@ public:
return NS_OK;
}
NS_IMETHOD SetDispatchListener(nsDispatchListener * aDispatchListener);
NS_IMETHOD Exit(void);
public:

Просмотреть файл

@ -61,7 +61,6 @@ static int gKeepGoing = 1;
//-------------------------------------------------------------------------
nsAppShell::nsAppShell()
{
mDispatchListener = 0;
}
@ -77,13 +76,6 @@ NS_METHOD nsAppShell::Create(int* argc, char ** argv)
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
mDispatchListener = aDispatchListener;
return NS_OK;
}
//-------------------------------------------------------------------------
//
// Enter a message handler loop
@ -140,8 +132,6 @@ NS_METHOD nsAppShell::Run(void)
if (keepGoing != 0) {
TranslateMessage(&msg);
nsToolkit::mDispatchMessage(&msg);
if (mDispatchListener)
mDispatchListener->AfterDispatch();
}
} else {

Просмотреть файл

@ -52,9 +52,6 @@ class nsAppShell : public nsIAppShell
NS_DECL_ISUPPORTS
NS_DECL_NSIAPPSHELL
private:
nsDispatchListener* mDispatchListener;
};
#endif // nsAppShell_h__

Просмотреть файл

@ -149,8 +149,6 @@ static const char *event_names[] =
nsAppShell::nsAppShell()
{
mDispatchListener = 0;
if (!sEventQueueList)
sEventQueueList = new nsVoidArray();
@ -285,12 +283,6 @@ NS_METHOD nsAppShell::Create(int* bac, char ** bav)
return NS_OK;
}
NS_METHOD nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener)
{
mDispatchListener = aDispatchListener;
return NS_OK;
}
NS_IMETHODIMP nsAppShell::Spinup()
{
nsresult rv = NS_OK;

Просмотреть файл

@ -64,7 +64,6 @@ public:
NS_IMETHOD GetNativeEvent(PRBool &aRealEvent, void *&aEvent);
NS_IMETHOD DispatchNativeEvent(PRBool aRealEvent, void *aEvent);
NS_IMETHOD SetDispatchListener(nsDispatchListener* aDispatchListener);
NS_IMETHOD Exit();
virtual void * GetNativeData(PRUint32 aDataType);
static void DispatchXEvent(XEvent *event);
@ -76,7 +75,6 @@ public:
static Display *mDisplay;
private:
static XlibRgbHandle *mXlib_rgb_handle;
nsDispatchListener* mDispatchListener;
static void HandleButtonEvent(XEvent *event, nsWidget *aWidget);
static void HandleMotionNotifyEvent(XEvent *event, nsWidget *aWidget);