libxml-2.0
utilX
tts
+ vconf
)
FOREACH(flag ${pkgs_CFLAGS})
using namespace std;
#include "put_record.h"
-BinAutoPopupConfigParser* BinAutoPopupConfigParser::m_instance = NULL;
-
BinAutoPopupConfigParser::BinAutoPopupConfigParser() {
memset((void*)&m_autopopup_configure, 0x00, sizeof(SclAutoPopupConfigure));
}
}
BinAutoPopupConfigParser* BinAutoPopupConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinAutoPopupConfigParser();
- }
- return m_instance;
+ static BinAutoPopupConfigParser instance;
+
+ return &instance;
}
void
using namespace binary_xmlresource;
-BinResource* BinResource::m_instance = NULL;
-
BinResource::BinResource() {
m_input_mode_configure_parser = NULL;
m_layout_parser = NULL;
}
BinResource::~BinResource() {
- if (m_input_mode_configure_parser)
- delete m_input_mode_configure_parser;
m_input_mode_configure_parser = NULL;
- if (m_layout_parser)
- delete m_layout_parser;
m_layout_parser = NULL;
- if (m_key_coordinate_frame_parser)
- delete m_key_coordinate_frame_parser;
m_key_coordinate_frame_parser = NULL;
- if (m_modifier_decoration_parser)
- delete m_modifier_decoration_parser;
m_modifier_decoration_parser = NULL;
-
- if (m_label_properties_parser)
- delete m_label_properties_parser;
m_label_properties_parser = NULL;
-
- if (m_default_configure_parser)
- delete m_default_configure_parser;
m_default_configure_parser = NULL;
-
- if (m_autopopup_configure_parser)
- delete m_autopopup_configure_parser;
m_autopopup_configure_parser = NULL;
- if (m_magnifier_configure_parser)
- delete m_magnifier_configure_parser;
m_magnifier_configure_parser = NULL;
-
- if (m_nine_patch_file_list_parser)
- delete m_nine_patch_file_list_parser;
m_nine_patch_file_list_parser = NULL;
}
BinResource* BinResource::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinResource();
- }
- return m_instance;
+ static BinResource instance;
+ return &instance;
}
void BinResource::init(const char *entry_filepath) {
using namespace std;
#include "put_record.h"
-BinDefaultConfigParser* BinDefaultConfigParser::m_instance = NULL;
-
BinDefaultConfigParser::BinDefaultConfigParser() {
memset((void*)&m_default_configure, 0x00, sizeof(SclDefaultConfigure));
}
}
BinDefaultConfigParser* BinDefaultConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinDefaultConfigParser();
- }
- return m_instance;
+ static BinDefaultConfigParser instance;
+ return &instance;
}
void BinDefaultConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
void parsing_autopopup_configure();
void decode_color(SclColor&, int width);
private:
- static BinAutoPopupConfigParser *m_instance;
SclAutoPopupConfigure m_autopopup_configure;
StringCollector m_string_collector;
FileStorage m_storage;
IParserInfo_Provider* parser_info_provider;
-private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinAutoPopupConfigParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
BinResource();
private:
- static BinResource* m_instance;
-
BinInputModeConfigParser *m_input_mode_configure_parser;
BinLayoutParser *m_layout_parser;
BinKeyCoordFrameParser *m_key_coordinate_frame_parser;
BinAutoPopupConfigParser *m_autopopup_configure_parser;
BinMagnifierConfigParser *m_magnifier_configure_parser;
BinNinePatchFileParser *m_nine_patch_file_list_parser;
-
- private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinResource::m_instance != NULL)
- {
- delete m_instance;
- m_instance = NULL;
- }
- }
- };
- static DestructHelper des;
};
}
void parsing_default_configure();
void decode_color(SclColor&, int width);
private:
- static BinDefaultConfigParser *m_instance;
SclDefaultConfigure m_default_configure;
StringCollector m_string_collector;
IParserInfo_Provider* parser_info_provider;
FileStorage m_storage;
-private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinDefaultConfigParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
StringCollector m_string_collector;
private:
- static BinInputModeConfigParser *m_instance;
int m_inputmode_size;
SclInputModeConfigure m_input_mode_configure_table[MAX_SCL_INPUT_MODE];
-
FileStorage m_storage;
IParserInfo_Provider* parser_info_provider;
};
void decode_key_coordinate_record(FileStorage& storage, const PSclLayoutKeyCoordinate cur, const Key_coordinate_record_width&);
private:
- static BinKeyCoordFrameParser *m_instance;
SclLayoutKeyCoordinate* m_key_coordinate_pointer_frame[MAX_SCL_LAYOUT][MAX_KEY];
IParserInfo_Provider *parser_info_provider;
StringCollector m_string_collector;
FileStorage m_storage;
- private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinKeyCoordFrameParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
void decode_color(SclColor& color, int width);
private:
- static BinLabelPropertyParser *m_instance;
SclLabelProperties m_label_properties_frame[MAX_SCL_LABEL_PROPERTIES][MAX_SIZE_OF_LABEL_FOR_ONE];
int m_size;
IParserInfo_Provider *parser_info_provider;
FileStorage m_storage;
StringCollector m_string_collector;
- private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinLabelPropertyParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
void decode_color(SclColor&, int width);
private:
- static BinLayoutParser *m_instance;
int m_layout_size;
SclLayout m_layout_table[MAX_SCL_LAYOUT];
FileStorage m_storage;
IParserInfo_Provider *parser_info_provider;
StringCollector m_string_collector;
- private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinLayoutParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
void parsing_magnifier_configure();
private:
- static BinMagnifierConfigParser *m_instance;
SclMagnifierWndConfigure m_magnifier_configure;
StringCollector m_string_collector;
FileStorage m_storage;
IParserInfo_Provider* parser_info_provider;
-
-private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinMagnifierConfigParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
void parsing_modifier_decoration_table();
private:
- static BinModifierDecorationParser *m_instance;
SclModifierDecoration m_modifier_decoration_table[MAX_SCL_MODIFIER_DECORATION_NUM];
IParserInfo_Provider *parser_info_provider;
StringCollector m_string_collector;
FileStorage m_storage;
- private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinModifierDecorationParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
BinNinePatchFileParser();
void parsing_nine_patch_file_list();
private:
- static BinNinePatchFileParser *m_instance;
SclNinePatchInfo m_nine_patch_file_list[MAX_NINE_PATCH_FILE_LIST];
int m_size;
StringCollector m_string_collector;
FileStorage m_storage;
IParserInfo_Provider* parser_info_provider;
- private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (BinNinePatchFileParser::m_instance != NULL)
- delete m_instance;
- }
- };
- static DestructHelper des;
};
#include "simple_debug.h"
#include "put_record.h"
using namespace std;
-BinInputModeConfigParser* BinInputModeConfigParser::m_instance = NULL;
BinInputModeConfigParser::BinInputModeConfigParser() {
m_inputmode_size = 0;
BinInputModeConfigParser*
BinInputModeConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinInputModeConfigParser();
- }
- return m_instance;
+ static BinInputModeConfigParser instance;
+ return &instance;
}
void
using namespace std;
using namespace scl;
-BinKeyCoordFrameParser* BinKeyCoordFrameParser::m_instance = NULL;
BinKeyCoordFrameParser::BinKeyCoordFrameParser() {
memset(m_key_coordinate_pointer_frame, 0x00, sizeof(SclLayoutKeyCoordinatePointer) * MAX_SCL_LAYOUT * MAX_KEY);
}
}
BinKeyCoordFrameParser* BinKeyCoordFrameParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinKeyCoordFrameParser();
- }
- return m_instance;
+ static BinKeyCoordFrameParser instance;
+ return &instance;
}
void
#include "label_properties_bin_parser.h"
#include "simple_debug.h"
#include "put_record.h"
-BinLabelPropertyParser* BinLabelPropertyParser::m_instance = NULL;
BinLabelPropertyParser::BinLabelPropertyParser() {
m_size = 0;
}
BinLabelPropertyParser* BinLabelPropertyParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinLabelPropertyParser();
- }
- return m_instance;
+ static BinLabelPropertyParser instance;
+ return &instance;
}
void BinLabelPropertyParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
m_storage.set_str_provider(parser_info_provider);
using namespace std;
using namespace scl;
-BinLayoutParser* BinLayoutParser::m_instance = NULL;
-
BinLayoutParser::
BinLayoutParser() {
m_layout_size = 0;
}
BinLayoutParser* BinLayoutParser::
get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinLayoutParser();
- }
- return m_instance;
+ static BinLayoutParser instance;
+ return &instance;
}
void BinLayoutParser::
init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
#include <assert.h>
using namespace std;
#include "put_record.h"
-BinMagnifierConfigParser* BinMagnifierConfigParser::m_instance = NULL;
BinMagnifierConfigParser::BinMagnifierConfigParser() {
memset((void*)&m_magnifier_configure, 0x00, sizeof(SclMagnifierWndConfigure));
}
BinMagnifierConfigParser* BinMagnifierConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinMagnifierConfigParser();
- }
- return m_instance;
+ static BinMagnifierConfigParser instance;
+ return &instance;
}
void BinMagnifierConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
#include <memory.h>
#include "put_record.h"
-BinModifierDecorationParser* BinModifierDecorationParser::m_instance = NULL;
-
BinModifierDecorationParser::BinModifierDecorationParser() {
memset(m_modifier_decoration_table, 0x00, sizeof(SclModifierDecoration) * MAX_SCL_MODIFIER_DECORATION_NUM);
}
BinModifierDecorationParser*
BinModifierDecorationParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinModifierDecorationParser();
- }
- return m_instance;
+ static BinModifierDecorationParser instance;
+ return &instance;
}
void
BinModifierDecorationParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
#include <memory.h>
#include <assert.h>
#include "put_record.h"
-BinNinePatchFileParser* BinNinePatchFileParser::m_instance = NULL;
BinNinePatchFileParser::BinNinePatchFileParser() {
m_size = 0;
m_size = 0;
}
BinNinePatchFileParser* BinNinePatchFileParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new BinNinePatchFileParser();
- }
- return m_instance;
+ static BinNinePatchFileParser instance;
+ return &instance;
}
void BinNinePatchFileParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
m_storage.set_str_provider(parser_info_provider);
#include <stdarg.h>
#include <stdio.h>
-SclLog* SclLog::m_instance = NULL;
-
SclLog::SclLog() : m_flog(NULL) {
char *env = NULL;
char *scllog = NULL;
SclLog*
SclLog::get_instance() {
- if(m_instance == NULL) {
- m_instance = new SclLog();
- }
-
- return m_instance;
+ static SclLog instance;
+ return &instance;
}
void
~SclLog();
private:
SclLog();
- static SclLog* m_instance;
FILE *m_flog;
};
CSCLEventsImplEfl::CSCLEventsImplEfl()
{
SCL_DEBUG();
- /* Initializes all window resources */
- m_mouse_down_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, mouse_press, NULL);
- m_mouse_move_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, mouse_move, NULL);
- m_mouse_up_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, mouse_release, NULL);
- m_xclient_msg_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, client_message_cb, NULL);
+ m_mouse_down_handler = NULL;
+ m_mouse_move_handler = NULL;
+ m_mouse_up_handler = NULL;
+
+ m_xclient_msg_handler = NULL;
}
/**
{
SCL_DEBUG();
+ fini();
+}
+
+void CSCLEventsImplEfl::init()
+{
+ /* Initializes all window resources */
+ m_mouse_down_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, mouse_press, NULL);
+ m_mouse_move_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, mouse_move, NULL);
+ m_mouse_up_handler = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, mouse_release, NULL);
+
+ m_xclient_msg_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, client_message_cb, NULL);
+}
+
+void CSCLEventsImplEfl::fini()
+{
if (m_mouse_down_handler) ecore_event_handler_del(m_mouse_down_handler);
+ m_mouse_down_handler = NULL;
if (m_mouse_move_handler) ecore_event_handler_del(m_mouse_move_handler);
+ m_mouse_move_handler = NULL;
if (m_mouse_up_handler) ecore_event_handler_del(m_mouse_up_handler);
+ m_mouse_up_handler = NULL;
if (m_xclient_msg_handler) ecore_event_handler_del(m_xclient_msg_handler);
+ m_xclient_msg_handler = NULL;
}
sclboolean get_window_rect(const sclwindow window, SclRectangle *rect)
CSCLEventsImplEfl();
~CSCLEventsImplEfl();
+ void init();
+ void fini();
+
/* Implementation about interface functions */
void connect_window_events(const sclwindow wnd, const sclint evt);
void create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean addToMap);
SCL_DEBUG();
}
+void CSCLGraphicsImplEfl::init()
+{
+
+}
+
+void CSCLGraphicsImplEfl::fini()
+{
+
+}
+
Evas_Object* extract_partimage_from_fullimage(
Evas_Object* fullimage,
int img_x,int img_y,
CSCLGraphicsImplEfl();
~CSCLGraphicsImplEfl();
+ void init();
+ void fini();
+
void draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path, SclImageCachedInfo *cachedinfo,
sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
sclint src_x, sclint src_y, sclint src_width, sclint src_height, sclboolean extrace_image);
SCL_DEBUG();
}
+void CSCLWindowsImplEfl::init()
+{
+
+}
+
+void CSCLWindowsImplEfl::fini()
+{
+
+}
/**
* Create a content window and binds it into given parent window as a child
CSCLWindowsImplEfl();
~CSCLWindowsImplEfl();
+ void init();
+ void fini();
+
sclwindow create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
sclwindow create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
sclwindow create_magnifier_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
class CSCLActionState
{
private:
- static CSCLActionState* m_instance; /* For singleton */
CSCLActionState();
public:
~CSCLActionState();
class CSCLContext
{
private:
- static CSCLContext* m_instance; /* For singleton */
CSCLContext();
public:
~CSCLContext();
class CSCLController
{
private:
- static CSCLController* m_instance; /* For singleton */
CSCLController();
public:
~CSCLController();
*/
class CSCLErrorAdjustment
{
-private:
- static CSCLErrorAdjustment* m_instance; /* For singleton */
-
public:
CSCLErrorAdjustment();
CSCLErrorAdjustment(sclwindow parent);
class CSCLEventHandler : public ISCLUIEventCallback
{
private:
- static CSCLEventHandler* m_instance; /* For singleton */
CSCLEventHandler();
public:
~CSCLEventHandler();
class CSCLEventsImpl
{
public :
+ virtual void init() = 0;
+ virtual void fini() = 0;
+
virtual void connect_window_events(const sclwindow wnd, const sclint evt) = 0;
virtual void create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean addToMap) = 0;
virtual void destroy_timer(const scl32 id) = 0;
CSCLEvents();
~CSCLEvents();
- static CSCLEvents* m_instance; /* For singleton */
static CSCLEvents* get_instance();
+ void init();
+ void fini();
+
void connect_window_events(sclwindow wnd, const sclint evt);
void create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean addToMap = TRUE) {
*/
class CSCLFeedback
{
-private:
- static CSCLFeedback* m_instance; /* For singleton */
-
public:
CSCLFeedback();
CSCLFeedback(sclwindow parent);
class CSCLFontProxy
{
private:
- static CSCLFontProxy* m_instance; /* For singleton */
CSCLFontProxy();
public :
~CSCLFontProxy();
*/
class CSCLGraphicsImpl
{
+ virtual void init() = 0;
+ virtual void fini() = 0;
+
friend class CSCLGraphics;
private:
virtual void draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path,
friend class CSCLFontProxy;
private:
- static CSCLGraphics* m_instance; /* For singleton */
CSCLGraphics();
public :
~CSCLGraphics();
static CSCLGraphics* get_instance();
+ void init();
+ void fini();
+
void draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path, SclImageCachedInfo *cachedinfo, sclint dest_x, sclint dest_y,
sclint dest_width = -1, sclint dest_height = -1, sclint src_x = 0, sclint src_y = 0, sclint src_width = -1, sclint src_height = -1, sclboolean extrace_image = FALSE) {
get_scl_graphics_impl()->draw_image(window, draw_ctx, image_path, cachedinfo, dest_x, dest_y, dest_width, dest_height, src_x, src_y, src_width, src_height, extrace_image);
class CSCLGwes
{
private:
- static CSCLGwes* m_instance; /* For singleton */
CSCLGwes();
public :
~CSCLGwes();
public:
void init(sclwindow parent, scl16 width, scl16 height);
+ void fini();
CSCLGraphics *m_graphics;
CSCLWindows *m_windows;
class CSCLImageProxy
{
private:
- static CSCLImageProxy* m_instance; /* For singleton */
CSCLImageProxy();
public :
~CSCLImageProxy();
class CSCLResourceCache
{
private:
- static CSCLResourceCache* m_instance; /* For singleton */
CSCLResourceCache();
public:
~CSCLUI();
/*
- * @brief This API initializes SCL library and creates new SCL context
+ * @brief This API initializes SCL library
* @param[in] main_window a pointer to main window object
* @param[in] parser_type decides which parser should be selected for parsing SCL UI resource file
* @param[in] entry_filepath a file path to SCL's UI resource entry file
*/
sclboolean init(sclwindow main_window, SCLParserType parser_type, const sclchar *entry_filepath);
+ /*
+ * @brief This API deinitializes SCL library
+ */
+ void fini();
+
/**
* @brief This API requests SCL library to show the S/W keyboard on the screen
* @param[in] auto_relocate Indicates whether the SCL library should relocate the keyboard window automatically
friend class CSCLFontProxy;
private:
- static CSCLUIBuilder* m_instance; /* For singleton */
CSCLUIBuilder();
public:
~CSCLUIBuilder();
class CSCLUIImpl
{
private:
- static CSCLUIImpl* m_instance; /* For singleton */
CSCLUIImpl();
public:
static CSCLUIImpl* get_instance();
sclboolean init(sclwindow parent, SCLParserType parser_type, const char *entry_filepath);
+ void fini();
void show();
void hide();
class CSCLUtilsImpl
{
public :
+ virtual void init() = 0;
+ virtual void fini() = 0;
+
virtual sclboolean get_screen_resolution(sclint *x, sclint *y) = 0;
virtual sclboolean play_tts(const sclchar *str) = 0;
virtual sclboolean play_sound(const sclchar* snd_style) = 0;
class CSCLUtilsImplLinux : public CSCLUtilsImpl
{
public :
+ void init();
+ void fini();
+
sclboolean get_screen_resolution(sclint *x, sclint *y);
sclboolean play_tts(const sclchar *str);
sclboolean play_sound(const sclchar* snd_style);
class CSCLUtilsImplWin32 : public CSCLUtilsImpl
{
public :
+ void init();
+ void fini();
+
sclboolean get_screen_resolution(sclint *x, sclint *y);
sclboolean play_tts(const sclchar *str);
sclboolean play_sound(const sclchar* snd_style);
_CSCLUtils() {
m_impl = 0;
}
- virtual sclboolean get_screen_resolution(sclint *x, sclint *y) = 0;
- virtual sclboolean play_tts(const sclchar *str) = 0;
- virtual sclboolean play_sound(const sclchar* snd_style) = 0;
- virtual sclboolean play_vibration(const sclchar* vibe_style, const scllong duration) = 0;
- virtual sclboolean open_devices() = 0;
- virtual sclboolean close_devices() = 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;
+ }
protected :
CSCLUtilsImpl* GetCSCLUtilsImpl() {
class CSCLUtils : public _CSCLUtils
{
private:
- static CSCLUtils* m_instance; /* For singleton */
CSCLUtils();
public :
~CSCLUtils();
static CSCLUtils* get_instance();
void init();
+ void fini();
void scale_x(scl16 *x);
void scale_y(scl16 *y);
sclchar* get_str_dup(const sclchar* str);
- sclboolean get_screen_resolution(sclint *x, sclint *y) {
- return GetCSCLUtilsImpl()->get_screen_resolution(x, y);
- }
-
- sclboolean play_tts(const sclchar* str) {
- return GetCSCLUtilsImpl()->play_tts(str);
- }
-
- sclboolean play_sound(const sclchar* snd_style) {
- return GetCSCLUtilsImpl()->play_sound(snd_style);
- }
-
- sclboolean play_vibration(const sclchar* vibe_style, const scllong duration) {
- return GetCSCLUtilsImpl()->play_vibration(vibe_style, duration);
- }
-
- sclboolean open_devices() {
- return GetCSCLUtilsImpl()->open_devices();
- }
- sclboolean close_devices() {
- return GetCSCLUtilsImpl()->close_devices();
- }
-
sclboolean sleep(sclulong msc);
sclchar* get_composed_path(sclchar* buf, const sclchar* prefix, const sclchar* path);
class CSCLWindowsImpl
{
public :
+ virtual void init() = 0;
+ virtual void fini() = 0;
+
virtual sclwindow create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
virtual sclwindow create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
virtual sclwindow create_magnifier_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
class CSCLWindows
{
private:
- static CSCLWindows* m_instance; /* For singleton */
CSCLWindows();
public :
~CSCLWindows();
static CSCLWindows* get_instance();
+ void init();
+ void fini();
+
sclwindow open_popup(const SclWindowOpener opener, const SclRectangle& geometry, sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual, sclboolean use_dim_window, sclint img_offset_x = 0, sclint img_offset_y = 0, sclint timeout = 0);
bool close_popup(sclwindow window);
bool close_all_popups(sclwindow skip_window = SCLWINDOW_INVALID);
using namespace scl;
-CSCLActionState* CSCLActionState::m_instance = NULL; /* For singleton */
-
CSCLActionState::CSCLActionState()
{
SCL_DEBUG();
CSCLActionState*
CSCLActionState::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLActionState();
- }
- return (CSCLActionState*)m_instance;
+ static CSCLActionState instance;
+ return &instance;
}
using namespace scl;
-CSCLContext* CSCLContext::m_instance = NULL; /* For singleton */
-
CSCLContext::CSCLContext()
{
SCL_DEBUG();
CSCLContext*
CSCLContext::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLContext();
- }
- return (CSCLContext*)m_instance;
+ static CSCLContext instance;
+ return &instance;
}
void
return TRUE;
}
-CSCLController* CSCLController::m_instance = NULL; /* For singleton */
-
-
CSCLController::CSCLController()
{
SCL_DEBUG();
CSCLController*
CSCLController::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLController();
- }
- return (CSCLController*)m_instance;
+ static CSCLController instance;
+ return &instance;
}
void
#define TWO 2
using namespace scl;
-CSCLErrorAdjustment* CSCLErrorAdjustment::m_instance = NULL; /* For singleton */
CSCLErrorAdjustment* CSCLErrorAdjustment::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLErrorAdjustment();
- }
- return (CSCLErrorAdjustment*)m_instance;
+ static CSCLErrorAdjustment instance;
+ return &instance;
}
CSCLErrorAdjustment::CSCLErrorAdjustment()
using namespace scl;
-CSCLEventHandler* CSCLEventHandler::m_instance = NULL; /* For singleton */
-
CSCLEventHandler::CSCLEventHandler()
{
SCL_DEBUG();
CSCLEventHandler*
CSCLEventHandler::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLEventHandler();
- }
- return (CSCLEventHandler*)m_instance;
+ static CSCLEventHandler instance;
+ return &instance;
}
static void handle_shift_button_click_event(SclUIEventDesc ui_event_desc)
using namespace scl;
-CSCLEvents* CSCLEvents::m_instance = NULL; /* For singleton */
-
CSCLEvents::CSCLEvents()
{
SCL_DEBUG();
CSCLEvents::~CSCLEvents()
{
SCL_DEBUG();
+
+ fini();
+
+ if (m_impl) {
+ delete m_impl;
+ m_impl = NULL;
+ }
+}
+
+void CSCLEvents::init()
+{
+ CSCLEventsImpl *impl = get_scl_events_impl();
+ if (impl) {
+ impl->init();
+ }
+}
+
+void CSCLEvents::fini()
+{
+ CSCLEventsImpl *impl = get_scl_events_impl();
+ if (impl) {
+ impl->fini();
+ }
}
CSCLEventsImpl* CSCLEvents::get_scl_events_impl()
CSCLEvents* CSCLEvents::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLEvents();
- }
- return (CSCLEvents*)m_instance;
+ static CSCLEvents instance;
+ return &instance;
}
void
#include "sclcontext.h"
using namespace scl;
-CSCLFeedback* CSCLFeedback::m_instance = NULL; /* For singleton */
CSCLFeedback* CSCLFeedback::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLFeedback();
- }
- return (CSCLFeedback*)m_instance;
+ static CSCLFeedback instance;
+ return &instance;
}
CSCLFeedback::CSCLFeedback()
using namespace scl;
-CSCLFontProxy* CSCLFontProxy::m_instance = NULL; /* For singleton */
-
/**
* Constructor
*/
CSCLFontProxy* CSCLFontProxy::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLFontProxy();
- }
- return (CSCLFontProxy*)m_instance;
+ static CSCLFontProxy instance;
+ return &instance;
}
sclfont
using namespace scl;
-CSCLGraphics* CSCLGraphics::m_instance = NULL; /* For singleton */
-
CSCLGraphics::CSCLGraphics()
{
SCL_DEBUG();
- m_impl = 0;
+ m_impl = NULL;
}
CSCLGraphics::~CSCLGraphics()
{
SCL_DEBUG();
+
+ fini();
+
+ if (m_impl) {
+ delete m_impl;
+ m_impl = NULL;
+ }
+}
+
+void CSCLGraphics::init()
+{
+ CSCLGraphicsImpl *impl = get_scl_graphics_impl();
+ if (impl) {
+ impl->init();
+ }
+}
+
+void CSCLGraphics::fini()
+{
+ CSCLGraphicsImpl *impl = get_scl_graphics_impl();
+ if (impl) {
+ impl->fini();
+ }
}
CSCLGraphicsImpl* CSCLGraphics::get_scl_graphics_impl()
CSCLGraphics* CSCLGraphics::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLGraphics();
- }
- return (CSCLGraphics*)m_instance;
+ static CSCLGraphics instance;
+ return &instance;
}
using namespace scl;
-CSCLGwes* CSCLGwes::m_instance = NULL; /* For singleton */
-
CSCLGwes::CSCLGwes()
{
SCL_DEBUG();
+
m_windows = NULL;
m_graphics = NULL;
m_events = NULL;
CSCLGwes::~CSCLGwes()
{
SCL_DEBUG();
- if (m_windows) delete(m_windows);
- if (m_graphics) delete(m_graphics);
- if (m_events) delete(m_events);
+
+ fini();
}
void CSCLGwes::init(sclwindow parent, scl16 width, scl16 height)
{
SCL_DEBUG();
+
if (m_windows == NULL) m_windows = CSCLWindows::get_instance();
if (m_graphics == NULL) m_graphics = CSCLGraphics::get_instance();
if (m_events == NULL) m_events = CSCLEvents::get_instance();
+ if (m_windows) {
+ m_windows->init();
+ }
+ if (m_graphics) {
+ m_graphics->init();
+ }
+ if (m_events) {
+ m_events->init();
+ }
+
sclwindow wnd = m_windows->create_base_window(parent, width, height);
m_events->connect_window_events(wnd, SCL_EVENT_MOUSE | SCL_EVENT_EXPOSE);
}
-CSCLGwes* CSCLGwes::get_instance()
+void CSCLGwes::fini()
{
- if (!m_instance) {
- m_instance = new CSCLGwes();
+ SCL_DEBUG();
+
+ if (m_windows) {
+ m_windows->fini();
+ m_windows = NULL;
+ }
+ if (m_graphics) {
+ m_graphics->fini();
+ m_graphics = NULL;
+ }
+ if (m_events) {
+ m_events->fini();
+ m_events = NULL;
}
- return (CSCLGwes*)m_instance;
+}
+
+CSCLGwes* CSCLGwes::get_instance()
+{
+ static CSCLGwes instance;
+ return &instance;
}
using namespace scl;
-CSCLImageProxy* CSCLImageProxy::m_instance = NULL; /* For singleton */
-
/**
* Constructor
*/
CSCLImageProxy* CSCLImageProxy::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLImageProxy();
- }
- return (CSCLImageProxy*)m_instance;
+ static CSCLImageProxy instance;
+ return &instance;
}
sclimage
#include <assert.h>
using namespace scl;
-CSCLResourceCache* CSCLResourceCache::m_instance = NULL; /* For singleton */
-
CSCLResourceCache::CSCLResourceCache()
{
SCL_DEBUG();
CSCLResourceCache*
CSCLResourceCache::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLResourceCache();
- }
- return (CSCLResourceCache*)m_instance;
+ static CSCLResourceCache instance;
+ return &instance;
}
(*pCurLayoutKeyCoordinate)[loop].extract_offset_y *= utils->get_custom_scale_rate_y();
(*pCurLayoutKeyCoordinate)[loop].magnifier_offset_x *= utils->get_custom_scale_rate_x();
(*pCurLayoutKeyCoordinate)[loop].magnifier_offset_y *= utils->get_custom_scale_rate_y();
-
- utils->log("CUSTOM_SCALED_GEOMETRY : %d %d %d %d",
- (*pCurLayoutKeyCoordinate)[loop].x, (*pCurLayoutKeyCoordinate)[loop].y,
- (*pCurLayoutKeyCoordinate)[loop].width, (*pCurLayoutKeyCoordinate)[loop].height);
}
}
}
CSCLUI::~CSCLUI()
{
- delete m_impl;
+ m_impl = NULL;
}
sclboolean CSCLUI::init(sclwindow parent, const SCLParserType parser_type, const char *entry_filepath)
return ret;
}
+void
+CSCLUI::fini()
+{
+ if (m_impl) {
+ m_impl->fini();
+ }
+}
+
/**
* Shows the SCL main window
* For displaying the SCL UI, you should explicitly call this function after CSCLUI class is created
//extern sclboolean g_key_spacing_off;
-CSCLUIBuilder* CSCLUIBuilder::m_instance = NULL; /* For singleton */
-
CSCLUIBuilder::CSCLUIBuilder()
{
SCL_DEBUG();
CSCLUIBuilder::~CSCLUIBuilder()
{
SCL_DEBUG();
- if (m_gwes) delete m_gwes;
m_gwes = NULL;
- if (m_utils) delete m_utils;
m_utils = NULL;
}
CSCLUIBuilder*
CSCLUIBuilder::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLUIBuilder();
- }
- return (CSCLUIBuilder*)m_instance;
+ static CSCLUIBuilder instance;
+ return &instance;
}
void
using namespace scl;
-CSCLUIImpl* CSCLUIImpl::m_instance = NULL; /* For singleton */
-
CSCLUIImpl::CSCLUIImpl()
{
SCL_DEBUG();
CSCLUIImpl*
CSCLUIImpl::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLUIImpl();
- }
- return (CSCLUIImpl*)m_instance;
+ static CSCLUIImpl instance;
+ return &instance;
}
sclboolean CSCLUIImpl::init(sclwindow parent, const SCLParserType parser_type, const char *entry_filepath)
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
+ CSCLGwes *gwes = CSCLGwes::get_instance();
if (sclres_manager && builder && cache && utils) {
sclres_manager->init(parser_type, entry_filepath);
return TRUE;
}
+void
+CSCLUIImpl::fini()
+{
+ CSCLUtils *utils = CSCLUtils::get_instance();
+ if (utils) {
+ utils->fini();
+ }
+
+ CSCLGwes *gwes = CSCLGwes::get_instance();
+ if (gwes) {
+ gwes->fini();
+ }
+}
+
/**
* Shows the SCL main window
* For displaying the SCL UI, you should explicitly call this function after CSCLUIImpl class is created
using namespace scl;
-CSCLUtils* CSCLUtils::m_instance = NULL; /* For singleton */
-
#define SCL_MAX_UNIQUE_ID 1000
CSCLUtils::CSCLUtils()
m_custom_scale_rate_y = 1.0f;
m_scn_resolution_x = 0;
m_scn_resolution_y = 0;
- open_devices();
}
CSCLUtils::~CSCLUtils()
{
SCL_DEBUG();
- close_devices();
+
+ /* To make sure everything's cleaned up */
+ fini();
}
CSCLUtils* CSCLUtils::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLUtils();
- }
- return (CSCLUtils*)m_instance;
+ static CSCLUtils instance;
+ return &instance;
}
void
CSCLUtils::init()
{
SCL_DEBUG();
-
+
+ CSCLUtilsImpl *impl = GetCSCLUtilsImpl();
+ if (impl) {
+ impl->init();
+ }
+
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclDefaultConfigure default_configure = NULL;
if (sclres_manager) {
m_nine_patch_info_map.clear();
}
+void CSCLUtils::fini()
+{
+ SCL_DEBUG();
+
+ CSCLUtilsImpl *impl = GetCSCLUtilsImpl();
+ if (impl) {
+ impl->fini();
+ }
+}
+
/**
* Returns a scale rate (see default screen resolution in sclconfig.h file)
*/
using namespace scl;
-CSCLWindows* CSCLWindows::m_instance = NULL; /* For singleton */
-
CSCLWindows::CSCLWindows()
{
SCL_DEBUG();
CSCLWindows::~CSCLWindows()
{
SCL_DEBUG();
- if (SCLWINDOW_INVALID != m_base_winctx.window) {
- get_scl_windows_impl()->destroy_window(m_base_winctx.window);
- }
- if (SCLWINDOW_INVALID != m_magnifier_winctx.window) {
- get_scl_windows_impl()->destroy_window(m_magnifier_winctx.window);
+ fini();
+
+ if (m_impl) {
+ delete m_impl;
+ m_impl = NULL;
}
+}
- if (SCLWINDOW_INVALID != m_dim_winctx.window) {
- get_scl_windows_impl()->destroy_window(m_dim_winctx.window);
+void CSCLWindows::init()
+{
+ CSCLWindowsImpl *impl = get_scl_windows_impl();
+ if (impl) {
+ impl->init();
}
+}
+
+void CSCLWindows::fini()
+{
+ CSCLWindowsImpl* impl = get_scl_windows_impl();
+
+ if (impl) {
+ impl->fini();
+
+ if (SCLWINDOW_INVALID != m_base_winctx.window) {
+ impl->destroy_window(m_base_winctx.window);
+ m_base_winctx.window = SCLWINDOW_INVALID;
+ }
- for (int loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window != SCLWINDOW_INVALID) {
- if (!m_popup_winctx[loop].is_virtual) {
- get_scl_windows_impl()->destroy_window(m_popup_winctx[loop].window);
+ if (SCLWINDOW_INVALID != m_magnifier_winctx.window) {
+ impl->destroy_window(m_magnifier_winctx.window);
+ m_magnifier_winctx.window = SCLWINDOW_INVALID;
+ }
+
+ if (SCLWINDOW_INVALID != m_dim_winctx.window) {
+ impl->destroy_window(m_dim_winctx.window);
+ m_dim_winctx.window = SCLWINDOW_INVALID;
+ }
+
+ for (int loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
+ if (m_popup_winctx[loop].window != SCLWINDOW_INVALID) {
+ if (!m_popup_winctx[loop].is_virtual) {
+ impl->destroy_window(m_popup_winctx[loop].window);
+ }
+ m_popup_winctx[loop].window = SCLWINDOW_INVALID;
}
}
}
-
}
CSCLWindowsImpl*
CSCLWindows*
CSCLWindows::get_instance()
{
- if (!m_instance) {
- m_instance = new CSCLWindows();
- }
- return (CSCLWindows*)m_instance;
+ static CSCLWindows instance;
+ return &instance;
}
sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectangle &geometry, sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual, sclboolean use_dim_window, sclint img_offset_x, sclint img_offset_y, sclint timeout)
#include <feedback.h>
#include <Elementary.h>
#include <tts.h>
+#include <vconf.h>
#include <dlog.h>
#ifndef LOG_TAG
return ret;
}
+void accessibility_changed_cb(keynode_t *key, void* data)
+{
+ int r;
+ int enabled;
+ if (vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &enabled)) {
+ LOGD("VCONFKEY_SETAPPL_ACCESSIBILITY_TTS : %d, (%p)", enabled, tts);
+ if (enabled) {
+ if (tts == NULL) {
+ LOGD("Initializing TTS\n");
+
+ r = tts_create(&tts);
+ if (TTS_ERROR_NONE != r) {
+ LOGD("tts_create FAILED : result(%d)", r);
+ } else {
+ tts_set_mode (tts, TTS_MODE_SCREEN_READER);
+ }
+ if (TTS_ERROR_NONE != r) {
+ LOGD("tts_set_mode FAILED : result(%d)", r);
+ }
+
+ tts_state_e current_state;
+ r = tts_get_state(tts, ¤t_state);
+ if (TTS_ERROR_NONE != r) {
+ LOGD("tts_get_state FAILED : result(%d)", r);
+ }
+
+ if (TTS_STATE_CREATED == current_state) {
+ r = tts_prepare(tts);
+ }
+ if (TTS_ERROR_NONE != r) {
+ LOGD("tts_prepare FAILED : ret(%d)\n", r);
+ }
+ }
+ } else {
+ if (tts != NULL) {
+ LOGD("Deinitializing TTS\n");
+
+ r = tts_unprepare(tts);
+ if (TTS_ERROR_NONE != r) {
+ LOGD("tts_unprepare FAILED : result(%d)", r);
+ }
+
+ r = tts_destroy(tts);
+ if (TTS_ERROR_NONE != r) {
+ LOGD("tts_destroy FAILED : result(%d)", r);
+ }
+
+ tts = NULL;
+ }
+ }
+ }
+}
+
+void
+CSCLUtilsImplLinux::init() {
+ SCL_DEBUG();
+ open_devices();
+
+ vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb, NULL);
+ accessibility_changed_cb(NULL, NULL);
+}
+
+void
+CSCLUtilsImplLinux::fini() {
+ SCL_DEBUG();
+
+ vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, accessibility_changed_cb);
+
+ close_devices();
+}
+
/* FIXME : Currently the screen resolution is locally cached, should be updated when it gets changed */
sclboolean
CSCLUtilsImplLinux::get_screen_resolution(sclint *x, sclint *y) {
LOGD("FEEDBACK INITIALIZATION SUCCESSFUL : %d\n", r);
}
- r = tts_create(&tts);
- if (TTS_ERROR_NONE != r) {
- LOGD("tts_create FAILED : result(%d)", r);
- } else {
- r = tts_set_mode (tts, TTS_MODE_SCREEN_READER);
- }
- if (TTS_ERROR_NONE != r) {
- LOGD("tts_set_mode FAILED : result(%d)", r);
- }
-
- tts_state_e current_state;
- r = tts_get_state(tts, ¤t_state);
- if (TTS_ERROR_NONE != r) {
- LOGD("tts_get_state FAILED : result(%d)", r);
- }
-
- if (TTS_STATE_CREATED == current_state) {
- r = tts_prepare(tts);
- }
- if (TTS_ERROR_NONE != r) {
- LOGD("tts_prepare FAILED : ret(%d)\n", r);
- }
-
return TRUE;
}
LOGD("FEEDBACK DEINITIALIZATION SUCCESSFUL : %d\n", r);
}
- r = tts_unprepare(tts);
- if (TTS_ERROR_NONE != r) {
- LOGD("tts_unprepare FAILED : result(%d)", r);
- }
-
- r = tts_destroy(tts);
- if (TTS_ERROR_NONE != r) {
- LOGD("tts_destroy FAILED : result(%d)", r);
- }
return TRUE;
}
using namespace scl;
+void
+CSCLUtilsImplWin32::init() {
+ SCL_DEBUG();
+ open_devices();
+}
+
+void
+CSCLUtilsImplWin32::fini() {
+ SCL_DEBUG();
+ close_devices();
+}
+
sclboolean
CSCLUtilsImplWin32::get_screen_resolution(sclint *x, sclint *y) {
SCL_DEBUG();
static sclres::SclRes *_current_parser = NULL;
-SclResParserManager* SclResParserManager::m_instance = NULL;
SclResParserManager::~SclResParserManager() {
- if (_current_parser)
- delete _current_parser;
_current_parser = NULL;
}
SclResParserManager*
SclResParserManager::get_instance() {
- if (m_instance == NULL) {
- m_instance = new SclResParserManager();
- }
- return m_instance;
+ static SclResParserManager instance;
+ return &instance;
}
SclResParserManager::SclResParserManager() {
void destroy();
private:
SclResParserManager();
- static SclResParserManager* m_instance;
};
#endif
SclAutoPopupConfigure m_autopopup_configure;
};
-AutoPopupConfigParser* AutoPopupConfigParser::m_instance = NULL;
-
AutoPopupConfigParser::AutoPopupConfigParser() {
m_impl = new AutoPopupConfigureParserImpl;
}
AutoPopupConfigParser*
AutoPopupConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new AutoPopupConfigParser();
- }
- return m_instance;
+ static AutoPopupConfigParser instance;
+ return &instance;
}
int
SclDefaultConfigure m_default_configure;
};
-DefaultConfigParser* DefaultConfigParser::m_instance = NULL;
-
DefaultConfigParser*
DefaultConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new DefaultConfigParser();
- }
- return m_instance;
+ static DefaultConfigParser instance;
+ return &instance;
}
DefaultConfigParser::DefaultConfigParser() {
m_impl = new DefaultConfigureParserImpl;
static AutoPopupConfigParser *get_instance();
private:
AutoPopupConfigParser();
- static AutoPopupConfigParser *m_instance;
};
static DefaultConfigParser *get_instance();
private:
DefaultConfigParser();
- static DefaultConfigParser *m_instance;
};
static InputModeConfigParser *get_instance();
private:
InputModeConfigParser();
- static InputModeConfigParser *m_instance;
};
#endif
static LabelPropertyParser *get_instance();
private:
LabelPropertyParser();
- static LabelPropertyParser *m_instance;
};
private:
LayoutParser();
- static LayoutParser *m_instance;
};
static MagnifierConfigParser *get_instance();
private:
MagnifierConfigParser();
- static MagnifierConfigParser *m_instance;
};
static MainEntryParser *get_instance();
private:
MainEntryParser();
- static MainEntryParser *m_instance;
};
#endif
static ModifierDecorationParser *get_instance();
private:
ModifierDecorationParser();
- static ModifierDecorationParser *m_instance;
};
static NinePatchFileParser *get_instance();
private:
NinePatchFileParser();
- static NinePatchFileParser *m_instance;
};
XMLResource();
private:
- static XMLResource* m_instance;
-
MainEntryParser *m_main_entry_parser;
InputModeConfigParser *m_input_mode_configure_parser;
LayoutParser *m_layout_parser;
AutoPopupConfigParser *m_autopopup_configure_parser;
MagnifierConfigParser *m_magnifier_configure_parser;
NinePatchFileParser *m_nine_patch_file_list_parser;
-
- private:
- class DestructHelper {
- public:
- ~DestructHelper() {
- if (XMLResource::m_instance != NULL)
- {
- delete m_instance;
- m_instance = NULL;
- }
- }
- };
- static DestructHelper des;
};
}
SclInputModeConfigure m_input_mode_configure_table[MAX_SCL_INPUT_MODE];
};
-InputModeConfigParser* InputModeConfigParser::m_instance = NULL;
-
InputModeConfigParser::InputModeConfigParser() {
m_impl = new InputModeConfigureParserImpl;
}
InputModeConfigParser*
InputModeConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new InputModeConfigParser();
- }
- return m_instance;
+ static InputModeConfigParser instance;
+ return &instance;
}
int
int m_size;
};
-LabelPropertyParser* LabelPropertyParser::m_instance = NULL;
-
LabelPropertyParser::LabelPropertyParser() {
m_impl = new LabelPropertiesParserImpl;
}
LabelPropertyParser*
LabelPropertyParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new LabelPropertyParser();
- }
- return m_instance;
+ static LabelPropertyParser instance;
+ return &instance;
}
int
}
}
-/* LayoutParser */
-LayoutParser* LayoutParser::m_instance = NULL;
-
LayoutParser::LayoutParser() {
m_impl = new LayoutParserImpl;
}
LayoutParser*
LayoutParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new LayoutParser();
- }
- return m_instance;
+ static LayoutParser instance;
+ return &instance;
}
int
SclMagnifierWndConfigure m_magnifier_configure;
};
-MagnifierConfigParser* MagnifierConfigParser::m_instance = NULL;
-
MagnifierConfigParser::MagnifierConfigParser() {
m_impl = new MagnifierConfigureParserImpl;
}
MagnifierConfigParser*
MagnifierConfigParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new MagnifierConfigParser();
- }
- return m_instance;
+ static MagnifierConfigParser instance;
+ return &instance;
}
int
XMLFiles m_xml_files;
};
-MainEntryParser* MainEntryParser::m_instance = NULL;
-
MainEntryParser::MainEntryParser() {
m_impl = new MainEntryParserImpl;
}
MainEntryParser*
MainEntryParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new MainEntryParser();
- }
- return m_instance;
+ static MainEntryParser instance;
+ return &instance;
}
int
SclModifierDecoration m_modifier_decoration_table[MAX_SCL_MODIFIER_DECORATION_NUM];
};
-ModifierDecorationParser* ModifierDecorationParser::m_instance = NULL;
-
ModifierDecorationParser*
ModifierDecorationParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new ModifierDecorationParser();
- }
- return m_instance;
+ static ModifierDecorationParser instance;
+ return &instance;
}
ModifierDecorationParser::ModifierDecorationParser() {
};
-NinePatchFileParser* NinePatchFileParser::m_instance = NULL;
-
NinePatchFileParser::NinePatchFileParser() {
m_impl = new NinePatchFileListParserImpl;
}
}
NinePatchFileParser*
NinePatchFileParser::get_instance() {
- if (m_instance == NULL) {
- m_instance = new NinePatchFileParser();
- }
- return m_instance;
+ static NinePatchFileParser instance;
+ return &instance;
}
int
using namespace xmlresource;
-XMLResource* XMLResource::m_instance = NULL;
-
XMLResource::XMLResource() {
m_main_entry_parser = NULL;
m_input_mode_configure_parser = NULL;
}
XMLResource::~XMLResource() {
- if (m_main_entry_parser)
- delete m_main_entry_parser;
m_main_entry_parser = NULL;
- if (m_input_mode_configure_parser)
- delete m_input_mode_configure_parser;
m_input_mode_configure_parser = NULL;
- if (m_layout_parser)
- delete m_layout_parser;
m_layout_parser = NULL;
- if (m_modifier_decoration_parser)
- delete m_modifier_decoration_parser;
m_modifier_decoration_parser = NULL;
-
- if (m_label_properties_parser)
- delete m_label_properties_parser;
m_label_properties_parser = NULL;
-
- if (m_default_configure_parser)
- delete m_default_configure_parser;
m_default_configure_parser = NULL;
-
- if (m_autopopup_configure_parser)
- delete m_autopopup_configure_parser;
m_autopopup_configure_parser = NULL;
- if (m_magnifier_configure_parser)
- delete m_magnifier_configure_parser;
m_magnifier_configure_parser = NULL;
-
- if (m_nine_patch_file_list_parser)
- delete m_nine_patch_file_list_parser;
m_nine_patch_file_list_parser = NULL;
}
XMLResource*
XMLResource::get_instance() {
- if (m_instance == NULL) {
- m_instance = new XMLResource();
- }
- return m_instance;
+ static XMLResource instance;
+ return &instance;
}
static void