Added methods that return the entry_ref to the application and the port of its app looper.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@674 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -23,6 +23,7 @@ AppRunner::AppRunner(bool requestQuitOnDestruction)
|
|||||||
fOutput(),
|
fOutput(),
|
||||||
fReader(-1),
|
fReader(-1),
|
||||||
fTeam(-1),
|
fTeam(-1),
|
||||||
|
fRef(),
|
||||||
fMessenger(),
|
fMessenger(),
|
||||||
fRequestQuitOnDestruction(requestQuitOnDestruction)
|
fRequestQuitOnDestruction(requestQuitOnDestruction)
|
||||||
{
|
{
|
||||||
@@ -50,6 +51,7 @@ AppRunner::Run(const char *command, const char *args, bool findCommand)
|
|||||||
find_test_app(command, &appPath);
|
find_test_app(command, &appPath);
|
||||||
command = appPath.String();
|
command = appPath.String();
|
||||||
}
|
}
|
||||||
|
get_ref_for_path(command, &fRef);
|
||||||
// add args, i.e. compose the command line
|
// add args, i.e. compose the command line
|
||||||
BString cmdLine(command);
|
BString cmdLine(command);
|
||||||
if (args) {
|
if (args) {
|
||||||
@@ -128,6 +130,34 @@ AppRunner::Team()
|
|||||||
return fTeam;
|
return fTeam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AppLooperPort
|
||||||
|
port_id
|
||||||
|
AppRunner::AppLooperPort()
|
||||||
|
{
|
||||||
|
struct messenger_hack {
|
||||||
|
port_id fPort;
|
||||||
|
int32 fHandlerToken;
|
||||||
|
team_id fTeam;
|
||||||
|
int32 extra0;
|
||||||
|
int32 extra1;
|
||||||
|
bool fPreferredTarget;
|
||||||
|
bool extra2;
|
||||||
|
bool extra3;
|
||||||
|
bool extra4;
|
||||||
|
};
|
||||||
|
return ((messenger_hack*)&fMessenger)->fPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetRef
|
||||||
|
status_t
|
||||||
|
AppRunner::GetRef(entry_ref *ref)
|
||||||
|
{
|
||||||
|
status_t error = (ref ? B_OK : B_ERROR);
|
||||||
|
if (error == B_OK)
|
||||||
|
*ref = fRef;
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
// RequestQuit
|
// RequestQuit
|
||||||
status_t
|
status_t
|
||||||
AppRunner::RequestQuit()
|
AppRunner::RequestQuit()
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <DataIO.h>
|
#include <DataIO.h>
|
||||||
|
#include <Entry.h>
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
|
|
||||||
class AppRunner {
|
class AppRunner {
|
||||||
@@ -18,6 +19,8 @@ public:
|
|||||||
bool HasQuitted();
|
bool HasQuitted();
|
||||||
void WaitFor(bool requestQuit = false);
|
void WaitFor(bool requestQuit = false);
|
||||||
team_id Team();
|
team_id Team();
|
||||||
|
port_id AppLooperPort();
|
||||||
|
status_t GetRef(entry_ref *ref);
|
||||||
status_t RequestQuit();
|
status_t RequestQuit();
|
||||||
|
|
||||||
status_t GetOutput(BString *buffer);
|
status_t GetOutput(BString *buffer);
|
||||||
@@ -38,6 +41,7 @@ private:
|
|||||||
BMallocIO fOutput;
|
BMallocIO fOutput;
|
||||||
thread_id fReader;
|
thread_id fReader;
|
||||||
team_id fTeam;
|
team_id fTeam;
|
||||||
|
entry_ref fRef;
|
||||||
BMessenger fMessenger;
|
BMessenger fMessenger;
|
||||||
bool fRequestQuitOnDestruction;
|
bool fRequestQuitOnDestruction;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user