memset((*pCurButtonContext), 0x00, sizeof(SclButtonContext) * MAX_KEY);
- for (loop = 0;loop < (num_columns * num_rows) && loop < MAX_KEY && loop < MAX_SIZE_OF_AUTOPOPUP_STRING;loop++) {
+ int button_index = 0;
+
+ if (autopopup_configure->line_image_path &&
+ strlen(autopopup_configure->line_image_path) > 0) {
+ for (loop = 0;loop < num_columns - 1;loop++) {
+ if (button_index < MAX_KEY) {
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+
+ (*pCurLayoutKeyCoordinates)[button_index].x =
+ autopopup_configure->bg_padding * utils->get_smallest_custom_scale_rate() +
+ (autopopup_configure->button_width * utils->get_custom_scale_rate_x() * (loop + 1)) +
+ (autopopup_configure->button_spacing * utils->get_smallest_custom_scale_rate() * loop);
+ (*pCurLayoutKeyCoordinates)[button_index].y = pCurLayout->bg_line_width;
+ (*pCurLayoutKeyCoordinates)[button_index].width =
+ autopopup_configure->button_spacing * utils->get_smallest_custom_scale_rate();
+ (*pCurLayoutKeyCoordinates)[button_index].height = height - (pCurLayout->bg_line_width * 2);
+
+ (*pCurButtonContext)[button_index].used = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].button_type = BUTTON_TYPE_UIITEM;
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[0][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[0][1] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[1][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[1][1] =
+ autopopup_configure->line_image_path;
+ button_index++;
+ }
+ }
+
+ for (loop = 0;loop < num_rows - 1;loop++) {
+ if (button_index < MAX_KEY) {
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+
+ (*pCurLayoutKeyCoordinates)[button_index].x = pCurLayout->bg_line_width;
+ (*pCurLayoutKeyCoordinates)[button_index].y =
+ autopopup_configure->bg_padding * utils->get_smallest_custom_scale_rate() +
+ (autopopup_configure->button_height * utils->get_custom_scale_rate_y() * (loop + 1)) +
+ (autopopup_configure->button_spacing * utils->get_smallest_custom_scale_rate() * loop);
+ (*pCurLayoutKeyCoordinates)[button_index].width = width - (pCurLayout->bg_line_width * 2);
+ (*pCurLayoutKeyCoordinates)[button_index].height =
+ autopopup_configure->button_spacing * utils->get_smallest_custom_scale_rate();
+
+ (*pCurButtonContext)[button_index].used = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].button_type = BUTTON_TYPE_UIITEM;
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[0][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[0][1] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[1][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[1][1] =
+ autopopup_configure->line_image_path;
+ button_index++;
+ }
+ }
+ }
+
+ for (loop = 0;loop < (num_columns * num_rows) && button_index < MAX_KEY && loop < MAX_SIZE_OF_AUTOPOPUP_STRING;loop++) {
column = (loop % num_columns);
row = loop / num_columns;
x = autopopup_configure->bg_padding * utils->get_smallest_custom_scale_rate() +
(autopopup_configure->button_height * utils->get_custom_scale_rate_y() * (num_rows - row - 1)) +
(autopopup_configure->button_spacing * utils->get_smallest_custom_scale_rate() * row);
- (*pCurLayoutKeyCoordinates)[loop].valid = TRUE;
- (*pCurLayoutKeyCoordinates)[loop].x = x +
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].x = x +
autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop].y = y +
+ (*pCurLayoutKeyCoordinates)[button_index].y = y +
autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop].width =
+ (*pCurLayoutKeyCoordinates)[button_index].width =
autopopup_configure->button_width * utils->get_custom_scale_rate_x();
- (*pCurLayoutKeyCoordinates)[loop].height =
+ (*pCurLayoutKeyCoordinates)[button_index].height =
autopopup_configure->button_height * utils->get_custom_scale_rate_y();
- (*pCurLayoutKeyCoordinates)[loop].popup_relative_x = 0;
- (*pCurLayoutKeyCoordinates)[loop].popup_relative_y = 0;
- (*pCurLayoutKeyCoordinates)[loop].extract_offset_x = 0;
- (*pCurLayoutKeyCoordinates)[loop].extract_offset_y = 0;
- (*pCurLayoutKeyCoordinates)[loop].sub_layout = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].popup_relative_x = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].popup_relative_y = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].extract_offset_x = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].extract_offset_y = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].sub_layout = NULL;
- (*pCurLayoutKeyCoordinates)[loop].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
if (loop < num_keys) {
- (*pCurLayoutKeyCoordinates)[loop].button_type = BUTTON_TYPE_NORMAL;
+ (*pCurLayoutKeyCoordinates)[button_index].button_type = BUTTON_TYPE_NORMAL;
} else {
- (*pCurLayoutKeyCoordinates)[loop].button_type = BUTTON_TYPE_UIITEM;
+ (*pCurLayoutKeyCoordinates)[button_index].button_type = BUTTON_TYPE_UIITEM;
}
- (*pCurLayoutKeyCoordinates)[loop].key_type = KEY_TYPE_STRING;
- (*pCurLayoutKeyCoordinates)[loop].popup_type = POPUP_TYPE_NONE;
- (*pCurLayoutKeyCoordinates)[loop].use_magnifier = FALSE;
- (*pCurLayoutKeyCoordinates)[loop].use_long_key_magnifier = TRUE;
- memset((*pCurLayoutKeyCoordinates)[loop].popup_input_mode, NOT_USED, sizeof((*pCurLayoutKeyCoordinates)[loop].popup_input_mode));
-
- (*pCurLayoutKeyCoordinates)[loop].valid = TRUE;
- (*pCurLayoutKeyCoordinates)[loop].label_count = 1;
+ (*pCurLayoutKeyCoordinates)[button_index].key_type = KEY_TYPE_STRING;
+ (*pCurLayoutKeyCoordinates)[button_index].popup_type = POPUP_TYPE_NONE;
+ (*pCurLayoutKeyCoordinates)[button_index].use_magnifier = FALSE;
+ (*pCurLayoutKeyCoordinates)[button_index].use_long_key_magnifier = TRUE;
+ memset((*pCurLayoutKeyCoordinates)[button_index].popup_input_mode, NOT_USED, sizeof((*pCurLayoutKeyCoordinates)[loop].popup_input_mode));
+
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].label_count = 1;
if (context->get_caps_lock_mode()) {
- (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_OFF][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].label[SCL_SHIFT_STATE_OFF][0] =
coordinate->autopopup_key_labels[SCL_SHIFT_STATE_ON][loop];
- (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_ON][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].label[SCL_SHIFT_STATE_ON][0] =
coordinate->autopopup_key_labels[SCL_SHIFT_STATE_OFF][loop];
- (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_LOCK][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].label[SCL_SHIFT_STATE_LOCK][0] =
coordinate->autopopup_key_labels[SCL_SHIFT_STATE_OFF][loop];
} else {
- (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_OFF][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].label[SCL_SHIFT_STATE_OFF][0] =
coordinate->autopopup_key_labels[SCL_SHIFT_STATE_OFF][loop];
- (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_ON][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].label[SCL_SHIFT_STATE_ON][0] =
coordinate->autopopup_key_labels[SCL_SHIFT_STATE_ON][loop];
- (*pCurLayoutKeyCoordinates)[loop].label[SCL_SHIFT_STATE_LOCK][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].label[SCL_SHIFT_STATE_LOCK][0] =
coordinate->autopopup_key_labels[SCL_SHIFT_STATE_LOCK][loop];
}
//(*pCurLayoutKeyProperties)[loop].labelPropId = SCL_LABEL_PROPERTY_AUTOPOPUP;
- (*pCurLayoutKeyCoordinates)[loop].label_type = autopopup_configure->label_type;
- memset((*pCurLayoutKeyCoordinates)[loop].image_label_path, 0x00, sizeof((*pCurLayoutKeyCoordinates)[loop].image_label_path));
- memset((*pCurLayoutKeyCoordinates)[loop].bg_image_path, 0x00, sizeof((*pCurLayoutKeyCoordinates)[loop].bg_image_path));
+ (*pCurLayoutKeyCoordinates)[button_index].label_type = autopopup_configure->label_type;
+ memset((*pCurLayoutKeyCoordinates)[button_index].image_label_path, 0x00, sizeof((*pCurLayoutKeyCoordinates)[loop].image_label_path));
+ memset((*pCurLayoutKeyCoordinates)[button_index].bg_image_path, 0x00, sizeof((*pCurLayoutKeyCoordinates)[loop].bg_image_path));
for (int innerLoop = 0;innerLoop < SCL_BUTTON_STATE_MAX;innerLoop++) {
- (*pCurLayoutKeyCoordinates)[loop].bg_image_path[SCL_SHIFT_STATE_OFF][innerLoop] =
- (*pCurLayoutKeyCoordinates)[loop].bg_image_path[SCL_SHIFT_STATE_ON][innerLoop] =
- (*pCurLayoutKeyCoordinates)[loop].bg_image_path[SCL_SHIFT_STATE_LOCK][innerLoop] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[SCL_SHIFT_STATE_OFF][innerLoop] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[SCL_SHIFT_STATE_ON][innerLoop] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[SCL_SHIFT_STATE_LOCK][innerLoop] =
autopopup_configure->button_image_path[innerLoop];
}
- (*pCurLayoutKeyCoordinates)[loop].key_value_count = 1;
+ (*pCurLayoutKeyCoordinates)[button_index].key_value_count = 1;
if (coordinate->autopopup_key_values[0][loop] == NULL) {
- (*pCurLayoutKeyCoordinates)[loop].key_value[0][0] = coordinate->autopopup_key_labels[0][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_value[0][0] = coordinate->autopopup_key_labels[0][loop];
} else {
- (*pCurLayoutKeyCoordinates)[loop].key_value[0][0] = coordinate->autopopup_key_values[0][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_value[0][0] = coordinate->autopopup_key_values[0][loop];
}
if (coordinate->autopopup_key_values[1][loop] == NULL) {
- (*pCurLayoutKeyCoordinates)[loop].key_value[1][0] = coordinate->autopopup_key_labels[1][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_value[1][0] = coordinate->autopopup_key_labels[1][loop];
} else {
- (*pCurLayoutKeyCoordinates)[loop].key_value[1][0] = coordinate->autopopup_key_values[1][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_value[1][0] = coordinate->autopopup_key_values[1][loop];
}
if (coordinate->autopopup_key_values[2][loop] == NULL) {
- (*pCurLayoutKeyCoordinates)[loop].key_value[2][0] = coordinate->autopopup_key_labels[2][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_value[2][0] = coordinate->autopopup_key_labels[2][loop];
} else {
- (*pCurLayoutKeyCoordinates)[loop].key_value[2][0] = coordinate->autopopup_key_values[2][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_value[2][0] = coordinate->autopopup_key_values[2][loop];
}
- (*pCurLayoutKeyCoordinates)[loop].key_event[0][0] = coordinate->autopopup_key_events[0][loop];
- (*pCurLayoutKeyCoordinates)[loop].key_event[1][0] = coordinate->autopopup_key_events[1][loop];
- (*pCurLayoutKeyCoordinates)[loop].key_event[2][0] = coordinate->autopopup_key_events[2][loop];
- (*pCurLayoutKeyCoordinates)[loop].long_key_type = KEY_TYPE_NONE;
- (*pCurLayoutKeyCoordinates)[loop].long_key_value = NULL;
- (*pCurLayoutKeyCoordinates)[loop].long_key_event = 0;
-
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_labels[0][0] = NULL;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_labels[1][0] = NULL;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_labels[2][0] = NULL;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_events[0][0] = 0;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_events[1][0] = 0;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_events[2][0] = 0;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_values[0][0] = NULL;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_values[1][0] = NULL;
- (*pCurLayoutKeyCoordinates)[loop].autopopup_key_values[2][0] = NULL;
- (*pCurLayoutKeyCoordinates)[loop].extra_option = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].key_event[0][0] = coordinate->autopopup_key_events[0][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_event[1][0] = coordinate->autopopup_key_events[1][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].key_event[2][0] = coordinate->autopopup_key_events[2][loop];
+ (*pCurLayoutKeyCoordinates)[button_index].long_key_type = KEY_TYPE_NONE;
+ (*pCurLayoutKeyCoordinates)[button_index].long_key_value = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].long_key_event = 0;
+
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_labels[0][0] = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_labels[1][0] = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_labels[2][0] = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_events[0][0] = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_events[1][0] = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_events[2][0] = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_values[0][0] = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_values[1][0] = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].autopopup_key_values[2][0] = NULL;
+ (*pCurLayoutKeyCoordinates)[button_index].extra_option = 0;
/* If the keyvalue is in between the SCL_ISCHAR range, consider this to be a KEY_TYPE_CHAR */
- if ((*pCurLayoutKeyCoordinates)[loop].key_value[0][0]) {
- if (strlen((*pCurLayoutKeyCoordinates)[loop].key_value[0][0]) == 1) {
- if (SCL_ISCHAR(*(*pCurLayoutKeyCoordinates)[loop].key_value[0][0])) {
- (*pCurLayoutKeyCoordinates)[loop].key_type = KEY_TYPE_CHAR;
+ if ((*pCurLayoutKeyCoordinates)[button_index].key_value[0][0]) {
+ if (strlen((*pCurLayoutKeyCoordinates)[button_index].key_value[0][0]) == 1) {
+ if (SCL_ISCHAR(*(*pCurLayoutKeyCoordinates)[button_index].key_value[0][0])) {
+ (*pCurLayoutKeyCoordinates)[button_index].key_type = KEY_TYPE_CHAR;
}
}
}
- (*pCurButtonContext)[loop].used = TRUE;
- }
- if (autopopup_configure->decoration_size > 0) {
- sclbyte decoidx;
- for (decoidx = 0;decoidx < MAX_WND_DECORATOR;decoidx++) {
- if (loop + decoidx < MAX_KEY) {
- (*pCurLayoutKeyCoordinates)[loop + decoidx].valid = TRUE;
- switch (decoidx) {
- case WND_DECORATOR_TOP_LEFT:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x = 0;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y = 0;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
+ (*pCurButtonContext)[button_index].used = TRUE;
+ button_index++;
+ }
+
+ for (loop = 0;loop < MAX_WND_DECORATOR;loop++) {
+ if (button_index < MAX_KEY &&
+ autopopup_configure->decoration_image_path[loop] &&
+ strlen(autopopup_configure->decoration_image_path[loop]) > 0) {
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ int decoration_size = autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
+ switch (loop) {
+ case WND_DECORATOR_TOP_LEFT:
+ (*pCurLayoutKeyCoordinates)[button_index].x = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].y = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].width = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].height = decoration_size;
+ break;
+ case WND_DECORATOR_TOP_CENTER:
+ (*pCurLayoutKeyCoordinates)[button_index].x = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].y = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].width = width - (2 * decoration_size);
+ (*pCurLayoutKeyCoordinates)[button_index].height = decoration_size;
+ break;
+ case WND_DECORATOR_TOP_RIGHT:
+ (*pCurLayoutKeyCoordinates)[button_index].x = width - decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].y = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].width = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].height = decoration_size;
+ break;
+ case WND_DECORATOR_MIDDLE_LEFT:
+ (*pCurLayoutKeyCoordinates)[button_index].x = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].y = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].width = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].height = height - (2 * decoration_size);
+ break;
+ case WND_DECORATOR_MIDDLE_CENTER:
+ (*pCurLayoutKeyCoordinates)[button_index].x = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].y = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].width = width;
+ (*pCurLayoutKeyCoordinates)[button_index].height = height;
+ break;
+ case WND_DECORATOR_MIDDLE_RIGHT:
+ (*pCurLayoutKeyCoordinates)[button_index].x = width - decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].y = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].width = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].height = height - (2 * decoration_size);
+ break;
+ case WND_DECORATOR_BOTTOM_LEFT:
+ (*pCurLayoutKeyCoordinates)[button_index].x = 0;
+ (*pCurLayoutKeyCoordinates)[button_index].y = height - decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].width = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].height = decoration_size;
+ break;
+ case WND_DECORATOR_BOTTOM_CENTER:
+ (*pCurLayoutKeyCoordinates)[button_index].x = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].y = height - decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].width = width - (2 * decoration_size);
+ (*pCurLayoutKeyCoordinates)[button_index].height = decoration_size;
+ break;
+ case WND_DECORATOR_BOTTOM_RIGHT:
+ (*pCurLayoutKeyCoordinates)[button_index].x = width - decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].y = height - decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].width = decoration_size;
+ (*pCurLayoutKeyCoordinates)[button_index].height = decoration_size;
+ break;
+ default:
break;
- case WND_DECORATOR_TOP_CENTER:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y = 0;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width = width -
- (2 * autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate());
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- break;
- case WND_DECORATOR_TOP_RIGHT:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x =
- width - autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y = 0;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- break;
- case WND_DECORATOR_MIDDLE_LEFT:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x = 0;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height = height -
- (2 * autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate());
- break;
- case WND_DECORATOR_MIDDLE_RIGHT:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x =
- width - autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height = height -
- (2 * autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate());
- break;
- case WND_DECORATOR_BOTTOM_LEFT:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x = 0;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y =
- height - autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- break;
- case WND_DECORATOR_BOTTOM_CENTER:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y =
- height - autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width = width -
- (2 * autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate());
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- break;
- case WND_DECORATOR_BOTTOM_RIGHT:
- (*pCurLayoutKeyCoordinates)[loop + decoidx].x =
- width - autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].y =
- height - autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].width =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- (*pCurLayoutKeyCoordinates)[loop + decoidx].height =
- autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
- break;
- default:
- break;
- }
-
- (*pCurButtonContext)[loop + decoidx].used = TRUE;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].valid = TRUE;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].button_type = BUTTON_TYPE_UIITEM;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].valid = TRUE;
- (*pCurLayoutKeyCoordinates)[loop + decoidx].bg_image_path[0][0] =
- (*pCurLayoutKeyCoordinates)[loop + decoidx].bg_image_path[0][1] =
- (*pCurLayoutKeyCoordinates)[loop + decoidx].bg_image_path[1][0] =
- (*pCurLayoutKeyCoordinates)[loop + decoidx].bg_image_path[1][1] =
- autopopup_configure->decoration_image_path[decoidx];
}
+
+ (*pCurButtonContext)[button_index].used = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].button_type = BUTTON_TYPE_UIITEM;
+ (*pCurLayoutKeyCoordinates)[button_index].valid = TRUE;
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[0][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[0][1] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[1][0] =
+ (*pCurLayoutKeyCoordinates)[button_index].bg_image_path[1][1] =
+ autopopup_configure->decoration_image_path[loop];
}
+ button_index++;
}
}
}
xmlFree(m_autopopup_configure.bg_image_path);
m_autopopup_configure.bg_image_path = NULL;
}
+
+ if (m_autopopup_configure.line_image_path) {
+ xmlFree(m_autopopup_configure.line_image_path);
+ m_autopopup_configure.line_image_path = NULL;
+ }
}
int parsing_autopopup_configure(const char* input_file) {
parsing_button_size(cur_node);
} else if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)"button_spacing")) {
m_autopopup_configure.button_spacing = get_content_int(cur_node);
+ } else if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)"line_image_path")) {
+ xmlChar* temp = xmlNodeGetContent(cur_node);
+ m_autopopup_configure.line_image_path = (sclchar *)temp;
} else if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)"label_type")) {
xmlChar* temp = xmlNodeGetContent(cur_node);
m_autopopup_configure.label_type = (sclchar *)temp;
child_node = child_node->next;
}
}
+
void parsing_button_size(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
while (child_node != NULL) {
if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"image")) {
- if (equal_prop(cur_node, "direction", "top_left")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_TOP_LEFT] = (sclchar *)xmlNodeGetContent(cur_node);;
- } else if (equal_prop(cur_node, "direction", "top_center")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_TOP_CENTER] = (sclchar *)xmlNodeGetContent(cur_node);;
- } else if (equal_prop(cur_node, "direction", "top_right")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_TOP_RIGHT] = (sclchar *)xmlNodeGetContent(cur_node);;
- } else if (equal_prop(cur_node, "direction", "middle_left")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_MIDDLE_LEFT] = (sclchar *)xmlNodeGetContent(cur_node);;
- } else if (equal_prop(cur_node, "direction", "middle_right")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_MIDDLE_RIGHT] = (sclchar *)xmlNodeGetContent(cur_node);;
- } else if (equal_prop(cur_node, "direction", "bottom_left")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_BOTTOM_LEFT] = (sclchar *)xmlNodeGetContent(cur_node);;
- } else if (equal_prop(cur_node, "direction", "bottom_center")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_BOTTOM_CENTER] = (sclchar *)xmlNodeGetContent(cur_node);;
- } else if (equal_prop(cur_node, "direction", "bottom_right")) {
- m_autopopup_configure.decoration_image_path[WND_DECORATOR_BOTTOM_RIGHT] = (sclchar *)xmlNodeGetContent(cur_node);;
+ if (equal_prop(child_node, "direction", "top_left")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_TOP_LEFT] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "top_center")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_TOP_CENTER] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "top_right")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_TOP_RIGHT] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "middle_left")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_MIDDLE_LEFT] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "middle_center")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_MIDDLE_CENTER] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "middle_right")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_MIDDLE_RIGHT] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "bottom_left")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_BOTTOM_LEFT] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "bottom_center")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_BOTTOM_CENTER] = (sclchar *)xmlNodeGetContent(child_node);
+ } else if (equal_prop(child_node, "direction", "bottom_right")) {
+ m_autopopup_configure.decoration_image_path[WND_DECORATOR_BOTTOM_RIGHT] = (sclchar *)xmlNodeGetContent(child_node);
}
}
child_node = child_node->next;