Introduced a new build flag and macro RUN_WITHOUT_APP_SERVER, to allow
several things to work without a running app server (the Storage Kit to begin with). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8695 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -8,6 +8,14 @@ if $(RUN_WITHOUT_REGISTRAR) {
|
|||||||
SubDirC++Flags $(defines) ;
|
SubDirC++Flags $(defines) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If defined allows to run applications without the app server
|
||||||
|
# -- needed until the app server runs on our kernel.
|
||||||
|
if $(RUN_WITHOUT_APP_SERVER) {
|
||||||
|
local defines = [ FDefines RUN_WITHOUT_APP_SERVER ] ;
|
||||||
|
SubDirCcFlags $(defines) ;
|
||||||
|
SubDirC++Flags $(defines) ;
|
||||||
|
}
|
||||||
|
|
||||||
# Collect libopenbeos.so sources.
|
# Collect libopenbeos.so sources.
|
||||||
subdirs = app interface support storage ;
|
subdirs = app interface support storage ;
|
||||||
for subdir in $(subdirs) {
|
for subdir in $(subdirs) {
|
||||||
|
|||||||
@@ -251,10 +251,12 @@ BApplication::~BApplication()
|
|||||||
// unregister from the roster
|
// unregister from the roster
|
||||||
BRoster::Private().RemoveApp(Team());
|
BRoster::Private().RemoveApp(Team());
|
||||||
|
|
||||||
|
#ifndef RUN_WITHOUT_APP_SERVER
|
||||||
// tell app_server we're quitting...
|
// tell app_server we're quitting...
|
||||||
BPortLink link(fServerFrom);
|
BPortLink link(fServerFrom);
|
||||||
link.StartMessage(B_QUIT_REQUESTED);
|
link.StartMessage(B_QUIT_REQUESTED);
|
||||||
link.Flush();
|
link.Flush();
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
|
|
||||||
// uninitialize be_app and be_app_messenger
|
// uninitialize be_app and be_app_messenger
|
||||||
be_app = NULL;
|
be_app = NULL;
|
||||||
@@ -853,6 +855,7 @@ void BApplication::InitData(const char* signature, status_t* error)
|
|||||||
|
|
||||||
// TODO: Not completely sure about the order, but this should be close.
|
// TODO: Not completely sure about the order, but this should be close.
|
||||||
|
|
||||||
|
#ifndef RUN_WITHOUT_APP_SERVER
|
||||||
// An app_server connection is necessary for a lot of stuff, so get that first.
|
// An app_server connection is necessary for a lot of stuff, so get that first.
|
||||||
if (fInitError == B_OK)
|
if (fInitError == B_OK)
|
||||||
connect_to_app_server();
|
connect_to_app_server();
|
||||||
@@ -860,6 +863,7 @@ void BApplication::InitData(const char* signature, status_t* error)
|
|||||||
setup_server_heaps();
|
setup_server_heaps();
|
||||||
if (fInitError == B_OK)
|
if (fInitError == B_OK)
|
||||||
get_scs();
|
get_scs();
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
|
|
||||||
|
|
||||||
// init be_app and be_app_messenger
|
// init be_app and be_app_messenger
|
||||||
@@ -868,10 +872,12 @@ void BApplication::InitData(const char* signature, status_t* error)
|
|||||||
be_app_messenger = BMessenger(NULL, this);
|
be_app_messenger = BMessenger(NULL, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef RUN_WITHOUT_APP_SERVER
|
||||||
// Initialize the IK after we have set be_app because of a construction of a
|
// Initialize the IK after we have set be_app because of a construction of a
|
||||||
// BAppServerLink (which depends on be_app) nested inside the call to get_menu_info.
|
// BAppServerLink (which depends on be_app) nested inside the call to get_menu_info.
|
||||||
if (fInitError == B_OK)
|
if (fInitError == B_OK)
|
||||||
fInitError = _init_interface_kit_();
|
fInitError = _init_interface_kit_();
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
// set the BHandler's name
|
// set the BHandler's name
|
||||||
if (fInitError == B_OK)
|
if (fInitError == B_OK)
|
||||||
SetName(ref.name);
|
SetName(ref.name);
|
||||||
@@ -882,10 +888,12 @@ void BApplication::InitData(const char* signature, status_t* error)
|
|||||||
create_app_meta_mime(path.Path(), false, true, false);
|
create_app_meta_mime(path.Path(), false, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef RUN_WITHOUT_APP_SERVER
|
||||||
// create global system cursors
|
// create global system cursors
|
||||||
// ToDo: these could have a predefined server token to safe the communication!
|
// ToDo: these could have a predefined server token to safe the communication!
|
||||||
B_CURSOR_SYSTEM_DEFAULT = new BCursor(B_HAND_CURSOR);
|
B_CURSOR_SYSTEM_DEFAULT = new BCursor(B_HAND_CURSOR);
|
||||||
B_CURSOR_I_BEAM = new BCursor(B_I_BEAM_CURSOR);
|
B_CURSOR_I_BEAM = new BCursor(B_I_BEAM_CURSOR);
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
|
|
||||||
// Return the error or exit, if there was an error and no error variable
|
// Return the error or exit, if there was an error and no error variable
|
||||||
// has been supplied.
|
// has been supplied.
|
||||||
|
|||||||
@@ -830,6 +830,9 @@ BBitmap::~BBitmap()
|
|||||||
// TODO: don't free fBasePtr, as it's owned by the app_server
|
// TODO: don't free fBasePtr, as it's owned by the app_server
|
||||||
// should probably decrement an associated reference count, though,
|
// should probably decrement an associated reference count, though,
|
||||||
// so the app_server knows this bitmap isn't used anymore
|
// so the app_server knows this bitmap isn't used anymore
|
||||||
|
#ifdef RUN_WITHOUT_APP_SERVER
|
||||||
|
free(fBasePtr);
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
}
|
}
|
||||||
|
|
||||||
// unarchiving constructor
|
// unarchiving constructor
|
||||||
@@ -2158,13 +2161,18 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags,
|
|||||||
{
|
{
|
||||||
status_t error = B_OK;
|
status_t error = B_OK;
|
||||||
|
|
||||||
|
#ifndef RUN_WITHOUT_APP_SERVER
|
||||||
BPrivate::BAppServerLink link;
|
BPrivate::BAppServerLink link;
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
if (fBasePtr) {
|
if (fBasePtr) {
|
||||||
// free(fBasePtr);
|
#ifdef RUN_WITHOUT_APP_SERVER
|
||||||
|
free(fBasePtr);
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
fBasePtr = NULL;
|
fBasePtr = NULL;
|
||||||
|
|
||||||
|
#ifndef RUN_WITHOUT_APP_SERVER
|
||||||
// AS_DELETE_BITMAP:
|
// AS_DELETE_BITMAP:
|
||||||
// Attached Data:
|
// Attached Data:
|
||||||
// 1) int32 server token
|
// 1) int32 server token
|
||||||
@@ -2183,6 +2191,7 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags,
|
|||||||
fBasePtr=NULL;
|
fBasePtr=NULL;
|
||||||
fArea=-1;
|
fArea=-1;
|
||||||
fServerToken=-1;
|
fServerToken=-1;
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
}
|
}
|
||||||
// check params
|
// check params
|
||||||
if (!bounds.IsValid() || !is_supported(colorSpace))
|
if (!bounds.IsValid() || !is_supported(colorSpace))
|
||||||
@@ -2197,8 +2206,17 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags,
|
|||||||
// allocate the bitmap buffer
|
// allocate the bitmap buffer
|
||||||
if (error == B_OK) {
|
if (error == B_OK) {
|
||||||
int32 size = bytesPerRow * (bounds.IntegerHeight() + 1);
|
int32 size = bytesPerRow * (bounds.IntegerHeight() + 1);
|
||||||
// fBasePtr = malloc(size);
|
#ifdef RUN_WITHOUT_APP_SERVER
|
||||||
|
fBasePtr = malloc(size);
|
||||||
|
if (fBasePtr) {
|
||||||
|
fSize = size;
|
||||||
|
fColorSpace = colorSpace;
|
||||||
|
fBounds = bounds;
|
||||||
|
fBytesPerRow = bytesPerRow;
|
||||||
|
fFlags = flags;
|
||||||
|
} else
|
||||||
|
error = B_NO_MEMORY;
|
||||||
|
#else
|
||||||
// Ask the server (via our owning application) to create a bitmap.
|
// Ask the server (via our owning application) to create a bitmap.
|
||||||
|
|
||||||
// Attach Data:
|
// Attach Data:
|
||||||
@@ -2262,6 +2280,7 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags,
|
|||||||
|
|
||||||
error = B_NO_MEMORY;
|
error = B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
#endif // RUN_WITHOUT_APP_SERVER
|
||||||
fWindow = NULL;
|
fWindow = NULL;
|
||||||
fToken = -1;
|
fToken = -1;
|
||||||
fOrigArea = -1;
|
fOrigArea = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user