mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 13:08:50 +02:00
Make some minor adjustments to module UI code
Made it so that enum_ui returns a const pointer to a structure rather than require an actual structure. Changed a few of the descriptions that I missed.
This commit is contained in:
parent
a12656bd91
commit
8bb208a090
@ -78,8 +78,8 @@ complete:
|
|||||||
|
|
||||||
static void module_load_ui_exports(struct obs_module *mod)
|
static void module_load_ui_exports(struct obs_module *mod)
|
||||||
{
|
{
|
||||||
bool (*enum_func)(size_t idx, struct obs_ui_info *info);
|
bool (*enum_func)(size_t idx, const struct obs_ui_info **info);
|
||||||
struct obs_ui_info ui_info;
|
const struct obs_ui_info *ui_info;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
enum_func = os_dlsym(mod->module, "enum_ui");
|
enum_func = os_dlsym(mod->module, "enum_ui");
|
||||||
@ -90,13 +90,13 @@ static void module_load_ui_exports(struct obs_module *mod)
|
|||||||
struct ui_callback callback;
|
struct ui_callback callback;
|
||||||
struct dstr name;
|
struct dstr name;
|
||||||
|
|
||||||
dstr_init_copy(&name, ui_info.name);
|
dstr_init_copy(&name, ui_info->name);
|
||||||
dstr_cat(&name, "_");
|
dstr_cat(&name, "_");
|
||||||
dstr_cat(&name, ui_info.task);
|
dstr_cat(&name, ui_info->task);
|
||||||
dstr_cat(&name, "_");
|
dstr_cat(&name, "_");
|
||||||
dstr_cat(&name, ui_info.target);
|
dstr_cat(&name, ui_info->target);
|
||||||
|
|
||||||
callback.ui_info = ui_info;
|
callback.ui_info = *ui_info;
|
||||||
callback.callback = os_dlsym(mod->module, name.array);
|
callback.callback = os_dlsym(mod->module, name.array);
|
||||||
|
|
||||||
if (!callback.callback) {
|
if (!callback.callback) {
|
||||||
|
@ -67,9 +67,10 @@ struct obs_ui_info {
|
|||||||
* ===========================================
|
* ===========================================
|
||||||
* Primary Exports
|
* Primary Exports
|
||||||
* ===========================================
|
* ===========================================
|
||||||
* bool enum_ui(size_t idx, struct obs_ui_info *ui_info);
|
* bool enum_ui(size_t idx, const struct obs_ui_info **ui_info);
|
||||||
|
*
|
||||||
* idx: index of the enumeration
|
* idx: index of the enumeration
|
||||||
* export: full name of the actual UI export.
|
* ui_info: pointer to the ui data for this enumeration
|
||||||
* Return value: false when no more available.
|
* Return value: false when no more available.
|
||||||
*
|
*
|
||||||
* ===========================================
|
* ===========================================
|
||||||
@ -121,7 +122,7 @@ struct obs_ui_info {
|
|||||||
* task: Task of the user interface (i.e. "config", "config_panel")
|
* task: Task of the user interface (i.e. "config", "config_panel")
|
||||||
* target: Desired target (i.e. "qt", "wx", "gtk3", "win32", etc)
|
* target: Desired target (i.e. "qt", "wx", "gtk3", "win32", etc)
|
||||||
* data: Pointer to the obs input/output/etc
|
* data: Pointer to the obs input/output/etc
|
||||||
* parent: Parent pointer for UI toolkit (if any)
|
* ui_data: UI-specific data, usually a parent pointer/handle (if any)
|
||||||
*
|
*
|
||||||
* Return value: OBS_UI_SUCCESS if the UI was successful
|
* Return value: OBS_UI_SUCCESS if the UI was successful
|
||||||
* OBS_UI_CANCEL if the UI was cancelled by the user
|
* OBS_UI_CANCEL if the UI was cancelled by the user
|
||||||
|
Loading…
Reference in New Issue
Block a user