Merge pull request #1805 from sputnick1124/frontend-api-access-systray

obs-frontend-api: Access system tray icon from API
This commit is contained in:
Jim 2019-04-06 23:35:46 -07:00 committed by GitHub
commit 34a06caf50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 0 deletions

View File

@ -67,6 +67,11 @@ struct OBSStudioAPI : obs_frontend_callbacks {
return (void*)main->winId();
}
void *obs_frontend_get_system_tray(void) override
{
return (void*)main->trayIcon.data();
}
void obs_frontend_get_scenes(
struct obs_frontend_source_list *sources) override
{

View File

@ -71,6 +71,13 @@ void *obs_frontend_get_main_window_handle(void)
: nullptr;
}
void *obs_frontend_get_system_tray(void)
{
return !!callbacks_valid()
? c->obs_frontend_get_system_tray()
: nullptr;
}
char **obs_frontend_get_scene_names(void)
{
if (!callbacks_valid())

View File

@ -82,6 +82,7 @@ static inline void obs_frontend_source_list_free(
EXPORT void *obs_frontend_get_main_window(void);
EXPORT void *obs_frontend_get_main_window_handle(void);
EXPORT void *obs_frontend_get_system_tray(void);
EXPORT char **obs_frontend_get_scene_names(void);
EXPORT void obs_frontend_get_scenes(struct obs_frontend_source_list *sources);

View File

@ -9,6 +9,7 @@ struct obs_frontend_callbacks {
virtual ~obs_frontend_callbacks() {}
virtual void *obs_frontend_get_main_window(void)=0;
virtual void *obs_frontend_get_main_window_handle(void)=0;
virtual void *obs_frontend_get_system_tray(void)=0;
virtual void obs_frontend_get_scenes(
struct obs_frontend_source_list *sources)=0;