From 03467948f0d40e4e732b101ff1407d188b5dc0f4 Mon Sep 17 00:00:00 2001 From: Agnelo Vaz Date: Mon, 28 Sep 2015 17:23:35 +0100 Subject: [PATCH] Removing GetDefaultFontDescription for Platform Abstraction API * Font Client now provides this functionality, Parsing file showed errors Change-Id: Ibb16f4f6353d761bf85601dac7c7673c227de2e2 Signed-off-by: Agnelo Vaz --- .../packaging/core-dali-adaptor-tests.spec | 1 - .../core-dali-platform-abstraction-tests.spec | 1 - .../test-platform-abstraction.cpp | 8 -- .../test-platform-abstraction.h | 5 - build/tizen/adaptor/Makefile.am | 2 - build/tizen/configure.ac | 1 - packaging/dali-adaptor-mobile.spec | 1 - packaging/dali-adaptor.spec | 1 - platform-abstractions/tizen/file.list | 1 - .../tizen/tizen-font-configuration-parser.cpp | 137 --------------------- .../tizen/tizen-font-configuration-parser.h | 46 ------- .../tizen/tizen-platform-abstraction.cpp | 6 - .../tizen/tizen-platform-abstraction.h | 5 - 13 files changed, 215 deletions(-) delete mode 100644 platform-abstractions/tizen/tizen-font-configuration-parser.cpp delete mode 100644 platform-abstractions/tizen/tizen-font-configuration-parser.h diff --git a/automated-tests/packaging/core-dali-adaptor-tests.spec b/automated-tests/packaging/core-dali-adaptor-tests.spec index beddb14..200b2d2 100644 --- a/automated-tests/packaging/core-dali-adaptor-tests.spec +++ b/automated-tests/packaging/core-dali-adaptor-tests.spec @@ -12,7 +12,6 @@ Requires: dali BuildRequires: dali-integration-devel BuildRequires: pkgconfig(dali-core) BuildRequires: pkgconfig(dali) -BuildRequires: libxml2-devel BuildRequires: cmake BuildRequires: pkgconfig(ecore) diff --git a/automated-tests/packaging/core-dali-platform-abstraction-tests.spec b/automated-tests/packaging/core-dali-platform-abstraction-tests.spec index 26183a4..07c66b2 100644 --- a/automated-tests/packaging/core-dali-platform-abstraction-tests.spec +++ b/automated-tests/packaging/core-dali-platform-abstraction-tests.spec @@ -12,7 +12,6 @@ Requires: dali BuildRequires: dali-integration-devel BuildRequires: pkgconfig(dali-core) BuildRequires: pkgconfig(dali) -BuildRequires: libxml2-devel BuildRequires: cmake diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp index a0a3589..d9ea25e 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp @@ -150,14 +150,6 @@ bool TestPlatformAbstraction::IsLoading() } /** - * @copydoc PlatformAbstraction::GetDefaultFontDescription() - */ -void TestPlatformAbstraction::GetDefaultFontDescription( std::string& family, std::string& style ) const -{ - // TODO -} - -/** * @copydoc PlatformAbstraction::GetDefaultFontSize() */ int TestPlatformAbstraction::GetDefaultFontSize() const diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.h index ecdda67..bff5de9 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.h +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-platform-abstraction.h @@ -138,11 +138,6 @@ public: virtual bool IsLoading(); /** - * @copydoc PlatformAbstraction::GetDefaultFontDescription() - */ - virtual void GetDefaultFontDescription( std::string& family, std::string& style ) const; - - /** * @copydoc PlatformAbstraction::GetDefaultFontSize() */ virtual int GetDefaultFontSize() const; diff --git a/build/tizen/adaptor/Makefile.am b/build/tizen/adaptor/Makefile.am index 0862419..6cdfa75 100644 --- a/build/tizen/adaptor/Makefile.am +++ b/build/tizen/adaptor/Makefile.am @@ -269,7 +269,6 @@ libdali_adaptor_la_CXXFLAGS = \ $(ECORE_CFLAGS) \ $(ECORE_IPC_CFLAGS) \ $(DLOG_CFLAGS) \ - $(XML_CFLAGS) \ $(VCONF_CFLAGS) \ $(EXIF_CFLAGS) \ $(MMFSOUND_CFLAGS) \ @@ -292,7 +291,6 @@ libdali_adaptor_la_LIBADD = \ $(ELEMENTARY_LIBS) \ $(ECORE_IPC_LIBS) \ $(DLOG_LIBS) \ - $(XML_LIBS) \ $(VCONF_LIBS) \ $(EXIF_LIBS) \ $(TTS_LIBS) \ diff --git a/build/tizen/configure.ac b/build/tizen/configure.ac index dc31079..11d2d3d 100644 --- a/build/tizen/configure.ac +++ b/build/tizen/configure.ac @@ -44,7 +44,6 @@ PKG_CHECK_MODULES(FREETYPE, [freetype2 >= $FREETYPE_REQUIRED]) PKG_CHECK_MODULES(FREETYPE_BITMAP_SUPPORT, [freetype2 >= $FREETYPE_BITMAP_SUPPORT_VERSION], [ freetype_bitmap_support=yes ], [ freetype_bitmap_support=no ] ) PKG_CHECK_MODULES(FONTCONFIG, fontconfig) PKG_CHECK_MODULES(PNG, libpng) -PKG_CHECK_MODULES(XML, libxml-2.0) PKG_CHECK_MODULES(LIBEXIF, libexif) PKG_CHECK_MODULES(LIBDRM, libdrm) PKG_CHECK_MODULES(LIBCURL, libcurl) diff --git a/packaging/dali-adaptor-mobile.spec b/packaging/dali-adaptor-mobile.spec index aac7531..2cf53db 100644 --- a/packaging/dali-adaptor-mobile.spec +++ b/packaging/dali-adaptor-mobile.spec @@ -37,7 +37,6 @@ BuildRequires: pkgconfig(xdamage) BuildRequires: pkgconfig(utilX) BuildRequires: dali-devel BuildRequires: dali-integration-devel -BuildRequires: libxml2-devel BuildRequires: pkgconfig(vconf) BuildRequires: tts-devel BuildRequires: pkgconfig(dlog) diff --git a/packaging/dali-adaptor.spec b/packaging/dali-adaptor.spec index 01dcc32..cdd7f00 100644 --- a/packaging/dali-adaptor.spec +++ b/packaging/dali-adaptor.spec @@ -52,7 +52,6 @@ BuildRequires: libjpeg-turbo-devel BuildRequires: pkgconfig(evas) BuildRequires: dali-devel BuildRequires: dali-integration-devel -BuildRequires: libxml2-devel BuildRequires: vconf-devel BuildRequires: vconf-keys-devel BuildRequires: tts-devel diff --git a/platform-abstractions/tizen/file.list b/platform-abstractions/tizen/file.list index 98711fc..b9efdd8 100755 --- a/platform-abstractions/tizen/file.list +++ b/platform-abstractions/tizen/file.list @@ -3,7 +3,6 @@ tizen_platform_abstraction_src_files = \ $(tizen_platform_abstraction_src_dir)/tizen-platform-abstraction.cpp \ $(tizen_platform_abstraction_src_dir)/tizen-logging.cpp \ - $(tizen_platform_abstraction_src_dir)/tizen-font-configuration-parser.cpp \ \ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-loader.cpp \ $(tizen_platform_abstraction_src_dir)/resource-loader/resource-requester-base.cpp \ diff --git a/platform-abstractions/tizen/tizen-font-configuration-parser.cpp b/platform-abstractions/tizen/tizen-font-configuration-parser.cpp deleted file mode 100644 index a1dc8f7..0000000 --- a/platform-abstractions/tizen/tizen-font-configuration-parser.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2014 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. - * - */ - -#include "tizen-font-configuration-parser.h" - -#include -#include -#include - -#include - -namespace Dali -{ - -namespace TizenPlatform -{ - -namespace FontConfigurationParser -{ - -#if defined(DEBUG_ENABLED) -namespace -{ -Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_TIZEN_FONT_CONFIGURATION_PARSER"); -} -#endif - -void Parse(std::string confFile, std::string& fontFamily, std::string& fontStyle) -{ - bool familyParsed(false); - bool styleParsed(false); - - if ( !confFile.empty() ) - { - xmlDocPtr doc = xmlParseFile(confFile.c_str()); - if(doc == NULL) - { - DALI_LOG_ERROR("Document %s not parsed successfully.\n", confFile.c_str()); - return; - } - - xmlNodePtr cur = xmlDocGetRootElement(doc); - if(cur == NULL) - { - DALI_LOG_ERROR("%s is Empty\n", confFile.c_str()); - xmlFreeDoc(doc); - return; - } - - if(xmlStrcmp(cur->name, (const xmlChar *)"fontconfig")) - { - DALI_LOG_ERROR("Document %s is of the wrong type, root node != fontconfig\n", confFile.c_str()); - xmlFreeDoc(doc); - return; - } - - cur = cur->xmlChildrenNode; - - while(cur != NULL && !(familyParsed && styleParsed)) - { - if((!xmlStrcmp(cur->name, (const xmlChar *)"match"))) - { - xmlNodePtr cur2 = cur->xmlChildrenNode; - while(cur2 != NULL && !(familyParsed && styleParsed)) - { - if((!xmlStrcmp(cur2->name, (const xmlChar *)"edit"))) - { - xmlChar* xmlValue = xmlGetProp( cur2, (const xmlChar *)"name" ); - if((!xmlStrcmp(xmlValue, (const xmlChar *)"family"))) - { - xmlNodePtr cur3 = cur2->xmlChildrenNode; - while(cur3 != NULL && !(familyParsed && styleParsed)) - { - if((!xmlStrcmp(cur3->name, (const xmlChar *)"string"))) - { - xmlChar* key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1); - DALI_LOG_INFO(gLogFilter,Debug::Concise, "Document %s uses the following font family as default: %s\n", confFile.c_str(), key); - std::stringstream str; - str << key; - fontFamily = str.str(); - xmlFree(key); - familyParsed = true; - break; - } - cur3 = cur3->next; - } - } - else if((!xmlStrcmp(xmlValue, (const xmlChar *)"style"))) - { - xmlNodePtr cur3 = cur2->xmlChildrenNode; - while(cur3 != NULL && !(familyParsed && styleParsed)) - { - if((!xmlStrcmp(cur3->name, (const xmlChar *)"string"))) - { - xmlChar* key = xmlNodeListGetString(doc, cur3->xmlChildrenNode, 1); - DALI_LOG_INFO(gLogFilter,Debug::Concise, "Document %s uses the following font style as default: %s\n", confFile.c_str(), key); - std::stringstream str; - str << key; - fontStyle = str.str(); - xmlFree(key); - styleParsed = true; - break; - } - cur3 = cur3->next; - } - } - xmlFree( xmlValue ); - } - cur2 = cur2->next; - } - } - cur = cur->next; - } - - xmlFreeDoc(doc); - } -} - -} // namespace FontConfParser - -} // namespace TizenPlatform - -} // namespace Dali diff --git a/platform-abstractions/tizen/tizen-font-configuration-parser.h b/platform-abstractions/tizen/tizen-font-configuration-parser.h deleted file mode 100644 index 2450e71..0000000 --- a/platform-abstractions/tizen/tizen-font-configuration-parser.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef __DALI_TIZEN_PLATFORM_FONT_CONFIGURATION_PARSER_H__ -#define __DALI_TIZEN_PLATFORM_FONT_CONFIGURATION_PARSER_H__ - -/* - * Copyright (c) 2014 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. - * - */ - -#include - -namespace Dali -{ - -namespace TizenPlatform -{ - -namespace FontConfigurationParser -{ - -/** - * Parses the given font configuration file and sets fontFamily accordingly. - * @param[in] confFile The configuration file to parse. - * @param[out] fontFamily This gets set with the default font family specified in the conf file. - * @param[out] fontStyle This gets set with the default font style specified in the conf file. - */ -void Parse(std::string confFile, std::string& fontFamily, std::string& fontStyle); - -} // namespace FontConfParser - -} // namespace TizenPlatform - -} // namespace Dali - -#endif // __DALI_TIZEN_PLATFORM_FONT_CONFIGURATION_PARSER_H__ diff --git a/platform-abstractions/tizen/tizen-platform-abstraction.cpp b/platform-abstractions/tizen/tizen-platform-abstraction.cpp index 0cca389..26debc0 100644 --- a/platform-abstractions/tizen/tizen-platform-abstraction.cpp +++ b/platform-abstractions/tizen/tizen-platform-abstraction.cpp @@ -28,7 +28,6 @@ // INTERNAL INCLUDES #include "resource-loader/resource-loader.h" -#include "tizen-font-configuration-parser.h" #include "image-loaders/image-loader.h" #include "portable/file-closer.h" @@ -84,11 +83,6 @@ void TizenPlatformAbstraction::Resume() } } -void TizenPlatformAbstraction::GetDefaultFontDescription( std::string& fontFamily, std::string& fontStyle ) const -{ - FontConfigurationParser::Parse(FONT_CONFIGURATION_FILE, fontFamily, fontStyle); -} - int TizenPlatformAbstraction::GetDefaultFontSize() const { int fontSize( -1 ); diff --git a/platform-abstractions/tizen/tizen-platform-abstraction.h b/platform-abstractions/tizen/tizen-platform-abstraction.h index 0705623..99c54a9 100644 --- a/platform-abstractions/tizen/tizen-platform-abstraction.h +++ b/platform-abstractions/tizen/tizen-platform-abstraction.h @@ -121,11 +121,6 @@ public: // PlatformAbstraction overrides virtual void JoinLoaderThreads(); /** - * @copydoc PlatformAbstraction::GetDefaultFontDescription() - */ - virtual void GetDefaultFontDescription( std::string& family, std::string& style ) const; - - /** * @copydoc PlatformAbstraction::GetDefaultFontSize() */ virtual int GetDefaultFontSize() const; -- 2.7.4