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: case B_QUIT_REQUESTED:
{ {
#if DISPLAYDRIVER != HWDRIVER
// Attached Data: // Attached Data:
// none // none
// We've been asked to quit, so (for now) broadcast to all // We've been asked to quit, so (for now) broadcast to all
// test apps to quit. This situation will occur only when the server // test apps to quit. This situation will occur only when the server
// is compiled as a regular Be application. // is compiled as a regular Be application.
if(DISPLAYDRIVER== HWDRIVER)
break;
Broadcast(AS_QUIT_APP); Broadcast(AS_QUIT_APP);
@ -678,6 +677,7 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg)
exit_thread(0); exit_thread(0);
// we are now clear to exit // we are now clear to exit
#endif
break; break;
} }
case AS_SET_SYSCURSOR_DEFAULTS: 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; DisplayDriver *driver = NULL;
switch(DISPLAYDRIVER) #if DISPLAYDRIVER == HWDRIVER
{
case HWDRIVER:
{
// If we're using the AccelerantDriver for rendering, eventually we will loop through // 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, // drivers until one can't initialize in order to support multiple monitors. For now,
// we'll just load one and be done with it. // we'll just load one and be done with it.
bool initDrivers = true; bool initDrivers = true;
while(initDrivers) while (initDrivers) {
{
driver = new AccelerantDriver(); driver = new AccelerantDriver();
AddDriver(driver); AddDriver(driver);
initDrivers = false; initDrivers = false;
} }
break;
} #elif DISPLAYDRIVER == DIRECTDRIVER
case DIRECTDRIVER:
{
// It would be nice to have this for the default testing driver. Someday.... // It would be nice to have this for the default testing driver. Someday....
driver = new DirectDriver(); driver = new DirectDriver();
AddDriver(driver); AddDriver(driver);
break;
} #elif DISPLAYDRIVER == PAINTERDRIVER
case PAINTERDRIVER:
{
// It would be nice to have this for the default testing driver. Someday.... // It would be nice to have this for the default testing driver. Someday....
driver = new DisplayDriverPainter(); driver = new DisplayDriverPainter();
AddDriver(driver); AddDriver(driver);
break;
} #else
default:
{
// It would be nice to not ever need this again.... // It would be nice to not ever need this again....
driver = new ViewDriver(); driver = new ViewDriver();
AddDriver(driver); AddDriver(driver);
break; #endif
}
}
if(fScreenList.CountItems()<1) if (fScreenList.CountItems() < 1) {
{
delete this; delete this;
return; return;
} }
@ -130,7 +119,9 @@ void Desktop::Init(void)
SetActiveRootLayerByIndex(0); SetActiveRootLayerByIndex(0);
} }
void Desktop::AddDriver(DisplayDriver *driver)
void
Desktop::AddDriver(DisplayDriver *driver)
{ {
if (driver->Initialize()) { if (driver->Initialize()) {
// TODO: be careful of screen initialization - monitor may not support 640x480 // 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)); STRACE(("Key Down: 0x%lx\n",scancode));
if(DISPLAYDRIVER==HWDRIVER) #if DISPLAYDRIVER == HWDRIVER
{
// Check for workspace change or safe video mode // Check for workspace change or safe video mode
if(scancode>0x01 && scancode<0x0e) if(scancode>0x01 && scancode<0x0e)
{ {
@ -1337,9 +1336,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break; break;
} }
} }
} #else // DISPLAYDRIVER != HWDRIVER
else
{
// F12 // F12
if(scancode>0x1 && scancode<0xe) if(scancode>0x1 && scancode<0xe)
{ {
@ -1415,7 +1412,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break; break;
} }
} }
} #endif // DISPLAYDRIVER != HWDRIVER
// We got this far, so apparently it's safe to pass to the active // We got this far, so apparently it's safe to pass to the active
// window. // window.
@ -1479,8 +1476,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
STRACE(("Key Up: 0x%lx\n",scancode)); STRACE(("Key Up: 0x%lx\n",scancode));
if(DISPLAYDRIVER==HWDRIVER) #if DISPLAYDRIVER == HWDRIVER
{
// Tab key // Tab key
if(scancode==0x26 && (modifiers & B_CONTROL_KEY)) if(scancode==0x26 && (modifiers & B_CONTROL_KEY))
{ {
@ -1491,9 +1487,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break; break;
//} //}
} }
} #else // DISPLAYDRIVER != HWDRIVER
else
{
if(scancode==0x26 && (modifiers & B_LEFT_SHIFT_KEY)) if(scancode==0x26 && (modifiers & B_LEFT_SHIFT_KEY))
{ {
//ServerApp *deskbar=app_server->FindApp("application/x-vnd.Be-TSKB"); //ServerApp *deskbar=app_server->FindApp("application/x-vnd.Be-TSKB");
@ -1503,7 +1497,7 @@ void RootLayer::KeyboardEventHandler(int32 code, BPortLink& msg)
break; break;
//} //}
} }
} #endif
// We got this far, so apparently it's safe to pass to the active // We got this far, so apparently it's safe to pass to the active
// window. // window.

View File

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