launch_daemon: Added support for external events.
* Other apps can register events, and the launch_daemon can act on them when they are triggered.
This commit is contained in:
@@ -22,12 +22,15 @@ namespace BPrivate {
|
||||
#define B_LAUNCH_DAEMON_PORT_NAME "system:launch_daemon"
|
||||
|
||||
|
||||
// message constants
|
||||
// Message constants
|
||||
enum {
|
||||
B_GET_LAUNCH_DATA = 'lnda',
|
||||
B_LAUNCH_TARGET = 'lntg',
|
||||
B_LAUNCH_SESSION = 'lnse',
|
||||
B_REGISTER_SESSION_DAEMON = 'lnrs',
|
||||
B_REGISTER_LAUNCH_EVENT = 'lnre',
|
||||
B_UNREGISTER_LAUNCH_EVENT = 'lnue',
|
||||
B_NOTIFY_LAUNCH_EVENT = 'lnne',
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -30,12 +30,21 @@ public:
|
||||
|
||||
status_t StartSession(const char* login);
|
||||
|
||||
status_t RegisterEvent(const BMessenger& source,
|
||||
const char* name);
|
||||
status_t UnregisterEvent(const BMessenger& source,
|
||||
const char* name);
|
||||
status_t NotifyEvent(const BMessenger& source,
|
||||
const char* name);
|
||||
|
||||
class Private;
|
||||
|
||||
private:
|
||||
friend class Private;
|
||||
|
||||
void _InitMessenger();
|
||||
status_t _UpdateEvent(uint32 what,
|
||||
const BMessenger& source, const char* name);
|
||||
|
||||
private:
|
||||
BMessenger fMessenger;
|
||||
|
||||
Reference in New Issue
Block a user