Made DISPLAYDRIVER a true compile time option.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12119 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-03-29 15:39:08 +00:00
parent 7ffc4e7782
commit b2b5acff33
4 changed files with 188 additions and 204 deletions

View File

@ -618,14 +618,13 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg)
}
case B_QUIT_REQUESTED:
{
#if DISPLAYDRIVER != HWDRIVER
// Attached Data:
// none
// We've been asked to quit, so (for now) broadcast to all
// test apps to quit. This situation will occur only when the server
// is compiled as a regular Be application.
if(DISPLAYDRIVER== HWDRIVER)
break;
Broadcast(AS_QUIT_APP);
@ -678,6 +677,7 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg)
exit_thread(0);
// we are now clear to exit
#endif
break;
}
case AS_SET_SYSCURSOR_DEFAULTS:

View File

@ -75,52 +75,41 @@ Desktop::~Desktop(void)
}
void Desktop::Init(void)
void
Desktop::Init(void)
{
DisplayDriver *driver = NULL;
switch(DISPLAYDRIVER)
{
case HWDRIVER:
{
#if DISPLAYDRIVER == HWDRIVER
// If we're using the AccelerantDriver for rendering, eventually we will loop through
// drivers until one can't initialize in order to support multiple monitors. For now,
// we'll just load one and be done with it.
bool initDrivers = true;
while(initDrivers)
{
while (initDrivers) {
driver = new AccelerantDriver();
AddDriver(driver);
initDrivers = false;
}
break;
}
case DIRECTDRIVER:
{
#elif DISPLAYDRIVER == DIRECTDRIVER
// It would be nice to have this for the default testing driver. Someday....
driver = new DirectDriver();
AddDriver(driver);
break;
}
case PAINTERDRIVER:
{
#elif DISPLAYDRIVER == PAINTERDRIVER
// It would be nice to have this for the default testing driver. Someday....
driver = new DisplayDriverPainter();
AddDriver(driver);
break;
}
default:
{
#else
// It would be nice to not ever need this again....
driver = new ViewDriver();
AddDriver(driver);
break;
}
}
#endif
if(fScreenList.CountItems()<1)
{
if (fScreenList.CountItems() < 1) {
delete this;
return;
}
@ -130,7 +119,9 @@ void Desktop::Init(void)
SetActiveRootLayerByIndex(0);
}
void Desktop::AddDriver(DisplayDriver *driver)
void
Desktop::AddDriver(DisplayDriver *driver)
{
if (driver->Initialize()) {
// TODO: be careful of screen initialization - monitor may not support 640x480

View File

@ -1271,8 +1271,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
STRACE(("Key Down: 0x%lx\n",scancode));
if(DISPLAYDRIVER==HWDRIVER)
{
#if DISPLAYDRIVER == HWDRIVER
// Check for workspace change or safe video mode
if(scancode>0x01 && scancode<0x0e)
{
@ -1337,9 +1336,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break;
}
}
}
else
{
#else // DISPLAYDRIVER != HWDRIVER
// F12
if(scancode>0x1 && scancode<0xe)
{
@ -1415,7 +1412,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break;
}
}
}
#endif // DISPLAYDRIVER != HWDRIVER
// We got this far, so apparently it's safe to pass to the active
// window.
@ -1479,8 +1476,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
STRACE(("Key Up: 0x%lx\n",scancode));
if(DISPLAYDRIVER==HWDRIVER)
{
#if DISPLAYDRIVER == HWDRIVER
// Tab key
if(scancode==0x26 && (modifiers & B_CONTROL_KEY))
{
@ -1491,9 +1487,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break;
//}
}
}
else
{
#else // DISPLAYDRIVER != HWDRIVER
if(scancode==0x26 && (modifiers & B_LEFT_SHIFT_KEY))
{
//ServerApp *deskbar=app_server->FindApp("application/x-vnd.Be-TSKB");
@ -1503,7 +1497,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break;
//}
}
}
#endif
// We got this far, so apparently it's safe to pass to the active
// window.

View File

@ -380,11 +380,10 @@ int32 ServerApp::MonitorApp(void *data)
// If we are using the real, accelerated version of the
// DisplayDriver, we do NOT want the user to be able shut down
// the server. The results would NOT be pretty
if(DISPLAYDRIVER!=HWDRIVER)
{
#if DISPLAYDRIVER != HWDRIVER
BMessage pleaseQuit(B_QUIT_REQUESTED);
app->SendMessageToClient(&pleaseQuit);
}
#endif
break;
}