Uglified the header according to the OT style.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@376 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+145
-151
@@ -1,15 +1,31 @@
|
|||||||
/******************************************************************************
|
//------------------------------------------------------------------------------
|
||||||
/
|
// Copyright (c) 2001-2002, OpenBeOS
|
||||||
/ File: Roster.h
|
//
|
||||||
/
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
/ Description: BRoster class lets you launch apps and keeps
|
// copy of this software and associated documentation files (the "Software"),
|
||||||
/ track of apps that are running.
|
// to deal in the Software without restriction, including without limitation
|
||||||
/ Global be_roster represents the default BRoster.
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
/ app_info structure provides info for a running app.
|
// and/or sell copies of the Software, and to permit persons to whom the
|
||||||
/
|
// Software is furnished to do so, subject to the following conditions:
|
||||||
/ Copyright 1995-98, Be Incorporated, All Rights Reserved.
|
//
|
||||||
/
|
// The above copyright notice and this permission notice shall be included in
|
||||||
******************************************************************************/
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// File Name: Roster.h
|
||||||
|
// Author: Ingo Weinhold ([email protected])
|
||||||
|
// Description: BRoster class lets you launch apps and keeps
|
||||||
|
// track of apps that are running.
|
||||||
|
// Global be_roster represents the default BRoster.
|
||||||
|
// app_info structure provides info for a running app.
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
#ifndef _ROSTER_H
|
#ifndef _ROSTER_H
|
||||||
#define _ROSTER_H
|
#define _ROSTER_H
|
||||||
@@ -29,8 +45,8 @@ extern "C" int _init_roster_();
|
|||||||
/* --------- app_info Struct and Values ------------------------ */
|
/* --------- app_info Struct and Values ------------------------ */
|
||||||
|
|
||||||
struct app_info {
|
struct app_info {
|
||||||
app_info();
|
app_info();
|
||||||
~app_info();
|
~app_info();
|
||||||
|
|
||||||
thread_id thread;
|
thread_id thread;
|
||||||
team_id team;
|
team_id team;
|
||||||
@@ -52,9 +68,9 @@ struct app_info {
|
|||||||
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
B_REQUEST_LAUNCHED = 0x00000001,
|
B_REQUEST_LAUNCHED = 0x00000001,
|
||||||
B_REQUEST_QUIT = 0x00000002,
|
B_REQUEST_QUIT = 0x00000002,
|
||||||
B_REQUEST_ACTIVATED = 0x00000004
|
B_REQUEST_ACTIVATED = 0x00000004
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@@ -68,152 +84,130 @@ enum {
|
|||||||
|
|
||||||
class BRoster {
|
class BRoster {
|
||||||
public:
|
public:
|
||||||
BRoster();
|
BRoster();
|
||||||
~BRoster();
|
~BRoster();
|
||||||
|
|
||||||
/* Querying for apps */
|
/* Querying for apps */
|
||||||
bool IsRunning(const char *mime_sig) const;
|
bool IsRunning(const char *mimeSig) const;
|
||||||
bool IsRunning(entry_ref *ref) const;
|
bool IsRunning(entry_ref *ref) const;
|
||||||
team_id TeamFor(const char *mime_sig) const;
|
team_id TeamFor(const char *mimeSig) const;
|
||||||
team_id TeamFor(entry_ref *ref) const;
|
team_id TeamFor(entry_ref *ref) const;
|
||||||
void GetAppList(BList *team_id_list) const;
|
void GetAppList(BList *teamIDList) const;
|
||||||
void GetAppList(const char *sig, BList *team_id_list) const;
|
void GetAppList(const char *sig, BList *teamIDList) const;
|
||||||
status_t GetAppInfo(const char *sig, app_info *info) const;
|
status_t GetAppInfo(const char *sig, app_info *info) const;
|
||||||
status_t GetAppInfo(entry_ref *ref, app_info *info) const;
|
status_t GetAppInfo(entry_ref *ref, app_info *info) const;
|
||||||
status_t GetRunningAppInfo(team_id team, app_info *info) const;
|
status_t GetRunningAppInfo(team_id team, app_info *info) const;
|
||||||
status_t GetActiveAppInfo(app_info *info) const;
|
status_t GetActiveAppInfo(app_info *info) const;
|
||||||
status_t FindApp(const char *mime_type, entry_ref *app) const;
|
status_t FindApp(const char *mimeType, entry_ref *app) const;
|
||||||
status_t FindApp(entry_ref *ref, entry_ref *app) const;
|
status_t FindApp(entry_ref *ref, entry_ref *app) const;
|
||||||
|
|
||||||
/* Launching, activating, and broadcasting to apps */
|
/* Launching, activating, and broadcasting to apps */
|
||||||
status_t Broadcast(BMessage *msg) const;
|
status_t Broadcast(BMessage *msg) const;
|
||||||
status_t Broadcast(BMessage *msg, BMessenger reply_to) const;
|
status_t Broadcast(BMessage *msg, BMessenger replyTo) const;
|
||||||
status_t StartWatching(BMessenger target,
|
status_t StartWatching(BMessenger target,
|
||||||
uint32 event_mask = B_REQUEST_LAUNCHED | B_REQUEST_QUIT) const;
|
uint32 eventMask = B_REQUEST_LAUNCHED | B_REQUEST_QUIT) const;
|
||||||
status_t StopWatching(BMessenger target) const;
|
status_t StopWatching(BMessenger target) const;
|
||||||
status_t ActivateApp(team_id team) const;
|
status_t ActivateApp(team_id team) const;
|
||||||
status_t Launch(const char *mime_type, BMessage *initial_msgs = NULL,
|
|
||||||
team_id *app_team = NULL) const;
|
|
||||||
status_t Launch(const char *mime_type, BList *message_list,
|
|
||||||
team_id *app_team = NULL) const;
|
|
||||||
status_t Launch(const char *mime_type, int argc, char **args,
|
|
||||||
team_id *app_team = NULL) const;
|
|
||||||
|
|
||||||
status_t Launch(const entry_ref *ref, const BMessage *initial_message = NULL,
|
status_t Launch(const char *mimeType, BMessage *initialMsgs = NULL,
|
||||||
team_id *app_team = NULL) const;
|
team_id *appTeam = NULL) const;
|
||||||
status_t Launch(const entry_ref *ref, const BList *message_list,
|
status_t Launch(const char *mimeType, BList *messageList,
|
||||||
team_id *app_team = NULL) const;
|
team_id *appTeam = NULL) const;
|
||||||
status_t Launch(const entry_ref *ref, int argc, const char * const *args,
|
status_t Launch(const char *mimeType, int argc, char **args,
|
||||||
team_id *app_team = NULL) const;
|
team_id *appTeam = NULL) const;
|
||||||
|
status_t Launch(const entry_ref *ref,
|
||||||
|
const BMessage *initialMessage = NULL,
|
||||||
|
team_id *app_team = NULL) const;
|
||||||
|
status_t Launch(const entry_ref *ref, const BList *messageList,
|
||||||
|
team_id *appTeam = NULL) const;
|
||||||
|
status_t Launch(const entry_ref *ref, int argc, const char * const *args,
|
||||||
|
team_id *appTeam = NULL) const;
|
||||||
|
|
||||||
/* Recent document and app support */
|
/* Recent document and app support */
|
||||||
void GetRecentDocuments(BMessage *refList, int32 maxCount,
|
void GetRecentDocuments(BMessage *refList, int32 maxCount,
|
||||||
const char *ofType = NULL,
|
const char *ofType = NULL,
|
||||||
const char *openedByAppSig = NULL) const;
|
const char *openedByAppSig = NULL) const;
|
||||||
void GetRecentDocuments(BMessage *refList, int32 maxCount,
|
void GetRecentDocuments(BMessage *refList, int32 maxCount,
|
||||||
const char *ofTypeList[], int32 ofTypeListCount,
|
const char *ofTypeList[], int32 ofTypeListCount,
|
||||||
const char *openedByAppSig = NULL) const;
|
const char *openedByAppSig = NULL) const;
|
||||||
void GetRecentFolders(BMessage *refList, int32 maxCount,
|
void GetRecentFolders(BMessage *refList, int32 maxCount,
|
||||||
const char *openedByAppSig = NULL) const;
|
const char *openedByAppSig = NULL) const;
|
||||||
void GetRecentApps(BMessage *refList, int32 maxCount) const;
|
void GetRecentApps(BMessage *refList, int32 maxCount) const;
|
||||||
|
|
||||||
void AddToRecentDocuments(const entry_ref *doc,
|
void AddToRecentDocuments(const entry_ref *doc,
|
||||||
const char *appSig = NULL) const;
|
const char *appSig = NULL) const;
|
||||||
void AddToRecentFolders(const entry_ref *folder,
|
void AddToRecentFolders(const entry_ref *folder,
|
||||||
const char *appSig = NULL) const;
|
const char *appSig = NULL) const;
|
||||||
|
|
||||||
/*----- Private or reserved ------------------------------*/
|
/*----- Private or reserved ------------------------------*/
|
||||||
private:
|
private:
|
||||||
|
friend class BApplication;
|
||||||
|
friend class BWindow;
|
||||||
|
friend class _BAppCleanup_;
|
||||||
|
friend int _init_roster_();
|
||||||
|
friend status_t _send_to_roster_(BMessage *, BMessage *, bool);
|
||||||
|
friend bool _is_valid_roster_mess_(bool);
|
||||||
|
friend status_t BMimeType::StartWatching(BMessenger);
|
||||||
|
friend status_t BMimeType::StopWatching(BMessenger);
|
||||||
|
friend status_t BClipboard::StartWatching(BMessenger);
|
||||||
|
friend status_t BClipboard::StopWatching(BMessenger);
|
||||||
|
|
||||||
friend class BApplication;
|
enum mtarget {
|
||||||
friend class BWindow;
|
MAIN_MESSENGER,
|
||||||
friend class _BAppCleanup_;
|
MIME_MESSENGER,
|
||||||
friend int _init_roster_();
|
USE_GIVEN
|
||||||
friend status_t _send_to_roster_(BMessage *, BMessage *, bool);
|
};
|
||||||
friend bool _is_valid_roster_mess_(bool);
|
|
||||||
friend status_t BMimeType::StartWatching(BMessenger);
|
|
||||||
friend status_t BMimeType::StopWatching(BMessenger);
|
|
||||||
friend status_t BClipboard::StartWatching(BMessenger);
|
|
||||||
friend status_t BClipboard::StopWatching(BMessenger);
|
|
||||||
|
|
||||||
enum mtarget {
|
status_t _StartWatching(mtarget target, BMessenger *rosterMess,
|
||||||
MAIN_MESSENGER,
|
uint32 what, BMessenger notify,
|
||||||
MIME_MESSENGER,
|
uint32 event_mask) const;
|
||||||
USE_GIVEN
|
status_t _StopWatching(mtarget target, BMessenger *rosterMess, uint32 what,
|
||||||
};
|
BMessenger notify) const;
|
||||||
|
uint32 AddApplication(const char *mimeSig, entry_ref *ref, uint32 flags,
|
||||||
|
team_id team, thread_id thread, port_id port,
|
||||||
|
bool fullReg) const;
|
||||||
|
void SetSignature(team_id team, const char *mimeSig) const;
|
||||||
|
void SetThread(team_id team, thread_id thread) const;
|
||||||
|
void SetThreadAndTeam(uint32 entry_token, thread_id thread,
|
||||||
|
team_id team) const;
|
||||||
|
void CompleteRegistration(team_id team, thread_id, port_id port) const;
|
||||||
|
bool IsAppPreRegistered(entry_ref *ref, team_id team,
|
||||||
|
app_info *info) const;
|
||||||
|
void RemovePreRegApp(uint32 entryToken) const;
|
||||||
|
void RemoveApp(team_id team) const;
|
||||||
|
|
||||||
status_t _StartWatching(mtarget t, BMessenger *roster_mess, uint32 what,
|
status_t xLaunchAppPrivate(const char *mimeSig, const entry_ref *ref,
|
||||||
BMessenger notify, uint32 event_mask) const;
|
BList* msgList, int cargs, char **args,
|
||||||
status_t _StopWatching(mtarget t, BMessenger *roster_mess, uint32 what,
|
team_id *appTeam) const;
|
||||||
BMessenger notify) const;
|
bool UpdateActiveApp(team_id team) const;
|
||||||
uint32 AddApplication( const char *mime_sig,
|
void SetAppFlags(team_id team, uint32 flags) const;
|
||||||
entry_ref *ref,
|
void DumpRoster() const;
|
||||||
uint32 flags,
|
status_t resolve_app(const char *inType, const entry_ref *ref,
|
||||||
team_id team,
|
entry_ref *appRef, char *appSig, uint32 *appFlags,
|
||||||
thread_id thread,
|
bool *wasDocument) const;
|
||||||
port_id port,
|
status_t translate_ref(const entry_ref *ref, BMimeType *appMeta,
|
||||||
bool full_reg) const;
|
entry_ref *appRef, BFile *appFile, char *appSig,
|
||||||
void SetSignature(team_id team, const char *mime_sig) const;
|
bool *wasDocument) const;
|
||||||
void SetThread(team_id team, thread_id tid) const;
|
status_t translate_type(const char *mimeType, BMimeType *meta,
|
||||||
void SetThreadAndTeam(uint32 entry_token,
|
entry_ref *appRef, BFile *appFile,
|
||||||
thread_id tid,
|
char *appSig) const;
|
||||||
team_id team) const;
|
status_t sniff_file(const entry_ref *file, BNodeInfo *finfo,
|
||||||
void CompleteRegistration(team_id team,
|
char *mimeType) const;
|
||||||
thread_id,
|
bool is_wildcard(const char *sig) const;
|
||||||
port_id port) const;
|
status_t get_unique_supporting_app(const BMessage *apps,
|
||||||
bool IsAppPreRegistered( entry_ref *ref,
|
char *outSig) const;
|
||||||
team_id team,
|
status_t get_random_supporting_app(const BMessage *apps,
|
||||||
app_info *info) const;
|
char *outSig) const;
|
||||||
void RemovePreRegApp(uint32 entry_token) const;
|
char **build_arg_vector(char **args, int *pargs, const entry_ref *appRef,
|
||||||
void RemoveApp(team_id team) const;
|
const entry_ref *docRef) const;
|
||||||
|
status_t send_to_running(team_id team, const entry_ref *appRef,
|
||||||
|
int cargs, char **args, const BList *msgList,
|
||||||
|
const entry_ref *ref) const;
|
||||||
|
void InitMessengers();
|
||||||
|
|
||||||
status_t xLaunchAppPrivate( const char *mime_sig,
|
BMessenger fMess;
|
||||||
const entry_ref *ref,
|
BMessenger fMimeMess;
|
||||||
BList* msg_list,
|
uint32 _fReserved[3];
|
||||||
int cargs,
|
|
||||||
char **args,
|
|
||||||
team_id *app_team) const;
|
|
||||||
bool UpdateActiveApp(team_id team) const;
|
|
||||||
void SetAppFlags(team_id team, uint32 flags) const;
|
|
||||||
void DumpRoster() const;
|
|
||||||
status_t resolve_app(const char *in_type,
|
|
||||||
const entry_ref *ref,
|
|
||||||
entry_ref *app_ref,
|
|
||||||
char *app_sig,
|
|
||||||
uint32 *app_flags,
|
|
||||||
bool *was_document) const;
|
|
||||||
status_t translate_ref(const entry_ref *ref,
|
|
||||||
BMimeType *app_meta,
|
|
||||||
entry_ref *app_ref,
|
|
||||||
BFile *app_file,
|
|
||||||
char *app_sig,
|
|
||||||
bool *was_document) const;
|
|
||||||
status_t translate_type(const char *mime_type,
|
|
||||||
BMimeType *meta,
|
|
||||||
entry_ref *app_ref,
|
|
||||||
BFile *app_file,
|
|
||||||
char *app_sig) const;
|
|
||||||
status_t sniff_file(const entry_ref *file,
|
|
||||||
BNodeInfo *finfo,
|
|
||||||
char *mime_type) const;
|
|
||||||
bool is_wildcard(const char *sig) const;
|
|
||||||
status_t get_unique_supporting_app(const BMessage *apps,
|
|
||||||
char *out_sig) const;
|
|
||||||
status_t get_random_supporting_app(const BMessage *apps,
|
|
||||||
char *out_sig) const;
|
|
||||||
char **build_arg_vector(char **args, int *pargs,
|
|
||||||
const entry_ref *app_ref,
|
|
||||||
const entry_ref *doc_ref) const;
|
|
||||||
status_t send_to_running(team_id tema,
|
|
||||||
const entry_ref *app_ref,
|
|
||||||
int cargs, char **args,
|
|
||||||
const BList *msg_list,
|
|
||||||
const entry_ref *ref) const;
|
|
||||||
void InitMessengers();
|
|
||||||
|
|
||||||
BMessenger fMess;
|
|
||||||
BMessenger fMimeMess;
|
|
||||||
uint32 _fReserved[3];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-----------------------------------------------------*/
|
/*-----------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user