From 6bad184c025b0ccf92adc7b8eafe5c8731fdaed5 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 25 Jan 2017 17:00:05 +0900 Subject: [PATCH] Hide unnecessary class symbol Change-Id: I8c660d269d8f271f9555f8e06e1eeacfa3b14430 Signed-off-by: Jihoon Kim --- scl/include/sclconfig.h | 2 ++ scl/include/sclutils.h | 71 +++++++---------------------------------------- scl/sclutils.cpp | 73 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 61 deletions(-) diff --git a/scl/include/sclconfig.h b/scl/include/sclconfig.h index 0cdbb27..c854027 100644 --- a/scl/include/sclconfig.h +++ b/scl/include/sclconfig.h @@ -18,7 +18,9 @@ #ifndef __SCL_CONFIG_H__ #define __SCL_CONFIG_H__ +#ifndef EXAPI #define EXAPI __attribute__ ((visibility("default"))) +#endif namespace scl { diff --git a/scl/include/sclutils.h b/scl/include/sclutils.h index ded3c66..489dd07 100644 --- a/scl/include/sclutils.h +++ b/scl/include/sclutils.h @@ -62,7 +62,7 @@ public : virtual sclint log(const sclchar *msg) = 0; }; -class EXAPI CSCLUtilsImplLinux : public CSCLUtilsImpl +class CSCLUtilsImplLinux : public CSCLUtilsImpl { public : void init(); @@ -99,67 +99,16 @@ public : class _CSCLUtils { public : - _CSCLUtils() { - m_impl = 0; - } - - virtual void init() { - CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); - if (impl) { - impl->init(); - } - } - virtual void fini() { - CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); - if (impl) { - impl->fini(); - } - } - - virtual sclboolean get_screen_resolution(sclint *x, sclint *y) { - sclboolean ret = FALSE; - CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); - if (impl) { - ret = impl->get_screen_resolution(x, y); - } - return ret; - } - virtual sclboolean play_tts(const sclchar *str) { - sclboolean ret = FALSE; - CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); - if (impl) { - ret = impl->play_tts(str); - } - return ret; - } - virtual sclboolean play_sound(const sclchar* snd_style) { - sclboolean ret = FALSE; - CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); - if (impl) { - ret = impl->play_sound(snd_style); - } - return ret; - } - virtual sclboolean play_vibration(const sclchar* vibe_style, const scllong duration) { - sclboolean ret = FALSE; - CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); - if (impl) { - ret = impl->play_vibration(vibe_style, duration); - } - return ret; - } - + _CSCLUtils(); + + virtual void init(); + virtual void fini(); + virtual sclboolean get_screen_resolution(sclint *x, sclint *y); + virtual sclboolean play_tts(const sclchar *str); + virtual sclboolean play_sound(const sclchar* snd_style); + virtual sclboolean play_vibration(const sclchar* vibe_style, const scllong duration); protected : - CSCLUtilsImpl* GetCSCLUtilsImpl() { - if (m_impl == 0) { -#ifdef __WIN32__ - m_impl = new CSCLUtilsImplWin32; -#else - m_impl = new CSCLUtilsImplLinux; -#endif - } - return m_impl; - } + CSCLUtilsImpl* GetCSCLUtilsImpl(); private : CSCLUtilsImpl* m_impl; diff --git a/scl/sclutils.cpp b/scl/sclutils.cpp index 6c2a749..1d605a4 100644 --- a/scl/sclutils.cpp +++ b/scl/sclutils.cpp @@ -475,3 +475,76 @@ sclint CSCLUtils::log(const sclchar *fmt, ...) return ret; } + +_CSCLUtils::_CSCLUtils() +{ + m_impl = 0; +} + +void _CSCLUtils::init() +{ + CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); + if (impl) { + impl->init(); + } +} + +void _CSCLUtils::fini() +{ + CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); + if (impl) { + impl->fini(); + } +} + +sclboolean _CSCLUtils::get_screen_resolution(sclint *x, sclint *y) +{ + sclboolean ret = FALSE; + CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); + if (impl) { + ret = impl->get_screen_resolution(x, y); + } + return ret; +} + +sclboolean _CSCLUtils::play_tts(const sclchar *str) +{ + sclboolean ret = FALSE; + CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); + if (impl) { + ret = impl->play_tts(str); + } + return ret; +} + +sclboolean _CSCLUtils::play_sound(const sclchar* snd_style) +{ + sclboolean ret = FALSE; + CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); + if (impl) { + ret = impl->play_sound(snd_style); + } + return ret; +} + +sclboolean _CSCLUtils::play_vibration(const sclchar* vibe_style, const scllong duration) +{ + sclboolean ret = FALSE; + CSCLUtilsImpl *impl = GetCSCLUtilsImpl(); + if (impl) { + ret = impl->play_vibration(vibe_style, duration); + } + return ret; +} + +CSCLUtilsImpl* _CSCLUtils::GetCSCLUtilsImpl() +{ + if (m_impl == 0) { +#ifdef __WIN32__ + m_impl = new CSCLUtilsImplWin32; +#else + m_impl = new CSCLUtilsImplLinux; +#endif + } + return m_impl; +} -- 2.7.4