fclose(fp);
return -1;
}
- if (1 != fread(m_storage, size, 1, fp)) {
+ if (size > 0 && 1 != fread(m_storage, size, 1, fp)) {
if (m_storage) {
delete []m_storage;
}
BinLayoutParser() {
m_layout_size = 0;
memset(m_layout_table, 0x00, sizeof(SclLayout) * MAX_SCL_LAYOUT);
+ parser_info_provider = NULL;
}
BinLayoutParser::
~BinLayoutParser() {
BinNinePatchFileParser::BinNinePatchFileParser() {
m_size = 0;
memset(m_nine_patch_file_list, 0x00, sizeof(SclNinePatchInfo) * MAX_NINE_PATCH_FILE_LIST);
+ parser_info_provider = NULL;
}
BinNinePatchFileParser::~BinNinePatchFileParser() {
CSCLGraphicsImplEfl::~CSCLGraphicsImplEfl()
{
SCL_DEBUG();
+
+ fini ();
}
void CSCLGraphicsImplEfl::init()
evas_object_show(clipper);
clip_object = new EFLObject;
- clip_object->object = clipper;
- clip_object->type = EFLOBJECT_CLIPOBJECT;
- clip_object->position.x = dest_x;
- clip_object->position.y = dest_y;
- clip_object->position.width = dest_width;
- clip_object->position.height = dest_height;
- clip_object->etc_info = image_path;
- clip_object->extracted = FALSE;
- clip_object->data = NULL;
+ if (clip_object) {
+ clip_object->object = clipper;
+ clip_object->type = EFLOBJECT_CLIPOBJECT;
+ clip_object->position.x = dest_x;
+ clip_object->position.y = dest_y;
+ clip_object->position.width = dest_width;
+ clip_object->position.height = dest_height;
+ clip_object->etc_info = image_path;
+ clip_object->extracted = FALSE;
+ clip_object->data = NULL;
+ }
#endif
} else {
evas_object_move(image_object, dest_x, dest_y);
}
#endif
- utils->log("WinEfl_showwin %p %p (basewin %p mag %p)\n",
- window,
- windows->get_base_window(), windows->get_magnifier_window());
+ if (utils) {
+ utils->log("WinEfl_showwin %p %p (basewin %p mag %p)\n",
+ window,
+ windows->get_base_window(), windows->get_magnifier_window());
+ }
}
}
mouse_farthest_point.x = 0;
mouse_farthest_point.y = 0;
event_type = EVENT_TYPE_NONE;
+ mouse_pressed_point.x = 0;
+ mouse_pressed_point.y = 0;
+ mouse_current_point.x = 0;
+ mouse_current_point.y = 0;
+ mouse_farthest_point.x = 0;
+ mouse_farthest_point.y = 0;
}
const sclchar *key_value;
sclulong key_event;
m_prev_display_mode = DISPLAYMODE_PORTRAIT;
m_prev_input_mode = NOT_USED;
+ m_hidden = false;
+ m_caps_lock_mode = false;
+
m_magnifier_enabled = TRUE;
m_sounce_enabled = TRUE;
m_vibration_enabled = TRUE;
m_highlight_ui_animation_enabled = FALSE;
m_tts_enabled = FALSE;
+ m_cur_highlighted_key = 0;
+ m_cur_highlighted_window = SCLWINDOW_INVALID;
m_multi_touch_context.clear();
m_last_touch_device_id = SCLTOUCHDEVICE_INVALID;
desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
desc.key_modifier = key_modifier;
- if (handler->on_event_drag_state_changed(desc) && context->get_magnifier_enabled()) {
+ if (handler && handler->on_event_drag_state_changed(desc) && context->get_magnifier_enabled()) {
update_magnifier = TRUE;
}
}
}
break;
case SCL_TIMER_AUTOTEST: {
+ srand(time(NULL));
sclint rnd = rand() % 100;
- if (cache->get_cur_layout(windows->get_base_window()) == NULL) {
+ const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
+
+ if (layout == NULL) {
return FALSE;
}
- sclint x = (rand() % (cache->get_cur_layout(windows->get_base_window())->width));
- sclint y = (rand() % (cache->get_cur_layout(windows->get_base_window())->height));
+ srand(time(NULL));
+ sclint x = (rand() % (layout->width));
+
+ srand(time(NULL));
+ sclint y = (rand() % (layout->height));
if (rnd < 80) {
events->generate_mouse_event(SCL_MOUSE_EVENT_PRESS, x, y);
if (SCL_EVENT_PASS_ON ==
handler->on_event_notification(SCL_UINOTITYPE_SHIFT_STATE_CHANGE, &desc)) {
- context->set_shift_state(SCL_SHIFT_STATE_OFF);
+ if (context)
+ context->set_shift_state(SCL_SHIFT_STATE_OFF);
}
}
}
break;
case SIGACTION_UNPRESS_KEYS:
- context->set_cur_pressed_key(context->get_last_touch_device_id(), NOT_USED);
- context->set_cur_pressed_window(context->get_last_touch_device_id(), SCLWINDOW_INVALID);
+ if (context) {
+ context->set_cur_pressed_key(context->get_last_touch_device_id(), NOT_USED);
+ context->set_cur_pressed_window(context->get_last_touch_device_id(), SCLWINDOW_INVALID);
+ }
break;
default:
break;
SclPoint *pos;
pos = events->get_touch_event_offset();
- if (m_enabled) {
+ if (m_enabled && utils) {
if (level == TOUCH_OFFSET_LEVEL_1) {
*x = *x + utils->get_scaled_x(pos->x);
} else if (level == TOUCH_OFFSET_LEVEL_2) {
sclboolean search_in_base_window = TRUE;
sclboolean exclude_popup_covered_area = FALSE;
- if (!windows->is_base_window(windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP))) {
+ if (windows && !windows->is_base_window(windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP))) {
if (cache && window_context && scl_check_arrindex(window_context->inputmode, MAX_SCL_INPUT_MODE)) {
const SclLayout *cur_layout =
cache->get_cur_layout(windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP));
windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP));
}
/* Now search buttons in base window */
- if (search_in_base_window) {
+ if (search_in_base_window && windows) {
base_candidate = get_next_candidate_key(direction, cur_key_coordinate, windows->get_base_window());
}
SCL_DEBUG();
memset(mCurThemename, 0x00, sizeof(mCurThemename));
+ memset(&mCurBaseLayout, 0x00, sizeof(SclLayout));
+
+ mCurStartingCoordinates.x = 0;
+ mCurStartingCoordinates.y = 0;
+ mCurStartingCoordinatesOption = SCL_STARTING_COORDINATES_OPTION_ALL;
}
CSCLResourceCache::~CSCLResourceCache()
!scl_check_arrindex_unsigned(layout, sclres_manager->get_layout_size())) {
layout = 0;
}
- m_gwes->init(parent,
- m_utils->get_scaled_x(sclres_layout[layout].width),
- m_utils->get_scaled_y(sclres_layout[layout].height));
+
+ if (m_utils) {
+ m_gwes->init(parent,
+ m_utils->get_scaled_x(sclres_layout[layout].width),
+ m_utils->get_scaled_y(sclres_layout[layout].height));
+ }
CSCLContext *context = CSCLContext::get_instance();
context->set_display_mode(display_mode);
scl_assert(default_configure->target_screen_width);
scl_assert(default_configure->target_screen_height);
if (default_configure->target_screen_width != 0 &&default_configure->target_screen_height != 0) {
- impl->get_screen_resolution(&m_scn_resolution_x, &m_scn_resolution_y);
+ CSCLUtilsImpl *impl = GetCSCLUtilsImpl();
+ if (impl)
+ impl->get_screen_resolution(&m_scn_resolution_x, &m_scn_resolution_y);
+
m_scn_rate_x = m_scn_resolution_x / (float)default_configure->target_screen_width;
m_scn_rate_y = m_scn_resolution_y / (float)default_configure->target_screen_height;
button_context->state = BUTTON_STATE_NORMAL;
}*/
- if (coordinate)
+ if (windows && coordinate)
windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
}
}
class String_Encoder:public IString_Encoder{
public:
String_Encoder() {
+ m_file = NULL;
}
void set_path(const char* file) {
return -1;
}
- char* xml_text_dir = argv[1];
- if (0 != access(xml_text_dir, R_OK)) {
- perror(xml_text_dir);
- return -1;
+ char* xml_text_dir = NULL;
+ if (argv[1])
+ xml_text_dir = strdup(argv[1]);
+
+ if (xml_text_dir) {
+ if (0 != access(xml_text_dir, R_OK)) {
+ perror(xml_text_dir);
+ free(xml_text_dir);
+ return -1;
+ }
+ else {
+ free(xml_text_dir);
+ xml_text_dir = NULL;
+ }
}
char* xml_bin_dir = NULL;
if (argc < 3) {
- xml_bin_dir = argv[1];
+ if (argv[1])
+ xml_bin_dir = strdup(argv[1]);
} else {
- xml_bin_dir = argv[2];
+ if (argv[2])
+ xml_bin_dir = strdup(argv[2]);
}
- if (0 != access(xml_bin_dir, W_OK)) {
- perror(xml_bin_dir);
- return -1;
+ if (xml_bin_dir) {
+ if (0 != access(xml_bin_dir, W_OK)) {
+ perror(xml_bin_dir);
+ free(xml_bin_dir);
+ return -1;
+ }
+ else {
+ free(xml_bin_dir);
+ xml_bin_dir = NULL;
+ }
}
XMLResource *xmlresource = XMLResource::get_instance();
return -1;
}
-
xmlresource->set_resource_directory(xml_text_dir);
xmlresource->init("main_entry.xml");