|
25 | 25 | // - Function signatures (names, argument counts, argument order, and argument
|
26 | 26 | // type) cannot change.
|
27 | 27 | // - The core behavior of existing functions cannot change.
|
28 |
| -// - Instead of nesting structures by value within another structure, prefer |
29 |
| -// nesting by pointer. This ensures that adding members to the nested struct |
30 |
| -// does not break the ABI of the parent struct. |
| 28 | +// - Instead of nesting structures by value within another structure/union, |
| 29 | +// prefer nesting by pointer. This ensures that adding members to the nested |
| 30 | +// struct does not break the ABI of the parent struct/union. |
31 | 31 | // - Instead of array of structures, prefer array of pointers to structures.
|
32 | 32 | // This ensures that array indexing does not break if members are added
|
33 | 33 | // to the structure.
|
@@ -1064,6 +1064,57 @@ typedef int64_t FlutterPlatformViewIdentifier;
|
1064 | 1064 | FLUTTER_EXPORT
|
1065 | 1065 | extern const int32_t kFlutterSemanticsNodeIdBatchEnd;
|
1066 | 1066 |
|
| 1067 | +// The enumeration of possible string attributes that affect how assistive |
| 1068 | +// technologies announce a string. |
| 1069 | +// |
| 1070 | +// See dart:ui's implementers of the StringAttribute abstract class. |
| 1071 | +typedef enum { |
| 1072 | + // Indicates the string should be announced character by character. |
| 1073 | + kSpellOut, |
| 1074 | + // Indicates the string should be announced using the specified locale. |
| 1075 | + kLocale, |
| 1076 | +} FlutterStringAttributeType; |
| 1077 | + |
| 1078 | +// Indicates the assistive technology should announce out the string character |
| 1079 | +// by character. |
| 1080 | +// |
| 1081 | +// See dart:ui's SpellOutStringAttribute. |
| 1082 | +typedef struct { |
| 1083 | + /// The size of this struct. Must be sizeof(FlutterSpellOutStringAttribute). |
| 1084 | + size_t struct_size; |
| 1085 | +} FlutterSpellOutStringAttribute; |
| 1086 | + |
| 1087 | +// Indicates the assistive technology should announce the string using the |
| 1088 | +// specified locale. |
| 1089 | +// |
| 1090 | +// See dart:ui's LocaleStringAttribute. |
| 1091 | +typedef struct { |
| 1092 | + /// The size of this struct. Must be sizeof(FlutterLocaleStringAttribute). |
| 1093 | + size_t struct_size; |
| 1094 | + // The locale of this attribute. |
| 1095 | + const char* locale; |
| 1096 | +} FlutterLocaleStringAttribute; |
| 1097 | + |
| 1098 | +// Indicates how the assistive technology should treat the string. |
| 1099 | +// |
| 1100 | +// See dart:ui's StringAttribute. |
| 1101 | +typedef struct { |
| 1102 | + /// The size of this struct. Must be sizeof(FlutterStringAttribute). |
| 1103 | + size_t struct_size; |
| 1104 | + // The position this attribute starts. |
| 1105 | + size_t start; |
| 1106 | + // The next position after the attribute ends. |
| 1107 | + size_t end; |
| 1108 | + /// The type of the attribute described by the subsequent union. |
| 1109 | + FlutterStringAttributeType type; |
| 1110 | + union { |
| 1111 | + // Indicates the string should be announced character by character. |
| 1112 | + const FlutterSpellOutStringAttribute* spell_out; |
| 1113 | + // Indicates the string should be announced using the specified locale. |
| 1114 | + const FlutterLocaleStringAttribute* locale; |
| 1115 | + }; |
| 1116 | +} FlutterStringAttribute; |
| 1117 | + |
1067 | 1118 | /// A node that represents some semantic data.
|
1068 | 1119 | ///
|
1069 | 1120 | /// The semantics tree is maintained during the semantics phase of the pipeline
|
@@ -1215,6 +1266,31 @@ typedef struct {
|
1215 | 1266 | FlutterPlatformViewIdentifier platform_view_id;
|
1216 | 1267 | /// A textual tooltip attached to the node.
|
1217 | 1268 | const char* tooltip;
|
| 1269 | + // The number of string attributes associated with the `label`. |
| 1270 | + size_t label_attribute_count; |
| 1271 | + // Array of string attributes associated with the `label`. |
| 1272 | + // Has length `label_attribute_count`. |
| 1273 | + const FlutterStringAttribute** label_attributes; |
| 1274 | + // The number of string attributes associated with the `hint`. |
| 1275 | + size_t hint_attribute_count; |
| 1276 | + // Array of string attributes associated with the `hint`. |
| 1277 | + // Has length `hint_attribute_count`. |
| 1278 | + const FlutterStringAttribute** hint_attributes; |
| 1279 | + // The number of string attributes associated with the `value`. |
| 1280 | + size_t value_attribute_count; |
| 1281 | + // Array of string attributes associated with the `value`. |
| 1282 | + // Has length `value_attribute_count`. |
| 1283 | + const FlutterStringAttribute** value_attributes; |
| 1284 | + // The number of string attributes associated with the `increased_value`. |
| 1285 | + size_t increased_value_attribute_count; |
| 1286 | + // Array of string attributes associated with the `increased_value`. |
| 1287 | + // Has length `increased_value_attribute_count`. |
| 1288 | + const FlutterStringAttribute** increased_value_attributes; |
| 1289 | + // The number of string attributes associated with the `decreased_value`. |
| 1290 | + size_t decreased_value_attribute_count; |
| 1291 | + // Array of string attributes associated with the `decreased_value`. |
| 1292 | + // Has length `decreased_value_attribute_count`. |
| 1293 | + const FlutterStringAttribute** decreased_value_attributes; |
1218 | 1294 | } FlutterSemanticsNode2;
|
1219 | 1295 |
|
1220 | 1296 | /// `FlutterSemanticsCustomAction` ID used as a sentinel to signal the end of a
|
|
0 commit comments