Skip to content

Commit 18b1374

Browse files
committed
Better internal order of definitions
1 parent 3bdf959 commit 18b1374

14 files changed

+1550
-1550
lines changed

Generator/Types/ClassDef.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ public override void CollectDependencies()
4444
}
4545

4646
factories = GetFactoryTypes().Select(f => TypeHelpers.GetTypeName(Generator, this, f, TypeUsage.Alias)).ToArray();
47-
47+
4848
if (Type.Interfaces.Count > 0)
4949
{
5050
var defaultInterface = TypeHelpers.GetDefaultInterface(Type);
5151
aliasedType = TypeHelpers.GetTypeName(Generator, this, defaultInterface, TypeUsage.Alias);
5252
}
5353

54-
var factoryMethods = GetFactoryTypes().SelectMany(f => Generator.GetTypeDefinition(f).Methods).ToArray();
55-
var staticMethods = statics.SelectMany(s => Generator.GetTypeDefinition(s).Methods).ToArray();
56-
54+
var factoryMethods = GetFactoryTypes().OrderBy(f => f.FullName).SelectMany(f => Generator.GetTypeDefinition(f).Methods).ToArray();
55+
var staticMethods = statics.OrderBy(s => s.FullName).SelectMany(s => Generator.GetTypeDefinition(s).Methods).ToArray();
56+
5757
foreach (var m in factoryMethods)
5858
{
5959
methodWrappers.Add(new ClassMethodDef(m, this));
@@ -97,7 +97,7 @@ public override void Emit()
9797
{ features.GetInvertedAttribute() }RT_CLASS!{{class { DefinitionName }: IInspectable}}");
9898
}
9999

