* _IsSystemApp() did not work anymore with the new directory hierarchy. It will
now check for the complete path instead of just the prefix. This fixes bug #3862. * Made TRoster.h self contained. * Style cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30788 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+235
-229
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
#include <MessageQueue.h>
|
#include <MessageQueue.h>
|
||||||
|
#include <Roster.h>
|
||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
#include <hash_set>
|
#include <hash_set>
|
||||||
@@ -32,90 +33,96 @@ typedef map<int32, BMessageQueue*> IARRequestMap;
|
|||||||
|
|
||||||
class TRoster {
|
class TRoster {
|
||||||
public:
|
public:
|
||||||
TRoster();
|
TRoster();
|
||||||
virtual ~TRoster();
|
virtual ~TRoster();
|
||||||
|
|
||||||
void HandleAddApplication(BMessage *request);
|
void HandleAddApplication(BMessage* request);
|
||||||
void HandleCompleteRegistration(BMessage *request);
|
void HandleCompleteRegistration(BMessage* request);
|
||||||
void HandleIsAppRegistered(BMessage *request);
|
void HandleIsAppRegistered(BMessage* request);
|
||||||
void HandleRemovePreRegApp(BMessage *request);
|
void HandleRemovePreRegApp(BMessage* request);
|
||||||
void HandleRemoveApp(BMessage *request);
|
void HandleRemoveApp(BMessage* request);
|
||||||
void HandleSetThreadAndTeam(BMessage *request);
|
void HandleSetThreadAndTeam(BMessage* request);
|
||||||
void HandleSetSignature(BMessage *request);
|
void HandleSetSignature(BMessage* request);
|
||||||
void HandleGetAppInfo(BMessage *request);
|
void HandleGetAppInfo(BMessage* request);
|
||||||
void HandleGetAppList(BMessage *request);
|
void HandleGetAppList(BMessage* request);
|
||||||
void HandleUpdateActiveApp(BMessage *request);
|
void HandleUpdateActiveApp(BMessage* request);
|
||||||
void HandleBroadcast(BMessage *request);
|
void HandleBroadcast(BMessage* request);
|
||||||
void HandleStartWatching(BMessage *request);
|
void HandleStartWatching(BMessage* request);
|
||||||
void HandleStopWatching(BMessage *request);
|
void HandleStopWatching(BMessage* request);
|
||||||
void HandleGetRecentDocuments(BMessage *request);
|
void HandleGetRecentDocuments(BMessage* request);
|
||||||
void HandleGetRecentFolders(BMessage *request);
|
void HandleGetRecentFolders(BMessage* request);
|
||||||
void HandleGetRecentApps(BMessage *request);
|
void HandleGetRecentApps(BMessage* request);
|
||||||
void HandleAddToRecentDocuments(BMessage *request);
|
void HandleAddToRecentDocuments(BMessage* request);
|
||||||
void HandleAddToRecentFolders(BMessage *request);
|
void HandleAddToRecentFolders(BMessage* request);
|
||||||
void HandleAddToRecentApps(BMessage *request);
|
void HandleAddToRecentApps(BMessage* request);
|
||||||
void HandleLoadRecentLists(BMessage *request);
|
void HandleLoadRecentLists(BMessage* request);
|
||||||
void HandleSaveRecentLists(BMessage *request);
|
void HandleSaveRecentLists(BMessage* request);
|
||||||
|
|
||||||
void ClearRecentDocuments();
|
void ClearRecentDocuments();
|
||||||
void ClearRecentFolders();
|
void ClearRecentFolders();
|
||||||
void ClearRecentApps();
|
void ClearRecentApps();
|
||||||
|
|
||||||
status_t Init();
|
status_t Init();
|
||||||
|
|
||||||
status_t AddApp(RosterAppInfo *info);
|
status_t AddApp(RosterAppInfo* info);
|
||||||
void RemoveApp(RosterAppInfo *info);
|
void RemoveApp(RosterAppInfo* info);
|
||||||
void UpdateActiveApp(RosterAppInfo *info);
|
void UpdateActiveApp(RosterAppInfo* info);
|
||||||
|
|
||||||
void CheckSanity();
|
void CheckSanity();
|
||||||
|
|
||||||
void SetShuttingDown(bool shuttingDown);
|
void SetShuttingDown(bool shuttingDown);
|
||||||
status_t GetShutdownApps(AppInfoList &userApps, AppInfoList &systemApps,
|
status_t GetShutdownApps(AppInfoList& userApps,
|
||||||
AppInfoList &backgroundApps, hash_set<team_id> &vitalSystemApps);
|
AppInfoList& systemApps,
|
||||||
|
AppInfoList& backgroundApps,
|
||||||
|
hash_set<team_id>& vitalSystemApps);
|
||||||
|
|
||||||
status_t AddWatcher(Watcher *watcher);
|
status_t AddWatcher(Watcher* watcher);
|
||||||
void RemoveWatcher(Watcher *watcher);
|
void RemoveWatcher(Watcher* watcher);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// hook functions
|
// hook functions
|
||||||
void _AppAdded(RosterAppInfo *info);
|
void _AppAdded(RosterAppInfo* info);
|
||||||
void _AppRemoved(RosterAppInfo *info);
|
void _AppRemoved(RosterAppInfo* info);
|
||||||
void _AppActivated(RosterAppInfo *info);
|
void _AppActivated(RosterAppInfo* info);
|
||||||
void _AppDeactivated(RosterAppInfo *info);
|
void _AppDeactivated(RosterAppInfo* info);
|
||||||
|
|
||||||
// helper functions
|
// helper functions
|
||||||
static status_t _AddMessageAppInfo(BMessage* message, const app_info* info);
|
static status_t _AddMessageAppInfo(BMessage* message,
|
||||||
static status_t _AddMessageWatchingInfo(BMessage* message,
|
const app_info* info);
|
||||||
const app_info* info);
|
static status_t _AddMessageWatchingInfo(BMessage* message,
|
||||||
uint32 _NextToken();
|
const app_info* info);
|
||||||
|
uint32 _NextToken();
|
||||||
|
|
||||||
void _AddIARRequest(IARRequestMap& map, int32 key, BMessage* request);
|
void _AddIARRequest(IARRequestMap& map, int32 key,
|
||||||
void _ReplyToIARRequests(BMessageQueue* requests,
|
BMessage* request);
|
||||||
const RosterAppInfo* info);
|
void _ReplyToIARRequests(BMessageQueue* requests,
|
||||||
void _ReplyToIARRequest(BMessage* request, const RosterAppInfo* info);
|
const RosterAppInfo* info);
|
||||||
|
void _ReplyToIARRequest(BMessage* request,
|
||||||
|
const RosterAppInfo* info);
|
||||||
|
|
||||||
void _HandleGetRecentEntries(BMessage* request);
|
void _HandleGetRecentEntries(BMessage* request);
|
||||||
|
|
||||||
|
void _ValidateRunning(const entry_ref& ref,
|
||||||
|
const char* signature);
|
||||||
|
bool _IsSystemApp(RosterAppInfo* info) const;
|
||||||
|
|
||||||
|
status_t _LoadRosterSettings(const char* path = NULL);
|
||||||
|
status_t _SaveRosterSettings(const char* path = NULL);
|
||||||
|
static const char* kDefaultRosterSettingsFile;
|
||||||
|
|
||||||
void _ValidateRunning(const entry_ref& ref, const char* signature);
|
|
||||||
bool _IsSystemApp(RosterAppInfo* info) const;
|
|
||||||
|
|
||||||
status_t _LoadRosterSettings(const char *path = NULL);
|
|
||||||
status_t _SaveRosterSettings(const char *path = NULL);
|
|
||||||
static const char *kDefaultRosterSettingsFile;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BLocker fLock;
|
BLocker fLock;
|
||||||
AppInfoList fRegisteredApps;
|
AppInfoList fRegisteredApps;
|
||||||
AppInfoList fEarlyPreRegisteredApps;
|
AppInfoList fEarlyPreRegisteredApps;
|
||||||
IARRequestMap fIARRequestsByID;
|
IARRequestMap fIARRequestsByID;
|
||||||
IARRequestMap fIARRequestsByToken;
|
IARRequestMap fIARRequestsByToken;
|
||||||
RosterAppInfo* fActiveApp;
|
RosterAppInfo* fActiveApp;
|
||||||
WatchingService fWatchingService;
|
WatchingService fWatchingService;
|
||||||
RecentApps fRecentApps;
|
RecentApps fRecentApps;
|
||||||
RecentEntries fRecentDocuments;
|
RecentEntries fRecentDocuments;
|
||||||
RecentEntries fRecentFolders;
|
RecentEntries fRecentFolders;
|
||||||
uint32 fLastToken;
|
uint32 fLastToken;
|
||||||
bool fShuttingDown;
|
bool fShuttingDown;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // T_ROSTER_H
|
#endif // T_ROSTER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user