diff --git a/CHANGELOG.md b/CHANGELOG.md index f945d893d7a4269370e20e86f22513a4a805d815..bc48fd96e464c94f2327b7f9d7bbd122df8e0d12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 This changelog file was started on October 2019. Previous changes were more or less tracked in the *NEWS* file. +## [5.3.0] Unreleased +### Changed +- Enum relocations dictionnary is now automatically computed, causing an API change in C++, Swift & Java wrappers! ## [5.2.0] 2022-11-14 diff --git a/tester/wrapper_cpp_tester.cpp b/tester/wrapper_cpp_tester.cpp index 30190de9d8854b492a21f2536959c555ea911d85..d3edc867e11755663faf1b11d273325ded7c9f06 100644 --- a/tester/wrapper_cpp_tester.cpp +++ b/tester/wrapper_cpp_tester.cpp @@ -43,10 +43,9 @@ static void create_chat_room(){ std::list<std::shared_ptr<linphone::Address> > participants; std::shared_ptr<const linphone::Address> localAddress; participants.push_back(linphone::Object::cPtrToSharedPtr<linphone::Address>(pauline->identity)); - params->setBackend(linphone::ChatRoomBackend::Basic); + params->setBackend(linphone::ChatRoom::Backend::Basic); - -// Creation, store the result inside a variable to test variable scope. + // Creation, store the result inside a variable to test variable scope. auto chatRoom = core->createChatRoom(params, localAddress, participants); auto cChatRoom = (LinphoneChatRoom*)linphone::Object::sharedPtrToCPtr(chatRoom); diff --git a/tools/abstractapi.py b/tools/abstractapi.py index 5b295610463b6b9f68efa8713f8b920e3c9776f6..a7d12f06a4dc530c3ba7ffc76b8dfb8a7226013a 100644 --- a/tools/abstractapi.py +++ b/tools/abstractapi.py @@ -513,35 +513,9 @@ class CParser: self.forcedRefcountableClasses = ['LinphoneFactory'] self.enum_relocations = { - 'LinphoneAccountCreatorActivationCodeStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorDomainStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorEmailStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorLanguageStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorPasswordStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorPhoneNumberStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorTransportStatus' : 'LinphoneAccountCreator', - 'LinphoneAccountCreatorUsernameStatus' : 'LinphoneAccountCreator', - 'LinphoneCallDir' : 'LinphoneCall', - 'LinphoneCallState' : 'LinphoneCall', - 'LinphoneCallStatus' : 'LinphoneCall', - 'LinphoneConferenceState' : 'LinphoneConference', - 'LinphoneChatRoomState' : 'LinphoneChatRoom', - 'LinphoneChatMessageDirection' : 'LinphoneChatMessage', - 'LinphoneChatMessageState' : 'LinphoneChatMessage', - 'LinphoneCoreLogCollectionUploadState' : 'LinphoneCore', - 'LinphoneEventLogType' : 'LinphoneEventLog', 'LinphoneSecurityEventType' : 'LinphoneEventLog', - 'LinphoneFriendListStatus' : 'LinphoneFriendList', - 'LinphoneFriendListSyncStatus' : 'LinphoneFriendList', - 'LinphonePlayerState' : 'LinphonePlayer', - 'LinphonePresenceActivityType' : 'LinphonePresenceActivity', - 'LinphoneTunnelMode' : 'LinphoneTunnel', - 'LinphoneAudioDeviceType' : 'LinphoneAudioDevice', - 'LinphoneAudioDeviceCapabilities' : 'LinphoneAudioDevice', - 'LinphoneConferenceSchedulerState' : 'LinphoneConferenceScheduler', - 'LinphoneConferenceInfoState' : 'LinphoneConferenceInfo' } + self.enable_enum_relocations = True self.cProject = cProject @@ -743,8 +717,15 @@ class CParser: self.enumsIndex[cenum.publicName] = enum self.enumeratorsIndex.update(enumeratorsIndex) - if cenum.publicName in self.enum_relocations: - self._pending_enums.append(enum) + if self.enable_enum_relocations: + enum_cname = enum.name.to_c() + for class_ in self.cProject.classes: + class_cname = class_.name + if enum_cname.startswith(class_cname): + print('Considering ' + enum_cname + ' as a child of ' + class_cname) + self.enum_relocations[enum_cname] = class_cname + self._pending_enums.append(enum) + break return enum def parse_class(self, cclass): diff --git a/wrappers/csharp/genwrapper.py b/wrappers/csharp/genwrapper.py index 7819588bf00b27fd9c6d4416d65dbeb3dab3503e..c66d38e6a4f50940f34fde958bbe1009fc7d3c1b 100644 --- a/wrappers/csharp/genwrapper.py +++ b/wrappers/csharp/genwrapper.py @@ -489,7 +489,7 @@ if __name__ == '__main__': 'linphone_core_set_native_video_window_id' ] parser.classBl += 'LinphoneCoreVTable' - parser.enum_relocations = {} # No nested enums in C#, will cause ambiguousness between Call.State (the enum) and call.State (the property) + parser.enable_enum_relocations = False # No nested enums in C#, will cause ambiguousness between Call.State (the enum) and call.State (the property) parser.parse_all() translator = CsharpTranslator() renderer = pystache.Renderer()