Skip to content

Commit 2d4f5da

Browse files
committed
Remove unneeded pieces
1 parent 1a8ea7e commit 2d4f5da

1 file changed

Lines changed: 13 additions & 88 deletions

File tree

text/0047-switch-to-advanced-docking-system.md

Lines changed: 13 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
- Allow the user to switch between pre-made layouts
66
- Plugins could register their own
77
- Users could save their own
8-
- Dock added by plugins with the old method are added as "*Legacy dock*"
9-
- Frontend API methods and events about ADS docks
8+
- Dock added by plugins with the old methods are added as "*Legacy dock*"
109

1110
Note: The "central widget" design is kept.
1211

@@ -140,7 +139,7 @@ Those docks are named `obs-$SERVICE_$DOCK_NAME` where `$SERVICE` is the service
140139

141140
## Legacy dock
142141

143-
If switching to ADS is made at the same as switching to Qt 6. This feature will only concern builds that still use Qt 5 (e.g. Ubuntu 20.04).
142+
**TODO: Talk about `obs_frontend_add_custom_qdock()`**
144143

145144
The frontend API method `obs_frontend_add_dock()` is put in deprecation. And if dual switch only Qt5 and on Qt 6 the method is removed or does nothing, this is possible because plugin will need to be rebuilt agaisnt Qt6.
146145

@@ -171,103 +170,23 @@ Users could be able to save their own layouts. Those layouts will have their nam
171170

172171
Note: ADS perspective feature is not directly used because it relies heavily on QSettings.
173172
## Frontend API
174-
Like said earlier, the method `obs_frontend_add_dock()` is put in deprecation.
175173

176-
All add/remove methods related to ADS requiring a name will require the plugin module to be able to prefix the given name with the module name (`mod_name`) to avoid conflicts.
177-
178-
So the following method will be added to libobs to access modules `mod_name`:
179-
```c++
180-
EXPORT const char *obs_get_module_mod_name(obs_module_t *module);
181-
```
182-
183-
### Add a dock
184-
```c++
185-
/* takes QWidget */
186-
#define obs_frontend_add_dock_2(title, unique_name, widget) \
187-
obs_frontend_add_module_dock(obs_current_module(), title, \
188-
unique_name, widget)
189-
EXPORT void obs_frontend_add_module_dock(obs_module_t *module,
190-
const char *title,
191-
const char *unique_name,
192-
void *widget);
193-
```
174+
**TODO: Talk about obs_frontend_add_dock_by_id() that is now a thing**
194175

195176
This allow to add a OBSAdvDock with the given QWidget. Those docks are stored in the Dock Manager and their names is stored in the QStringList for plugins extra docks.
196177

197-
Default height and width would based on the widget actual size except if `"defaultWidth"` and `"defaultHeight"` properties are set with the [`setProperty()`][7] method on the widget.
178+
Default height and width would based on the widget actual size.
198179

199180
Minimum sizes used by the dock are based on the widget ones.
200181

201182
### Remove a dock
202-
```c++
203-
#define obs_frontend_remove_dock(unique_name) \
204-
obs_frontend_remove_module_dock(obs_current_module(), unique_name)
205-
EXPORT void obs_frontend_remove_module_dock(obs_module_t *module,
206-
const char *unique_name);
207-
```
208-
209-
This allow the plugin to remove a dock added earlier.
210-
211-
### Add a browser dock
212-
```c++
213-
EXPORT bool obs_frontend_is_browser_available(void);
214-
```
215-
216-
This allow to know if the running OBS Studio has browser feature enabled. So it return false if OBS Studio was built without browser or is running under Wayland.
217-
218-
```c++
219-
#define obs_frontend_add_browser_dock(dock_params, browser_params) \
220-
obs_frontend_add_module_browser_dock(obs_current_module(), \
221-
dock_params, browser_params)
222-
EXPORT void obs_frontend_add_module_browser_dock(obs_module_t *module,
223-
struct obs_frontend_browser_dock_params *dock_params,
224-
struct obs_frontend_browser_params *browser_params);
225-
```
226-
227-
This allow the plugin to add a dock with a QCefWidget as widget.
228183

229-
If browser docks are added in the module load or post load steps, their parameter will be stored and those will be really added later.
184+
**TODO: Talk about `obs_frontend_remove_dock()` that is now a thing**
230185

231-
The QCefWidget will get parameters from this structure:
232-
233-
```c++
234-
struct obs_frontend_browser_params {
235-
const char *url;
236-
bool enable_cookie;
237-
struct dstr startup_script;
238-
DARRAY(char *) force_popup_urls;
239-
};
240-
```
241-
242-
- `bool enable_cookie`: if true `panel_cookie` will be used. The plugin maker will have to remove the dock the between profile change because the cookie manager is per profile.
243-
- `struct dstr startup_script` allow to set a startup script for the QCefWidget.
244-
- `DARRAY(char *) force_popup_urls` allow to set a list of url forced to popup.
245-
246-
And the dock itself will get parameters from this structure:
247-
248-
```c++
249-
struct obs_frontend_browser_dock_params {
250-
const char *unique_name;
251-
const char *title;
252-
int default_width;
253-
int default_height;
254-
int min_width;
255-
int min_height;
256-
};
257-
```
258-
259-
`obs_frontend_remove_dock()` can be used to remove the browser dock.
260-
261-
### Remove browser cookie
262-
Since enabling cookie is posible, allowing to delete those is required.
263-
264-
```c++
265-
EXPORT void obs_frontend_delete_browser_cookie(const char *url);
266-
```
186+
### Add a dock layouts
267187

268-
This will remove cookie related to the given URL.
188+
**TODO: Refactor API design**
269189

270-
### Add a dock layouts
271190
```c++
272191
#define obs_frontend_add_dock_layout(title, unique_name, xml_layout) \
273192
obs_frontend_add_module_dock_layout(obs_current_module(), \
@@ -295,6 +214,9 @@ EXPORT void obs_frontend_set_dock_layouts(const char *layout_name);
295214
This allow the plugin to set a registered dock layouts to the UI, the asked name should come directly from the get list method.
296215
297216
### Remove a dock layouts
217+
218+
**TODO: Refactor API design**
219+
298220
```c++
299221
#define obs_frontend_remove_dock_layout(unique_name) \
300222
obs_frontend_remove_module_dock_layout(obs_current_module(), \
@@ -306,6 +228,9 @@ EXPORT void obs_frontend_remove_module_dock_layout(obs_module_t *module,
306228
This allow the plugin to remove a dock layouts from the UI.
307229

308230
### Add a entirely custom dock
231+
232+
**TODO: Redo as those will be only legacy docks**
233+
309234
```c++
310235
/* takes ads::CDockWidget */
311236
#define obs_frontend_add_custom_dock(unique_name, dock) \

0 commit comments

Comments
 (0)