Mercurial > dwindows
comparison os2/dw.c @ 2090:cdb94c6fd611
Added initial implmentation of dw_feature_get/set() on all platforms.
Only tested on Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 11 Jun 2020 01:11:23 +0000 |
parents | 94ea915bd917 |
children | 68f1924fdd13 |
comparison
equal
deleted
inserted
replaced
2089:bcc7877dcdac | 2090:cdb94c6fd611 |
---|---|
13828 return _WideToUTF8((wchar_t *)wstring); | 13828 return _WideToUTF8((wchar_t *)wstring); |
13829 #else | 13829 #else |
13830 return NULL; | 13830 return NULL; |
13831 #endif | 13831 #endif |
13832 } | 13832 } |
13833 | |
13834 /* | |
13835 * Gets the state of the requested library feature. | |
13836 * Parameters: | |
13837 * feature: The requested feature for example DW_FEATURE_DARK_MODE | |
13838 * Returns: | |
13839 * DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature. | |
13840 * DW_FEATURE_DISABLED if the feature is supported but disabled. | |
13841 * DW_FEATURE_ENABLED if the feature is supported and enabled. | |
13842 * Other value greater than 1, same as enabled but with extra info. | |
13843 */ | |
13844 int API dw_feature_get(DWFEATURE feature) | |
13845 { | |
13846 switch(feature) | |
13847 { | |
13848 case DW_FEATURE_WINDOW_BORDER: | |
13849 case DW_FEATURE_MLE_WORD_WRAP: | |
13850 case DW_FEATURE_NOTEBOOK_STATUS_TEXT: | |
13851 case DW_FEATURE_MDI: | |
13852 return DW_FEATURE_ENABLED; | |
13853 } | |
13854 return DW_FEATURE_UNSUPPORTED; | |
13855 } | |
13856 | |
13857 /* | |
13858 * Sets the state of the requested library feature. | |
13859 * Parameters: | |
13860 * feature: The requested feature for example DW_FEATURE_DARK_MODE | |
13861 * state: DW_FEATURE_DISABLED, DW_FEATURE_ENABLED or any value greater than 1. | |
13862 * Returns: | |
13863 * DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature. | |
13864 * DW_ERROR_NONE if the feature is supported and successfully configured. | |
13865 * DW_ERROR_GENERAL if the feature is supported but could not be configured. | |
13866 * Remarks: | |
13867 * These settings are typically used during dw_init() so issue before | |
13868 * setting up the library with dw_init(). | |
13869 */ | |
13870 int API dw_feature_set(DWFEATURE feature, int state) | |
13871 { | |
13872 switch(feature) | |
13873 { | |
13874 /* These features are supported but not configurable */ | |
13875 case DW_FEATURE_WINDOW_BORDER: | |
13876 case DW_FEATURE_MLE_WORD_WRAP: | |
13877 case DW_FEATURE_NOTEBOOK_STATUS_TEXT: | |
13878 case DW_FEATURE_MDI: | |
13879 return DW_ERROR_GENERAL; | |
13880 /* These features are supported and configurable */ | |
13881 } | |
13882 return DW_FEATURE_UNSUPPORTED; | |
13883 } |