13
13
/// Embedding the window gives more control to the host, and feels more integrated.
14
14
/// Floating window are sometimes the only option due to technical limitations.
15
15
///
16
+ /// The Embedding protocol is by far the most common, supported by all hosts to date,
17
+ /// and a plugin author should support at least that case.
18
+ ///
16
19
/// Showing the GUI works as follow:
17
20
/// 1. clap_plugin_gui->is_api_supported(), check what can work
18
21
/// 2. clap_plugin_gui->create(), allocates gui resources
@@ -85,7 +88,10 @@ typedef struct clap_gui_resize_hints {
85
88
bool can_resize_horizontally ;
86
89
bool can_resize_vertically ;
87
90
88
- // only if can resize horizontally and vertically
91
+ // if both horizontal and vertical resize are available, do we preserve the
92
+ // aspect ratio, and if so, what is the width x height aspect ratio to preserve.
93
+ // These flags are unused if can_resize_horizontally or vertically are false,
94
+ // and ratios are unused if preserve is false.
89
95
bool preserve_aspect_ratio ;
90
96
uint32_t aspect_ratio_width ;
91
97
uint32_t aspect_ratio_height ;
@@ -94,7 +100,8 @@ typedef struct clap_gui_resize_hints {
94
100
// Size (width, height) is in pixels; the corresponding windowing system extension is
95
101
// responsible for defining if it is physical pixels or logical pixels.
96
102
typedef struct clap_plugin_gui {
97
- // Returns true if the requested gui api is supported
103
+ // Returns true if the requested gui api is supported, either in floating (plugin-created)
104
+ // or non-floating (embedded) mode.
98
105
// [main-thread]
99
106
bool (CLAP_ABI * is_api_supported )(const clap_plugin_t * plugin , const char * api , bool is_floating );
100
107
0 commit comments