Open Broadcaster Software
Free, open source software for live streaming and recording
obs-ui.h File Reference

Go to the source code of this file.

Data Structures

struct  obs_modal_ui
 
struct  obs_modeless_ui
 

Macros

#define OBS_UI_SUCCESS   0
 
#define OBS_UI_CANCEL   -1
 
#define OBS_UI_NOTFOUND   -2
 

Functions

EXPORT void obs_register_modal_ui (const struct obs_modal_ui *info)
 
EXPORT void obs_register_modeless_ui (const struct obs_modeless_ui *info)
 
EXPORT int obs_exec_ui (const char *id, const char *task, const char *target, void *data, void *ui_data)
 
EXPORT void * obs_create_ui (const char *id, const char *task, const char *target, void *data, void *ui_data)
 

Detailed Description

Modules can specify custom user-interface-specific exports. UI functions can be within the same library as the actual core logic, or separated in to different modules to split up UI logic and core module logic.

The reasoning for this is to allow for custom user interface of differing toolkits or for automatically generated user interface, or to simply allow separation of UI code from core code (which may often be in differing languages).

Macro Definition Documentation

◆ OBS_UI_CANCEL

#define OBS_UI_CANCEL   -1

◆ OBS_UI_NOTFOUND

#define OBS_UI_NOTFOUND   -2

◆ OBS_UI_SUCCESS

#define OBS_UI_SUCCESS   0

Function Documentation

◆ obs_create_ui()

EXPORT void* obs_create_ui ( const char *  id,
const char *  task,
const char *  target,
void *  data,
void *  ui_data 
)

Requests modeless UI to be created. Returns immediately.

Parameters
nameName of the input/output/etc type that UI was requested for
taskTask of the user interface
targetDesired target (i.e. "qt", "wx", "gtk3", "win32", etc)
dataPointer to the obs input/output/etc
ui_dataUI-specific data, usually a parent pointer/handle (if any)
Returns
Pointer/handle to the target-specific modeless object, or NULL if not found or failed.

◆ obs_exec_ui()

EXPORT int obs_exec_ui ( const char *  id,
const char *  task,
const char *  target,
void *  data,
void *  ui_data 
)

Requests modal UI to be displayed. Returns when user is complete.

Parameters
nameName of the input/output/etc type that UI was requested for
taskTask of the user interface (usually "config")
targetDesired target (i.e. "qt", "wx", "gtk3", "win32", etc)
dataPointer to the obs input/output/etc
ui_dataUI-specific data, usually a parent pointer/handle (if any)
Returns
OBS_UI_SUCCESS if the UI was successful, OBS_UI_CANCEL if the UI was cancelled by the user, or OBS_UI_NOTFOUND if the UI callback was not found

◆ obs_register_modal_ui()

EXPORT void obs_register_modal_ui ( const struct obs_modal_ui info)

Regsiters a modal UI definition to the current obs context. This should be used in obs_module_load.

Parameters
infoPointer to the modal definition structure

◆ obs_register_modeless_ui()

EXPORT void obs_register_modeless_ui ( const struct obs_modeless_ui info)

Registers a modeless UI definition to the current obs context. This should be used in obs_module_load.

Parameters
infoPointer to the modal definition structure