From 5a01074b7e696ad4d8e32c1e64ed7b1f893fb50b Mon Sep 17 00:00:00 2001 From: Daekwang Ryu Date: Tue, 9 Aug 2022 13:42:15 +0900 Subject: [PATCH] Revert "[Tizen] Revert "(Build) Disable to compile unused modules"" This reverts commit ab92a6190043c4e4bc8eccddedd7c4761106b85b. --- build/tizen/configure.ac | 23 ++++++ build/tizen/dali-extension/Makefile.am | 25 ++++-- build/tizen/dali-extension/configure.ac | 9 ++- dali-extension/dali-extension.h | 4 +- dali-extension/image-loader/loader-dummy.cpp | 15 ++-- dali-extension/image-loader/tizen-image-loader.cpp | 88 +++++++++++----------- packaging/dali-extension.spec | 35 ++++++--- 7 files changed, 126 insertions(+), 73 deletions(-) mode change 100755 => 100644 dali-extension/image-loader/loader-dummy.cpp mode change 100755 => 100644 dali-extension/image-loader/tizen-image-loader.cpp diff --git a/build/tizen/configure.ac b/build/tizen/configure.ac index a0fbbd6..b370622 100755 --- a/build/tizen/configure.ac +++ b/build/tizen/configure.ac @@ -40,12 +40,35 @@ AC_ARG_ENABLE([web-engine-plugin], [enable_web_engine_plugin=$enableval], [enable_web_engine_plugin=no]) +AC_ARG_ENABLE([imageloader-extension], + [AC_HELP_STRING([--enable-imageloader-extension], + [Turns on image loader extension build])], + [enable_imageloader_extension=$enableval], + [enable_imageloader_extension=no]) + +AC_ARG_ENABLE([color-controller], + [AC_HELP_STRING([--enable-color-controller], + [Turns on color controller plugin build])], + [enable_color_controller=$enableval], + [enable_color_controller=no]) + +AC_ARG_ENABLE([evas-plugin], + [AC_HELP_STRING([--enable-evas-plugin], + [Turns on evas plugin])], + [enable_evas_plugin=$enableval], + [enable_evas_plugin=no]) + PKG_CHECK_MODULES([DALI], [dali2-core dali2-adaptor dali2-toolkit]) AC_CONFIG_SUBDIRS(key) AC_CONFIG_SUBDIRS(video-player) + +if test "x$enable_imageloader_extension" = "xyes"; then AC_CONFIG_SUBDIRS(image-loader) +fi +if test "x$enable_color_controller" = "xyes"; then AC_CONFIG_SUBDIRS(color-controller) +fi if test "x$with_tizen_55_or_greater" = "xyes"; then AC_CONFIG_SUBDIRS(vector-animation-renderer) diff --git a/build/tizen/dali-extension/Makefile.am b/build/tizen/dali-extension/Makefile.am index 990e570..7623641 100755 --- a/build/tizen/dali-extension/Makefile.am +++ b/build/tizen/dali-extension/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright (c) 2020 Samsung Electronics Co., Ltd. +# Copyright (c) 2022 Samsung Electronics Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,17 +19,21 @@ extension_src_dir = ../../../dali-extension # evas-plugin +if EVAS_PLUGIN include ../../../dali-extension/devel-api/evas-plugin/file.list include ../../../dali-extension/internal/evas-plugin/file.list +endif lib_LTLIBRARIES = lib_LTLIBRARIES += libdali2-extension.la # Todo Evas plugin separation +if EVAS_PLUGIN libdali2_extension_la_SOURCES = \ $(evas_plugin_devel_src_files) \ $(evas_plugin_internal_src_files) +endif libdali2_extension_la_DEPENDENCIES = @@ -38,21 +42,29 @@ libdali2_extension_la_CXXFLAGS = \ $(DALI_CFLAGS) \ $(DALI_EXTENSION_CFLAGS) \ $(DALI_ADAPTOR_INTEGRATION_CFLAGS) \ - $(ELEMENTARY_CFLAGS) \ - $(EVAS_CFLAGS) \ $(WAYLAND_CFLAGS) \ -DEFL_BETA_API_SUPPORT \ -I../../../ \ -Werror -Wall +if EVAS_PLUGIN +libdali2_extension_la_CXXFLAGS += \ + $(ELEMENTARY_CFLAGS) \ + $(EVAS_CFLAGS) +endif + libdali2_extension_la_LIBADD = \ $(DLOG_LIBS) \ $(DALI_LIBS) \ $(DALI_ADAPTOR_INTEGRATION_LIBS) \ - $(ELEMENTARY_LIBS) \ - $(EVAS_LIBS) \ $(WAYLAND_LIBS) +if EVAS_PLUGIN +libdali2_extension_la_LIBADD += \ + $(ELEMENTARY_LIBS) \ + $(EVAS_LIBS) +endif + libdali2_extension_la_LDFLAGS = \ -rdynamic @@ -60,5 +72,8 @@ libdali2_extension_la_LDFLAGS = \ dali2_extensiondir = $(devincludepath)/dali-extension dali2_extension_HEADERS = ../../../dali-extension/dali-extension.h +if EVAS_PLUGIN dali2_extension_evasplugindir = $(devincludepath)/dali-extension/devel-api/evas-plugin dali2_extension_evasplugin_HEADERS = $(evas_plugin_devel_header_files) +endif + diff --git a/build/tizen/dali-extension/configure.ac b/build/tizen/dali-extension/configure.ac index 423d19a..e1a4f55 100755 --- a/build/tizen/dali-extension/configure.ac +++ b/build/tizen/dali-extension/configure.ac @@ -16,15 +16,20 @@ LT_INIT DALI_EXTENSION_VERSION=dali_version AC_SUBST(DALI_EXTENSION_VERSION) +AM_CONDITIONAL([EVAS_PLUGIN], [test x$evas_plugin = xtrue]) + if test "x$enable_debug" = "xyes"; then DALI_CFLAGS="$DALI_CFLAGS -DDEBUG_ENABLED" fi -# For evas-plugin PKG_CHECK_MODULES(DALI_ADAPTOR_INTEGRATION, dali2-adaptor-integration) +PKG_CHECK_MODULES(WAYLAND, [ecore-wl2]) + +# For evas-plugin +if test "x$enable_evas_plugin" = "xyes"; then PKG_CHECK_MODULES(ELEMENTARY, elementary) PKG_CHECK_MODULES(EVAS, evas) -PKG_CHECK_MODULES(WAYLAND, [ecore-wl2]) +fi devincludepath=${includedir} AC_SUBST(devincludepath) diff --git a/dali-extension/dali-extension.h b/dali-extension/dali-extension.h index 3d634aa..f257b61 100644 --- a/dali-extension/dali-extension.h +++ b/dali-extension/dali-extension.h @@ -2,7 +2,7 @@ #define DALI_EXTENSION_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,7 +18,9 @@ * */ +#if defined(EVAS_PLUGIN) #include #include +#endif #endif // DALI_EXTENSION_H diff --git a/dali-extension/image-loader/loader-dummy.cpp b/dali-extension/image-loader/loader-dummy.cpp old mode 100755 new mode 100644 index f39c0a7..4c7ae98 --- a/dali-extension/image-loader/loader-dummy.cpp +++ b/dali-extension/image-loader/loader-dummy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,21 +18,19 @@ // HEADER #include "loader-dummy.h" -#include -#include #include +#include // INTERNAL INCLUDES namespace Dali { namespace Plugin { - /** * This code is a dummy code. You can implement it here. */ -bool LoadImageHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height ) +bool LoadImageHeader(const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height) { bool success = false; /* Loads the header of a image file and fills in the width and height appropriately. */ @@ -40,8 +38,7 @@ bool LoadImageHeader( const Dali::ImageLoader::Input& input, unsigned int& width return success; } - -bool LoadBitmapFromImage( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap ) +bool LoadBitmapFromImage(const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap) { bool success = false; /* Loads the bitmap from an image file. This function checks the header first */ @@ -49,5 +46,5 @@ bool LoadBitmapFromImage( const Dali::ImageLoader::Input& input, Dali::Devel::Pi return success; } -} -} +} // namespace Plugin +} // namespace Dali diff --git a/dali-extension/image-loader/tizen-image-loader.cpp b/dali-extension/image-loader/tizen-image-loader.cpp old mode 100755 new mode 100644 index 34bf24b..70ca83b --- a/dali-extension/image-loader/tizen-image-loader.cpp +++ b/dali-extension/image-loader/tizen-image-loader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ */ // CLASS HEADER -#include -#include #include +#include +#include #include "loader-dummy.h" // The plugin factories @@ -27,9 +27,9 @@ extern "C" DALI_EXPORT_API Dali::ImageLoaderPlugin* CreateImageLoaderPlugin(void return new Dali::Plugin::TizenImageLoader; } -extern "C" DALI_EXPORT_API void DestroyImageLoaderPlugin( Dali::ImageLoaderPlugin* plugin ) +extern "C" DALI_EXPORT_API void DestroyImageLoaderPlugin(Dali::ImageLoaderPlugin* plugin) { - if( plugin != NULL ) + if(plugin != NULL) { delete plugin; } @@ -41,62 +41,59 @@ namespace Plugin { namespace { - /** +/** * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE */ - enum FileFormats - { - // Unknown file format - FORMAT_UNKNOWN = -1, +enum FileFormats +{ + // Unknown file format + FORMAT_UNKNOWN = -1, - // formats that use magic bytes - FORMAT_DUMMY = 0, - FORMAT_TOTAL_COUNT - }; + // formats that use magic bytes + FORMAT_DUMMY = 0, + FORMAT_TOTAL_COUNT +}; - /** +/** * A lookup table containing all the bitmap loaders with the appropriate information. * Has to be in sync with enum FileFormats */ - const Dali::ImageLoader::BitmapLoader BITMAP_LOADER_LOOKUP_TABLE[FORMAT_TOTAL_COUNT] = +const Dali::ImageLoader::BitmapLoader BITMAP_LOADER_LOOKUP_TABLE[FORMAT_TOTAL_COUNT] = { - { 0x0, 0x0, LoadBitmapFromImage, LoadImageHeader, Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS }, - }; - + {0x0, 0x0, LoadBitmapFromImage, nullptr, LoadImageHeader, Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS}, +}; - struct FormatExtension - { - const std::string extension; - FileFormats format; - }; +struct FormatExtension +{ + const std::string extension; + FileFormats format; +}; - const FormatExtension FORMAT_EXTENSIONS[] = +const FormatExtension FORMAT_EXTENSIONS[] = { - { ".dummy", FORMAT_DUMMY } - }; + {".dummy", FORMAT_DUMMY}}; - const unsigned int FORMAT_EXTENSIONS_COUNT = sizeof(FORMAT_EXTENSIONS) / sizeof(FormatExtension); +const unsigned int FORMAT_EXTENSIONS_COUNT = sizeof(FORMAT_EXTENSIONS) / sizeof(FormatExtension); +FileFormats GetFormatHint(const std::string& filename) +{ + FileFormats format = FORMAT_UNKNOWN; - FileFormats GetFormatHint( const std::string& filename ) + for(unsigned int i = 0; i < FORMAT_EXTENSIONS_COUNT; ++i) { - FileFormats format = FORMAT_UNKNOWN; - - for ( unsigned int i = 0; i < FORMAT_EXTENSIONS_COUNT; ++i ) + unsigned int length = FORMAT_EXTENSIONS[i].extension.size(); + if((filename.size() > length) && + (0 == filename.compare(filename.size() - length, length, FORMAT_EXTENSIONS[i].extension))) { - unsigned int length = FORMAT_EXTENSIONS[i].extension.size(); - if ( ( filename.size() > length ) && - ( 0 == filename.compare( filename.size() - length, length, FORMAT_EXTENSIONS[i].extension ) ) ) - { - format = FORMAT_EXTENSIONS[i].format; - break; - } + format = FORMAT_EXTENSIONS[i].format; + break; } - return format; } - + return format; } +} // namespace + TizenImageLoader::TizenImageLoader() { } @@ -105,11 +102,11 @@ TizenImageLoader::~TizenImageLoader() { } -const Dali::ImageLoader::BitmapLoader* TizenImageLoader::BitmapLoaderLookup( const std::string& filename ) const +const Dali::ImageLoader::BitmapLoader* TizenImageLoader::BitmapLoaderLookup(const std::string& filename) const { - const Dali::ImageLoader::BitmapLoader *lookupPtr = BITMAP_LOADER_LOOKUP_TABLE; - FileFormats format = GetFormatHint( filename ); - if ( format != FORMAT_UNKNOWN ) + const Dali::ImageLoader::BitmapLoader* lookupPtr = BITMAP_LOADER_LOOKUP_TABLE; + FileFormats format = GetFormatHint(filename); + if(format != FORMAT_UNKNOWN) { lookupPtr = BITMAP_LOADER_LOOKUP_TABLE + format; return lookupPtr; @@ -123,4 +120,3 @@ const Dali::ImageLoader::BitmapLoader* TizenImageLoader::BitmapLoaderLookup( con } // namespace Plugin } // namespace Dali - diff --git a/packaging/dali-extension.spec b/packaging/dali-extension.spec index f5c11f7..74013a6 100755 --- a/packaging/dali-extension.spec +++ b/packaging/dali-extension.spec @@ -43,11 +43,14 @@ BuildRequires: pkgconfig(dali2-adaptor) BuildRequires: pkgconfig(dali2-toolkit) BuildRequires: pkgconfig(dlog) -# For evas-plugin BuildRequires: pkgconfig(dali2-adaptor-integration) +BuildRequires: pkgconfig(ecore-wl2) + +# For evas-plugin +%if 0%{?enable_evas_plugin} BuildRequires: pkgconfig(elementary) BuildRequires: pkgconfig(evas) -BuildRequires: pkgconfig(ecore-wl2) +%endif %if 0%{?tizen_65_or_greater} BuildRequires: pkgconfig(rive_tizen) @@ -213,9 +216,6 @@ Header & package configuration of rive-animation-view %define dali_data_ro_dir %TZ_SYS_RO_SHARE/dali/ %define dev_include_path %{_includedir} -# Use Image Loader Plugin -%define use_image_loader 0 - ############################## # Build ############################## @@ -255,12 +255,17 @@ autoreconf --install %if 0%{?enable_web_engine_plugin} == 1 --enable-web-engine-plugin \ %endif +%if 0%{?enable_image_loader} + --enable-imageloader-extension \ +%endif +%if 0%{?enable_color_controller} + --enable-color-controller \ +%endif +%if 0%{?enable_evas_plugin} + --enable-evas-plugin \ +%endif --enable-ecore-wl2 \ --enable-keyextension -%if 0%{?use_image_loader} -%configure \ - --enable-imageloader-extension -%endif make %{?jobs:-j%jobs} @@ -315,9 +320,11 @@ popd exit 0 %endif +%if 0%{?enable_image_loader} %post image-loader-plugin /sbin/ldconfig exit 0 +%endif %if 0%{?tizen_55_or_greater} %post vector-animation-renderer-plugin @@ -331,9 +338,11 @@ exit 0 exit 0 %endif +%if 0%{?enable_color_controller} %post color-controller-plugin /sbin/ldconfig exit 0 +%endif %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1 %post web-engine-lwe-plugin @@ -372,9 +381,11 @@ exit 0 exit 0 %endif +%if 0%{?enable_image_loader} %postun image-loader-plugin /sbin/ldconfig exit 0 +%endif %if 0%{?tizen_55_or_greater} %postun vector-animation-renderer-plugin @@ -388,9 +399,11 @@ exit 0 exit 0 %endif +%if 0%{?enable_color_controller} %postun color-controller-plugin /sbin/ldconfig exit 0 +%endif %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1 %postun web-engine-lwe-plugin @@ -442,7 +455,7 @@ exit 0 %license LICENSE %endif -%if 0%{?use_image_loader} +%if 0%{?enable_image_loader} %files image-loader-plugin %manifest dali-extension.manifest %defattr(-,root,root,-) @@ -471,11 +484,13 @@ exit 0 %{_libdir}/pkgconfig/dali2-extension-rive-animation-view.pc %endif +%if 0%{?enable_color_controller} %files color-controller-plugin %manifest dali-extension.manifest %defattr(-,root,root,-) %{_libdir}/libdali2-color-controller-plugin.so* %license LICENSE +%endif %if 0%{?tizen_55_or_greater} && 0%{?enable_web_engine_plugin} == 1 %files web-engine-lwe-plugin -- 2.7.4