Added dispatching of some now implemented roster requests.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@463 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-07-26 20:02:10 +00:00
parent 71ba5e917b
commit c39e453222
+17 -11
View File
@@ -1,8 +1,5 @@
// Registrar.cpp // Registrar.cpp
#ifndef DEBUG
# define DEBUG 1
#endif
#include "Debug.h" #include "Debug.h"
#include <Application.h> #include <Application.h>
@@ -22,31 +19,33 @@ Registrar::Registrar()
fClipboardHandler(NULL), fClipboardHandler(NULL),
fMIMEManager(NULL) fMIMEManager(NULL)
{ {
FUNCTION_START(); FUNCTION_START();
// move the following code to ReadyToRun() once it works. // move the following code to ReadyToRun() once it works.
fRoster = new TRoster; fRoster = new TRoster;
fClipboardHandler = new ClipboardHandler; fClipboardHandler = new ClipboardHandler;
AddHandler(fClipboardHandler); AddHandler(fClipboardHandler);
fMIMEManager = new MIMEManager; fMIMEManager = new MIMEManager;
fMIMEManager->Run(); fMIMEManager->Run();
FUNCTION_END();
} }
// destructor // destructor
Registrar::~Registrar() Registrar::~Registrar()
{ {
FUNCTION_START(); FUNCTION_START();
fMIMEManager->Lock(); fMIMEManager->Lock();
fMIMEManager->Quit(); fMIMEManager->Quit();
RemoveHandler(fClipboardHandler); RemoveHandler(fClipboardHandler);
delete fClipboardHandler; delete fClipboardHandler;
delete fRoster; delete fRoster;
FUNCTION_END();
} }
// MessageReceived // MessageReceived
void void
Registrar::MessageReceived(BMessage *message) Registrar::MessageReceived(BMessage *message)
{ {
FUNCTION_START(); FUNCTION_START();
switch (message->what) { switch (message->what) {
case B_REG_GET_MIME_MESSENGER: case B_REG_GET_MIME_MESSENGER:
{ {
@@ -81,27 +80,34 @@ FUNCTION_START();
case B_REG_REMOVE_APP: case B_REG_REMOVE_APP:
fRoster->HandleRemoveApp(message); fRoster->HandleRemoveApp(message);
break; break;
case B_REG_SET_THREAD_AND_TEAM:
fRoster->HandleSetThreadAndTeam(message);
break;
case B_REG_GET_RUNNING_APP_INFO:
fRoster->HandleGetRunningAppInfo(message);
break;
default: default:
BApplication::MessageReceived(message); BApplication::MessageReceived(message);
break; break;
} }
FUNCTION_END(); FUNCTION_END();
} }
// ReadyToRun // ReadyToRun
void void
Registrar::ReadyToRun() Registrar::ReadyToRun()
{ {
FUNCTION_START(); FUNCTION_START();
} }
// QuitRequested // QuitRequested
bool bool
Registrar::QuitRequested() Registrar::QuitRequested()
{ {
FUNCTION_START(); FUNCTION_START();
// The final registrar must not quit. At least not that easily. ;-) // The final registrar must not quit. At least not that easily. ;-)
return BApplication::QuitRequested(); return BApplication::QuitRequested();
FUNCTION_END();
} }
@@ -109,7 +115,7 @@ FUNCTION_START();
int int
main() main()
{ {
FUNCTION_START(); FUNCTION_START();
// rename the main thread // rename the main thread
rename_thread(find_thread(NULL), kRosterThreadName); rename_thread(find_thread(NULL), kRosterThreadName);
// create and run the registrar application // create and run the registrar application
@@ -118,7 +124,7 @@ PRINT(("app->Run()...\n"));
app->Run(); app->Run();
PRINT(("delete app...\n")); PRINT(("delete app...\n"));
delete app; delete app;
FUNCTION_END(); FUNCTION_END();
return 0; return 0;
} }