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
+1 -3
View File
@@ -33,6 +33,7 @@
#include "RootLayer.h" #include "RootLayer.h"
#include "ScreenManager.h" #include "ScreenManager.h"
#include "ServerApp.h" #include "ServerApp.h"
#include "ServerConfig.h"
#include "ServerCursor.h" #include "ServerCursor.h"
#include "ServerProtocol.h" #include "ServerProtocol.h"
#include "ServerWindow.h" #include "ServerWindow.h"
@@ -77,9 +78,6 @@ ColorSet gGUIColorSet;
*/ */
AppServer::AppServer() AppServer::AppServer()
: MessageLooper("app_server"), : MessageLooper("app_server"),
#if TEST_MODE
BApplication(SERVER_SIGNATURE),
#endif
fCursorSem(-1), fCursorSem(-1),
fCursorArea(-1) fCursorArea(-1)
{ {
+1 -7
View File
@@ -14,7 +14,6 @@
#include <Application.h> #include <Application.h>
#include <Window.h> #include <Window.h>
#include <String.h> #include <String.h>
#include "ServerConfig.h" #include "ServerConfig.h"
#include "MessageLooper.h" #include "MessageLooper.h"
@@ -35,12 +34,7 @@ namespace BPrivate {
and initializes most of the server's globals. and initializes most of the server's globals.
*/ */
class AppServer : class AppServer : public MessageLooper {
public MessageLooper
#if TEST_MODE
, public BApplication
#endif
{
public: public:
AppServer(); AppServer();
virtual ~AppServer(); virtual ~AppServer();
+36 -28
View File
@@ -13,6 +13,12 @@ UseFreeTypeHeaders ;
SEARCH_SOURCE += [ FDirName $(SUBDIR) drawing ] ; SEARCH_SOURCE += [ FDirName $(SUBDIR) drawing ] ;
HWINTERFACE_SOURCES =
BBitmapBuffer.cpp
HWInterface.cpp
MultiLocker.cpp
;
if ( $(TARGET_PLATFORM) = haiku ) { if ( $(TARGET_PLATFORM) = haiku ) {
# This overrides the definitions in private/servers/app/ServerConfig.h # This overrides the definitions in private/servers/app/ServerConfig.h
defines = [ FDefines TEST_MODE=0 ] ; defines = [ FDefines TEST_MODE=0 ] ;
@@ -20,27 +26,23 @@ if ( $(TARGET_PLATFORM) = haiku ) {
SubDirCcFlags $(defines) ; SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) ; SubDirC++Flags $(defines) ;
VIEW_DRIVER_SOURCES =
AccelerantBuffer.cpp
AccelerantHWInterface.cpp
BitmapBuffer.cpp
DisplayDriverPainter.cpp
HWInterface.cpp
MallocBuffer.cpp
UpdateQueue.cpp
;
} else { } else {
VIEW_DRIVER_SOURCES = SharedLibrary hwinterface :
fake_input_server.cpp $(HWINTERFACE_SOURCES)
BitmapBuffer.cpp
AccelerantBuffer.cpp
AccelerantHWInterface.cpp
DisplayDriverPainter.cpp
HWInterface.cpp
MallocBuffer.cpp
UpdateQueue.cpp
ViewHWInterface.cpp
; ;
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 : SharedLibrary appserver :
@@ -72,7 +74,6 @@ Server app_server :
# Misc. Sources # Misc. Sources
DebugInfoManager.cpp DebugInfoManager.cpp
SubWindowList.cpp SubWindowList.cpp
MultiLocker.cpp
PicturePlayer.cpp PicturePlayer.cpp
PNGDump.cpp PNGDump.cpp
RAMLinkMsgReader.cpp RAMLinkMsgReader.cpp
@@ -91,10 +92,16 @@ Server app_server :
ServerWindow.cpp ServerWindow.cpp
# DisplayDriver Classes # 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 VirtualScreen.cpp
BBitmapBuffer.cpp
BitmapHWInterface.cpp BitmapHWInterface.cpp
DefaultDecorator.cpp DefaultDecorator.cpp
Layer.cpp Layer.cpp
@@ -124,17 +131,18 @@ if $(TARGET_PLATFORM) = haiku {
} else { } else {
# link as test application under R5 # link as test application under R5
LINKFLAGS on app_server ?= $(LINKFLAGS) ; LinkSharedOSLibs libhwinterface.so :
LINKFLAGS on app_server += -lbe ; libappserver.so libopenbeos.so ;
LinkSharedOSLibs libappserver.so : LinkSharedOSLibs libappserver.so :
root be <boot!home!config!lib>libopenbeos.so <boot!home!config!lib>libopenbeos.so
textencoding libfreetype.so ; libtextencoding.so libfreetype.so ;
LinkSharedOSLibs app_server : 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 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 ; SubInclude OBOS_TOP src servers app drawing Painter ;
@@ -14,6 +14,7 @@
#include <new> #include <new>
#include <stdio.h> #include <stdio.h>
#include <Application.h>
#include <Bitmap.h> #include <Bitmap.h>
#include <Cursor.h> #include <Cursor.h>
#include <Locker.h> #include <Locker.h>
@@ -92,6 +93,18 @@ string_for_color_space(color_space format)
return name; 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 //#define INPUTSERVER_TEST_MODE 1
class CardView : public BView { class CardView : public BView {
@@ -384,6 +397,8 @@ ViewHWInterface::~ViewHWInterface()
delete fBackBuffer; delete fBackBuffer;
delete fFrontBuffer; delete fFrontBuffer;
delete be_app;
} }
// Initialize // Initialize
@@ -443,6 +458,23 @@ ViewHWInterface::SetMode(const display_mode &mode)
// create the window if we don't have one already // create the window if we don't have one already
if (!fWindow) { 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))); fWindow = new CardWindow(frame.OffsetToCopy(BPoint(50.0, 50.0)));
// fire up the window thread but don't show it on screen yet // fire up the window thread but don't show it on screen yet