100-
foreach (var factory in factories)
100+
foreach (var factory in factories.OrderBy(f => f))
101101
{
102102
needClassID = true;
103103
Module.Append($@"
@@ -111,7 +111,7 @@ public override void Emit()
111111
RT_CLASS!{{static class { DefinitionName }}}");
112112
}
113113

114-
foreach (var staticType in statics)
114+
foreach (var staticType in statics.OrderBy(t => t.FullName))
115115
{
116116
var staticName = Generator.GetTypeDefinition(staticType).DefinitionName;
117117
needClassID = true;

src/rt/gen/windows/applicationmodel.rs

Lines changed: 154 additions & 154 deletions
Large diffs are not rendered by default.

src/rt/gen/windows/devices.rs

Lines changed: 163 additions & 163 deletions
Large diffs are not rendered by default.

src/rt/gen/windows/gaming.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,9 @@ impl IArcadeStick {
239239
}
240240
}
241241
RT_CLASS!{class ArcadeStick: IArcadeStick}
242-
impl RtActivatable<IArcadeStickStatics2> for ArcadeStick {}
243242
impl RtActivatable<IArcadeStickStatics> for ArcadeStick {}
243+
impl RtActivatable<IArcadeStickStatics2> for ArcadeStick {}
244244
impl ArcadeStick {
245-
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<ArcadeStick>> { unsafe {
246-
<Self as RtActivatable<IArcadeStickStatics2>>::get_activation_factory().from_game_controller(gameController)
247-
}}
248245
#[inline] pub fn add_arcade_stick_added(value: &super::super::foundation::EventHandler<ArcadeStick>) -> Result<super::super::foundation::EventRegistrationToken> { unsafe {
249246
<Self as RtActivatable<IArcadeStickStatics>>::get_activation_factory().add_arcade_stick_added(value)
250247
}}
@@ -260,6 +257,9 @@ impl ArcadeStick {
260257
#[inline] pub fn get_arcade_sticks() -> Result<ComPtr<super::super::foundation::collections::IVectorView<ArcadeStick>>> { unsafe {
261258
<Self as RtActivatable<IArcadeStickStatics>>::get_activation_factory().get_arcade_sticks()
262259
}}
260+
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<ArcadeStick>> { unsafe {
261+
<Self as RtActivatable<IArcadeStickStatics2>>::get_activation_factory().from_game_controller(gameController)
262+
}}
263263
}
264264
DEFINE_CLSID!(ArcadeStick(&[87,105,110,100,111,119,115,46,71,97,109,105,110,103,46,73,110,112,117,116,46,65,114,99,97,100,101,83,116,105,99,107,0]) [CLSID_ArcadeStick]);
265265
RT_ENUM! { enum ArcadeStickButtons: u32 {
@@ -502,12 +502,9 @@ impl IGamepad {
502502
}
503503
}
504504
RT_CLASS!{class Gamepad: IGamepad}
505-
impl RtActivatable<IGamepadStatics2> for Gamepad {}
506505
impl RtActivatable<IGamepadStatics> for Gamepad {}
506+
impl RtActivatable<IGamepadStatics2> for Gamepad {}
507507
impl Gamepad {
508-
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<Gamepad>> { unsafe {
509-
<Self as RtActivatable<IGamepadStatics2>>::get_activation_factory().from_game_controller(gameController)
510-
}}
511508
#[inline] pub fn add_gamepad_added(value: &super::super::foundation::EventHandler<Gamepad>) -> Result<super::super::foundation::EventRegistrationToken> { unsafe {
512509
<Self as RtActivatable<IGamepadStatics>>::get_activation_factory().add_gamepad_added(value)
513510
}}
@@ -523,6 +520,9 @@ impl Gamepad {
523520
#[inline] pub fn get_gamepads() -> Result<ComPtr<super::super::foundation::collections::IVectorView<Gamepad>>> { unsafe {
524521
<Self as RtActivatable<IGamepadStatics>>::get_activation_factory().get_gamepads()
525522
}}
523+
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<Gamepad>> { unsafe {
524+
<Self as RtActivatable<IGamepadStatics2>>::get_activation_factory().from_game_controller(gameController)
525+
}}
526526
}
527527
DEFINE_CLSID!(Gamepad(&[87,105,110,100,111,119,115,46,71,97,109,105,110,103,46,73,110,112,117,116,46,71,97,109,101,112,97,100,0]) [CLSID_Gamepad]);
528528
DEFINE_IID!(IID_IGamepad2, 1008110013, 22805, 16965, 176, 192, 200, 159, 174, 3, 8, 255);
@@ -664,12 +664,9 @@ impl IRacingWheel {
664664
}
665665
}
666666
RT_CLASS!{class RacingWheel: IRacingWheel}
667-
impl RtActivatable<IRacingWheelStatics2> for RacingWheel {}
668667
impl RtActivatable<IRacingWheelStatics> for RacingWheel {}
668+
impl RtActivatable<IRacingWheelStatics2> for RacingWheel {}
669669
impl RacingWheel {
670-
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<RacingWheel>> { unsafe {
671-
<Self as RtActivatable<IRacingWheelStatics2>>::get_activation_factory().from_game_controller(gameController)
672-
}}
673670
#[inline] pub fn add_racing_wheel_added(value: &super::super::foundation::EventHandler<RacingWheel>) -> Result<super::super::foundation::EventRegistrationToken> { unsafe {
674671
<Self as RtActivatable<IRacingWheelStatics>>::get_activation_factory().add_racing_wheel_added(value)
675672
}}
@@ -685,6 +682,9 @@ impl RacingWheel {
685682
#[inline] pub fn get_racing_wheels() -> Result<ComPtr<super::super::foundation::collections::IVectorView<RacingWheel>>> { unsafe {
686683
<Self as RtActivatable<IRacingWheelStatics>>::get_activation_factory().get_racing_wheels()
687684
}}
685+
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<RacingWheel>> { unsafe {
686+
<Self as RtActivatable<IRacingWheelStatics2>>::get_activation_factory().from_game_controller(gameController)
687+
}}
688688
}
689689
DEFINE_CLSID!(RacingWheel(&[87,105,110,100,111,119,115,46,71,97,109,105,110,103,46,73,110,112,117,116,46,82,97,99,105,110,103,87,104,101,101,108,0]) [CLSID_RacingWheel]);
690690
RT_ENUM! { enum RacingWheelButtons: u32 {
@@ -909,12 +909,9 @@ impl IUINavigationController {
909909
}
910910
}
911911
RT_CLASS!{class UINavigationController: IUINavigationController}
912-
impl RtActivatable<IUINavigationControllerStatics2> for UINavigationController {}
913912
impl RtActivatable<IUINavigationControllerStatics> for UINavigationController {}
913+
impl RtActivatable<IUINavigationControllerStatics2> for UINavigationController {}
914914
impl UINavigationController {
915-
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<UINavigationController>> { unsafe {
916-
<Self as RtActivatable<IUINavigationControllerStatics2>>::get_activation_factory().from_game_controller(gameController)
917-
}}
918915
#[inline] pub fn add_uinavigation_controller_added(value: &super::super::foundation::EventHandler<UINavigationController>) -> Result<super::super::foundation::EventRegistrationToken> { unsafe {
919916
<Self as RtActivatable<IUINavigationControllerStatics>>::get_activation_factory().add_uinavigation_controller_added(value)
920917
}}
@@ -930,6 +927,9 @@ impl UINavigationController {
930927
#[inline] pub fn get_uinavigation_controllers() -> Result<ComPtr<super::super::foundation::collections::IVectorView<UINavigationController>>> { unsafe {
931928
<Self as RtActivatable<IUINavigationControllerStatics>>::get_activation_factory().get_uinavigation_controllers()
932929
}}
930+
#[inline] pub fn from_game_controller(gameController: &IGameController) -> Result<ComPtr<UINavigationController>> { unsafe {
931+
<Self as RtActivatable<IUINavigationControllerStatics2>>::get_activation_factory().from_game_controller(gameController)
932+
}}
933933
}
934934
DEFINE_CLSID!(UINavigationController(&[87,105,110,100,111,119,115,46,71,97,109,105,110,103,46,73,110,112,117,116,46,85,73,78,97,118,105,103,97,116,105,111,110,67,111,110,116,114,111,108,108,101,114,0]) [CLSID_UINavigationController]);
935935
DEFINE_IID!(IID_IUINavigationControllerStatics, 789877514, 63224, 19016, 141, 137, 148, 120, 108, 202, 12, 46);
@@ -1003,12 +1003,9 @@ impl ICustomGameControllerFactory {
10031003
}
10041004
}
10051005
RT_CLASS!{static class GameControllerFactoryManager}
1006-
impl RtActivatable<IGameControllerFactoryManagerStatics2> for GameControllerFactoryManager {}
10071006
impl RtActivatable<IGameControllerFactoryManagerStatics> for GameControllerFactoryManager {}
1007+
impl RtActivatable<IGameControllerFactoryManagerStatics2> for GameControllerFactoryManager {}
10081008
impl GameControllerFactoryManager {
1009-
#[inline] pub fn try_get_factory_controller_from_game_controller(factory: &ICustomGameControllerFactory, gameController: &super::IGameController) -> Result<ComPtr<super::IGameController>> { unsafe {
1010-
<Self as RtActivatable<IGameControllerFactoryManagerStatics2>>::get_activation_factory().try_get_factory_controller_from_game_controller(factory, gameController)
1011-
}}
10121009
#[inline] pub fn register_custom_factory_for_gip_interface(factory: &ICustomGameControllerFactory, interfaceId: Guid) -> Result<()> { unsafe {
10131010
<Self as RtActivatable<IGameControllerFactoryManagerStatics>>::get_activation_factory().register_custom_factory_for_gip_interface(factory, interfaceId)
10141011
}}
@@ -1018,6 +1015,9 @@ impl GameControllerFactoryManager {
10181015
#[inline] pub fn register_custom_factory_for_xusb_type(factory: &ICustomGameControllerFactory, xusbType: XusbDeviceType, xusbSubtype: XusbDeviceSubtype) -> Result<()> { unsafe {
10191016
<Self as RtActivatable<IGameControllerFactoryManagerStatics>>::get_activation_factory().register_custom_factory_for_xusb_type(factory, xusbType, xusbSubtype)
10201017
}}
1018+
#[inline] pub fn try_get_factory_controller_from_game_controller(factory: &ICustomGameControllerFactory, gameController: &super::IGameController) -> Result<ComPtr<super::IGameController>> { unsafe {
1019+
<Self as RtActivatable<IGameControllerFactoryManagerStatics2>>::get_activation_factory().try_get_factory_controller_from_game_controller(factory, gameController)
1020+
}}
10211021
}
10221022
DEFINE_CLSID!(GameControllerFactoryManager(&[87,105,110,100,111,119,115,46,71,97,109,105,110,103,46,73,110,112,117,116,46,67,117,115,116,111,109,46,71,97,109,101,67,111,110,116,114,111,108,108,101,114,70,97,99,116,111,114,121,77,97,110,97,103,101,114,0]) [CLSID_GameControllerFactoryManager]);
10231023
DEFINE_IID!(IID_IGameControllerFactoryManagerStatics, 919299811, 53409, 18822, 162, 76, 64, 177, 55, 222, 186, 158);

