// Update the position of the target window
//windows->get_window_context(window, TRUE);
SclWindowContext *winctx = windows->get_window_context(window);
- windows->get_window_rect(window, &(winctx->geometry));
- if (get_window_rect(window, &rect)) {
- int adjustx = ev->root.x;
- int adjusty = ev->root.y;
-
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
- PSclDefaultConfigure default_configure = NULL;
- if (sclres_manager) {
- default_configure = sclres_manager->get_default_configure();
- }
- if (default_configure) {
- SCLDisplayMode display_mode = context->get_display_mode();
- CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
- if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
- adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
+ if (winctx) {
+ windows->get_window_rect(window, &(winctx->geometry));
+ if (get_window_rect(window, &rect)) {
+ int adjustx = ev->root.x;
+ int adjusty = ev->root.y;
+
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+ PSclDefaultConfigure default_configure = NULL;
+ if (sclres_manager) {
+ default_configure = sclres_manager->get_default_configure();
+ }
+ if (default_configure) {
+ SCLDisplayMode display_mode = context->get_display_mode();
+ CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
+ if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+ adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
+ }
}
- }
- sclint winwidth = rect.width;
- sclint winheight = rect.height;
- if (context->get_display_mode() != DISPLAYMODE_PORTRAIT) {
- rect.height = winwidth;
- rect.width = winheight;
- }
+ sclint winwidth = rect.width;
+ sclint winheight = rect.height;
+ if (context->get_display_mode() != DISPLAYMODE_PORTRAIT) {
+ rect.height = winwidth;
+ rect.width = winheight;
+ }
- sclboolean process_event = FALSE;
- if ((adjustx >= rect.x && adjustx <= (rect.x + winwidth)) &&
- (adjusty >= rect.y && adjusty <= (rect.y + winheight))) {
- process_event = TRUE;
- }
- if (process_event)
- {
- // Now convert the global coordinate to appropriate local coordinate
- SclPoint coords = get_rotated_local_coords(ev->root.x, ev->root.y, context->get_rotation(), &rect);
- controller->mouse_press(window, coords.x, coords.y, ev->multi.device);
- mouse_pressed = TRUE;
- processed = TRUE;
- pressed_window = window;
+ sclboolean process_event = FALSE;
+ if ((adjustx >= rect.x && adjustx <= (rect.x + winwidth)) &&
+ (adjusty >= rect.y && adjusty <= (rect.y + winheight))) {
+ process_event = TRUE;
+ }
+ if (process_event)
+ {
+ // Now convert the global coordinate to appropriate local coordinate
+ SclPoint coords = get_rotated_local_coords(ev->root.x, ev->root.y, context->get_rotation(), &rect);
+ controller->mouse_press(window, coords.x, coords.y, ev->multi.device);
+ mouse_pressed = TRUE;
+ processed = TRUE;
+ pressed_window = window;
+ }
}
}
}
-
index++;
} while (index < MAX_ZORDER_NUM && window != SCLWINDOW_INVALID && !processed);
window = windows->get_nth_window_in_Z_order_list(index);
if (window) {
SclWindowContext *winctx = windows->get_window_context(window);
- windows->get_window_rect(window, &(winctx->geometry));
- if (get_window_rect(window, &rect)) {
- int adjustx = ev->root.x;
- int adjusty = ev->root.y;
-
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
- PSclDefaultConfigure default_configure = NULL;
- if (sclres_manager) {
- default_configure = sclres_manager->get_default_configure();
- }
- if (default_configure) {
- SCLDisplayMode display_mode = context->get_display_mode();
- CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
- if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
- adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
+ if (winctx) {
+ windows->get_window_rect(window, &(winctx->geometry));
+ if (get_window_rect(window, &rect)) {
+ int adjustx = ev->root.x;
+ int adjusty = ev->root.y;
+
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+ PSclDefaultConfigure default_configure = NULL;
+ if (sclres_manager) {
+ default_configure = sclres_manager->get_default_configure();
+ }
+ if (default_configure) {
+ SCLDisplayMode display_mode = context->get_display_mode();
+ CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
+ if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+ adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
+ }
}
- }
- sclint winwidth = rect.width;
- sclint winheight = rect.height;
- if (context->get_display_mode() != DISPLAYMODE_PORTRAIT) {
- rect.height = winwidth;
- rect.width = winheight;
- }
+ sclint winwidth = rect.width;
+ sclint winheight = rect.height;
+ if (context->get_display_mode() != DISPLAYMODE_PORTRAIT) {
+ rect.height = winwidth;
+ rect.width = winheight;
+ }
- sclboolean process_event = FALSE;
- if ((adjustx >= rect.x && adjustx <= (rect.x + winwidth)) &&
- (adjusty >= rect.y && adjusty <= (rect.y + winheight))) {
- process_event = TRUE;
- }
- if (process_event)
- {
- /* Now convert the global coordinate to appropriate local coordinate */
- SclPoint coords = get_rotated_local_coords(ev->root.x, ev->root.y, context->get_rotation(), &rect);
- controller->mouse_release(window, coords.x, coords.y, ev->multi.device);
- processed = TRUE;
+ sclboolean process_event = FALSE;
+ if ((adjustx >= rect.x && adjustx <= (rect.x + winwidth)) &&
+ (adjusty >= rect.y && adjusty <= (rect.y + winheight))) {
+ process_event = TRUE;
+ }
+ if (process_event)
+ {
+ /* Now convert the global coordinate to appropriate local coordinate */
+ SclPoint coords = get_rotated_local_coords(ev->root.x, ev->root.y, context->get_rotation(), &rect);
+ controller->mouse_release(window, coords.x, coords.y, ev->multi.device);
+ processed = TRUE;
+ }
}
}
}
-
index++;
} while (index < MAX_ZORDER_NUM && window != SCLWINDOW_INVALID && !processed);
}
window = windows->get_nth_window_in_Z_order_list(index);
if (window) {
SclWindowContext *winctx = windows->get_window_context(window);
- windows->get_window_rect(window, &(winctx->geometry));
- if (get_window_rect(window, &rect)) {
- int adjustx = ev->root.x;
- int adjusty = ev->root.y;
-
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
- PSclDefaultConfigure default_configure = NULL;
- if (sclres_manager) {
- default_configure = sclres_manager->get_default_configure();
- }
- if (default_configure) {
- SCLDisplayMode display_mode = context->get_display_mode();
- CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
- if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
- adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
+ if (winctx) {
+ windows->get_window_rect(window, &(winctx->geometry));
+ if (get_window_rect(window, &rect)) {
+ int adjustx = ev->root.x;
+ int adjusty = ev->root.y;
+
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+ PSclDefaultConfigure default_configure = NULL;
+ if (sclres_manager) {
+ default_configure = sclres_manager->get_default_configure();
+ }
+ if (default_configure) {
+ SCLDisplayMode display_mode = context->get_display_mode();
+ CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
+ if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+ adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
+ }
}
- }
- sclint winwidth = rect.width;
- sclint winheight = rect.height;
- if (context->get_display_mode() != DISPLAYMODE_PORTRAIT) {
- rect.height = winwidth;
- rect.width = winheight;
- }
+ sclint winwidth = rect.width;
+ sclint winheight = rect.height;
+ if (context->get_display_mode() != DISPLAYMODE_PORTRAIT) {
+ rect.height = winwidth;
+ rect.width = winheight;
+ }
- sclboolean process_event = FALSE;
- if ((adjustx >= rect.x && adjustx <= (rect.x + winwidth)) &&
- (adjusty >= rect.y && adjusty <= (rect.y + winheight))) {
- process_event = TRUE;
- }
- /* Process this event regardless of the coordinate if the top window has the POPUP_GRAB layout style */
- if (index == SCL_WINDOW_Z_TOP) {
- const SclLayout *layout = cache->get_cur_layout(window);
- if (layout) {
- if (layout->style == LAYOUT_STYLE_POPUP_GRAB) {
+ sclboolean process_event = FALSE;
+ if ((adjustx >= rect.x && adjustx <= (rect.x + winwidth)) &&
+ (adjusty >= rect.y && adjusty <= (rect.y + winheight))) {
process_event = TRUE;
+ }
+ /* Process this event regardless of the coordinate if the top window has the POPUP_GRAB layout style */
+ if (index == SCL_WINDOW_Z_TOP) {
+ const SclLayout *layout = cache->get_cur_layout(window);
+ if (layout) {
+ if (layout->style == LAYOUT_STYLE_POPUP_GRAB) {
+ process_event = TRUE;
+ }
}
}
- }
- if (process_event)
- {
- /* Now convert the global coordinate to appropriate local coordinate */
- SclPoint coords = get_rotated_local_coords(ev->root.x, ev->root.y, context->get_rotation(), &rect);
+ if (process_event)
+ {
+ /* Now convert the global coordinate to appropriate local coordinate */
+ SclPoint coords = get_rotated_local_coords(ev->root.x, ev->root.y, context->get_rotation(), &rect);
- controller->mouse_move(window, coords.x, coords.y, ev->multi.device);
- processed = TRUE;
+ controller->mouse_move(window, coords.x, coords.y, ev->multi.device);
+ processed = TRUE;
+ }
}
-
- index++;
}
}
+ index++;
} while (index < MAX_ZORDER_NUM && window != SCLWINDOW_INVALID && !processed);
}
if (windows && utils && winctx) {
if (winctx->etc_info) {
- while ((Eina_List*)(winctx->etc_info)) {
- EFLObject *object = (EFLObject*)eina_list_data_get((Eina_List*)(winctx->etc_info));
- if (object) {
- Evas_Object* eo = object->object;
- if (object->extracted) {
- //evas_object_image_data_set(eo, NULL);
- void *data = evas_object_image_data_get(eo, 1);
- if (data) {
- free(data);
+ Eina_List *list = (Eina_List*)(winctx->etc_info);
+ Eina_List *iter = NULL;
+ Eina_List *iter_next = NULL;
+ void *data = NULL;
+
+ EINA_LIST_FOREACH_SAFE(list, iter, iter_next, data) {
+ if (data) {
+ EFLObject *object = (EFLObject*)(data);
+ if (object) {
+ Evas_Object* eo = object->object;
+ if (object->extracted) {
+ //evas_object_image_data_set(eo, NULL);
+ void *data = evas_object_image_data_get(eo, 1);
+ if (data) {
+ free(data);
+ }
}
- }
- if (eo) {
- evas_object_del(eo);
- object->object = NULL;
- }
- if (object->type == EFLOBJECT_TEXTBLOCK) {
- Evas_Textblock_Style *st = (Evas_Textblock_Style*)(object->data);
- if (st) {
- evas_textblock_style_free(st);
+ if (eo) {
+ evas_object_del(eo);
+ object->object = NULL;
}
+ if (object->type == EFLOBJECT_TEXTBLOCK) {
+ Evas_Textblock_Style *st = (Evas_Textblock_Style*)(object->data);
+ if (st) {
+ evas_textblock_style_free(st);
+ }
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_TextCache.size();loop++) {
- if (g_TextCache[loop].text == object->object) {
- g_TextCache[loop].used = FALSE;
+ for(sclint loop = 0;loop < g_TextCache.size();loop++) {
+ if (g_TextCache[loop].text == object->object) {
+ g_TextCache[loop].used = FALSE;
+ }
}
- }
#endif
- } else if (object->type == EFLOBJECT_IMAGE) {
+ } else if (object->type == EFLOBJECT_IMAGE) {
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
- if (g_ImageCache[loop].image == object->object) {
- g_ImageCache[loop].used = FALSE;
+ for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
+ if (g_ImageCache[loop].image == object->object) {
+ g_ImageCache[loop].used = FALSE;
+ }
}
- }
#endif
+ }
+ delete object;
}
}
- winctx->etc_info = eina_list_remove_list((Eina_List*)(winctx->etc_info), (Eina_List*)(winctx->etc_info));
- if (object)
- delete object;
+ list = eina_list_remove_list(list, iter);
}
winctx->etc_info = NULL;
}
void CSCLWindows::init()
{
+ int loop;
CSCLWindowsImpl *impl = get_scl_windows_impl();
if (impl) {
impl->init();
}
+ for (loop = 0;loop < MAX_ZORDER_NUM;loop++) {
+ m_Z_order_list[loop] = SCLWINDOW_INVALID;
+ }
+ m_initialized = TRUE;
}
void CSCLWindows::fini()
}
}
}
+
+ m_initialized = FALSE;
}
CSCLWindowsImpl*
{
SCL_DEBUG();
- m_base_winctx.hidden = TRUE;
- m_base_winctx.geometry.width = width;
- m_base_winctx.geometry.height = height;
- m_base_winctx.is_virtual = FALSE;
- m_base_winctx.popup_type = POPUP_TYPE_NONE;
- m_base_winctx.opener.window = parent;
- m_base_winctx.geometry.x = m_base_winctx.geometry.y = 0;
- m_base_winctx.etc_info = NULL;
- m_base_winctx.window = get_scl_windows_impl()->create_base_window(parent, &m_base_winctx, width, height);
-
- push_window_in_Z_order_list(m_base_winctx.window);
+ if (m_initialized) {
+ m_base_winctx.hidden = TRUE;
+ m_base_winctx.geometry.width = width;
+ m_base_winctx.geometry.height = height;
+ m_base_winctx.is_virtual = FALSE;
+ m_base_winctx.popup_type = POPUP_TYPE_NONE;
+ m_base_winctx.opener.window = parent;
+ m_base_winctx.geometry.x = m_base_winctx.geometry.y = 0;
+ m_base_winctx.etc_info = NULL;
+ m_base_winctx.window = get_scl_windows_impl()->create_base_window(parent, &m_base_winctx, width, height);
+
+ push_window_in_Z_order_list(m_base_winctx.window);
+ }
// Update the position information
//get_window_context(parent, TRUE);
CSCLWindowsImpl* impl = get_scl_windows_impl();
sclwindow window = SCLWINDOW_INVALID;
- if (impl) {
- if (m_magnifier_winctx.window == NULL) {
+ if (impl && m_initialized) {
+ if (m_magnifier_winctx.window == SCLWINDOW_INVALID) {
window = impl->create_magnifier_window(parent, &m_magnifier_winctx, width, height);
impl->set_keep_above(window, TRUE);
if (window) {
default_configure = sclres_manager->get_default_configure();
}
- if (impl && default_configure) {
+ if (impl && m_initialized && default_configure) {
if (m_dim_winctx.window == NULL) {
m_dim_winctx.hidden = TRUE;
if (default_configure->use_actual_dim_window) {
SclResParserManager::~SclResParserManager() {
_current_parser = NULL;
+ m_initialized = false;
}
SclResParserManager*
SclResParserManager::SclResParserManager() {
_current_parser = NULL;
+ m_initialized = false;
}
void
SclResParserManager::init(const SCLParserType parser_type, const char *entry_filepath) {
- if (parser_type == SCL_PARSER_TYPE_XML) {
- SCLLOG(SclLog::MESSAGE, "Use text xml\n");
- _current_parser = XMLResource::get_instance();
- }
- else if (parser_type == SCL_PARSER_TYPE_BINARY_XML) {
- SCLLOG(SclLog::MESSAGE, "Use binary xml\n");
- _current_parser = BinResource::get_instance();
- }
-
- /* Let's acquire the directory information from filepath */
- std::string str = entry_filepath;
- size_t found;
- found = str.find_last_of("/\\");
-
- std::string filepath = str.substr(0, found);
- std::string filename = str.substr(found + 1);
-
- //assert(_current_parser != NULL);
- if (_current_parser != NULL) {
- /* Assume the directory where the main entry file exists, is the default resource directory */
- _current_parser->set_resource_directory(filepath.c_str());
- _current_parser->init(filename.c_str());
+ if (!m_initialized) {
+ if (parser_type == SCL_PARSER_TYPE_XML) {
+ SCLLOG(SclLog::MESSAGE, "Use text xml\n");
+ _current_parser = XMLResource::get_instance();
+ }
+ else if (parser_type == SCL_PARSER_TYPE_BINARY_XML) {
+ SCLLOG(SclLog::MESSAGE, "Use binary xml\n");
+ _current_parser = BinResource::get_instance();
+ }
+
+ /* Let's acquire the directory information from filepath */
+ std::string str = entry_filepath;
+ size_t found;
+ found = str.find_last_of("/\\");
+
+ std::string filepath = str.substr(0, found);
+ std::string filename = str.substr(found + 1);
+
+ //assert(_current_parser != NULL);
+ if (_current_parser != NULL) {
+ /* Assume the directory where the main entry file exists, is the default resource directory */
+ _current_parser->set_resource_directory(filepath.c_str());
+ _current_parser->init(filename.c_str());
#ifdef __SCL_TXT_DEBUG
- put_autopopup_configure(PARSER, *(_current_parser->get_autopopup_configure()));
- put_default_configure(PARSER, *(_current_parser->get_default_configure()));
- put_input_mode_configure_table(PARSER, _current_parser->get_input_mode_configure_table());
- put_key_coordinate_frame(PARSER, _current_parser->get_key_coordinate_pointer_frame());
- put_label_properties_frame(PARSER, _current_parser->get_label_properties_frame());
- put_layout_table(PARSER, _current_parser->get_layout_table());
- put_magnifier_wnd_configure(PARSER, *(_current_parser->get_magnifier_configure()));
- put_modifier_decoration(PARSER, _current_parser->get_modifier_decoration_table());
- //put_nine_patch_info(PARSER, _current_parser->get_nine_patch_file_list());
+ put_autopopup_configure(PARSER, *(_current_parser->get_autopopup_configure()));
+ put_default_configure(PARSER, *(_current_parser->get_default_configure()));
+ put_input_mode_configure_table(PARSER, _current_parser->get_input_mode_configure_table());
+ put_key_coordinate_frame(PARSER, _current_parser->get_key_coordinate_pointer_frame());
+ put_label_properties_frame(PARSER, _current_parser->get_label_properties_frame());
+ put_layout_table(PARSER, _current_parser->get_layout_table());
+ put_magnifier_wnd_configure(PARSER, *(_current_parser->get_magnifier_configure()));
+ put_modifier_decoration(PARSER, _current_parser->get_modifier_decoration_table());
+ //put_nine_patch_info(PARSER, _current_parser->get_nine_patch_file_list());
#endif
+ }
+ m_initialized = true;
}
}