diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2013-12-31 15:05:01 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-01-01 17:33:29 +0200 |
commit | 645fb66bbdf756cedbcbcfd8be59ce9f58b2e731 (patch) | |
tree | 40177b3e17190bc89ae8c54fbc3262cb1d88a76f | |
parent | c48ecfaf2b31f6dd64b6c779ed3a076a7efbc113 (diff) |
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
-rw-r--r-- | include/osl/detail/component-declarations.h | 121 | ||||
-rw-r--r-- | include/osl/detail/component-mapping.h | 107 | ||||
-rw-r--r-- | ios/CustomTarget_LibreOffice_app.mk | 4 | ||||
-rw-r--r-- | ios/CustomTarget_MobileLibreOffice_app.mk | 4 | ||||
-rw-r--r-- | ios/CustomTarget_TiledLibreOffice_app.mk | 4 | ||||
-rw-r--r-- | ios/experimental/LibreOffice/LibreOffice/lo.mm | 31 | ||||
-rw-r--r-- | ios/experimental/TiledLibreOffice/TiledLibreOffice/lo.mm | 30 | ||||
-rw-r--r-- | ios/shared/ios_sharedlo/cxx/mlo.mm | 33 |
8 files changed, 18 insertions, 316 deletions
diff --git a/include/osl/detail/component-declarations.h b/include/osl/detail/component-declarations.h deleted file mode 100644 index b8fb658d2822..000000000000 --- a/include/osl/detail/component-declarations.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#ifndef INCLUDED_OSL_DETAIL_COMPONENT_DECLARATIONS_H -#define INCLUDED_OSL_DETAIL_COMPONENT_DECLARATIONS_H - -#ifdef DISABLE_DYNLOADING - -#ifdef __cplusplus -extern "C" { -#endif - -void * analysis_component_getFactory( const char * , void * , void * ); -void * animcore_component_getFactory( const char * , void * , void * ); -void * avmedia_component_getFactory( const char * , void * , void * ); -void * basprov_component_getFactory( const char * , void * , void * ); -void * bootstrap_component_getFactory( const char * , void * , void * ); -void * chartcore_component_getFactory( const char * , void * , void * ); -void * comphelp_component_getFactory( const char * , void * , void * ); -void * configmgr_component_getFactory( const char * , void * , void * ); -void * cui_component_getFactory( const char * , void * , void * ); -void * date_component_getFactory( const char * , void * , void * ); -void * dba_component_getFactory( const char * , void * , void * ); -void * dbaxml_component_getFactory( const char * , void * , void * ); -void * deployment_component_getFactory( const char * , void * , void * ); -void * dlgprov_component_getFactory( const char * , void * , void * ); -void * embobj_component_getFactory( const char * , void * , void * ); -void * emboleobj_component_getFactory( const char * , void * , void * ); -void * evtatt_component_getFactory( const char * , void * , void * ); -void * filterconfig1_component_getFactory( const char * , void * , void * ); -void * frm_component_getFactory( const char * , void * , void * ); -void * fsstorage_component_getFactory( const char * , void * , void * ); -void * fwk_component_getFactory( const char * , void * , void * ); -void * fwl_component_getFactory( const char * , void * , void * ); -void * fwm_component_getFactory( const char * , void * , void * ); -void * hwp_component_getFactory( const char * , void * , void * ); -void * hyphen_component_getFactory( const char * , void * , void * ); -void * i18npool_component_getFactory( const char * , void * , void * ); -void * i18nsearch_component_getFactory( const char * , void * , void * ); -void * introspection_component_getFactory( const char * , void * , void * ); -void * lng_component_getFactory( const char * , void * , void * ); -void * lnth_component_getFactory( const char * , void * , void * ); -void * localebe1_component_getFactory( const char * , void * , void * ); -void * oox_component_getFactory( const char * , void * , void * ); -void * package2_component_getFactory( const char * , void * , void * ); -void * pricing_component_getFactory( const char * , void * , void * ); -void * protocolhandler_component_getFactory( const char * , void * , void * ); -void * reflection_component_getFactory( const char * , void * , void * ); -void * sb_component_getFactory( const char * , void * , void * ); -void * sc_component_getFactory( const char * , void * , void * ); -void * scd_component_getFactory( const char * , void * , void * ); -void * scfilt_component_getFactory( const char * , void * , void * ); -void * scriptframe_component_getFactory( const char * , void * , void * ); -void * sd_component_getFactory( const char * , void * , void * ); -void * sdd_component_getFactory( const char * , void * , void * ); -void * sfx_component_getFactory( const char * , void * , void * ); -void * sm_component_getFactory( const char * , void * , void * ); -void * smd_component_getFactory( const char * , void * , void * ); -void * sot_component_getFactory( const char * , void * , void * ); -void * spell_component_getFactory( const char * , void * , void * ); -void * spl_component_getFactory( const char * , void * , void * ); -void * stocservices_component_getFactory( const char * , void * , void * ); -void * stringresource_component_getFactory( const char * , void * , void * ); -void * svgfilter_component_getFactory( const char * , void * , void * ); -void * svl_component_getFactory( const char * , void * , void * ); -void * svt_component_getFactory( const char * , void * , void * ); -void * svx_component_getFactory( const char * , void * , void * ); -void * svxcore_component_getFactory( const char * , void * , void * ); -void * sw_component_getFactory( const char * , void * , void * ); -void * swd_component_getFactory( const char * , void * , void * ); -void * t602filter_component_getFactory( const char * , void * , void * ); -void * textfd_component_getFactory( const char * , void * , void * ); -void * tk_component_getFactory( const char * , void * , void * ); -void * ucb_component_getFactory( const char * , void * , void * ); -void * ucpexpand1_component_getFactory( const char * , void * , void * ); -void * ucpfile_component_getFactory( const char * , void * , void * ); -void * ucppkg1_component_getFactory( const char * , void * , void * ); -void * unordf_component_getFactory( const char * , void * , void * ); -void * unoxml_component_getFactory( const char * , void * , void * ); -void * utl_component_getFactory( const char * , void * , void * ); -void * uui_component_getFactory( const char * , void * , void * ); -void * vbaevents_component_getFactory( const char * , void * , void * ); -void * vbaswobj_component_getFactory( const char * , void * , void * ); -void * vcl_component_getFactory( const char * , void * , void * ); -void * wpftdraw_component_getFactory( const char * , void * , void * ); -void * wpftwriter_component_getFactory( const char * , void * , void * ); -void * writerfilter_component_getFactory( const char * , void * , void * ); -void * xmlfd_component_getFactory( const char * , void * , void * ); -void * xmlsecurity_component_getFactory( const char * , void * , void * ); -void * xo_component_getFactory( const char * , void * , void * ); -void * xof_component_getFactory( const char * , void * , void * ); -void * xstor_component_getFactory( const char * , void * , void * ); - -void * com_sun_star_comp_extensions_xml_sax_FastParser( void * , void * ); -void * com_sun_star_comp_extensions_xml_sax_ParserExpat( void * , void * ); -void * com_sun_star_comp_stoc_DLLComponentLoader( void * , void * ); -void * com_sun_star_comp_stoc_ImplementationRegistration( void * , void * ); -void * com_sun_star_comp_stoc_NestedRegistry( void * , void * ); -void * com_sun_star_comp_stoc_ORegistryServiceManager( void * , void * ); -void * com_sun_star_comp_stoc_OServiceManager( void * , void * ); -void * com_sun_star_comp_stoc_OServiceManagerWrapper( void * , void * ); -void * com_sun_star_comp_stoc_SimpleRegistry( void * , void * ); -void * com_sun_star_extensions_xml_sax_Writer( void * , void * ); -void * com_sun_star_security_comp_stoc_AccessController( void * , void * ); -void * com_sun_star_security_comp_stoc_FilePolicy( void * , void * ); - -#ifdef __cplusplus -} -#endif - -#endif /* DISABLE_DYNLOADING */ - -#endif // INCLUDED_OSL_DETAIL_COMPONENT_DECLARATIONS_H - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/osl/detail/component-mapping.h b/include/osl/detail/component-mapping.h index b32d41b5c8a8..ce82083bf1e3 100644 --- a/include/osl/detail/component-mapping.h +++ b/include/osl/detail/component-mapping.h @@ -10,8 +10,6 @@ #ifndef INCLUDED_OSL_DETAIL_COMPONENT_MAPPING_H #define INCLUDED_OSL_DETAIL_COMPONENT_MAPPING_H -#include <osl/detail/component-declarations.h> - #ifdef DISABLE_DYNLOADING #ifdef __cplusplus @@ -43,111 +41,6 @@ const lib_to_constructor_mapping *lo_get_constructor_map(void); } #endif -#define LO_CORE_FACTORY_MAP \ - { "libembobj.a", embobj_component_getFactory }, \ - { "libemboleobj.a", emboleobj_component_getFactory }, \ - { "libintrospectionlo.a", introspection_component_getFactory }, \ - { "libreflectionlo.a", reflection_component_getFactory }, \ - { "libstocserviceslo.a", stocservices_component_getFactory }, \ - { "libcomphelper.a", comphelp_component_getFactory }, \ - { "libconfigmgrlo.a", configmgr_component_getFactory }, \ - { "libdeployment.a", deployment_component_getFactory }, \ - { "libevtattlo.a", evtatt_component_getFactory }, \ - { "libfilterconfiglo.a", filterconfig1_component_getFactory }, \ - { "libfsstoragelo.a", fsstorage_component_getFactory }, \ - { "libfwklo.a", fwk_component_getFactory }, \ - { "libfwllo.a", fwl_component_getFactory }, \ - { "libhyphenlo.a", hyphen_component_getFactory }, \ - { "libi18npoollo.a", i18npool_component_getFactory }, \ - { "liblnglo.a", lng_component_getFactory }, \ - { "liblnthlo.a", lnth_component_getFactory }, \ - { "liblocalebe1lo.a", localebe1_component_getFactory }, \ - { "libooxlo.a", oox_component_getFactory }, \ - { "libpackage2.a", package2_component_getFactory }, \ - { "libsfxlo.a", sfx_component_getFactory }, \ - { "libsotlo.a", sot_component_getFactory }, \ - { "libspelllo.a", spell_component_getFactory }, \ - { "libsvllo.a", svl_component_getFactory }, \ - { "libsvtlo.a", svt_component_getFactory }, \ - { "libsvxlo.a", svx_component_getFactory }, \ - { "libtklo.a", tk_component_getFactory }, \ - { "libucb1.a", ucb_component_getFactory }, \ - { "libucpexpand1lo.a", ucpexpand1_component_getFactory }, \ - { "libucpfile1.a", ucpfile_component_getFactory }, \ - { "libunordflo.a", unordf_component_getFactory }, \ - { "libunoxmllo.a", unoxml_component_getFactory }, \ - { "libutllo.a", utl_component_getFactory }, \ - { "libvcllo.a", vcl_component_getFactory }, \ - { "libxmlsecurity.a", xmlsecurity_component_getFactory }, \ - { "libxolo.a", xo_component_getFactory }, \ - { "libxoflo.a", xof_component_getFactory }, \ - { "libxstor.a", xstor_component_getFactory }, \ - -#define LO_EXTENDED_CORE_FACTORY_MAP \ - LO_CORE_FACTORY_MAP \ - { "libanimcorelo.a", animcore_component_getFactory }, \ - { "libavmedialo.a", avmedia_component_getFactory }, \ - { "libchartcorelo.a", chartcore_component_getFactory }, \ - { "libfilterconfiglo.a", filterconfig1_component_getFactory }, \ - { "libfrmlo.a", frm_component_getFactory }, \ - { "libfwklo.a", fwk_component_getFactory }, \ - { "libfwmlo.a", fwm_component_getFactory }, \ - { "libsvxcorelo.a", svxcore_component_getFactory }, \ - { "libtextfdlo.a", textfd_component_getFactory }, \ - { "libtklo.a", tk_component_getFactory }, \ - { "libucppkg1.a", ucppkg1_component_getFactory }, \ - { "libxmlfdlo.a", xmlfd_component_getFactory }, \ - -#define LO_BASE_CORE_FACTORY_MAP \ - { "libdbalo.a", dba_component_getFactory }, \ - { "libdbaxmllo.a", dbaxml_component_getFactory }, \ - -#define LO_CALC_CORE_FACTORY_MAP \ - { "libscdlo.a", scd_component_getFactory }, \ - { "libscfiltlo.a", scfilt_component_getFactory }, \ - { "libsclo.a", sc_component_getFactory }, \ - -#define LO_CALC_FACTORY_MAP \ - LO_CALC_CORE_FACTORY_MAP \ - { "libanalysislo.a", analysis_component_getFactory }, \ - { "libdatelo.a", date_component_getFactory }, \ - { "libpricinglo.a", pricing_component_getFactory }, \ - -#define LO_DRAW_CORE_FACTORY_MAP \ - { "libsddlo.a", sdd_component_getFactory }, \ - { "libsdlo.a", sd_component_getFactory }, \ - { "libsvgfilterlo.a", svgfilter_component_getFactory }, \ - { "libwpftdrawlo.a", wpftdraw_component_getFactory }, \ - -#define LO_MATH_FACTORY_MAP \ - { "libsmdlo.a", smd_component_getFactory }, \ - { "libsmlo.a", sm_component_getFactory }, \ - -#define LO_WRITER_CORE_FACTORY_MAP \ - { "libswdlo.a", swd_component_getFactory }, \ - { "libswlo.a", sw_component_getFactory }, \ - { "libwriterfilterlo.a", writerfilter_component_getFactory }, \ - -#define LO_WRITER_FACTORY_MAP \ - LO_WRITER_CORE_FACTORY_MAP \ - { "libhwplo.a", hwp_component_getFactory }, \ - { "libt602filterlo.a", t602filter_component_getFactory }, \ - { "libwpftwriterlo.a", wpftwriter_component_getFactory }, \ - -#define NON_APP_SPECIFIC_CONSTRUCTOR_MAP \ - { "com_sun_star_comp_extensions_xml_sax_ParserExpat", com_sun_star_comp_extensions_xml_sax_ParserExpat }, \ - { "com_sun_star_comp_extensions_xml_sax_FastParser", com_sun_star_comp_extensions_xml_sax_FastParser }, \ - { "com_sun_star_comp_stoc_DLLComponentLoader", com_sun_star_comp_stoc_DLLComponentLoader }, \ - { "com_sun_star_comp_stoc_ImplementationRegistration", com_sun_star_comp_stoc_ImplementationRegistration }, \ - { "com_sun_star_comp_stoc_NestedRegistry", com_sun_star_comp_stoc_NestedRegistry }, \ - { "com_sun_star_comp_stoc_ORegistryServiceManager", com_sun_star_comp_stoc_ORegistryServiceManager }, \ - { "com_sun_star_comp_stoc_OServiceManager", com_sun_star_comp_stoc_OServiceManager }, \ - { "com_sun_star_comp_stoc_OServiceManagerWrapper", com_sun_star_comp_stoc_OServiceManagerWrapper }, \ - { "com_sun_star_comp_stoc_SimpleRegistry", com_sun_star_comp_stoc_SimpleRegistry }, \ - { "com_sun_star_extensions_xml_sax_Writer", com_sun_star_extensions_xml_sax_Writer }, \ - { "com_sun_star_security_comp_stoc_AccessController", com_sun_star_security_comp_stoc_AccessController }, \ - { "com_sun_star_security_comp_stoc_FilePolicy", com_sun_star_security_comp_stoc_FilePolicy }, \ - #endif /* DISABLE_DYNLOADING */ #endif // INCLUDED_OSL_DETAIL_COMPONENT_MAPPING_H 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 <UIKit/UIKit.h> #include <postmac.h> -#include <osl/detail/component-mapping.h> #include <osl/process.h> #include <touch/touch.h> -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 <UIKit/UIKit.h> #include <postmac.h> -#include <osl/detail/component-mapping.h> #include <osl/process.h> #include <touch/touch.h> -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 <UIKit/UIKit.h> #include <postmac.h> -#include <osl/detail/component-mapping.h> #include <touch/touch.h> #undef TimeValue #include <osl/process.h> -#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://"; |