src/rt/gen/windows/globalization.rs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -611,19 +611,19 @@ impl ICalendar {
611611
}
612612
}
613613
RT_CLASS!{class Calendar: ICalendar}
614-
impl RtActivatable<ICalendarFactory2> for Calendar {}
615614
impl RtActivatable<ICalendarFactory> for Calendar {}
615+
impl RtActivatable<ICalendarFactory2> for Calendar {}
616616
impl RtActivatable<IActivationFactory> for Calendar {}
617617
impl Calendar {
618-
#[inline] pub fn create_calendar_with_time_zone(languages: &super::foundation::collections::IIterable<HString>, calendar: &HStringArg, clock: &HStringArg, timeZoneId: &HStringArg) -> Result<ComPtr<Calendar>> { unsafe {
619-
<Self as RtActivatable<ICalendarFactory2>>::get_activation_factory().create_calendar_with_time_zone(languages, calendar, clock, timeZoneId)
620-
}}
621618
#[inline] pub fn create_calendar_default_calendar_and_clock(languages: &super::foundation::collections::IIterable<HString>) -> Result<ComPtr<Calendar>> { unsafe {
622619
<Self as RtActivatable<ICalendarFactory>>::get_activation_factory().create_calendar_default_calendar_and_clock(languages)
623620
}}
624621
#[inline] pub fn create_calendar(languages: &super::foundation::collections::IIterable<HString>, calendar: &HStringArg, clock: &HStringArg) -> Result<ComPtr<Calendar>> { unsafe {
625622
<Self as RtActivatable<ICalendarFactory>>::get_activation_factory().create_calendar(languages, calendar, clock)
626623
}}
624+
#[inline] pub fn create_calendar_with_time_zone(languages: &super::foundation::collections::IIterable<HString>, calendar: &HStringArg, clock: &HStringArg, timeZoneId: &HStringArg) -> Result<ComPtr<Calendar>> { unsafe {
625+
<Self as RtActivatable<ICalendarFactory2>>::get_activation_factory().create_calendar_with_time_zone(languages, calendar, clock, timeZoneId)
626+
}}
627627
}
628628
DEFINE_CLSID!(Calendar(&[87,105,110,100,111,119,115,46,71,108,111,98,97,108,105,122,97,116,105,111,110,46,67,97,108,101,110,100,97,114,0]) [CLSID_Calendar]);
629629
DEFINE_IID!(IID_ICalendarFactory, 2213905426, 58731, 19573, 166, 110, 15, 99, 213, 119, 88, 166);
@@ -655,28 +655,10 @@ impl ICalendarFactory2 {
655655
}
656656
}
657657
RT_CLASS!{static class CalendarIdentifiers}
658-
impl RtActivatable<ICalendarIdentifiersStatics3> for CalendarIdentifiers {}
659-
impl RtActivatable<ICalendarIdentifiersStatics2> for CalendarIdentifiers {}
660658
impl RtActivatable<ICalendarIdentifiersStatics> for CalendarIdentifiers {}
659+
impl RtActivatable<ICalendarIdentifiersStatics2> for CalendarIdentifiers {}
660+
impl RtActivatable<ICalendarIdentifiersStatics3> for CalendarIdentifiers {}
661661
impl CalendarIdentifiers {
662-
#[inline] pub fn get_chinese_lunar() -> Result<HString> { unsafe {
663-
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_chinese_lunar()
664-
}}
665-
#[inline] pub fn get_japanese_lunar() -> Result<HString> { unsafe {
666-
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_japanese_lunar()
667-
}}
668-
#[inline] pub fn get_korean_lunar() -> Result<HString> { unsafe {
669-
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_korean_lunar()
670-
}}
671-
#[inline] pub fn get_taiwan_lunar() -> Result<HString> { unsafe {
672-
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_taiwan_lunar()
673-
}}
674-
#[inline] pub fn get_vietnamese_lunar() -> Result<HString> { unsafe {
675-
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_vietnamese_lunar()
676-
}}
677-
#[inline] pub fn get_persian() -> Result<HString> { unsafe {
678-
<Self as RtActivatable<ICalendarIdentifiersStatics2>>::get_activation_factory().get_persian()
679-
}}
680662
#[inline] pub fn get_gregorian() -> Result<HString> { unsafe {
681663
<Self as RtActivatable<ICalendarIdentifiersStatics>>::get_activation_factory().get_gregorian()
682664
}}
@@ -704,6 +686,24 @@ impl CalendarIdentifiers {
704686
#[inline] pub fn get_um_al_qura() -> Result<HString> { unsafe {
705687
<Self as RtActivatable<ICalendarIdentifiersStatics>>::get_activation_factory().get_um_al_qura()
706688
}}
689+
#[inline] pub fn get_persian() -> Result<HString> { unsafe {
690+
<Self as RtActivatable<ICalendarIdentifiersStatics2>>::get_activation_factory().get_persian()
691+
}}
692+
#[inline] pub fn get_chinese_lunar() -> Result<HString> { unsafe {
693+
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_chinese_lunar()
694+
}}
695+
#[inline] pub fn get_japanese_lunar() -> Result<HString> { unsafe {
696+
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_japanese_lunar()
697+
}}
698+
#[inline] pub fn get_korean_lunar() -> Result<HString> { unsafe {
699+
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_korean_lunar()
700+
}}
701+
#[inline] pub fn get_taiwan_lunar() -> Result<HString> { unsafe {
702+
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_taiwan_lunar()
703+
}}
704+
#[inline] pub fn get_vietnamese_lunar() -> Result<HString> { unsafe {
705+
<Self as RtActivatable<ICalendarIdentifiersStatics3>>::get_activation_factory().get_vietnamese_lunar()
706+
}}
707707
}
708708
DEFINE_CLSID!(CalendarIdentifiers(&[87,105,110,100,111,119,115,46,71,108,111,98,97,108,105,122,97,116,105,111,110,46,67,97,108,101,110,100,97,114,73,100,101,110,116,105,102,105,101,114,115,0]) [CLSID_CalendarIdentifiers]);
709709
DEFINE_IID!(IID_ICalendarIdentifiersStatics, 2154119016, 11442, 19487, 181, 144, 240, 245, 43, 244, 253, 26);
@@ -840,12 +840,9 @@ impl IClockIdentifiersStatics {
840840
}
841841
}
842842
RT_CLASS!{static class CurrencyIdentifiers}
843-
impl RtActivatable<ICurrencyIdentifiersStatics2> for CurrencyIdentifiers {}
844843
impl RtActivatable<ICurrencyIdentifiersStatics> for CurrencyIdentifiers {}
844+
impl RtActivatable<ICurrencyIdentifiersStatics2> for CurrencyIdentifiers {}
845845
impl CurrencyIdentifiers {
846-
#[inline] pub fn get_byn() -> Result<HString> { unsafe {
847-
<Self as RtActivatable<ICurrencyIdentifiersStatics2>>::get_activation_factory().get_byn()
848-
}}
849846
#[inline] pub fn get_aed() -> Result<HString> { unsafe {
850847
<Self as RtActivatable<ICurrencyIdentifiersStatics>>::get_activation_factory().get_aed()
851848
}}
@@ -1317,6 +1314,9 @@ impl CurrencyIdentifiers {
13171314
#[inline] pub fn get_zwl() -> Result<HString> { unsafe {
13181315
<Self as RtActivatable<ICurrencyIdentifiersStatics>>::get_activation_factory().get_zwl()
13191316
}}
1317+
#[inline] pub fn get_byn() -> Result<HString> { unsafe {
1318+
<Self as RtActivatable<ICurrencyIdentifiersStatics2>>::get_activation_factory().get_byn()
1319+
}}
13201320
}
13211321
DEFINE_CLSID!(CurrencyIdentifiers(&[87,105,110,100,111,119,115,46,71,108,111,98,97,108,105,122,97,116,105,111,110,46,67,117,114,114,101,110,99,121,73,100,101,110,116,105,102,105,101,114,115,0]) [CLSID_CurrencyIdentifiers]);
13221322
DEFINE_IID!(IID_ICurrencyIdentifiersStatics, 2669480219, 54662, 18707, 155, 106, 169, 189, 45, 193, 40, 116);
@@ -2445,21 +2445,21 @@ impl ILanguage {
24452445
}
24462446
RT_CLASS!{class Language: ILanguage}
24472447
impl RtActivatable<ILanguageFactory> for Language {}
2448-
impl RtActivatable<ILanguageStatics2> for Language {}
24492448
impl RtActivatable<ILanguageStatics> for Language {}
2449+
impl RtActivatable<ILanguageStatics2> for Language {}
24502450
impl Language {
24512451
#[inline] pub fn create_language(languageTag: &HStringArg) -> Result<ComPtr<Language>> { unsafe {
24522452
<Self as RtActivatable<ILanguageFactory>>::get_activation_factory().create_language(languageTag)
24532453
}}
2454-
#[inline] pub fn try_set_input_method_language_tag(languageTag: &HStringArg) -> Result<bool> { unsafe {
2455-
<Self as RtActivatable<ILanguageStatics2>>::get_activation_factory().try_set_input_method_language_tag(languageTag)
2456-
}}
24572454
#[inline] pub fn is_well_formed(languageTag: &HStringArg) -> Result<bool> { unsafe {
24582455
<Self as RtActivatable<ILanguageStatics>>::get_activation_factory().is_well_formed(languageTag)
24592456
}}
24602457
#[inline] pub fn get_current_input_method_language_tag() -> Result<HString> { unsafe {
24612458
<Self as RtActivatable<ILanguageStatics>>::get_activation_factory().get_current_input_method_language_tag()
24622459
}}
2460+
#[inline] pub fn try_set_input_method_language_tag(languageTag: &HStringArg) -> Result<bool> { unsafe {
2461+
<Self as RtActivatable<ILanguageStatics2>>::get_activation_factory().try_set_input_method_language_tag(languageTag)
2462+
}}
24632463
}
24642464
DEFINE_CLSID!(Language(&[87,105,110,100,111,119,115,46,71,108,111,98,97,108,105,122,97,116,105,111,110,46,76,97,110,103,117,97,103,101,0]) [CLSID_Language]);
24652465
DEFINE_IID!(IID_ILanguageExtensionSubtags, 2105388869, 13965, 17252, 133, 43, 222, 201, 39, 3, 123, 133);

0 commit comments

Comments
 (0)