AppMisc.h revision 4c25397c
1/*
2 * Copyright 2002-2009, Ingo Weinhold, bonefish@users.sf.net.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _APP_MISC_H
6#define _APP_MISC_H
7
8
9#include <Handler.h>
10#include <Locker.h>
11#include <OS.h>
12#include <SupportDefs.h>
13
14
15struct entry_ref;
16
17namespace BPrivate {
18
19class ServerLink;
20
21
22status_t get_app_path(team_id team, char *buffer);
23status_t get_app_path(char *buffer);
24status_t get_app_ref(team_id team, entry_ref *ref, bool traverse = true);
25status_t get_app_ref(entry_ref *ref, bool traverse = true);
26
27team_id current_team();
28void init_team_after_fork();
29thread_id main_thread_for(team_id team);
30
31bool is_app_showing_modal_window(team_id team);
32
33status_t create_desktop_connection(ServerLink* link, const char* name,
34	int32 capacity);
35
36} // namespace BPrivate
37
38// _get_object_token_
39/*!	Return the token of a BHandler.
40
41	\param object The BHandler.
42	\return the token.
43
44*/
45inline int32 _get_object_token_(const BHandler* object)
46	{ return object->fToken; }
47
48#endif	// _APP_MISC_H
49