From dbdabb9fd9236adacbc6b5883f73e36a97a07079 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Tue, 1 Jun 2021 10:01:53 +0900 Subject: [PATCH] Revert "[Tizen] Add text wrapping hyphen mode support" This reverts commit d84536e885d09fc1d402e84a47f17c1f1baeb2d0. --- build/tizen/deps-check.cmake | 8 - build/tizen/profiles/common-profile.cmake | 23 -- build/tizen/profiles/mobile-profile.cmake | 22 -- build/tizen/profiles/tv-profile.cmake | 23 -- build/tizen/profiles/ubuntu-profile.cmake | 21 -- dali/devel-api/file.list | 2 - dali/devel-api/text-abstraction/hyphenation.cpp | 62 ----- dali/devel-api/text-abstraction/hyphenation.h | 113 ---------- .../text-abstraction-definitions.h | 11 +- dali/devel-api/text-abstraction/text-abstraction.h | 1 - dali/internal/text/file.list | 17 +- .../text/text-abstraction/hyphenation-impl.cpp | 249 --------------------- .../text/text-abstraction/hyphenation-impl.h | 106 --------- packaging/dali-adaptor.spec | 1 - 14 files changed, 12 insertions(+), 647 deletions(-) delete mode 100644 dali/devel-api/text-abstraction/hyphenation.cpp delete mode 100644 dali/devel-api/text-abstraction/hyphenation.h delete mode 100644 dali/internal/text/text-abstraction/hyphenation-impl.cpp delete mode 100644 dali/internal/text/text-abstraction/hyphenation-impl.h diff --git a/build/tizen/deps-check.cmake b/build/tizen/deps-check.cmake index ab82f2b..924db40 100644 --- a/build/tizen/deps-check.cmake +++ b/build/tizen/deps-check.cmake @@ -77,7 +77,6 @@ CHECK_MODULE_AND_SET( LIBEXIF libexif [] ) CHECK_MODULE_AND_SET( LIBDRM libdrm [] ) CHECK_MODULE_AND_SET( LIBCURL libcurl [] ) CHECK_MODULE_AND_SET( HARFBUZZ harfbuzz [] ) -CHECK_MODULE_AND_SET( HYPHEN libhyphen [] ) CHECK_MODULE_AND_SET( FRIBIDI fribidi [] ) CHECK_MODULE_AND_SET( CAIRO cairo [] ) CHECK_MODULE_AND_SET( EVAS evas [] ) @@ -312,13 +311,6 @@ IF (NOT APPLE) -lturbojpeg -ljpeg ) - -if( NOT ANDROID_PROFILE ) - SET( DALI_LDFLAGS ${DALI_LDFLAGS} - -lhyphen - ) -ENDIF() - ENDIF() # Android includes pthread with android lib diff --git a/build/tizen/profiles/common-profile.cmake b/build/tizen/profiles/common-profile.cmake index f2bcbc1..408643d 100755 --- a/build/tizen/profiles/common-profile.cmake +++ b/build/tizen/profiles/common-profile.cmake @@ -79,26 +79,3 @@ IF( COMPONENT_APPLICATION_SUPPORT ) ) ENDIF() -# Set the linker flags -SET(REQUIRED_LIBS - -lhyphen -) - -FIND_LIBRARY( HYPHEN_LIBRARY NAMES hyphen ) -IF (${HYPHEN_LIBRARY} MATCHES "HYPHEN_LIBRARY-NOTFOUND") - UNSET (HYPHEN_LIBRARY_AVAILABLE) -ELSE() - SET (HYPHEN_LIBRARY_AVAILABLE "HYPHEN_LIBRARY_AVAILABLE") - ADD_DEFINITIONS(-DHYPHEN_LIBRARY_AVAILABLE="${HYPHEN_LIBRARY_AVAILABLE}") - - #The path of hyphen library dictionary - IF (NOT "${HYPHEN_DIC}") - FIND_PATH(HYPHEN_DIC hyph_en_US.dic HINTS "/usr/local/share/hyphen" "/usr/share/hyphen" ) - IF ( NOT HYPHEN_DIC MATCHES "HYPHEN_DIC-NOTFOUND") - ADD_DEFINITIONS(-DHYPHEN_DIC="${HYPHEN_DIC}") - ENDIF() - ENDIF() - MESSAGE (HYPHEN_DIC: "${HYPHEN_DIC}") - -ENDIF() - diff --git a/build/tizen/profiles/mobile-profile.cmake b/build/tizen/profiles/mobile-profile.cmake index ef877a4..7726cc0 100755 --- a/build/tizen/profiles/mobile-profile.cmake +++ b/build/tizen/profiles/mobile-profile.cmake @@ -79,25 +79,3 @@ IF( COMPONENT_APPLICATION_SUPPORT ) ) ENDIF() -# Set the linker flags -SET(REQUIRED_LIBS - -lhyphen -) - -FIND_LIBRARY( HYPHEN_LIBRARY NAMES hyphen ) -IF (${HYPHEN_LIBRARY} MATCHES "HYPHEN_LIBRARY-NOTFOUND") - UNSET (HYPHEN_LIBRARY_AVAILABLE) -ELSE() - SET (HYPHEN_LIBRARY_AVAILABLE "HYPHEN_LIBRARY_AVAILABLE") - ADD_DEFINITIONS(-DHYPHEN_LIBRARY_AVAILABLE="${HYPHEN_LIBRARY_AVAILABLE}") - - #The path of hyphen library dictionary - IF (NOT "${HYPHEN_DIC}") - FIND_PATH(HYPHEN_DIC hyph_en_US.dic HINTS "/usr/local/share/hyphen" "/usr/share/hyphen" ) - IF ( NOT HYPHEN_DIC MATCHES "HYPHEN_DIC-NOTFOUND") - ADD_DEFINITIONS(-DHYPHEN_DIC="${HYPHEN_DIC}") - ENDIF() - ENDIF() - MESSAGE (HYPHEN_DIC: "${HYPHEN_DIC}") - -ENDIF() diff --git a/build/tizen/profiles/tv-profile.cmake b/build/tizen/profiles/tv-profile.cmake index 5f8e8e1..b7858ed 100755 --- a/build/tizen/profiles/tv-profile.cmake +++ b/build/tizen/profiles/tv-profile.cmake @@ -79,26 +79,3 @@ IF( COMPONENT_APPLICATION_SUPPORT ) ) ENDIF() -# Set the linker flags -SET(REQUIRED_LIBS - -lhyphen -) - -FIND_LIBRARY( HYPHEN_LIBRARY NAMES hyphen ) -IF (${HYPHEN_LIBRARY} MATCHES "HYPHEN_LIBRARY-NOTFOUND") - UNSET (HYPHEN_LIBRARY_AVAILABLE) -ELSE() - SET (HYPHEN_LIBRARY_AVAILABLE "HYPHEN_LIBRARY_AVAILABLE") - ADD_DEFINITIONS(-DHYPHEN_LIBRARY_AVAILABLE="${HYPHEN_LIBRARY_AVAILABLE}") - - #The path of hyphen library dictionary - IF (NOT "${HYPHEN_DIC}") - FIND_PATH(HYPHEN_DIC hyph_en_US.dic HINTS "/usr/local/share/hyphen" "/usr/share/hyphen" ) - IF ( NOT HYPHEN_DIC MATCHES "HYPHEN_DIC-NOTFOUND") - ADD_DEFINITIONS(-DHYPHEN_DIC="${HYPHEN_DIC}") - ENDIF() - ENDIF() - MESSAGE (HYPHEN_DIC: "${HYPHEN_DIC}") - -ENDIF() - diff --git a/build/tizen/profiles/ubuntu-profile.cmake b/build/tizen/profiles/ubuntu-profile.cmake index 26abe3e..6e35138 100755 --- a/build/tizen/profiles/ubuntu-profile.cmake +++ b/build/tizen/profiles/ubuntu-profile.cmake @@ -147,25 +147,4 @@ SET(REQUIRED_LIBS ${ECORE_LDFLAGS} -lpthread -lturbojpeg -ljpeg - -lhyphen ) - - -FIND_LIBRARY( HYPHEN_LIBRARY NAMES hyphen ) -IF (${HYPHEN_LIBRARY} MATCHES "HYPHEN_LIBRARY-NOTFOUND") - UNSET (HYPHEN_LIBRARY_AVAILABLE) -ELSE() - SET (HYPHEN_LIBRARY_AVAILABLE "HYPHEN_LIBRARY_AVAILABLE") - ADD_DEFINITIONS(-DHYPHEN_LIBRARY_AVAILABLE="${HYPHEN_LIBRARY_AVAILABLE}") - - #The path of hyphen library dictionary - IF (NOT "${HYPHEN_DIC}") - FIND_PATH(HYPHEN_DIC hyph_en_US.dic HINTS "/usr/local/share/hyphen" "/usr/share/hyphen" ) - IF ( NOT HYPHEN_DIC MATCHES "HYPHEN_DIC-NOTFOUND") - ADD_DEFINITIONS(-DHYPHEN_DIC="${HYPHEN_DIC}") - ENDIF() - ENDIF() - MESSAGE (HYPHEN_DIC: "${HYPHEN_DIC}") - -ENDIF() - diff --git a/dali/devel-api/file.list b/dali/devel-api/file.list index 78775b1..05d6a16 100755 --- a/dali/devel-api/file.list +++ b/dali/devel-api/file.list @@ -141,7 +141,6 @@ SET( devel_api_text_abstraction_src_files ${adaptor_devel_api_dir}/text-abstraction/shaping.cpp ${adaptor_devel_api_dir}/text-abstraction/text-renderer.cpp ${adaptor_devel_api_dir}/text-abstraction/text-renderer-layout-helper.cpp - ${adaptor_devel_api_dir}/text-abstraction/hyphenation.cpp ) @@ -159,5 +158,4 @@ SET( text_abstraction_header_files ${adaptor_devel_api_dir}/text-abstraction/text-abstraction-definitions.h ${adaptor_devel_api_dir}/text-abstraction/text-renderer.h ${adaptor_devel_api_dir}/text-abstraction/text-renderer-layout-helper.h - ${adaptor_devel_api_dir}/text-abstraction/hyphenation.h ) diff --git a/dali/devel-api/text-abstraction/hyphenation.cpp b/dali/devel-api/text-abstraction/hyphenation.cpp deleted file mode 100644 index 40a0da4..0000000 --- a/dali/devel-api/text-abstraction/hyphenation.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2021 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// INTERNAL INCLUDES -#include - -namespace Dali -{ -namespace TextAbstraction -{ -Hyphenation::Hyphenation() -{ -} - -Hyphenation::~Hyphenation() -{ -} - -Hyphenation::Hyphenation(Internal::Hyphenation* impl) -: BaseHandle(impl) -{ -} - -Hyphenation Hyphenation::Get() -{ - return Internal::Hyphenation::Get(); -} - -const char* Hyphenation::GetDictionaryEncoding(const char* lang) -{ - return GetImplementation(*this).GetDictionaryEncoding(lang); -} - -Vector Hyphenation::GetWordHyphens(const char* word, - Length wordSize, - const char* lang) -{ - return GetImplementation(*this).GetWordHyphens(word, - wordSize, - lang); -} - -} // namespace TextAbstraction - -} // namespace Dali diff --git a/dali/devel-api/text-abstraction/hyphenation.h b/dali/devel-api/text-abstraction/hyphenation.h deleted file mode 100644 index b8d5cfe..0000000 --- a/dali/devel-api/text-abstraction/hyphenation.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef DALI_PLATFORM_TEXT_ABSTRACTION_HYPHENATION_H -#define DALI_PLATFORM_TEXT_ABSTRACTION_HYPHENATION_H - -/* - * Copyright (c) 2021 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// INTERNAL INCLUDES -#include -#include - -// EXTERNAL INCLUDES -#include - -namespace Dali -{ -namespace TextAbstraction -{ -namespace Internal DALI_INTERNAL -{ -class Hyphenation; - -} // namespace DALI_INTERNAL - -/** - * @brief Hyphenation provides an interface to retrieve possible hyphenation of the text. - * - * This module get the hyphen positions for a word. - * To get the hyphen positions it needs to load the dictionary for the word language. - * also it need the word to be send using the correct encoding which can be known using - * - * @code - * Hyphenation hyphenation = Hyphenation::Get(); - * - * Character* text = "Hyphenation"; - * - * // get a vector of booleans that indicates possible hyphen locations. - * Vector *hyphens = hyphenation.GetWordHyphens(text, 11, "en_US"); - * - * @endcode - */ -class DALI_ADAPTOR_API Hyphenation : public BaseHandle -{ -public: - /** - * @brief Create an uninitialized Hyphenation handle. - * - */ - Hyphenation(); - - /** - * @brief Destructor - * - * This is non-virtual since derived Handle types must not contain data or virtual methods. - */ - ~Hyphenation(); - - /** - * @brief This constructor is used by Hyphenation::Get(). - * - * @param[in] implementation A pointer to the internal hyphenation object. - */ - explicit DALI_INTERNAL Hyphenation(Internal::Hyphenation* implementation); - - /** - * @brief Retrieve a handle to the Hyphenation instance. - * - * @return A handle to the Hyphenation. - */ - static Hyphenation Get(); - - /** - * - * Gets the encoding of the dictionary for the given language - * - * @param[in] lang language to get encoding for (en_US). - * - * @return The encoding of the language (UTF-32). - */ - const char* GetDictionaryEncoding(const char* lang); - - /** - * Gets a vector booleans that indicates possible hyphen locations. - * - * @param[in] word the word to get possible hyphens for. - * @param[in] wordSize the word size in bytes. - * @param[in] lang the language for the word - * - * @return vector of boolean, true if possible to hyphenate at this character position. - */ - Vector GetWordHyphens(const char* word, - Length wordSize, - const char* lang); -}; - -} // namespace TextAbstraction - -} // namespace Dali - -#endif // DALI_PLATFORM_TEXT_ABSTRACTION_HYPHENATION_H diff --git a/dali/devel-api/text-abstraction/text-abstraction-definitions.h b/dali/devel-api/text-abstraction/text-abstraction-definitions.h index e100ef8..9159653 100644 --- a/dali/devel-api/text-abstraction/text-abstraction-definitions.h +++ b/dali/devel-api/text-abstraction/text-abstraction-definitions.h @@ -2,7 +2,7 @@ #define DALI_TEXT_ABSTRACTION_DEFINITIONS_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -43,12 +43,9 @@ typedef uint32_t ColorIndex; ///< An index into an array of colors. */ enum { - LINE_MUST_BREAK = 0u, ///< Text must be broken into a new line. - LINE_ALLOW_BREAK = 1u, ///< Is possible to break the text into a new line. - LINE_NO_BREAK = 2u, ///< Text can't be broken into a new line. - LINE_INSIDEACHAR = 3u, ///< A UTF-8/16 sequence is unfinished. - LINE_INDETERMINATE = 4u, ///< End of input on a non-EOL char. - LINE_HYPHENATION_BREAK = 5u ///< Text can be broken with adding hyphen. + LINE_MUST_BREAK = 0u, ///< Text must be broken into a new line. + LINE_ALLOW_BREAK = 1u, ///< Is possible to break the text into a new line. + LINE_NO_BREAK = 2u ///< Text can't be broken into a new line. }; /** diff --git a/dali/devel-api/text-abstraction/text-abstraction.h b/dali/devel-api/text-abstraction/text-abstraction.h index 9361f17..3a9309e 100755 --- a/dali/devel-api/text-abstraction/text-abstraction.h +++ b/dali/devel-api/text-abstraction/text-abstraction.h @@ -26,6 +26,5 @@ #include #include #include -#include #endif // DALI_TEXT_ABSTRACTION_H diff --git a/dali/internal/text/file.list b/dali/internal/text/file.list index 1a420de..8530a7b 100644 --- a/dali/internal/text/file.list +++ b/dali/internal/text/file.list @@ -1,14 +1,13 @@ # module: text, backend: common -SET( adaptor_text_common_src_files - ${adaptor_text_dir}/text-abstraction/bidirectional-support-impl.cpp - ${adaptor_text_dir}/text-abstraction/cairo-renderer.cpp - ${adaptor_text_dir}/text-abstraction/font-client-helper.cpp - ${adaptor_text_dir}/text-abstraction/font-client-impl.cpp - ${adaptor_text_dir}/text-abstraction/font-client-plugin-impl.cpp - ${adaptor_text_dir}/text-abstraction/segmentation-impl.cpp - ${adaptor_text_dir}/text-abstraction/shaping-impl.cpp +SET( adaptor_text_common_src_files + ${adaptor_text_dir}/text-abstraction/bidirectional-support-impl.cpp + ${adaptor_text_dir}/text-abstraction/cairo-renderer.cpp + ${adaptor_text_dir}/text-abstraction/font-client-helper.cpp + ${adaptor_text_dir}/text-abstraction/font-client-impl.cpp + ${adaptor_text_dir}/text-abstraction/font-client-plugin-impl.cpp + ${adaptor_text_dir}/text-abstraction/segmentation-impl.cpp + ${adaptor_text_dir}/text-abstraction/shaping-impl.cpp ${adaptor_text_dir}/text-abstraction/text-renderer-impl.cpp - ${adaptor_text_dir}/text-abstraction/hyphenation-impl.cpp ) diff --git a/dali/internal/text/text-abstraction/hyphenation-impl.cpp b/dali/internal/text/text-abstraction/hyphenation-impl.cpp deleted file mode 100644 index eef2fe9..0000000 --- a/dali/internal/text/text-abstraction/hyphenation-impl.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2021 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// CLASS HEADER -#include - -// INTERNAL INCLUDES -#include - -#include - -// EXTERNAL INCLUDES -#ifdef HYPHEN_LIBRARY_AVAILABLE -#include -#else -#define HyphenDict void -#endif - -#ifndef HYPHEN_DIC -#define HYPHEN_DIC "abc" -#endif - -namespace -{ -#if defined(DEBUG_ENABLED) -Dali::Integration::Log::Filter* gLogFilter = Dali::Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_HYPHENATION"); -#endif - -} // namespace - -namespace Dali -{ -namespace TextAbstraction -{ -namespace Internal -{ -const char* const DEFAULT_LANGUAGE = "en_US"; -const unsigned int DEFAULT_LANGUAGE_LENGTH = 5u; - -struct Hyphenation::HyphenDictionary -{ - HyphenDictionary(std::string lang, HyphenDict* dict) - { - mLanguage = lang; - mDictionary = dict; - } - - ~HyphenDictionary() - { - } - - std::string mLanguage; - HyphenDict* mDictionary; -}; - -struct Hyphenation::Plugin -{ - Plugin() - : mHyphenDictionary() - { - } - - ~Plugin() - { -#ifdef HYPHEN_LIBRARY_AVAILABLE - for(auto&& it : mHyphenDictionary) - { - hnj_hyphen_free(it.mDictionary); - } -#endif - } - - std::string GetPathForLanguage(const char* lang) - { - std::string path = HYPHEN_DIC; - std::string filName = "/hyph_"; - filName.append(lang); - filName.append(".dic"); - path.append(filName); - - return path; // must be ..../hyph_en_US.dic - } - - HyphenDict* LoadDictionary(const char* language) - { -#ifdef HYPHEN_LIBRARY_AVAILABLE - const char* lang = (language ? language : DEFAULT_LANGUAGE); - - for(auto&& it : mHyphenDictionary) - { - if(!it.mLanguage.compare(lang)) - { - return it.mDictionary; - } - } - - std::string path = GetPathForLanguage(lang); - HyphenDict* dict = hnj_hyphen_load(path.c_str()); - if(!dict) - { - DALI_LOG_ERROR("Couldn't load hyphen dictionary:%s\n", lang); - } - else - { - mHyphenDictionary.push_back(HyphenDictionary(lang, dict)); - } - - return dict; -#else - return nullptr; -#endif - } - - const char* GetDictionaryEncoding(const char* lang) - { -#ifdef HYPHEN_LIBRARY_AVAILABLE - HyphenDict* dict = LoadDictionary(lang); - if(!dict) - { - return nullptr; - } - - return dict->cset; -#else - return "UTF_32"; -#endif - } - - Vector GetWordHyphens(const char* word, - Length wordLength, - const char* lang) - { - Vector hyphensList; - -#ifdef HYPHEN_LIBRARY_AVAILABLE - char* hyphens = nullptr; - char** rep = nullptr; - int* pos = nullptr; - int* cut = nullptr; - HyphenDict* dict; - - if((!word) || (wordLength < 1)) - { - return hyphensList; - } - - dict = LoadDictionary(lang); - if(!dict) - { - return hyphensList; - } - - hyphens = (char*)malloc(wordLength + 5); - - hnj_hyphen_hyphenate2(dict, (char*)(word), wordLength, hyphens, NULL, &rep, &pos, &cut); - - hyphensList.PushBack(false); - - for(Length i = 0; i < wordLength - 1; i++) - { - hyphensList.PushBack((bool)(hyphens[i + 1] & 1)); - } - - free(hyphens); -#endif - - return hyphensList; - } - - std::vector mHyphenDictionary; -}; - -Hyphenation::Hyphenation() -: mPlugin(nullptr) -{ -} - -Hyphenation::~Hyphenation() -{ -} - -TextAbstraction::Hyphenation Hyphenation::Get() -{ - TextAbstraction::Hyphenation hyphenationHandle; - - SingletonService service(SingletonService::Get()); - if(service) - { - // Check whether the singleton is already created - Dali::BaseHandle handle = service.GetSingleton(typeid(TextAbstraction::Hyphenation)); - if(handle) - { - // If so, downcast the handle - Hyphenation* impl = dynamic_cast(handle.GetObjectPtr()); - hyphenationHandle = TextAbstraction::Hyphenation(impl); - } - else // create and register the object - { - hyphenationHandle = TextAbstraction::Hyphenation(new Hyphenation); - service.Register(typeid(hyphenationHandle), hyphenationHandle); - } - } - - return hyphenationHandle; -} - -const char* Hyphenation::GetDictionaryEncoding(const char* lang) -{ - CreatePlugin(); - - return mPlugin->GetDictionaryEncoding(lang); -} - -Vector Hyphenation::GetWordHyphens(const char* word, - Length wordLength, - const char* lang) -{ - CreatePlugin(); - - return mPlugin->GetWordHyphens(word, wordLength, lang); -} - -void Hyphenation::CreatePlugin() -{ - if(!mPlugin) - { - mPlugin = std::make_unique(); - } -} - -} // namespace Internal - -} // namespace TextAbstraction - -} // namespace Dali diff --git a/dali/internal/text/text-abstraction/hyphenation-impl.h b/dali/internal/text/text-abstraction/hyphenation-impl.h deleted file mode 100644 index 53bc059..0000000 --- a/dali/internal/text/text-abstraction/hyphenation-impl.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef DALI_INTERNAL_TEXT_ABSTRACTION_HYPHENATION_IMPL_H -#define DALI_INTERNAL_TEXT_ABSTRACTION_HYPHENATION_IMPL_H - -/* - * Copyright (c) 2021 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// EXTERNAL INCLUDES -#include - -// INTERNAL INCLUDES -#include -#include - -namespace Dali -{ -namespace TextAbstraction -{ -namespace Internal -{ -/** - * Implementation of the Hyphenation - */ -class Hyphenation : public BaseObject -{ -public: - /** - * Constructor - */ - Hyphenation(); - - /** - * Destructor - */ - ~Hyphenation(); - - /** - * @copydoc Dali::Hyphenation::Get() - */ - static TextAbstraction::Hyphenation Get(); - - /** - * @copydoc Dali::Hyphenation::GetDictionaryEncoding() - */ - const char* GetDictionaryEncoding(const char* lang); - - /** - * @copydoc Dali::Hyphenation::GetWordHyphens() - */ - Vector GetWordHyphens(const char* word, - Length wordLength, - const char* lang); - -private: - /** - * Helper for lazy initialization. - */ - void CreatePlugin(); - -private: - // Undefined copy constructor. - Hyphenation(const Hyphenation&); - - // Undefined assignment constructor. - Hyphenation& operator=(const Hyphenation&); - - struct HyphenDictionary; - struct Plugin; - std::unique_ptr mPlugin; - -}; // class Hyphenation - -} // namespace Internal - -} // namespace TextAbstraction - -inline static TextAbstraction::Internal::Hyphenation& GetImplementation(TextAbstraction::Hyphenation& hyphenation) -{ - DALI_ASSERT_ALWAYS(hyphenation && "hyphenation handle is empty"); - BaseObject& handle = hyphenation.GetBaseObject(); - return static_cast(handle); -} - -inline static const TextAbstraction::Internal::Hyphenation& GetImplementation(const TextAbstraction::Hyphenation& hyphenation) -{ - DALI_ASSERT_ALWAYS(hyphenation && "hyphenation handle is empty"); - const BaseObject& handle = hyphenation.GetBaseObject(); - return static_cast(handle); -} - -} // namespace Dali - -#endif // DALI_INTERNAL_TEXT_ABSTRACTION_HYPHENATION_IMPL_H diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 0b6598e..9696250 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -61,7 +61,6 @@ BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(egl) BuildRequires: libcurl-devel BuildRequires: pkgconfig(harfbuzz) -BuildRequires: hyphen-devel BuildRequires: fribidi-devel BuildRequires: pkgconfig(capi-system-info) -- 2.7.4