include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / dlls / uiautomationcore / uia_ids.c
blob434494a8f2b596d48e11b1b671e9a223d2093d60
1 /*
2 * Copyright 2022 Connor McAdams for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "uia_private.h"
20 #include "ocidl.h"
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(uiautomation);
26 static int __cdecl uia_property_guid_compare(const void *a, const void *b)
28 const GUID *guid = a;
29 const struct uia_prop_info *property = b;
30 return memcmp(guid, property->guid, sizeof(*guid));
33 static int __cdecl uia_event_guid_compare(const void *a, const void *b)
35 const GUID *guid = a;
36 const struct uia_event_info *event = b;
37 return memcmp(guid, event->guid, sizeof(*guid));
40 static int __cdecl uia_pattern_guid_compare(const void *a, const void *b)
42 const GUID *guid = a;
43 const struct uia_pattern_info *pattern = b;
44 return memcmp(guid, pattern->guid, sizeof(*guid));
47 static int __cdecl uia_control_type_guid_compare(const void *a, const void *b)
49 const GUID *guid = a;
50 const struct uia_control_type_info *control = b;
51 return memcmp(guid, control->guid, sizeof(*guid));
54 /* Sorted by GUID. */
55 static const struct uia_prop_info default_uia_properties[] = {
56 { &AutomationId_Property_GUID, UIA_AutomationIdPropertyId,
57 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
58 { &FrameworkId_Property_GUID, UIA_FrameworkIdPropertyId,
59 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
60 { &IsTransformPatternAvailable_Property_GUID, UIA_IsTransformPatternAvailablePropertyId, },
61 { &IsScrollItemPatternAvailable_Property_GUID, UIA_IsScrollItemPatternAvailablePropertyId, },
62 { &IsExpandCollapsePatternAvailable_Property_GUID, UIA_IsExpandCollapsePatternAvailablePropertyId, },
63 { &CenterPoint_Property_GUID, UIA_CenterPointPropertyId, },
64 { &IsTableItemPatternAvailable_Property_GUID, UIA_IsTableItemPatternAvailablePropertyId, },
65 { &Scroll_HorizontalScrollPercent_Property_GUID, UIA_ScrollHorizontalScrollPercentPropertyId, },
66 { &AccessKey_Property_GUID, UIA_AccessKeyPropertyId,
67 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
68 { &RangeValue_Maximum_Property_GUID, UIA_RangeValueMaximumPropertyId, },
69 { &ClassName_Property_GUID, UIA_ClassNamePropertyId,
70 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
71 { &Transform2_ZoomMinimum_Property_GUID, UIA_Transform2ZoomMinimumPropertyId, },
72 { &LegacyIAccessible_Description_Property_GUID, UIA_LegacyIAccessibleDescriptionPropertyId, },
73 { &Transform2_ZoomLevel_Property_GUID, UIA_Transform2ZoomLevelPropertyId, },
74 { &Name_Property_GUID, UIA_NamePropertyId,
75 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
76 { &GridItem_RowSpan_Property_GUID, UIA_GridItemRowSpanPropertyId, },
77 { &Size_Property_GUID, UIA_SizePropertyId,
78 PROP_TYPE_ELEM_PROP, UIAutomationType_DoubleArray, },
79 { &IsTextPattern2Available_Property_GUID, UIA_IsTextPattern2AvailablePropertyId, },
80 { &Styles_FillPatternStyle_Property_GUID, UIA_StylesFillPatternStylePropertyId, },
81 { &FlowsTo_Property_GUID, UIA_FlowsToPropertyId,
82 PROP_TYPE_ELEM_PROP, UIAutomationType_ElementArray, },
83 { &ItemStatus_Property_GUID, UIA_ItemStatusPropertyId,
84 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
85 { &Scroll_VerticalViewSize_Property_GUID, UIA_ScrollVerticalViewSizePropertyId, },
86 { &Selection_IsSelectionRequired_Property_GUID, UIA_SelectionIsSelectionRequiredPropertyId, },
87 { &IsGridItemPatternAvailable_Property_GUID, UIA_IsGridItemPatternAvailablePropertyId, },
88 { &Window_CanMinimize_Property_GUID, UIA_WindowCanMinimizePropertyId, },
89 { &RangeValue_LargeChange_Property_GUID, UIA_RangeValueLargeChangePropertyId, },
90 { &Selection2_CurrentSelectedItem_Property_GUID, UIA_Selection2CurrentSelectedItemPropertyId, },
91 { &Culture_Property_GUID, UIA_CulturePropertyId,
92 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
93 { &LegacyIAccessible_DefaultAction_Property_GUID, UIA_LegacyIAccessibleDefaultActionPropertyId, },
94 { &Level_Property_GUID, UIA_LevelPropertyId,
95 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
96 { &IsKeyboardFocusable_Property_GUID, UIA_IsKeyboardFocusablePropertyId,
97 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
98 { &GridItem_Row_Property_GUID, UIA_GridItemRowPropertyId, },
99 { &IsSpreadsheetItemPatternAvailable_Property_GUID, UIA_IsSpreadsheetItemPatternAvailablePropertyId, },
100 { &Table_ColumnHeaders_Property_GUID, UIA_TableColumnHeadersPropertyId, },
101 { &Drag_GrabbedItems_Property_GUID, UIA_DragGrabbedItemsPropertyId, },
102 { &Annotation_Target_Property_GUID, UIA_AnnotationTargetPropertyId, },
103 { &IsSelectionItemPatternAvailable_Property_GUID, UIA_IsSelectionItemPatternAvailablePropertyId, },
104 { &IsDropTargetPatternAvailable_Property_GUID, UIA_IsDropTargetPatternAvailablePropertyId, },
105 { &Dock_DockPosition_Property_GUID, UIA_DockDockPositionPropertyId, },
106 { &Styles_StyleId_Property_GUID, UIA_StylesStyleIdPropertyId, },
107 { &Value_IsReadOnly_Property_GUID, UIA_ValueIsReadOnlyPropertyId,
108 PROP_TYPE_PATTERN_PROP, UIAutomationType_Bool,
109 UIA_ValuePatternId, },
110 { &IsSpreadsheetPatternAvailable_Property_GUID, UIA_IsSpreadsheetPatternAvailablePropertyId, },
111 { &Styles_StyleName_Property_GUID, UIA_StylesStyleNamePropertyId, },
112 { &IsAnnotationPatternAvailable_Property_GUID, UIA_IsAnnotationPatternAvailablePropertyId, },
113 { &SpreadsheetItem_AnnotationObjects_Property_GUID, UIA_SpreadsheetItemAnnotationObjectsPropertyId, },
114 { &IsInvokePatternAvailable_Property_GUID, UIA_IsInvokePatternAvailablePropertyId, },
115 { &HasKeyboardFocus_Property_GUID, UIA_HasKeyboardFocusPropertyId,
116 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
117 { &ClickablePoint_Property_GUID, UIA_ClickablePointPropertyId, },
118 { &NewNativeWindowHandle_Property_GUID, UIA_NativeWindowHandlePropertyId,
119 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
120 { &SizeOfSet_Property_GUID, UIA_SizeOfSetPropertyId,
121 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
122 { &LegacyIAccessible_Name_Property_GUID, UIA_LegacyIAccessibleNamePropertyId, },
123 { &Window_CanMaximize_Property_GUID, UIA_WindowCanMaximizePropertyId, },
124 { &Scroll_HorizontallyScrollable_Property_GUID, UIA_ScrollHorizontallyScrollablePropertyId, },
125 { &ExpandCollapse_ExpandCollapseState_Property_GUID, UIA_ExpandCollapseExpandCollapseStatePropertyId, },
126 { &Transform_CanRotate_Property_GUID, UIA_TransformCanRotatePropertyId, },
127 { &IsRangeValuePatternAvailable_Property_GUID, UIA_IsRangeValuePatternAvailablePropertyId, },
128 { &IsScrollPatternAvailable_Property_GUID, UIA_IsScrollPatternAvailablePropertyId, },
129 { &IsTransformPattern2Available_Property_GUID, UIA_IsTransformPattern2AvailablePropertyId, },
130 { &LabeledBy_Property_GUID, UIA_LabeledByPropertyId,
131 PROP_TYPE_ELEM_PROP, UIAutomationType_Element, },
132 { &ItemType_Property_GUID, UIA_ItemTypePropertyId,
133 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
134 { &Transform_CanMove_Property_GUID, UIA_TransformCanMovePropertyId, },
135 { &LocalizedControlType_Property_GUID, UIA_LocalizedControlTypePropertyId,
136 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
137 { &Annotation_AnnotationTypeId_Property_GUID, UIA_AnnotationAnnotationTypeIdPropertyId, },
138 { &FlowsFrom_Property_GUID, UIA_FlowsFromPropertyId,
139 PROP_TYPE_ELEM_PROP, UIAutomationType_ElementArray, },
140 { &OptimizeForVisualContent_Property_GUID, UIA_OptimizeForVisualContentPropertyId,
141 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
142 { &IsVirtualizedItemPatternAvailable_Property_GUID, UIA_IsVirtualizedItemPatternAvailablePropertyId, },
143 { &GridItem_Parent_Property_GUID, UIA_GridItemContainingGridPropertyId, },
144 { &LegacyIAccessible_Help_Property_GUID, UIA_LegacyIAccessibleHelpPropertyId, },
145 { &Toggle_ToggleState_Property_GUID, UIA_ToggleToggleStatePropertyId, },
146 { &IsTogglePatternAvailable_Property_GUID, UIA_IsTogglePatternAvailablePropertyId, },
147 { &LegacyIAccessible_State_Property_GUID, UIA_LegacyIAccessibleStatePropertyId, },
148 { &PositionInSet_Property_GUID, UIA_PositionInSetPropertyId,
149 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
150 { &RangeValue_IsReadOnly_Property_GUID, UIA_RangeValueIsReadOnlyPropertyId, },
151 { &Drag_DropEffects_Property_GUID, UIA_DragDropEffectsPropertyId, },
152 { &RangeValue_SmallChange_Property_GUID, UIA_RangeValueSmallChangePropertyId, },
153 { &IsTextEditPatternAvailable_Property_GUID, UIA_IsTextEditPatternAvailablePropertyId, },
154 { &GridItem_Column_Property_GUID, UIA_GridItemColumnPropertyId, },
155 { &LegacyIAccessible_ChildId_Property_GUID, UIA_LegacyIAccessibleChildIdPropertyId,
156 PROP_TYPE_PATTERN_PROP, UIAutomationType_Int,
157 UIA_LegacyIAccessiblePatternId, },
158 { &Annotation_DateTime_Property_GUID, UIA_AnnotationDateTimePropertyId, },
159 { &IsTablePatternAvailable_Property_GUID, UIA_IsTablePatternAvailablePropertyId, },
160 { &SelectionItem_IsSelected_Property_GUID, UIA_SelectionItemIsSelectedPropertyId, },
161 { &Window_WindowVisualState_Property_GUID, UIA_WindowWindowVisualStatePropertyId, },
162 { &IsOffscreen_Property_GUID, UIA_IsOffscreenPropertyId,
163 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
164 { &Annotation_Author_Property_GUID, UIA_AnnotationAuthorPropertyId, },
165 { &Orientation_Property_GUID, UIA_OrientationPropertyId,
166 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
167 { &Value_Value_Property_GUID, UIA_ValueValuePropertyId, },
168 { &VisualEffects_Property_GUID, UIA_VisualEffectsPropertyId,
169 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
170 { &Selection2_FirstSelectedItem_Property_GUID, UIA_Selection2FirstSelectedItemPropertyId, },
171 { &IsGridPatternAvailable_Property_GUID, UIA_IsGridPatternAvailablePropertyId, },
172 { &SelectionItem_SelectionContainer_Property_GUID, UIA_SelectionItemSelectionContainerPropertyId, },
173 { &HeadingLevel_Property_GUID, UIA_HeadingLevelPropertyId,
174 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
175 { &DropTarget_DropTargetEffect_Property_GUID, UIA_DropTargetDropTargetEffectPropertyId, },
176 { &Grid_ColumnCount_Property_GUID, UIA_GridColumnCountPropertyId, },
177 { &AnnotationTypes_Property_GUID, UIA_AnnotationTypesPropertyId,
178 PROP_TYPE_ELEM_PROP, UIAutomationType_IntArray, },
179 { &IsPeripheral_Property_GUID, UIA_IsPeripheralPropertyId,
180 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
181 { &Transform2_ZoomMaximum_Property_GUID, UIA_Transform2ZoomMaximumPropertyId, },
182 { &Drag_DropEffect_Property_GUID, UIA_DragDropEffectPropertyId, },
183 { &MultipleView_CurrentView_Property_GUID, UIA_MultipleViewCurrentViewPropertyId, },
184 { &Styles_FillColor_Property_GUID, UIA_StylesFillColorPropertyId, },
185 { &Rotation_Property_GUID, UIA_RotationPropertyId,
186 PROP_TYPE_ELEM_PROP, UIAutomationType_Double, },
187 { &SpreadsheetItem_Formula_Property_GUID, UIA_SpreadsheetItemFormulaPropertyId, },
188 { &IsEnabled_Property_GUID, UIA_IsEnabledPropertyId,
189 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
190 { &LocalizedLandmarkType_Property_GUID, UIA_LocalizedLandmarkTypePropertyId,
191 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
192 { &IsDataValidForForm_Property_GUID, UIA_IsDataValidForFormPropertyId,
193 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
194 { &IsControlElement_Property_GUID, UIA_IsControlElementPropertyId,
195 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
196 { &HelpText_Property_GUID, UIA_HelpTextPropertyId,
197 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
198 { &Table_RowHeaders_Property_GUID, UIA_TableRowHeadersPropertyId, },
199 { &ControllerFor_Property_GUID, UIA_ControllerForPropertyId,
200 PROP_TYPE_ELEM_PROP, UIAutomationType_ElementArray, },
201 { &ProviderDescription_Property_GUID, UIA_ProviderDescriptionPropertyId,
202 PROP_TYPE_SPECIAL, UIAutomationType_String, },
203 { &AriaProperties_Property_GUID, UIA_AriaPropertiesPropertyId,
204 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
205 { &LiveSetting_Property_GUID, UIA_LiveSettingPropertyId,
206 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
207 { &Selection2_LastSelectedItem_Property_GUID, UIA_Selection2LastSelectedItemPropertyId, },
208 { &Transform2_CanZoom_Property_GUID, UIA_Transform2CanZoomPropertyId, },
209 { &Window_IsModal_Property_GUID, UIA_WindowIsModalPropertyId, },
210 { &Annotation_AnnotationTypeName_Property_GUID, UIA_AnnotationAnnotationTypeNamePropertyId, },
211 { &AriaRole_Property_GUID, UIA_AriaRolePropertyId,
212 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
213 { &Scroll_VerticallyScrollable_Property_GUID, UIA_ScrollVerticallyScrollablePropertyId, },
214 { &RangeValue_Value_Property_GUID, UIA_RangeValueValuePropertyId, },
215 { &ProcessId_Property_GUID, UIA_ProcessIdPropertyId,
216 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
217 { &Scroll_VerticalScrollPercent_Property_GUID, UIA_ScrollVerticalScrollPercentPropertyId, },
218 { &IsObjectModelPatternAvailable_Property_GUID, UIA_IsObjectModelPatternAvailablePropertyId, },
219 { &IsDialog_Property_GUID, UIA_IsDialogPropertyId,
220 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
221 { &IsTextPatternAvailable_Property_GUID, UIA_IsTextPatternAvailablePropertyId, },
222 { &LegacyIAccessible_Role_Property_GUID, UIA_LegacyIAccessibleRolePropertyId,
223 PROP_TYPE_PATTERN_PROP, UIAutomationType_Int,
224 UIA_LegacyIAccessiblePatternId, },
225 { &Selection2_ItemCount_Property_GUID, UIA_Selection2ItemCountPropertyId, },
226 { &TableItem_RowHeaderItems_Property_GUID, UIA_TableItemRowHeaderItemsPropertyId, },
227 { &Styles_ExtendedProperties_Property_GUID, UIA_StylesExtendedPropertiesPropertyId, },
228 { &Selection_Selection_Property_GUID, UIA_SelectionSelectionPropertyId, },
229 { &TableItem_ColumnHeaderItems_Property_GUID, UIA_TableItemColumnHeaderItemsPropertyId, },
230 { &Window_WindowInteractionState_Property_GUID, UIA_WindowWindowInteractionStatePropertyId, },
231 { &Selection_CanSelectMultiple_Property_GUID, UIA_SelectionCanSelectMultiplePropertyId, },
232 { &Transform_CanResize_Property_GUID, UIA_TransformCanResizePropertyId, },
233 { &IsValuePatternAvailable_Property_GUID, UIA_IsValuePatternAvailablePropertyId, },
234 { &IsItemContainerPatternAvailable_Property_GUID, UIA_IsItemContainerPatternAvailablePropertyId, },
235 { &IsContentElement_Property_GUID, UIA_IsContentElementPropertyId,
236 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
237 { &LegacyIAccessible_KeyboardShortcut_Property_GUID, UIA_LegacyIAccessibleKeyboardShortcutPropertyId, },
238 { &IsPassword_Property_GUID, UIA_IsPasswordPropertyId,
239 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
240 { &IsWindowPatternAvailable_Property_GUID, UIA_IsWindowPatternAvailablePropertyId, },
241 { &RangeValue_Minimum_Property_GUID, UIA_RangeValueMinimumPropertyId, },
242 { &BoundingRectangle_Property_GUID, UIA_BoundingRectanglePropertyId,
243 PROP_TYPE_SPECIAL, UIAutomationType_Rect, },
244 { &LegacyIAccessible_Value_Property_GUID, UIA_LegacyIAccessibleValuePropertyId, },
245 { &IsDragPatternAvailable_Property_GUID, UIA_IsDragPatternAvailablePropertyId, },
246 { &DescribedBy_Property_GUID, UIA_DescribedByPropertyId,
247 PROP_TYPE_ELEM_PROP, UIAutomationType_ElementArray, },
248 { &IsSelectionPatternAvailable_Property_GUID, UIA_IsSelectionPatternAvailablePropertyId, },
249 { &Grid_RowCount_Property_GUID, UIA_GridRowCountPropertyId, },
250 { &OutlineColor_Property_GUID, UIA_OutlineColorPropertyId,
251 PROP_TYPE_ELEM_PROP, UIAutomationType_IntArray, },
252 { &Table_RowOrColumnMajor_Property_GUID, UIA_TableRowOrColumnMajorPropertyId, },
253 { &IsDockPatternAvailable_Property_GUID, UIA_IsDockPatternAvailablePropertyId, },
254 { &IsSynchronizedInputPatternAvailable_Property_GUID,UIA_IsSynchronizedInputPatternAvailablePropertyId, },
255 { &OutlineThickness_Property_GUID, UIA_OutlineThicknessPropertyId,
256 PROP_TYPE_ELEM_PROP, UIAutomationType_DoubleArray, },
257 { &IsLegacyIAccessiblePatternAvailable_Property_GUID,UIA_IsLegacyIAccessiblePatternAvailablePropertyId, },
258 { &AnnotationObjects_Property_GUID, UIA_AnnotationObjectsPropertyId,
259 PROP_TYPE_ELEM_PROP, UIAutomationType_ElementArray, },
260 { &IsRequiredForForm_Property_GUID, UIA_IsRequiredForFormPropertyId,
261 PROP_TYPE_ELEM_PROP, UIAutomationType_Bool, },
262 { &SpreadsheetItem_AnnotationTypes_Property_GUID, UIA_SpreadsheetItemAnnotationTypesPropertyId, },
263 { &FillColor_Property_GUID, UIA_FillColorPropertyId,
264 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
265 { &IsStylesPatternAvailable_Property_GUID, UIA_IsStylesPatternAvailablePropertyId, },
266 { &Window_IsTopmost_Property_GUID, UIA_WindowIsTopmostPropertyId, },
267 { &IsCustomNavigationPatternAvailable_Property_GUID, UIA_IsCustomNavigationPatternAvailablePropertyId, },
268 { &Scroll_HorizontalViewSize_Property_GUID, UIA_ScrollHorizontalViewSizePropertyId, },
269 { &AcceleratorKey_Property_GUID, UIA_AcceleratorKeyPropertyId,
270 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
271 { &IsTextChildPatternAvailable_Property_GUID, UIA_IsTextChildPatternAvailablePropertyId, },
272 { &LegacyIAccessible_Selection_Property_GUID, UIA_LegacyIAccessibleSelectionPropertyId, },
273 { &FillType_Property_GUID, UIA_FillTypePropertyId,
274 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
275 { &ControlType_Property_GUID, UIA_ControlTypePropertyId,
276 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
277 { &IsMultipleViewPatternAvailable_Property_GUID, UIA_IsMultipleViewPatternAvailablePropertyId, },
278 { &DropTarget_DropTargetEffects_Property_GUID, UIA_DropTargetDropTargetEffectsPropertyId, },
279 { &LandmarkType_Property_GUID, UIA_LandmarkTypePropertyId,
280 PROP_TYPE_ELEM_PROP, UIAutomationType_Int, },
281 { &Drag_IsGrabbed_Property_GUID, UIA_DragIsGrabbedPropertyId, },
282 { &GridItem_ColumnSpan_Property_GUID, UIA_GridItemColumnSpanPropertyId, },
283 { &Styles_Shape_Property_GUID, UIA_StylesShapePropertyId, },
284 { &RuntimeId_Property_GUID, UIA_RuntimeIdPropertyId,
285 PROP_TYPE_SPECIAL, UIAutomationType_IntArray, },
286 { &IsSelectionPattern2Available_Property_GUID, UIA_IsSelectionPattern2AvailablePropertyId, },
287 { &MultipleView_SupportedViews_Property_GUID, UIA_MultipleViewSupportedViewsPropertyId, },
288 { &Styles_FillPatternColor_Property_GUID, UIA_StylesFillPatternColorPropertyId, },
289 { &FullDescription_Property_GUID, UIA_FullDescriptionPropertyId,
290 PROP_TYPE_ELEM_PROP, UIAutomationType_String, },
293 static const int prop_id_idx[] = {
294 0xaa, 0x8b, 0x76, 0xa3, 0x3d, 0x0e, 0x9f, 0x08,
295 0x2e, 0x1e, 0x65, 0x00, 0x0a, 0x69, 0x2f, 0x1b,
296 0x68, 0x86, 0x3a, 0x88, 0x30, 0x3b, 0x52, 0x54,
297 0x01, 0x98, 0x14, 0x93, 0x04, 0x17, 0x58, 0x2d,
298 0xa4, 0x37, 0x38, 0x03, 0x24, 0x8f, 0x4f, 0x06,
299 0x7a, 0x45, 0x02, 0x84, 0x89, 0x55, 0x28, 0x75,
300 0x48, 0x8a, 0x09, 0x19, 0x4a, 0x07, 0x9e, 0x77,
301 0x15, 0x34, 0x74, 0x7f, 0x82, 0x16, 0x90, 0x5c,
302 0x1f, 0x4c, 0x0f, 0xa8, 0x42, 0x26, 0x35, 0x61,
303 0xac, 0x33, 0x18, 0x51, 0x81, 0x71, 0x9c, 0x50,
304 0x59, 0x6a, 0x21, 0x92, 0x7d, 0x80, 0x44, 0x3c,
305 0x83, 0x36, 0x96, 0x4d, 0x32, 0x8c, 0x0c, 0x7b,
306 0x46, 0x43, 0x87, 0xa1, 0x1c, 0x73, 0x6d, 0x67,
307 0x6b, 0x8e, 0x13, 0x6c, 0x85, 0x41, 0x94, 0x40,
308 0x78, 0x3e, 0x72, 0x53, 0x4e, 0x23, 0x2b, 0x11,
309 0x27, 0x2a, 0x62, 0x12, 0xa9, 0xad, 0x7e, 0x9b,
310 0x29, 0x64, 0x2c, 0x99, 0x20, 0x70, 0x39, 0x6e,
311 0xa0, 0x8d, 0xa7, 0x60, 0x49, 0x25, 0x5b, 0xa5,
312 0x22, 0x0d, 0x0b, 0x5f, 0x3f, 0x4b, 0x5e, 0x9d,
313 0x47, 0x31, 0x1d, 0x5d, 0x97, 0xa6, 0x66, 0xae,
314 0x9a, 0x91, 0xa2, 0x56, 0x95, 0x05, 0x63, 0x10,
315 0xab, 0x57, 0x6f, 0x1a, 0x7c, 0x5a, 0x79,
318 #define PROP_ID_MIN 30000
319 #define PROP_ID_MAX (PROP_ID_MIN + ARRAY_SIZE(default_uia_properties))
321 static const struct uia_prop_info *uia_prop_info_from_guid(const GUID *guid)
323 struct uia_prop_info *prop;
325 if ((prop = bsearch(guid, default_uia_properties, ARRAY_SIZE(default_uia_properties), sizeof(*prop),
326 uia_property_guid_compare)))
327 return prop;
329 return NULL;
332 const struct uia_prop_info *uia_prop_info_from_id(PROPERTYID prop_id)
334 if ((prop_id < PROP_ID_MIN) || (prop_id >= PROP_ID_MAX))
335 return NULL;
337 return &default_uia_properties[prop_id_idx[prop_id - PROP_ID_MIN]];
340 /* Sorted by GUID. */
341 static const struct uia_event_info default_uia_events[] = {
342 { &Selection_InvalidatedEvent_Event_GUID, UIA_Selection_InvalidatedEventId,
343 EventArgsType_Simple, },
344 { &Window_WindowOpened_Event_GUID, UIA_Window_WindowOpenedEventId,
345 EventArgsType_Simple, },
346 { &TextEdit_TextChanged_Event_GUID, UIA_TextEdit_TextChangedEventId,
347 EventArgsType_TextEditTextChanged, },
348 { &Drag_DragStart_Event_GUID, UIA_Drag_DragStartEventId,
349 EventArgsType_Simple, },
350 { &Changes_Event_GUID, UIA_ChangesEventId,
351 EventArgsType_Changes, },
352 { &DropTarget_DragLeave_Event_GUID, UIA_DropTarget_DragLeaveEventId,
353 EventArgsType_Simple, },
354 { &AutomationFocusChanged_Event_GUID, UIA_AutomationFocusChangedEventId,
355 EventArgsType_Simple, },
356 { &AsyncContentLoaded_Event_GUID, UIA_AsyncContentLoadedEventId,
357 EventArgsType_AsyncContentLoaded, },
358 { &MenuModeStart_Event_GUID, UIA_MenuModeStartEventId,
359 EventArgsType_Simple, },
360 { &HostedFragmentRootsInvalidated_Event_GUID, UIA_HostedFragmentRootsInvalidatedEventId,
361 EventArgsType_Simple, },
362 { &LayoutInvalidated_Event_GUID, UIA_LayoutInvalidatedEventId,
363 EventArgsType_Simple, },
364 { &MenuOpened_Event_GUID, UIA_MenuOpenedEventId,
365 EventArgsType_Simple, },
366 { &SystemAlert_Event_GUID, UIA_SystemAlertEventId,
367 EventArgsType_Simple, },
368 { &StructureChanged_Event_GUID, UIA_StructureChangedEventId,
369 EventArgsType_StructureChanged, },
370 { &InputDiscarded_Event_GUID, UIA_InputDiscardedEventId,
371 EventArgsType_Simple, },
372 { &MenuClosed_Event_GUID, UIA_MenuClosedEventId,
373 EventArgsType_Simple, },
374 { &Text_TextChangedEvent_Event_GUID, UIA_Text_TextChangedEventId,
375 EventArgsType_Simple, },
376 { &TextEdit_ConversionTargetChanged_Event_GUID, UIA_TextEdit_ConversionTargetChangedEventId,
377 EventArgsType_Simple, },
378 { &Drag_DragComplete_Event_GUID, UIA_Drag_DragCompleteEventId,
379 EventArgsType_Simple, },
380 { &InputReachedOtherElement_Event_GUID, UIA_InputReachedOtherElementEventId,
381 EventArgsType_Simple, },
382 { &LiveRegionChanged_Event_GUID, UIA_LiveRegionChangedEventId,
383 EventArgsType_Simple, },
384 { &InputReachedTarget_Event_GUID, UIA_InputReachedTargetEventId,
385 EventArgsType_Simple, },
386 { &DropTarget_DragEnter_Event_GUID, UIA_DropTarget_DragEnterEventId,
387 EventArgsType_Simple, },
388 { &MenuModeEnd_Event_GUID, UIA_MenuModeEndEventId,
389 EventArgsType_Simple, },
390 { &Text_TextSelectionChangedEvent_Event_GUID, UIA_Text_TextSelectionChangedEventId,
391 EventArgsType_Simple, },
392 { &AutomationPropertyChanged_Event_GUID, UIA_AutomationPropertyChangedEventId,
393 EventArgsType_PropertyChanged, },
394 { &SelectionItem_ElementRemovedFromSelectionEvent_Event_GUID, UIA_SelectionItem_ElementRemovedFromSelectionEventId,
395 EventArgsType_Simple, },
396 { &SelectionItem_ElementAddedToSelectionEvent_Event_GUID, UIA_SelectionItem_ElementAddedToSelectionEventId,
397 EventArgsType_Simple, },
398 { &DropTarget_Dropped_Event_GUID, UIA_DropTarget_DroppedEventId,
399 EventArgsType_Simple, },
400 { &ToolTipClosed_Event_GUID, UIA_ToolTipClosedEventId,
401 EventArgsType_Simple, },
402 { &Invoke_Invoked_Event_GUID, UIA_Invoke_InvokedEventId,
403 EventArgsType_Simple, },
404 { &Notification_Event_GUID, UIA_NotificationEventId,
405 EventArgsType_Notification, },
406 { &Window_WindowClosed_Event_GUID, UIA_Window_WindowClosedEventId,
407 EventArgsType_WindowClosed, },
408 { &Drag_DragCancel_Event_GUID, UIA_Drag_DragCancelEventId,
409 EventArgsType_Simple, },
410 { &SelectionItem_ElementSelectedEvent_Event_GUID, UIA_SelectionItem_ElementSelectedEventId,
411 EventArgsType_Simple, },
412 { &ToolTipOpened_Event_GUID, UIA_ToolTipOpenedEventId,
413 EventArgsType_Simple, },
416 static const int event_id_idx[] = {
417 0x23, 0x1d, 0x0d, 0x0b, 0x19, 0x06, 0x07, 0x0f,
418 0x0a, 0x1e, 0x1b, 0x1a, 0x22, 0x00, 0x18, 0x10,
419 0x01, 0x20, 0x08, 0x17, 0x15, 0x13, 0x0e, 0x0c,
420 0x14, 0x09, 0x03, 0x21, 0x12, 0x16, 0x05, 0x1c,
421 0x02, 0x11, 0x04, 0x1f,
424 #define EVENT_ID_MIN 20000
425 #define EVENT_ID_MAX (EVENT_ID_MIN + ARRAY_SIZE(default_uia_events))
427 static const struct uia_event_info *uia_event_info_from_guid(const GUID *guid)
429 struct uia_event_info *event;
431 if ((event = bsearch(guid, default_uia_events, ARRAY_SIZE(default_uia_events), sizeof(*event),
432 uia_event_guid_compare)))
433 return event;
435 return NULL;
438 const struct uia_event_info *uia_event_info_from_id(EVENTID event_id)
440 if ((event_id < EVENT_ID_MIN) || (event_id >= EVENT_ID_MAX))
441 return NULL;
443 return &default_uia_events[event_id_idx[event_id - EVENT_ID_MIN]];
446 /* Sorted by GUID. */
447 static const struct uia_pattern_info default_uia_patterns[] = {
448 { &ScrollItem_Pattern_GUID, UIA_ScrollItemPatternId,
449 &IID_IScrollItemProvider, },
450 { &Tranform_Pattern2_GUID, UIA_TransformPattern2Id,
451 &IID_ITransformProvider2, },
452 { &ItemContainer_Pattern_GUID, UIA_ItemContainerPatternId,
453 &IID_IItemContainerProvider, },
454 { &Drag_Pattern_GUID, UIA_DragPatternId,
455 &IID_IDragProvider, },
456 { &Window_Pattern_GUID, UIA_WindowPatternId,
457 &IID_IWindowProvider, },
458 { &VirtualizedItem_Pattern_GUID, UIA_VirtualizedItemPatternId,
459 &IID_IVirtualizedItemProvider, },
460 { &Dock_Pattern_GUID, UIA_DockPatternId,
461 &IID_IDockProvider, },
462 { &Styles_Pattern_GUID, UIA_StylesPatternId,
463 &IID_IStylesProvider, },
464 { &DropTarget_Pattern_GUID, UIA_DropTargetPatternId,
465 &IID_IDropTargetProvider, },
466 { &Text_Pattern_GUID, UIA_TextPatternId,
467 &IID_ITextProvider, },
468 { &Toggle_Pattern_GUID, UIA_TogglePatternId,
469 &IID_IToggleProvider, },
470 { &GridItem_Pattern_GUID, UIA_GridItemPatternId,
471 &IID_IGridItemProvider, },
472 { &RangeValue_Pattern_GUID, UIA_RangeValuePatternId,
473 &IID_IRangeValueProvider, },
474 { &TextEdit_Pattern_GUID, UIA_TextEditPatternId,
475 &IID_ITextEditProvider, },
476 { &CustomNavigation_Pattern_GUID, UIA_CustomNavigationPatternId,
477 &IID_ICustomNavigationProvider, },
478 { &Table_Pattern_GUID, UIA_TablePatternId,
479 &IID_ITableProvider, },
480 { &Value_Pattern_GUID, UIA_ValuePatternId,
481 &IID_IValueProvider, },
482 { &LegacyIAccessible_Pattern_GUID, UIA_LegacyIAccessiblePatternId,
483 &IID_ILegacyIAccessibleProvider, },
484 { &Text_Pattern2_GUID, UIA_TextPattern2Id,
485 &IID_ITextProvider2, },
486 { &ExpandCollapse_Pattern_GUID, UIA_ExpandCollapsePatternId,
487 &IID_IExpandCollapseProvider, },
488 { &SynchronizedInput_Pattern_GUID, UIA_SynchronizedInputPatternId,
489 &IID_ISynchronizedInputProvider, },
490 { &Scroll_Pattern_GUID, UIA_ScrollPatternId,
491 &IID_IScrollProvider, },
492 { &TextChild_Pattern_GUID, UIA_TextChildPatternId,
493 &IID_ITextChildProvider, },
494 { &TableItem_Pattern_GUID, UIA_TableItemPatternId,
495 &IID_ITableItemProvider, },
496 { &Spreadsheet_Pattern_GUID, UIA_SpreadsheetPatternId,
497 &IID_ISpreadsheetProvider, },
498 { &Grid_Pattern_GUID, UIA_GridPatternId,
499 &IID_IGridProvider, },
500 { &Annotation_Pattern_GUID, UIA_AnnotationPatternId,
501 &IID_IAnnotationProvider, },
502 { &Transform_Pattern_GUID, UIA_TransformPatternId,
503 &IID_ITransformProvider, },
504 { &MultipleView_Pattern_GUID, UIA_MultipleViewPatternId,
505 &IID_IMultipleViewProvider, },
506 { &Selection_Pattern_GUID, UIA_SelectionPatternId,
507 &IID_ISelectionProvider, },
508 { &SelectionItem_Pattern_GUID, UIA_SelectionItemPatternId,
509 &IID_ISelectionItemProvider, },
510 { &Invoke_Pattern_GUID, UIA_InvokePatternId,
511 &IID_IInvokeProvider, },
512 { &ObjectModel_Pattern_GUID, UIA_ObjectModelPatternId,
513 &IID_IObjectModelProvider, },
514 { &SpreadsheetItem_Pattern_GUID, UIA_SpreadsheetItemPatternId,
515 &IID_ISpreadsheetItemProvider, },
518 static const int pattern_id_idx[] = {
519 0x1f, 0x1d, 0x10, 0x0c, 0x15, 0x13, 0x19, 0x0b,
520 0x1c, 0x04, 0x1e, 0x06, 0x0f, 0x17, 0x09, 0x0a,
521 0x1b, 0x00, 0x11, 0x02, 0x05, 0x14, 0x20, 0x1a,
522 0x12, 0x07, 0x18, 0x21, 0x01, 0x16, 0x03, 0x08,
523 0x0d, 0x0e,
526 #define PATTERN_ID_MIN 10000
527 #define PATTERN_ID_MAX (PATTERN_ID_MIN + ARRAY_SIZE(default_uia_patterns))
529 static const struct uia_pattern_info *uia_pattern_info_from_guid(const GUID *guid)
531 struct uia_pattern_info *pattern;
533 if ((pattern = bsearch(guid, default_uia_patterns, ARRAY_SIZE(default_uia_patterns), sizeof(*pattern),
534 uia_pattern_guid_compare)))
535 return pattern;
537 return NULL;
540 const struct uia_pattern_info *uia_pattern_info_from_id(PATTERNID pattern_id)
542 if ((pattern_id < PATTERN_ID_MIN) || (pattern_id >= PATTERN_ID_MAX))
543 return NULL;
545 return &default_uia_patterns[pattern_id_idx[pattern_id - PATTERN_ID_MIN]];
548 /* Sorted by GUID. */
549 static const struct uia_control_type_info default_uia_control_types[] = {
550 { &Table_Control_GUID, UIA_TableControlTypeId },
551 { &StatusBar_Control_GUID, UIA_StatusBarControlTypeId },
552 { &Group_Control_GUID, UIA_GroupControlTypeId },
553 { &SplitButton_Control_GUID, UIA_SplitButtonControlTypeId },
554 { &CheckBox_Control_GUID, UIA_CheckBoxControlTypeId },
555 { &Hyperlink_Control_GUID, UIA_HyperlinkControlTypeId },
556 { &Tab_Control_GUID, UIA_TabControlTypeId },
557 { &ScrollBar_Control_GUID, UIA_ScrollBarControlTypeId },
558 { &Spinner_Control_GUID, UIA_SpinnerControlTypeId },
559 { &Menu_Control_GUID, UIA_MenuControlTypeId },
560 { &Window_Control_GUID, UIA_WindowControlTypeId },
561 { &DataItem_Control_GUID, UIA_DataItemControlTypeId },
562 { &SemanticZoom_Control_GUID, UIA_SemanticZoomControlTypeId },
563 { &Slider_Control_GUID, UIA_SliderControlTypeId },
564 { &TabItem_Control_GUID, UIA_TabItemControlTypeId },
565 { &MenuBar_Control_GUID, UIA_MenuBarControlTypeId },
566 { &ToolBar_Control_GUID, UIA_ToolBarControlTypeId },
567 { &Pane_Control_GUID, UIA_PaneControlTypeId },
568 { &Button_Control_GUID, UIA_ButtonControlTypeId },
569 { &ComboBox_Control_GUID, UIA_ComboBoxControlTypeId },
570 { &Document_Control_GUID, UIA_DocumentControlTypeId },
571 { &Thumb_Control_GUID, UIA_ThumbControlTypeId },
572 { &ProgressBar_Control_GUID, UIA_ProgressBarControlTypeId },
573 { &Calendar_Control_GUID, UIA_CalendarControlTypeId },
574 { &AppBar_Control_GUID, UIA_AppBarControlTypeId },
575 { &Tree_Control_GUID, UIA_TreeControlTypeId },
576 { &Separator_Control_GUID, UIA_SeparatorControlTypeId },
577 { &DataGrid_Control_GUID, UIA_DataGridControlTypeId },
578 { &TreeItem_Control_GUID, UIA_TreeItemControlTypeId },
579 { &TitleBar_Control_GUID, UIA_TitleBarControlTypeId },
580 { &Custom_Control_GUID, UIA_CustomControlTypeId },
581 { &Edit_Control_GUID, UIA_EditControlTypeId },
582 { &HeaderItem_Control_GUID, UIA_HeaderItemControlTypeId },
583 { &Header_Control_GUID, UIA_HeaderControlTypeId },
584 { &ToolTip_Control_GUID, UIA_ToolTipControlTypeId },
585 { &MenuItem_Control_GUID, UIA_MenuItemControlTypeId },
586 { &RadioButton_Control_GUID, UIA_RadioButtonControlTypeId },
587 { &Text_Control_GUID, UIA_TextControlTypeId },
588 { &List_Control_GUID, UIA_ListControlTypeId },
589 { &Image_Control_GUID, UIA_ImageControlTypeId },
590 { &ListItem_Control_GUID, UIA_ListItemControlTypeId },
593 static const int control_type_id_idx[] = {
594 0x12, 0x17, 0x04, 0x13, 0x1f, 0x05, 0x27, 0x28,
595 0x26, 0x09, 0x0f, 0x23, 0x16, 0x24, 0x07, 0x0d,
596 0x08, 0x01, 0x06, 0x0e, 0x25, 0x10, 0x22, 0x19,
597 0x1c, 0x1e, 0x02, 0x15, 0x1b, 0x0b, 0x14, 0x03,
598 0x0a, 0x11, 0x21, 0x20, 0x00, 0x1d, 0x1a, 0x0c,
599 0x18,
602 #define CONTROL_TYPE_ID_MIN 50000
603 #define CONTROL_TYPE_ID_MAX (CONTROL_TYPE_ID_MIN + ARRAY_SIZE(default_uia_control_types))
605 static const struct uia_control_type_info *uia_control_type_info_from_guid(const GUID *guid)
607 struct uia_control_type_info *control_type;
609 if ((control_type = bsearch(guid, default_uia_control_types, ARRAY_SIZE(default_uia_control_types),
610 sizeof(*control_type), uia_control_type_guid_compare)))
611 return control_type;
613 return NULL;
616 const struct uia_control_type_info *uia_control_type_info_from_id(CONTROLTYPEID control_type_id)
618 if ((control_type_id < CONTROL_TYPE_ID_MIN) || (control_type_id >= CONTROL_TYPE_ID_MAX))
619 return NULL;
621 return &default_uia_control_types[control_type_id_idx[control_type_id - CONTROL_TYPE_ID_MIN]];
624 /***********************************************************************
625 * UiaLookupId (uiautomationcore.@)
627 int WINAPI UiaLookupId(enum AutomationIdentifierType type, const GUID *guid)
629 int ret_id = 0;
631 TRACE("(%d, %s)\n", type, debugstr_guid(guid));
633 switch (type)
635 case AutomationIdentifierType_Property:
637 const struct uia_prop_info *prop = uia_prop_info_from_guid(guid);
639 if (prop)
640 ret_id = prop->prop_id;
641 else
642 FIXME("Failed to find propertyId for GUID %s\n", debugstr_guid(guid));
644 break;
647 case AutomationIdentifierType_Event:
649 const struct uia_event_info *event = uia_event_info_from_guid(guid);
651 if (event)
652 ret_id = event->event_id;
653 else
654 FIXME("Failed to find eventId for GUID %s\n", debugstr_guid(guid));
656 break;
659 case AutomationIdentifierType_Pattern:
661 const struct uia_pattern_info *pattern = uia_pattern_info_from_guid(guid);
663 if (pattern)
664 ret_id = pattern->pattern_id;
665 else
666 FIXME("Failed to find patternId for GUID %s\n", debugstr_guid(guid));
668 break;
671 case AutomationIdentifierType_ControlType:
673 const struct uia_control_type_info *control_type = uia_control_type_info_from_guid(guid);
675 if (control_type)
676 ret_id = control_type->control_type_id;
677 else
678 FIXME("Failed to find control type Id for GUID %s\n", debugstr_guid(guid));
680 break;
683 case AutomationIdentifierType_TextAttribute:
684 case AutomationIdentifierType_LandmarkType:
685 case AutomationIdentifierType_Annotation:
686 case AutomationIdentifierType_Changes:
687 case AutomationIdentifierType_Style:
688 FIXME("Unimplemented AutomationIdentifierType %d\n", type);
689 break;
691 default:
692 FIXME("Invalid AutomationIdentifierType %d\n", type);
693 break;
696 return ret_id;