From c39d6b973737cfca32ebfab90734a184d532d37a Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 7 Jul 2005 15:30:44 +0000 Subject: [PATCH] * Introduced is_app_showing_modal_window(). Not implemented yet. Maybe someone with app server insight wants to do that. :-) * Simplified main_thread_for() for Haiku. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13538 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/app/AppMisc.h | 2 ++ src/kits/app/AppMisc.cpp | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/headers/private/app/AppMisc.h b/headers/private/app/AppMisc.h index f1be8cdeb5..0ba348a52e 100644 --- a/headers/private/app/AppMisc.h +++ b/headers/private/app/AppMisc.h @@ -43,6 +43,8 @@ thread_id main_thread_for(team_id team); bool is_running_on_haiku(); +bool is_app_showing_modal_window(team_id team); + } // namespace BPrivate // _get_object_token_ diff --git a/src/kits/app/AppMisc.cpp b/src/kits/app/AppMisc.cpp index 631cf344e6..52cc12b922 100644 --- a/src/kits/app/AppMisc.cpp +++ b/src/kits/app/AppMisc.cpp @@ -117,6 +117,13 @@ current_team() thread_id main_thread_for(team_id team) { +#ifdef __HAIKU__ + // Under Haiku the team ID is equal to it's main thread ID. We just get + // a team info to verify the existence of the team. + team_info info; + status_t error = get_team_info(team, &info); + return (error == B_OK ? team : error); +#else // For I can't find any trace of how to explicitly get the main thread, // I assume the main thread is the one with the least thread ID. thread_id thread = B_BAD_TEAM_ID; @@ -127,6 +134,7 @@ main_thread_for(team_id team) thread = info.thread; } return thread; +#endif } // is_running_on_haiku @@ -146,5 +154,19 @@ is_running_on_haiku() return (uname(&info) == 0 && strcmp(info.sysname, "Haiku") == 0); } +// is_app_showing_modal_window +/*! \brief Returns whether the application identified by the supplied + \c team_id is currently showing a modal window. + \param team the ID of the application in question. + \return \c true, if the application is showing a modal window, \c false + otherwise. +*/ +bool +is_app_showing_modal_window(team_id team) +{ + // TODO: Implement! + return true; +} + } // namespace BPrivate