comparison gtk/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
13822 g_free(freeme); 13822 g_free(freeme);
13823 } 13823 }
13824 return retval; 13824 return retval;
13825 } 13825 }
13826 13826
13827 /*
13828 * Gets the state of the requested library feature.
13829 * Parameters:
13830 * feature: The requested feature for example DW_FEATURE_DARK_MODE
13831 * Returns:
13832 * DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature.
13833 * DW_FEATURE_DISABLED if the feature is supported but disabled.
13834 * DW_FEATURE_ENABLED if the feature is supported and enabled.
13835 * Other value greater than 1, same as enabled but with extra info.
13836 */
13837 int API dw_feature_get(DWFEATURE feature)
13838 {
13839 switch(feature)
13840 {
13841 #ifdef USE_WEBKIT
13842 case DW_FEATURE_HTML:
13843 #endif
13844 #if GLIB_CHECK_VERSION(2,40,0)
13845 case DW_FEATURE_NOTIFICATION:
13846 #endif
13847 #ifdef DW_INCLUDE_DEPRECATED
13848 case DW_FEATURE_MDI:
13849 #endif
13850 case DW_FEATURE_CONTAINER_STRIPE:
13851 case DW_FEATURE_MLE_WORD_WRAP:
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 #ifdef USE_WEBKIT
13876 case DW_FEATURE_HTML:
13877 #endif
13878 #if GLIB_CHECK_VERSION(2,40,0)
13879 case DW_FEATURE_NOTIFICATION:
13880 #endif
13881 #ifdef DW_INCLUDE_DEPRECATED
13882 case DW_FEATURE_MDI:
13883 #endif
13884 case DW_FEATURE_CONTAINER_STRIPE:
13885 case DW_FEATURE_MLE_WORD_WRAP:
13886 return DW_ERROR_GENERAL;
13887 /* These features are supported and configurable */
13888 }
13889 return DW_FEATURE_UNSUPPORTED;
13890 }