Connor McAdams : uiautomationcore: Add support for UIAutomationType_Bool properties.

Alexandre Julliard julliard at winehq.org
Mon Jul 25 16:18:23 CDT 2022


Module: wine
Branch: master
Commit: 0bc1f6876183b6a695d2660de119c75b38e41cab
URL:    https://gitlab.winehq.org/wine/wine/-/commit/0bc1f6876183b6a695d2660de119c75b38e41cab

Author: Connor McAdams <cmcadams at codeweavers.com>
Date:   Mon Jun 20 16:11:13 2022 -0400

uiautomationcore: Add support for UIAutomationType_Bool properties.

Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>

---

 dlls/uiautomationcore/tests/uiautomation.c |  4 +---
 dlls/uiautomationcore/uia_client.c         |  9 ++++++++
 dlls/uiautomationcore/uia_ids.c            | 36 ++++++++++++++++++++----------
 3 files changed, 34 insertions(+), 15 deletions(-)

diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c
index 7378e78d73d..669e6d58b87 100644
--- a/dlls/uiautomationcore/tests/uiautomation.c
+++ b/dlls/uiautomationcore/tests/uiautomation.c
@@ -4200,9 +4200,7 @@ static void check_uia_prop_val(PROPERTYID prop_id, enum UIAutomationType type, V
         break;
 
     case UIAutomationType_Bool:
-        todo_wine ok(V_VT(v) == VT_BOOL, "Unexpected VT %d\n", V_VT(v));
-        if (V_VT(v) != VT_BOOL)
-            break;
+        ok(V_VT(v) == VT_BOOL, "Unexpected VT %d\n", V_VT(v));
 
         /* UIA_IsKeyboardFocusablePropertyId is broken on Win8 and Win10v1507. */
         if (prop_id == UIA_IsKeyboardFocusablePropertyId)
diff --git a/dlls/uiautomationcore/uia_client.c b/dlls/uiautomationcore/uia_client.c
index d2f05648b11..c800645da0c 100644
--- a/dlls/uiautomationcore/uia_client.c
+++ b/dlls/uiautomationcore/uia_client.c
@@ -387,6 +387,15 @@ static HRESULT WINAPI uia_provider_get_prop_val(IWineUiaProvider *iface,
         *ret_val = v;
         break;
 
+    case UIAutomationType_Bool:
+        if (V_VT(&v) != VT_BOOL)
+        {
+            WARN("Invalid vt %d for UIAutomationType_Bool\n", V_VT(&v));
+            goto exit;
+        }
+        *ret_val = v;
+        break;
+
     case UIAutomationType_Element:
     {
         IRawElementProviderSimple *elprov;
diff --git a/dlls/uiautomationcore/uia_ids.c b/dlls/uiautomationcore/uia_ids.c
index 10eea31adc3..90de0e21ce9 100644
--- a/dlls/uiautomationcore/uia_ids.c
+++ b/dlls/uiautomationcore/uia_ids.c
@@ -66,7 +66,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &LegacyIAccessible_DefaultAction_Property_GUID,    UIA_LegacyIAccessibleDefaultActionPropertyId, },
     { &Level_Property_GUID,                              UIA_LevelPropertyId,
       UIAutomationType_Int, },
-    { &IsKeyboardFocusable_Property_GUID,                UIA_IsKeyboardFocusablePropertyId, },
+    { &IsKeyboardFocusable_Property_GUID,                UIA_IsKeyboardFocusablePropertyId,
+      UIAutomationType_Bool, },
     { &GridItem_Row_Property_GUID,                       UIA_GridItemRowPropertyId, },
     { &IsSpreadsheetItemPatternAvailable_Property_GUID,  UIA_IsSpreadsheetItemPatternAvailablePropertyId, },
     { &Table_ColumnHeaders_Property_GUID,                UIA_TableColumnHeadersPropertyId, },
@@ -82,7 +83,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &IsAnnotationPatternAvailable_Property_GUID,       UIA_IsAnnotationPatternAvailablePropertyId, },
     { &SpreadsheetItem_AnnotationObjects_Property_GUID,  UIA_SpreadsheetItemAnnotationObjectsPropertyId, },
     { &IsInvokePatternAvailable_Property_GUID,           UIA_IsInvokePatternAvailablePropertyId, },
-    { &HasKeyboardFocus_Property_GUID,                   UIA_HasKeyboardFocusPropertyId, },
+    { &HasKeyboardFocus_Property_GUID,                   UIA_HasKeyboardFocusPropertyId,
+      UIAutomationType_Bool, },
     { &ClickablePoint_Property_GUID,                     UIA_ClickablePointPropertyId, },
     { &NewNativeWindowHandle_Property_GUID,              UIA_NativeWindowHandlePropertyId,
       UIAutomationType_Int, },
@@ -104,7 +106,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &Annotation_AnnotationTypeId_Property_GUID,        UIA_AnnotationAnnotationTypeIdPropertyId, },
     { &FlowsFrom_Property_GUID,                          UIA_FlowsFromPropertyId,
       UIAutomationType_ElementArray, },
