hacking session with Ingo part2: in the R5 test environment, the app_server links no longer against libbe.so, the classes which need it, ViewHWInterface + friends, are extracted into their own library, but we need a bridge library as well for HWInterface + friends. The AppServer is consequently no BApplication in the test environment anymore, the BApplication that is needed to display the frame buffer window is handled in ViewHWInterface. No functional change, except that our BRegion implementation is now used in the test environment, and who knows what else... luckily we are so extremely binary compatible, that passing a Haiku BRegion to the R5 app_server actually works.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13848 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2005-07-28 23:48:46 +00:00
parent 87799a3a85
commit 15ae8872f7
4 changed files with 69 additions and 37 deletions

View File

@ -33,6 +33,7 @@
#include "RootLayer.h"
#include "ScreenManager.h"
#include "ServerApp.h"
#include "ServerConfig.h"
#include "ServerCursor.h"
#include "ServerProtocol.h"
#include "ServerWindow.h"
@ -77,9 +78,6 @@ ColorSet gGUIColorSet;
*/
AppServer::AppServer()
: MessageLooper("app_server"),
#if TEST_MODE
BApplication(SERVER_SIGNATURE),
#endif
fCursorSem(-1),
fCursorArea(-1)
{

View File

@ -14,7 +14,6 @@
#include <Application.h>
#include <Window.h>
#include <String.h>
#include "ServerConfig.h"
#include "MessageLooper.h"
@ -35,12 +34,7 @@ namespace BPrivate {
and initializes most of the server's globals.
*/
class AppServer :
public MessageLooper
#if TEST_MODE
, public BApplication
#endif
{
class AppServer : public MessageLooper {
public:
AppServer();
virtual ~AppServer();

View File

@ -13,6 +13,12 @@ UseFreeTypeHeaders ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) drawing ] ;
HWINTERFACE_SOURCES =
BBitmapBuffer.cpp
HWInterface.cpp
MultiLocker.cpp
;
if ( $(TARGET_PLATFORM) = haiku ) {
# This overrides the definitions in private/servers/app/ServerConfig.h
defines = [ FDefines TEST_MODE=0 ] ;
@ -20,27 +26,23 @@ if ( $(TARGET_PLATFORM) = haiku ) {
SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) ;
VIEW_DRIVER_SOURCES =
AccelerantBuffer.cpp
AccelerantHWInterface.cpp
BitmapBuffer.cpp
DisplayDriverPainter.cpp
HWInterface.cpp
MallocBuffer.cpp
UpdateQueue.cpp
;
} else {
VIEW_DRIVER_SOURCES =
fake_input_server.cpp
BitmapBuffer.cpp
AccelerantBuffer.cpp
AccelerantHWInterface.cpp
DisplayDriverPainter.cpp
HWInterface.cpp
MallocBuffer.cpp
UpdateQueue.cpp
ViewHWInterface.cpp
SharedLibrary hwinterface :
$(HWINTERFACE_SOURCES)
;
LINKFLAGS on libhwinterfaceimpl.so ?= $(LINKFLAGS) ;
LINKFLAGS on libhwinterfaceimpl.so += -lbe ;
SharedLibrary hwinterfaceimpl :
fake_input_server.cpp
ViewHWInterface.cpp
: libopenbeos.so libhwinterface.so
;
# make this empty, because it is already in the hwinterfaceimpl lib
# and therefore does not need to be included in app_server anymore
HWINTERFACE_SOURCES = ;
}
SharedLibrary appserver :
@ -72,7 +74,6 @@ Server app_server :
# Misc. Sources
DebugInfoManager.cpp
SubWindowList.cpp
MultiLocker.cpp
PicturePlayer.cpp
PNGDump.cpp
RAMLinkMsgReader.cpp
@ -91,10 +92,16 @@ Server app_server :
ServerWindow.cpp
# DisplayDriver Classes
$(VIEW_DRIVER_SOURCES)
AccelerantBuffer.cpp
AccelerantHWInterface.cpp
BitmapBuffer.cpp
DisplayDriverPainter.cpp
MallocBuffer.cpp
UpdateQueue.cpp
# this will be empty when compiling for R5
$(HWINTERFACE_SOURCES)
VirtualScreen.cpp
BBitmapBuffer.cpp
BitmapHWInterface.cpp
DefaultDecorator.cpp
Layer.cpp
@ -124,17 +131,18 @@ if $(TARGET_PLATFORM) = haiku {
} else {
# link as test application under R5
LINKFLAGS on app_server ?= $(LINKFLAGS) ;
LINKFLAGS on app_server += -lbe ;
LinkSharedOSLibs libhwinterface.so :
libappserver.so libopenbeos.so ;
LinkSharedOSLibs libappserver.so :
root be <boot!home!config!lib>libopenbeos.so
textencoding libfreetype.so ;
<boot!home!config!lib>libopenbeos.so
libtextencoding.so libfreetype.so ;
LinkSharedOSLibs app_server :
root be game translation libz.so libpng.so libappserver.so
libz.so libpng.so libappserver.so
libpainter.a <boot!home!config!lib>libopenbeos.so
libagg.a libfreetype.so textencoding ;
libhwinterface.so libhwinterfaceimpl.so
libagg.a libfreetype.so libtextencoding.so ;
}
SubInclude OBOS_TOP src servers app drawing Painter ;

View File

@ -14,6 +14,7 @@
#include <new>
#include <stdio.h>
#include <Application.h>
#include <Bitmap.h>
#include <Cursor.h>
#include <Locker.h>
@ -92,6 +93,18 @@ string_for_color_space(color_space format)
return name;
}
// run_app_thread
static int32
run_app_thread(void* cookie)
{
if (BApplication* app = (BApplication*)cookie) {
app->Lock();
app->Run();
}
return 0;
}
//#define INPUTSERVER_TEST_MODE 1
class CardView : public BView {
@ -384,6 +397,8 @@ ViewHWInterface::~ViewHWInterface()
delete fBackBuffer;
delete fFrontBuffer;
delete be_app;
}
// Initialize
@ -443,6 +458,23 @@ ViewHWInterface::SetMode(const display_mode &mode)
// create the window if we don't have one already
if (!fWindow) {
// if the window has not been created yet, the BApplication
// has not been created either, but we need one to display
// a real BWindow in the test environment.
// be_app->Run() needs to be called in another thread
BApplication* app = new BApplication("application/x-vnd.haiku-app-server");
app->Unlock();
thread_id appThread = spawn_thread(run_app_thread, "app thread",
B_NORMAL_PRIORITY, app);
if (appThread >= B_OK)
ret = resume_thread(appThread);
else
ret = appThread;
if (ret < B_OK)
return ret;
fWindow = new CardWindow(frame.OffsetToCopy(BPoint(50.0, 50.0)));
// fire up the window thread but don't show it on screen yet