diff options
Diffstat (limited to 'src/libaudcore/preferences.h')
-rw-r--r-- | src/libaudcore/preferences.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/libaudcore/preferences.h b/src/libaudcore/preferences.h index 750679c..8946b01 100644 --- a/src/libaudcore/preferences.h +++ b/src/libaudcore/preferences.h @@ -24,6 +24,11 @@ struct PreferencesWidget; +enum class FileSelectMode { + File, + Folder +}; + struct ComboItem { const char * label; const char * str; @@ -66,6 +71,10 @@ struct WidgetVEntry { bool password; }; +struct WidgetVFileEntry { + FileSelectMode mode; +}; + struct WidgetVCombo { /* static init */ ArrayRef<ComboItem> elems; @@ -101,6 +110,7 @@ union WidgetVariant { WidgetVTable table; WidgetVFonts font_btn; WidgetVEntry entry; + WidgetVFileEntry file_entry; WidgetVCombo combo; WidgetVBox box; WidgetVNotebook notebook; @@ -117,6 +127,7 @@ union WidgetVariant { constexpr WidgetVariant (WidgetVTable table) : table (table) {} constexpr WidgetVariant (WidgetVFonts fonts) : font_btn (fonts) {} constexpr WidgetVariant (WidgetVEntry entry) : entry (entry) {} + constexpr WidgetVariant (WidgetVFileEntry file_entry) : file_entry (file_entry) {} constexpr WidgetVariant (WidgetVCombo combo) : combo (combo) {} constexpr WidgetVariant (WidgetVBox box) : box (box) {} constexpr WidgetVariant (WidgetVNotebook notebook) : notebook (notebook) {} @@ -209,6 +220,7 @@ struct PreferencesWidget RadioButton, SpinButton, Entry, + FileEntry, ComboBox, FontButton, Box, @@ -261,6 +273,12 @@ constexpr PreferencesWidget WidgetEntry (const char * label, { return {PreferencesWidget::Entry, label, (child == WIDGET_CHILD), cfg, entry}; } +constexpr PreferencesWidget WidgetFileEntry (const char * label, + WidgetConfig cfg, WidgetVFileEntry file_entry = WidgetVFileEntry(), + WidgetIsChild child = WIDGET_NOT_CHILD) + { return {PreferencesWidget::FileEntry, label, + (child == WIDGET_CHILD), cfg, file_entry}; } + constexpr PreferencesWidget WidgetCombo (const char * label, WidgetConfig cfg, WidgetVCombo combo, WidgetIsChild child = WIDGET_NOT_CHILD) { return {PreferencesWidget::ComboBox, label, @@ -284,11 +302,13 @@ constexpr PreferencesWidget WidgetNotebook (WidgetVNotebook notebook) constexpr PreferencesWidget WidgetSeparator (WidgetVSeparator separator = WidgetVSeparator ()) { return {PreferencesWidget::Separator, 0, 0, {}, separator}; } -constexpr PreferencesWidget WidgetCustomGTK (void * (* populate) ()) - { return {PreferencesWidget::CustomGTK, 0, 0, {}, populate}; } +constexpr PreferencesWidget WidgetCustomGTK (void * (* populate) (), + WidgetIsChild child = WIDGET_NOT_CHILD) + { return {PreferencesWidget::CustomGTK, 0, (child == WIDGET_CHILD), {}, populate}; } -constexpr PreferencesWidget WidgetCustomQt (void * (* populate) ()) - { return {PreferencesWidget::CustomQt, 0, 0, {}, populate}; } +constexpr PreferencesWidget WidgetCustomQt (void * (* populate) (), + WidgetIsChild child = WIDGET_NOT_CHILD) + { return {PreferencesWidget::CustomQt, 0, (child == WIDGET_CHILD), {}, populate}; } struct PluginPreferences { ArrayRef<PreferencesWidget> widgets; |