comparison gtk3/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
12308 g_free(freeme); 12308 g_free(freeme);
12309 } 12309 }
12310 return retval; 12310 return retval;
12311 } 12311 }
12312 12312
12313 /*
12314 * Gets the state of the requested library feature.
12315 * Parameters:
12316 * feature: The requested feature for example DW_FEATURE_DARK_MODE
12317 * Returns:
12318 * DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature.
12319 * DW_FEATURE_DISABLED if the feature is supported but disabled.
12320 * DW_FEATURE_ENABLED if the feature is supported and enabled.
12321 * Other value greater than 1, same as enabled but with extra info.
12322 */
12323 int API dw_feature_get(DWFEATURE feature)
12324 {
12325 switch(feature)
12326 {
12327 #ifdef USE_WEBKIT
12328 case DW_FEATURE_HTML:
12329 #endif
12330 #ifdef USE_WEBKIT2
12331 case DW_FEATURE_HTML_RESULT:
12332 #endif
12333 #if GLIB_CHECK_VERSION(2,40,0)
12334 case DW_FEATURE_NOTIFICATION:
12335 #endif
12336 #ifdef DW_INCLUDE_DEPRECATED
12337 case DW_FEATURE_MDI:
12338 #endif
12339 #if !GTK_CHECK_VERSION(3,14,0)
12340 case DW_FEATURE_CONTAINER_STRIPE:
12341 #endif
12342 case DW_FEATURE_MLE_WORD_WRAP:
12343 return DW_FEATURE_ENABLED;
12344 }
12345 return DW_FEATURE_UNSUPPORTED;
12346 }
12347
12348 /*
12349 * Sets the state of the requested library feature.
12350 * Parameters:
12351 * feature: The requested feature for example DW_FEATURE_DARK_MODE
12352 * state: DW_FEATURE_DISABLED, DW_FEATURE_ENABLED or any value greater than 1.
12353 * Returns:
12354 * DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature.
12355 * DW_ERROR_NONE if the feature is supported and successfully configured.
12356 * DW_ERROR_GENERAL if the feature is supported but could not be configured.
12357 * Remarks:
12358 * These settings are typically used during dw_init() so issue before
12359 * setting up the library with dw_init().
12360 */
12361 int API dw_feature_set(DWFEATURE feature, int state)
12362 {
12363 switch(feature)
12364 {
12365 /* These features are supported but not configurable */
12366 #ifdef USE_WEBKIT
12367 case DW_FEATURE_HTML:
12368 #endif
12369 #ifdef USE_WEBKIT2
12370 case DW_FEATURE_HTML_RESULT:
12371 #endif
12372 #if GLIB_CHECK_VERSION(2,40,0)
12373 case DW_FEATURE_NOTIFICATION:
12374 #endif
12375 #ifdef DW_INCLUDE_DEPRECATED
12376 case DW_FEATURE_MDI:
12377 #endif
12378 #if !GTK_CHECK_VERSION(3,14,0)
12379 case DW_FEATURE_CONTAINER_STRIPE:
12380 #endif
12381 case DW_FEATURE_MLE_WORD_WRAP:
12382 return DW_ERROR_GENERAL;
12383 /* These features are supported and configurable */
12384 }
12385 return DW_FEATURE_UNSUPPORTED;
12386 }