-    { &OptimizeForVisualContent_Property_GUID,           UIA_OptimizeForVisualContentPropertyId, },
+    { &OptimizeForVisualContent_Property_GUID,           UIA_OptimizeForVisualContentPropertyId,
+      UIAutomationType_Bool, },
     { &IsVirtualizedItemPatternAvailable_Property_GUID,  UIA_IsVirtualizedItemPatternAvailablePropertyId, },
     { &GridItem_Parent_Property_GUID,                    UIA_GridItemContainingGridPropertyId, },
     { &LegacyIAccessible_Help_Property_GUID,             UIA_LegacyIAccessibleHelpPropertyId, },
@@ -123,7 +126,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &IsTablePatternAvailable_Property_GUID,            UIA_IsTablePatternAvailablePropertyId, },
     { &SelectionItem_IsSelected_Property_GUID,           UIA_SelectionItemIsSelectedPropertyId, },
     { &Window_WindowVisualState_Property_GUID,           UIA_WindowWindowVisualStatePropertyId, },
-    { &IsOffscreen_Property_GUID,                        UIA_IsOffscreenPropertyId, },
+    { &IsOffscreen_Property_GUID,                        UIA_IsOffscreenPropertyId,
+      UIAutomationType_Bool, },
     { &Annotation_Author_Property_GUID,                  UIA_AnnotationAuthorPropertyId, },
     { &Orientation_Property_GUID,                        UIA_OrientationPropertyId,
       UIAutomationType_Int, },
@@ -139,7 +143,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &Grid_ColumnCount_Property_GUID,                   UIA_GridColumnCountPropertyId, },
     { &AnnotationTypes_Property_GUID,                    UIA_AnnotationTypesPropertyId,
       UIAutomationType_IntArray, },
-    { &IsPeripheral_Property_GUID,                       UIA_IsPeripheralPropertyId, },
+    { &IsPeripheral_Property_GUID,                       UIA_IsPeripheralPropertyId,
+      UIAutomationType_Bool, },
     { &Transform2_ZoomMaximum_Property_GUID,             UIA_Transform2ZoomMaximumPropertyId, },
     { &Drag_DropEffect_Property_GUID,                    UIA_DragDropEffectPropertyId, },
     { &MultipleView_CurrentView_Property_GUID,           UIA_MultipleViewCurrentViewPropertyId, },
@@ -147,10 +152,13 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &Rotation_Property_GUID,                           UIA_RotationPropertyId,
       UIAutomationType_Double, },
     { &SpreadsheetItem_Formula_Property_GUID,            UIA_SpreadsheetItemFormulaPropertyId, },
-    { &IsEnabled_Property_GUID,                          UIA_IsEnabledPropertyId, },
+    { &IsEnabled_Property_GUID,                          UIA_IsEnabledPropertyId,
+      UIAutomationType_Bool, },
     { &LocalizedLandmarkType_Property_GUID,              UIA_LocalizedLandmarkTypePropertyId, },
