Open Broadcaster Software
Free, open source software for live streaming and recording
obs-ui.h
Go to the documentation of this file.
1 /******************************************************************************
2  Copyright (C) 2013-2014 by Hugh Bailey <obs.jim@gmail.com>
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
17 
18 #pragma once
19 
20 #include "util/c99defs.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
40 struct obs_modal_ui {
41  const char *id;
42  const char *task;
43  const char *target;
67  bool (*exec)(void *object, void *ui_data);
68 
69  void *type_data;
70  void (*free_type_data)(void *type_data);
71 };
72 
79 EXPORT void obs_register_modal_ui(const struct obs_modal_ui *info);
80 
81 /* ------------------------------------------------------------------------- */
82 
85  const char *id;
86  const char *task;
87  const char *target;
106  void *(*create)(void *object, void *ui_data);
107 
108  void *type_data;
109  void (*free_type_data)(void *type_data);
110 };
111 
118 EXPORT void obs_register_modeless_ui(const struct obs_modeless_ui *info);
119 
120 /* ------------------------------------------------------------------------- */
121 
122 #define OBS_UI_SUCCESS 0
123 #define OBS_UI_CANCEL -1
124 #define OBS_UI_NOTFOUND -2
125 
139 EXPORT int obs_exec_ui(const char *id, const char *task, const char *target,
140  void *data, void *ui_data);
141 
154 EXPORT void *obs_create_ui(const char *id, const char *task,
155  const char *target, void *data, void *ui_data);
156 
157 
158 #ifdef __cplusplus
159 }
160 #endif
EXPORT void obs_register_modal_ui(const struct obs_modal_ui *info)
void * type_data
Definition: obs-ui.h:108
bool(* exec)(void *object, void *ui_data)
Definition: obs-ui.h:67
EXPORT void obs_register_modeless_ui(const struct obs_modeless_ui *info)
Definition: obs-ui.h:40
const char * task
Definition: obs-ui.h:42
EXPORT void * obs_create_ui(const char *id, const char *task, const char *target, void *data, void *ui_data)
const char * target
Definition: obs-ui.h:87
#define EXPORT
Definition: c99defs.h:49
void(* free_type_data)(void *type_data)
Definition: obs-ui.h:109
Definition: obs-ui.h:84
EXPORT int obs_exec_ui(const char *id, const char *task, const char *target, void *data, void *ui_data)
void * type_data
Definition: obs-ui.h:69
const char * id
Definition: obs-ui.h:85
void(* free_type_data)(void *type_data)
Definition: obs-ui.h:70
const char * task
Definition: obs-ui.h:86
const char * target
Definition: obs-ui.h:43
const char * id
Definition: obs-ui.h:41
#define bool
Definition: vc_stdbool.h:5