From 645fb66bbdf756cedbcbcfd8be59ce9f58b2e731 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Tue, 31 Dec 2013 15:05:01 +0100 Subject: Use native-code.py generated code also for iOS. This allows us to get rid of component-declarations.h and simplify component-mapping.h. For new, converted, implementation_getFactories, adding one line into native-code.py should be enough to make them available in application. Change-Id: I042320e5b7f8a9aa9f02b77d2bdd07cf9a690ee6 --- ios/CustomTarget_LibreOffice_app.mk | 4 +++ ios/CustomTarget_MobileLibreOffice_app.mk | 4 +++ ios/CustomTarget_TiledLibreOffice_app.mk | 4 +++ ios/experimental/LibreOffice/LibreOffice/lo.mm | 31 ++------------------ .../TiledLibreOffice/TiledLibreOffice/lo.mm | 30 ++------------------ ios/shared/ios_sharedlo/cxx/mlo.mm | 33 ++-------------------- 6 files changed, 18 insertions(+), 88 deletions(-) (limited to 'ios') diff --git a/ios/CustomTarget_LibreOffice_app.mk b/ios/CustomTarget_LibreOffice_app.mk index 719ff0905bb7..f9101148dc91 100644 --- a/ios/CustomTarget_LibreOffice_app.mk +++ b/ios/CustomTarget_LibreOffice_app.mk @@ -137,6 +137,10 @@ else # Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one # can then open it from there in Xcode. $(call gb_CustomTarget_get_target,ios/LibreOffice_app) : $(gb_Helper_PHONY) + $(SRCDIR)/solenv/bin/native-code.py \ + -g extended_core -g writer \ + -s cui -s spl -s uui \ + > $(SRCDIR)/ios/experimental/LibreOffice/LibreOffice/native-code.mm if test $(SRCDIR) != $(BUILDDIR); then \ (cd $(SRCDIR) && tar cf - ios/experimental/LibreOffice/LibreOffice.xcodeproj/project.pbxproj) | (cd $(BUILDDIR) && tar xf -); \ fi diff --git a/ios/CustomTarget_MobileLibreOffice_app.mk b/ios/CustomTarget_MobileLibreOffice_app.mk index dcf20d911308..997ad10cbbcd 100644 --- a/ios/CustomTarget_MobileLibreOffice_app.mk +++ b/ios/CustomTarget_MobileLibreOffice_app.mk @@ -33,6 +33,10 @@ $(eval $(call gb_CustomTarget_CustomTarget,ios/MobileLibreOffice)) $(call gb_CustomTarget_get_target,ios/MobileLibreOffice): $(call gb_CustomTarget_get_target,ios/Lo_Xcconfig) MobileLibreOffice_setup #============================================================================== $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2) + $(SRCDIR)/solenv/bin/native-code.py \ + -g core -g writer_core \ + -s i18nsearch -s uui \ + > $(SRCDIR)/ios/shared/ios_sharedlo/cxx/native-code.mm $(call MobileLibreOfficeXcodeBuild, clean build) #============================================================================== diff --git a/ios/CustomTarget_TiledLibreOffice_app.mk b/ios/CustomTarget_TiledLibreOffice_app.mk index 44cacf50f4ac..7a280e286513 100644 --- a/ios/CustomTarget_TiledLibreOffice_app.mk +++ b/ios/CustomTarget_TiledLibreOffice_app.mk @@ -28,6 +28,10 @@ $(eval $(call gb_CustomTarget_CustomTarget,ios/TiledLibreOffice)) # Depend on the custom target that sets up lo.xcconfig $(call gb_CustomTarget_get_target,ios/TiledLibreOffice): $(call gb_CustomTarget_get_target,ios/Lo_Xcconfig) TiledLibreOffice_setup $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2) + $(SRCDIR)/solenv/bin/native-code.py \ + -g extended_core -g writer \ + -s cui -s spl -s uui \ + > $(SRCDIR)/ios/experimental/TiledLibreOffice/TiledLibreOffice/native-code.mm $(call TiledLibreOfficeXcodeBuild, clean build) # Setup diff --git a/ios/experimental/LibreOffice/LibreOffice/lo.mm b/ios/experimental/LibreOffice/LibreOffice/lo.mm index 04760a75bf91..3e69eb74c803 100644 --- a/ios/experimental/LibreOffice/LibreOffice/lo.mm +++ b/ios/experimental/LibreOffice/LibreOffice/lo.mm @@ -12,38 +12,11 @@ #import #include -#include #include #include -extern "C" -const lib_to_factory_mapping * -lo_get_factory_map(void) -{ - static lib_to_factory_mapping map[] = { - LO_EXTENDED_CORE_FACTORY_MAP - LO_WRITER_FACTORY_MAP - { "libcuilo.a", cui_component_getFactory }, - { "libspllo.a", spl_component_getFactory }, - { "libsvtlo.a", svt_component_getFactory }, - { "libuuilo.a", uui_component_getFactory }, - { NULL, NULL } - }; - - return map; -} - -extern "C" -const lib_to_constructor_mapping * -lo_get_constructor_map(void) -{ - static lib_to_constructor_mapping map[] = { - NON_APP_SPECIFIC_CONSTRUCTOR_MAP - { NULL, NULL } - }; - - return map; -} +// generated by solenv/bin/native-code.py: +#include "native-code.mm" extern "C" void diff --git a/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm b/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm index 755ff1a2384f..09cdc95d7605 100644 --- a/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm +++ b/ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm @@ -12,37 +12,11 @@ #import #include -#include #include #include -extern "C" -const lib_to_factory_mapping * -lo_get_factory_map(void) -{ - static lib_to_factory_mapping map[] = { - LO_EXTENDED_CORE_FACTORY_MAP - LO_WRITER_FACTORY_MAP - { "libcuilo.a", cui_component_getFactory }, - { "libspllo.a", spl_component_getFactory }, - { "libuuilo.a", uui_component_getFactory }, - { NULL, NULL } - }; - - return map; -} - -extern "C" -const lib_to_constructor_mapping * -lo_get_constructor_map(void) -{ - static lib_to_constructor_mapping map[] = { - NON_APP_SPECIFIC_CONSTRUCTOR_MAP - { NULL, NULL } - }; - - return map; -} +// generated by solenv/bin/native-code.py: +#include "native-code.mm" static NSString *createPaths(NSString *base, NSString *appRootEscaped, NSArray *fileNames) { diff --git a/ios/shared/ios_sharedlo/cxx/mlo.mm b/ios/shared/ios_sharedlo/cxx/mlo.mm index 8095b2af19c1..4279d0d8a5d9 100644 --- a/ios/shared/ios_sharedlo/cxx/mlo.mm +++ b/ios/shared/ios_sharedlo/cxx/mlo.mm @@ -13,41 +13,12 @@ #import #include -#include #include #undef TimeValue #include -#define MAP_LIB(LIB) { "lib" #LIB ".a", LIB##_component_getFactory } -#define MAP_LIB_LO(LIB) { "lib" #LIB "lo.a", LIB##_component_getFactory } -#define MAP_LIB_LO_1(LIB) { "lib" #LIB "lo.a", LIB##1_component_getFactory } - -extern "C" -const lib_to_factory_mapping * -lo_get_factory_map(void) -{ - static lib_to_factory_mapping map[] = { - LO_CORE_FACTORY_MAP - LO_WRITER_CORE_FACTORY_MAP - MAP_LIB_LO(uui), - MAP_LIB_LO(i18nsearch), - { NULL, NULL } - }; - - return map; -} - -extern "C" -const lib_to_constructor_mapping * -lo_get_constructor_map(void) -{ - static lib_to_constructor_mapping map[] = { - NON_APP_SPECIFIC_CONSTRUCTOR_MAP - { NULL, NULL } - }; - - return map; -} +// generated by solenv/bin/native-code.py: +#include "native-code.mm" NSString * createPaths(NSString * base,NSString * appRootEscaped,NSArray * fileNames){ NSString * prefix = @"file://"; -- cgit