int g_type;
static int last_pos_x = -1;
static int last_pos_y = -1;
+
if (!msg) {
LOGD("Incoming message is empty");
return;
}
CSCLController *controller = CSCLController::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
+
if (!windows || !controller) return;
+
sclwindow base_window = windows->get_base_window();
SclWindowContext *window_context = windows->get_window_context(base_window);
- if (window_context && window_context->hidden) return;
- LOGD("window_context->geometry.x=%d y=%d w=%d h=%d",window_context->geometry.x, window_context->geometry.y, window_context->geometry.width, window_context->geometry.height);
+
+ if (!window_context) return;
+ if (window_context->hidden) return;
+
+ LOGD("window_context->geometry.x=%d y=%d w=%d h=%d",
+ window_context->geometry.x, window_context->geometry.y,
+ window_context->geometry.width, window_context->geometry.height);
+
Gesture_Info *info = (Gesture_Info *)calloc(sizeof(Gesture_Info), 1);
if (!eldbus_message_arguments_get(msg, "iiiiiiu", &g_type, &info->x_beg,
&info->y_beg, &info->x_end, &info->y_end,
free(info);
return;
}
+
info->type = (Gesture)g_type;
LOGD("Incoming gesture name is %d : %d %d %d %d %d", info->type,
info->x_beg, info->y_beg, info->x_end, info->y_end, info->state);
+
if (info->type == ONE_FINGER_HOVER || info->type == ONE_FINGER_SINGLE_TAP) {
if (info->y_beg >= window_context->geometry.y) {
last_pos_x = info->x_beg;
LOGD("hover last_pos_x=%d last_pos_y=%d", last_pos_x, last_pos_y);
controller->mouse_over(base_window, last_pos_x, last_pos_y);
}
- }
- else if (info->type == ONE_FINGER_DOUBLE_TAP) {
+ } else if (info->type == ONE_FINGER_DOUBLE_TAP) {
if (info->y_beg >= window_context->geometry.y) {
last_pos_x = info->x_beg;
last_pos_y = info->y_beg - window_context->geometry.y;
sclshort base_layout = context->get_base_layout();
sclshort popup_layout = context->get_popup_layout(popup_window);
- SclLayoutKeyCoordinatePointer base_key =
- sclres_layout_key_coordinate_pointer_frame[base_layout][base_candidate.candidate];
- SclLayoutKeyCoordinatePointer popup_key =
- sclres_layout_key_coordinate_pointer_frame[popup_layout][popup_candidate.candidate];
-
- SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
- SclWindowContext *popup_window_context = windows->get_window_context(popup_window);
+ SclLayoutKeyCoordinatePointer base_key = NULL;
+ SclLayoutKeyCoordinatePointer popup_key = NULL;
+ SclWindowContext *base_window_context = NULL;
+ SclWindowContext *popup_window_context = NULL;
+
+ if (scl_check_arrindex(base_layout, MAX_SCL_LAYOUT) && scl_check_arrindex(popup_layout, MAX_SCL_LAYOUT)) {
+ base_key = sclres_layout_key_coordinate_pointer_frame[base_layout][base_candidate.candidate];
+ popup_key = sclres_layout_key_coordinate_pointer_frame[popup_layout][popup_candidate.candidate];
+ base_window_context = windows->get_window_context(windows->get_base_window());
+ popup_window_context = windows->get_window_context(popup_window);
+ }
SclRectangle base_key_coordinate = {0, 0, 0, 0};
if (base_window_context) {
sclint loop;
CSCLContext *context = CSCLContext::get_instance();
+ if (!context) return;
+
/* resets the current properties to predefined properties */
sclshort layout = context->get_base_layout();
CSCLContext *context = CSCLContext::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
+
+ if (!context || !cache || !sclres_manager) return FALSE;
+
const SclLayout* layout = cache->get_cur_layout(window);
const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclModifierDecoration sclres_modifier_decoration = sclres_manager->get_modifier_decoration_table();
assert(sclres_modifier_decoration != NULL);
SCL_DEBUG();
CSCLWindowsImpl* impl = get_scl_windows_impl();
+ CSCLUtils *utils = CSCLUtils::get_instance();
- if (impl) {
+ if (impl && utils) {
if (window == NULL) {
impl->set_window_rotation(m_base_window_context.window, rotation);
if (SCLWINDOW_INVALID != m_magnifier_window_context.window) {
- CSCLUtils *utils = CSCLUtils::get_instance();
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclMagnifierWndConfigure magnifier_configure = NULL;
for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
- cur_rec->label[shift_loop][label_for_one_state] = (sclchar*)key;
- if (auto_upper) {
- if (xmlStrlen(key) == 1 && shift_loop != SCL_SHIFT_STATE_OFF) {
- /* Let's manipulate the string for auto_upper */
- *key = toupper(*(cur_rec->label[SCL_SHIFT_STATE_OFF][label_for_one_state]));
+ if (key) {
+ cur_rec->label[shift_loop][label_for_one_state] = (sclchar*)key;
+ if (auto_upper) {
+ if (xmlStrlen(key) == 1 && shift_loop != SCL_SHIFT_STATE_OFF) {
+ /* Let's manipulate the string for auto_upper */
+ *key = toupper(*(cur_rec->label[SCL_SHIFT_STATE_OFF][label_for_one_state]));
+ }
}
- }
- /* If current key_value is NULL, let's just consider this label is the default key_value */
- if (label_for_one_state == 0) {
- if (cur_rec->key_value[shift_loop][label_for_one_state] == NULL) {
- cur_rec->key_value[shift_loop][label_for_one_state] = (sclchar*)key;
+ /* If current key_value is NULL, let's just consider this label is the default key_value */
+ if (label_for_one_state == 0) {
+ if (cur_rec->key_value[shift_loop][label_for_one_state] == NULL) {
+ cur_rec->key_value[shift_loop][label_for_one_state] = (sclchar*)key;
+ }
}
+ add_key_string(key);
}
- add_key_string(key);
}
}
}
for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
- cur_rec->magnifier_label[shift_loop][label_for_one_state] = (sclchar*)key;
- add_key_string(key);
+ if (key) {
+ cur_rec->magnifier_label[shift_loop][label_for_one_state] = (sclchar*)key;
+ add_key_string(key);
+ }
}
}
}
for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
- cur_rec->hint_string[shift_loop][multichar_state] = (sclchar*)key;
- add_key_string(key);
+ if (key) {
+ cur_rec->hint_string[shift_loop][multichar_state] = (sclchar*)key;
+ add_key_string(key);
+ }
}
}
}
if ((shift_state == shift_loop || shift_state == -1) &&
(button_state == button_loop || button_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
- cur_rec->image_label_path[shift_loop][button_loop] = (sclchar*)key;
- add_key_string(key);
+ if (key) {
+ cur_rec->image_label_path[shift_loop][button_loop] = (sclchar*)key;
+ add_key_string(key);
+ }
}
}
}
if ((shift_state == shift_loop || shift_state == -1) &&
(button_state == button_loop || button_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
- cur_rec->bg_image_path[shift_loop][button_loop] = (sclchar*)key;
- add_key_string(key);
+ if (key) {
+ cur_rec->bg_image_path[shift_loop][button_loop] = (sclchar*)key;
+ add_key_string(key);
+ }
}
}
}