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 void init_team_after_fork(); 29 thread_id main_thread_for(team_id team); 30 31 bool is_app_showing_modal_window(team_id team); 32 33 status_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 */ 45 inline int32 _get_object_token_(const BHandler* object) 46 { return object->fToken; } 47 48 #endif // _APP_MISC_H 49