diff 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
line wrap: on
line diff
--- a/os2/dw.c	Fri Jun 05 16:49:31 2020 +0000
+++ b/os2/dw.c	Thu Jun 11 01:11:23 2020 +0000
@@ -13830,3 +13830,54 @@
     return NULL;
 #endif
 }
+
+/*
+ * Gets the state of the requested library feature.
+ * Parameters:
+ *       feature: The requested feature for example DW_FEATURE_DARK_MODE
+ * Returns:
+ *       DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature.
+ *       DW_FEATURE_DISABLED if the feature is supported but disabled.
+ *       DW_FEATURE_ENABLED if the feature is supported and enabled.
+ *       Other value greater than 1, same as enabled but with extra info.
+ */
+int API dw_feature_get(DWFEATURE feature)
+{
+    switch(feature)
+    {
+        case DW_FEATURE_WINDOW_BORDER:
+        case DW_FEATURE_MLE_WORD_WRAP:
+        case DW_FEATURE_NOTEBOOK_STATUS_TEXT:
+        case DW_FEATURE_MDI:
+            return DW_FEATURE_ENABLED;
+    }
+    return DW_FEATURE_UNSUPPORTED;
+}
+
+/*
+ * Sets the state of the requested library feature.
+ * Parameters:
+ *       feature: The requested feature for example DW_FEATURE_DARK_MODE
+ *       state: DW_FEATURE_DISABLED, DW_FEATURE_ENABLED or any value greater than 1.
+ * Returns:
+ *       DW_FEATURE_UNSUPPORTED if the library or OS does not support the feature.
+ *       DW_ERROR_NONE if the feature is supported and successfully configured.
+ *       DW_ERROR_GENERAL if the feature is supported but could not be configured.
+ * Remarks: 
+ *       These settings are typically used during dw_init() so issue before 
+ *       setting up the library with dw_init().
+ */
+int API dw_feature_set(DWFEATURE feature, int state)
+{
+    switch(feature)
+    {
+        /* These features are supported but not configurable */
+        case DW_FEATURE_WINDOW_BORDER:
+        case DW_FEATURE_MLE_WORD_WRAP:
+        case DW_FEATURE_NOTEBOOK_STATUS_TEXT:
+        case DW_FEATURE_MDI:
+            return DW_ERROR_GENERAL;
+        /* These features are supported and configurable */
+    }
+    return DW_FEATURE_UNSUPPORTED;
+}