@@ -884,23 +884,6 @@ impl Default for PropertyIndices {
884
884
}
885
885
}
886
886
887
- #[ derive( Clone , Debug , PartialEq ) ]
888
- struct FrozenProperties {
889
- indices : PropertyIndices ,
890
- values : Box < [ PropertyValue ] > ,
891
- }
892
-
893
- /// An accessibility node snapshot that can't be modified. This is not used by
894
- /// toolkits or applications, but only by code that retains an AccessKit tree
895
- /// in memory, such as the `accesskit_consumer` crate.
896
- #[ derive( Clone , PartialEq ) ]
897
- pub struct FrozenNode {
898
- role : Role ,
899
- actions : u32 ,
900
- flags : u32 ,
901
- properties : FrozenProperties ,
902
- }
903
-
904
887
#[ derive( Clone , Debug , Default , PartialEq ) ]
905
888
struct Properties {
906
889
indices : PropertyIndices ,
@@ -974,31 +957,8 @@ impl Properties {
974
957
}
975
958
}
976
959
977
- impl From < Properties > for FrozenProperties {
978
- fn from ( props : Properties ) -> Self {
979
- Self {
980
- indices : props. indices ,
981
- values : props. values . into_boxed_slice ( ) ,
982
- }
983
- }
984
- }
985
-
986
960
macro_rules! flag_methods {
987
961
( $( $( #[ $doc: meta] ) * ( $id: ident, $getter: ident, $setter: ident, $clearer: ident) ) ,+) => {
988
- impl FrozenNode {
989
- $( $( #[ $doc] ) *
990
- #[ inline]
991
- pub fn $getter( & self ) -> bool {
992
- ( self . flags & ( Flag :: $id) . mask( ) ) != 0
993
- } ) *
994
- fn debug_flag_properties( & self , fmt: & mut fmt:: DebugStruct ) {
995
- $(
996
- if self . $getter( ) {
997
- fmt. field( stringify!( $getter) , & true ) ;
998
- }
999
- ) *
1000
- }
1001
- }
1002
962
impl Node {
1003
963
$( $( #[ $doc] ) *
1004
964
#[ inline]
@@ -1109,13 +1069,6 @@ macro_rules! vec_type_methods {
1109
1069
1110
1070
macro_rules! property_methods {
1111
1071
( $( $( #[ $doc: meta] ) * ( $id: ident, $getter: ident, $type_getter: ident, $getter_result: ty, $setter: ident, $type_setter: ident, $setter_param: ty, $clearer: ident) ) ,+) => {
1112
- impl FrozenNode {
1113
- $( $( #[ $doc] ) *
1114
- #[ inline]
1115
- pub fn $getter( & self ) -> $getter_result {
1116
- self . properties. indices. $type_getter( & self . properties. values, PropertyId :: $id)
1117
- } ) *
1118
- }
1119
1072
impl Node {
1120
1073
$( $( #[ $doc] ) *
1121
1074
#[ inline]
@@ -1168,9 +1121,6 @@ macro_rules! node_id_vec_property_methods {
1168
1121
$( #[ $doc] ) *
1169
1122
( $id, NodeId , $getter, get_node_id_vec, $setter, set_node_id_vec, $pusher, push_to_node_id_vec, $clearer)
1170
1123
} ) *
1171
- impl FrozenNode {
1172
- slice_properties_debug_method! { debug_node_id_vec_properties, [ $( $getter, ) * ] }
1173
- }
1174
1124
impl Node {
1175
1125
slice_properties_debug_method! { debug_node_id_vec_properties, [ $( $getter, ) * ] }
1176
1126
}
@@ -1195,9 +1145,6 @@ macro_rules! node_id_property_methods {
1195
1145
$( #[ $doc] ) *
1196
1146
( $id, $getter, get_node_id_property, Option <NodeId >, $setter, set_node_id_property, NodeId , $clearer)
1197
1147
} ) *
1198
- impl FrozenNode {
1199
- option_properties_debug_method! { debug_node_id_properties, [ $( $getter, ) * ] }
1200
- }
1201
1148
impl Node {
1202
1149
option_properties_debug_method! { debug_node_id_properties, [ $( $getter, ) * ] }
1203
1150
}
@@ -1210,9 +1157,6 @@ macro_rules! string_property_methods {
1210
1157
$( #[ $doc] ) *
1211
1158
( $id, $getter, get_string_property, Option <& str >, $setter, set_string_property, impl Into <Box <str >>, $clearer)
1212
1159
} ) *
1213
- impl FrozenNode {
1214
- option_properties_debug_method! { debug_string_properties, [ $( $getter, ) * ] }
1215
- }
1216
1160
impl Node {
1217
1161
option_properties_debug_method! { debug_string_properties, [ $( $getter, ) * ] }
1218
1162
}
@@ -1225,9 +1169,6 @@ macro_rules! f64_property_methods {
1225
1169
$( #[ $doc] ) *
1226
1170
( $id, $getter, get_f64_property, Option <f64 >, $setter, set_f64_property, f64 , $clearer)
1227
1171
} ) *
1228
- impl FrozenNode {
1229
- option_properties_debug_method! { debug_f64_properties, [ $( $getter, ) * ] }
1230
- }
1231
1172
impl Node {
1232
1173
option_properties_debug_method! { debug_f64_properties, [ $( $getter, ) * ] }
1233
1174
}
@@ -1240,9 +1181,6 @@ macro_rules! usize_property_methods {
1240
1181
$( #[ $doc] ) *
1241
1182
( $id, $getter, get_usize_property, Option <usize >, $setter, set_usize_property, usize , $clearer)
1242
1183
} ) *
1243
- impl FrozenNode {
1244
- option_properties_debug_method! { debug_usize_properties, [ $( $getter, ) * ] }
1245
- }
1246
1184
impl Node {
1247
1185
option_properties_debug_method! { debug_usize_properties, [ $( $getter, ) * ] }
1248
1186
}
@@ -1255,9 +1193,6 @@ macro_rules! color_property_methods {
1255
1193
$( #[ $doc] ) *
1256
1194
( $id, $getter, get_color_property, Option <u32 >, $setter, set_color_property, u32 , $clearer)
1257
1195
} ) *
1258
- impl FrozenNode {
1259
- option_properties_debug_method! { debug_color_properties, [ $( $getter, ) * ] }
1260
- }
1261
1196
impl Node {
1262
1197
option_properties_debug_method! { debug_color_properties, [ $( $getter, ) * ] }
1263
1198
}
@@ -1270,9 +1205,6 @@ macro_rules! text_decoration_property_methods {
1270
1205
$( #[ $doc] ) *
1271
1206
( $id, $getter, get_text_decoration_property, Option <TextDecoration >, $setter, set_text_decoration_property, TextDecoration , $clearer)
1272
1207
} ) *
1273
- impl FrozenNode {
1274
- option_properties_debug_method! { debug_text_decoration_properties, [ $( $getter, ) * ] }
1275
- }
1276
1208
impl Node {
1277
1209
option_properties_debug_method! { debug_text_decoration_properties, [ $( $getter, ) * ] }
1278
1210
}
@@ -1285,9 +1217,6 @@ macro_rules! length_slice_property_methods {
1285
1217
$( #[ $doc] ) *
1286
1218
( $id, $getter, get_length_slice_property, & [ u8 ] , $setter, set_length_slice_property, impl Into <Box <[ u8 ] >>, $clearer)
1287
1219
} ) *
1288
- impl FrozenNode {
1289
- slice_properties_debug_method! { debug_length_slice_properties, [ $( $getter, ) * ] }
1290
- }
1291
1220
impl Node {
1292
1221
slice_properties_debug_method! { debug_length_slice_properties, [ $( $getter, ) * ] }
1293
1222
}
@@ -1300,9 +1229,6 @@ macro_rules! coord_slice_property_methods {
1300
1229
$( #[ $doc] ) *
1301
1230
( $id, $getter, get_coord_slice_property, Option <& [ f32 ] >, $setter, set_coord_slice_property, impl Into <Box <[ f32 ] >>, $clearer)
1302
1231
} ) *
1303
- impl FrozenNode {
1304
- option_properties_debug_method! { debug_coord_slice_properties, [ $( $getter, ) * ] }
1305
- }
1306
1232
impl Node {
1307
1233
option_properties_debug_method! { debug_coord_slice_properties, [ $( $getter, ) * ] }
1308
1234
}
@@ -1315,9 +1241,6 @@ macro_rules! bool_property_methods {
1315
1241
$( #[ $doc] ) *
1316
1242
( $id, $getter, get_bool_property, Option <bool >, $setter, set_bool_property, bool , $clearer)
1317
1243
} ) *
1318
- impl FrozenNode {
1319
- option_properties_debug_method! { debug_bool_properties, [ $( $getter, ) * ] }
1320
- }
1321
1244
impl Node {
1322
1245
option_properties_debug_method! { debug_bool_properties, [ $( $getter, ) * ] }
1323
1246
}
@@ -1326,18 +1249,6 @@ macro_rules! bool_property_methods {
1326
1249
1327
1250
macro_rules! unique_enum_property_methods {
1328
1251
( $( $( #[ $doc: meta] ) * ( $id: ident, $getter: ident, $setter: ident, $clearer: ident) ) ,+) => {
1329
- impl FrozenNode {
1330
- $( $( #[ $doc] ) *
1331
- #[ inline]
1332
- pub fn $getter( & self ) -> Option <$id> {
1333
- match self . properties. indices. get( & self . properties. values, PropertyId :: $id) {
1334
- PropertyValue :: None => None ,
1335
- PropertyValue :: $id( value) => Some ( * value) ,
1336
- _ => unexpected_property_type( ) ,
1337
- }
1338
- } ) *
1339
- option_properties_debug_method! { debug_unique_enum_properties, [ $( $getter, ) * ] }
1340
- }
1341
1252
impl Node {
1342
1253
$( $( #[ $doc] ) *
1343
1254
#[ inline]
@@ -1371,38 +1282,6 @@ impl Node {
1371
1282
}
1372
1283
}
1373
1284
1374
- impl From < Node > for FrozenNode {
1375
- fn from ( node : Node ) -> Self {
1376
- Self {
1377
- role : node. role ,
1378
- actions : node. actions ,
1379
- flags : node. flags ,
1380
- properties : node. properties . into ( ) ,
1381
- }
1382
- }
1383
- }
1384
-
1385
- impl From < & FrozenNode > for Node {
1386
- fn from ( node : & FrozenNode ) -> Self {
1387
- Self {
1388
- role : node. role ,
1389
- actions : node. actions ,
1390
- flags : node. flags ,
1391
- properties : Properties {
1392
- indices : node. properties . indices ,
1393
- values : node. properties . values . to_vec ( ) ,
1394
- } ,
1395
- }
1396
- }
1397
- }
1398
-
1399
- impl FrozenNode {
1400
- #[ inline]
1401
- pub fn role ( & self ) -> Role {
1402
- self . role
1403
- }
1404
- }
1405
-
1406
1285
impl Node {
1407
1286
#[ inline]
1408
1287
pub fn role ( & self ) -> Role {
@@ -1412,16 +1291,7 @@ impl Node {
1412
1291
pub fn set_role ( & mut self , value : Role ) {
1413
1292
self . role = value;
1414
1293
}
1415
- }
1416
1294
1417
- impl FrozenNode {
1418
- #[ inline]
1419
- pub fn supports_action ( & self , action : Action ) -> bool {
1420
- ( self . actions & action. mask ( ) ) != 0
1421
- }
1422
- }
1423
-
1424
- impl Node {
1425
1295
#[ inline]
1426
1296
pub fn supports_action ( & self , action : Action ) -> bool {
1427
1297
( self . actions & action. mask ( ) ) != 0
@@ -1806,10 +1676,6 @@ property_methods! {
1806
1676
( TextSelection , text_selection, get_text_selection_property, Option <& TextSelection >, set_text_selection, set_text_selection_property, impl Into <Box <TextSelection >>, clear_text_selection)
1807
1677
}
1808
1678
1809
- impl FrozenNode {
1810
- option_properties_debug_method ! { debug_option_properties, [ transform, bounds, text_selection, ] }
1811
- }
1812
-
1813
1679
impl Node {
1814
1680
option_properties_debug_method ! { debug_option_properties, [ transform, bounds, text_selection, ] }
1815
1681
}
@@ -1818,40 +1684,6 @@ vec_property_methods! {
1818
1684
( CustomActions , CustomAction , custom_actions, get_custom_action_vec, set_custom_actions, set_custom_action_vec, push_custom_action, push_to_custom_action_vec, clear_custom_actions)
1819
1685
}
1820
1686
1821
- impl fmt:: Debug for FrozenNode {
1822
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1823
- let mut fmt = f. debug_struct ( "FrozenNode" ) ;
1824
-
1825
- fmt. field ( "role" , & self . role ( ) ) ;
1826
-
1827
- let supported_actions = action_mask_to_action_vec ( self . actions ) ;
1828
- if !supported_actions. is_empty ( ) {
1829
- fmt. field ( "actions" , & supported_actions) ;
1830
- }
1831
-
1832
- self . debug_flag_properties ( & mut fmt) ;
1833
- self . debug_node_id_vec_properties ( & mut fmt) ;
1834
- self . debug_node_id_properties ( & mut fmt) ;
1835
- self . debug_string_properties ( & mut fmt) ;
1836
- self . debug_f64_properties ( & mut fmt) ;
1837
- self . debug_usize_properties ( & mut fmt) ;
1838
- self . debug_color_properties ( & mut fmt) ;
1839
- self . debug_text_decoration_properties ( & mut fmt) ;
1840
- self . debug_length_slice_properties ( & mut fmt) ;
1841
- self . debug_coord_slice_properties ( & mut fmt) ;
1842
- self . debug_bool_properties ( & mut fmt) ;
1843
- self . debug_unique_enum_properties ( & mut fmt) ;
1844
- self . debug_option_properties ( & mut fmt) ;
1845
-
1846
- let custom_actions = self . custom_actions ( ) ;
1847
- if !custom_actions. is_empty ( ) {
1848
- fmt. field ( "custom_actions" , & custom_actions) ;
1849
- }
1850
-
1851
- fmt. finish ( )
1852
- }
1853
- }
1854
-
1855
1687
impl fmt:: Debug for Node {
1856
1688
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1857
1689
let mut fmt = f. debug_struct ( "Node" ) ;
0 commit comments