xref: /haiku/headers/private/app/AppMisc.h (revision 2b76973fa2401f7a5edf68e6470f3d3210cbcff3)
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 
15 struct entry_ref;
16 
17 namespace BPrivate {
18 
19 class ServerLink;
20 
21 
22 status_t get_app_path(team_id team, char *buffer);
23 status_t get_app_path(char *buffer);
24 status_t get_app_ref(team_id team, entry_ref *ref, bool traverse = true);
25 status_t get_app_ref(entry_ref *ref, bool traverse = true);
26 
27 team_id current_team();
28 thread_id main_thread_for(team_id team);
29 
30 bool is_app_showing_modal_window(team_id team);
31 
32 void invalidate_server_port();
33 port_id get_app_server_port();
34 status_t create_desktop_connection(ServerLink* link, const char* name,
35 	int32 capacity);
36 
37 } // namespace BPrivate
38 
39 // _get_object_token_
40 /*!	Return the token of a BHandler.
41 
42 	\param handler The BHandler.
43 	\return the token.
44 
45 */
46 inline int32 _get_object_token_(const BHandler* object)
47 	{ return object->fToken; }
48 
49 #endif	// _APP_MISC_H
50