-    { &IsDataValidForForm_Property_GUID,                 UIA_IsDataValidForFormPropertyId, },
-    { &IsControlElement_Property_GUID,                   UIA_IsControlElementPropertyId, },
+    { &IsDataValidForForm_Property_GUID,                 UIA_IsDataValidForFormPropertyId,
+      UIAutomationType_Bool, },
+    { &IsControlElement_Property_GUID,                   UIA_IsControlElementPropertyId,
+      UIAutomationType_Bool, },
     { &HelpText_Property_GUID,                           UIA_HelpTextPropertyId, },
     { &Table_RowHeaders_Property_GUID,                   UIA_TableRowHeadersPropertyId, },
     { &ControllerFor_Property_GUID,                      UIA_ControllerForPropertyId,
@@ -170,7 +178,8 @@ static const struct uia_prop_info default_uia_properties[] = {
       UIAutomationType_Int, },
     { &Scroll_VerticalScrollPercent_Property_GUID,       UIA_ScrollVerticalScrollPercentPropertyId, },
     { &IsObjectModelPatternAvailable_Property_GUID,      UIA_IsObjectModelPatternAvailablePropertyId, },
-    { &IsDialog_Property_GUID,                           UIA_IsDialogPropertyId, },
+    { &IsDialog_Property_GUID,                           UIA_IsDialogPropertyId,
+      UIAutomationType_Bool, },
     { &IsTextPatternAvailable_Property_GUID,             UIA_IsTextPatternAvailablePropertyId, },
     { &LegacyIAccessible_Role_Property_GUID,             UIA_LegacyIAccessibleRolePropertyId, },
     { &Selection2_ItemCount_Property_GUID,               UIA_Selection2ItemCountPropertyId, },
@@ -183,9 +192,11 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &Transform_CanResize_Property_GUID,                UIA_TransformCanResizePropertyId, },
     { &IsValuePatternAvailable_Property_GUID,            UIA_IsValuePatternAvailablePropertyId, },
     { &IsItemContainerPatternAvailable_Property_GUID,    UIA_IsItemContainerPatternAvailablePropertyId, },
-    { &IsContentElement_Property_GUID,                   UIA_IsContentElementPropertyId, },
+    { &IsContentElement_Property_GUID,                   UIA_IsContentElementPropertyId,
+      UIAutomationType_Bool, },
     { &LegacyIAccessible_KeyboardShortcut_Property_GUID, UIA_LegacyIAccessibleKeyboardShortcutPropertyId, },
-    { &IsPassword_Property_GUID,                         UIA_IsPasswordPropertyId, },
+    { &IsPassword_Property_GUID,                         UIA_IsPasswordPropertyId,
+      UIAutomationType_Bool, },
     { &IsWindowPatternAvailable_Property_GUID,           UIA_IsWindowPatternAvailablePropertyId, },
     { &RangeValue_Minimum_Property_GUID,                 UIA_RangeValueMinimumPropertyId, },
     { &BoundingRectangle_Property_GUID,                  UIA_BoundingRectanglePropertyId, },
@@ -205,7 +216,8 @@ static const struct uia_prop_info default_uia_properties[] = {
     { &IsLegacyIAccessiblePatternAvailable_Property_GUID,UIA_IsLegacyIAccessiblePatternAvailablePropertyId, },
     { &AnnotationObjects_Property_GUID,                  UIA_AnnotationObjectsPropertyId,
       UIAutomationType_ElementArray, },
-    { &IsRequiredForForm_Property_GUID,                  UIA_IsRequiredForFormPropertyId, },
+    { &IsRequiredForForm_Property_GUID,                  UIA_IsRequiredForFormPropertyId,
+      UIAutomationType_Bool, },
     { &SpreadsheetItem_AnnotationTypes_Property_GUID,    UIA_SpreadsheetItemAnnotationTypesPropertyId, },
     { &FillColor_Property_GUID,                          UIA_FillColorPropertyId,
       UIAutomationType_Int, },




More information about the wine-cvs mailing list