color.a = m_storage.get<sint_t>(width);
}
-void BinAutoPopupConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
- m_storage.set_str_provider(parser_info_provider);
+void BinAutoPopupConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+ m_storage.set_str_provider(provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_autopopup_configure();
}
}
for ( int i = ALLDATA; i < MAX_DATATYPE; ++i) {
- info[i].offset = offset_table[i];
- info[i].size = size_table[i];
+ m_info[i].offset = offset_table[i];
+ m_info[i].size = size_table[i];
}
- String_Bin_Parser stringBinParser(storageAllData, info[STRING].offset, info[STRING].size);
- Metadata_Bin_Parser metadataBinParser(storageAllData, info[METADATA].offset, info[METADATA].size);
+ String_Bin_Parser stringBinParser(storageAllData, m_info[STRING].offset, m_info[STRING].size);
+ Metadata_Bin_Parser metadataBinParser(storageAllData, m_info[METADATA].offset, m_info[METADATA].size);
String_Provider stringProvider(&stringBinParser);
Metadata_Provider metadataProvider(&metadataBinParser);
if (m_input_mode_configure_parser == NULL) {
m_input_mode_configure_parser = BinInputModeConfigParser::get_instance();
- m_input_mode_configure_parser->init(storageAllData, info[INPUT_MODE_CONFIGURE].offset, info[INPUT_MODE_CONFIGURE].size, &parser_info_provider);
+ m_input_mode_configure_parser->init(storageAllData, m_info[INPUT_MODE_CONFIGURE].offset, m_info[INPUT_MODE_CONFIGURE].size, &parser_info_provider);
}
if (m_default_configure_parser == NULL) {
m_default_configure_parser = BinDefaultConfigParser::get_instance();
- m_default_configure_parser->init(storageAllData, info[DEFAULT_CONFIGURE].offset, info[DEFAULT_CONFIGURE].size, &parser_info_provider);
+ m_default_configure_parser->init(storageAllData, m_info[DEFAULT_CONFIGURE].offset, m_info[DEFAULT_CONFIGURE].size, &parser_info_provider);
}
if (m_key_coordinate_frame_parser == NULL) {
m_key_coordinate_frame_parser = BinKeyCoordFrameParser::get_instance();
- m_key_coordinate_frame_parser->init(storageAllData, info[KEY_COORDINATE_FRAME].offset, info[KEY_COORDINATE_FRAME].size, &parser_info_provider);
+ m_key_coordinate_frame_parser->init(storageAllData, m_info[KEY_COORDINATE_FRAME].offset, m_info[KEY_COORDINATE_FRAME].size, &parser_info_provider);
}
if (m_layout_parser == NULL) {
m_layout_parser = BinLayoutParser::get_instance();
- m_layout_parser->init(storageAllData, info[LAYOUT].offset, info[LAYOUT].size, &parser_info_provider);
+ m_layout_parser->init(storageAllData, m_info[LAYOUT].offset, m_info[LAYOUT].size, &parser_info_provider);
}
if (m_modifier_decoration_parser == NULL) {
m_modifier_decoration_parser = BinModifierDecorationParser::get_instance();
- m_modifier_decoration_parser->init(storageAllData, info[MODIFIER_DECORATION].offset, info[MODIFIER_DECORATION].size, &parser_info_provider);
+ m_modifier_decoration_parser->init(storageAllData, m_info[MODIFIER_DECORATION].offset, m_info[MODIFIER_DECORATION].size, &parser_info_provider);
}
if (m_label_properties_parser == NULL) {
m_label_properties_parser = BinLabelPropertyParser::get_instance();
- m_label_properties_parser->init(storageAllData, info[LABEL_PROPERTIES_FRAME].offset, info[LABEL_PROPERTIES_FRAME].size, &parser_info_provider);
+ m_label_properties_parser->init(storageAllData, m_info[LABEL_PROPERTIES_FRAME].offset, m_info[LABEL_PROPERTIES_FRAME].size, &parser_info_provider);
}
if (m_autopopup_configure_parser == NULL) {
m_autopopup_configure_parser = BinAutoPopupConfigParser::get_instance();
- m_autopopup_configure_parser->init(storageAllData, info[AUTOPOPUP_CONFIGURE].offset, info[AUTOPOPUP_CONFIGURE].size, &parser_info_provider);
+ m_autopopup_configure_parser->init(storageAllData, m_info[AUTOPOPUP_CONFIGURE].offset, m_info[AUTOPOPUP_CONFIGURE].size, &parser_info_provider);
}
if (m_magnifier_configure_parser == NULL) {
m_magnifier_configure_parser = BinMagnifierConfigParser::get_instance();
- m_magnifier_configure_parser->init(storageAllData, info[MAGNIFIER_CONFIGURE].offset, info[MAGNIFIER_CONFIGURE].size, &parser_info_provider);
+ m_magnifier_configure_parser->init(storageAllData, m_info[MAGNIFIER_CONFIGURE].offset, m_info[MAGNIFIER_CONFIGURE].size, &parser_info_provider);
}
if (m_nine_patch_file_list_parser == NULL) {
m_nine_patch_file_list_parser = BinNinePatchFileParser::get_instance();
- m_nine_patch_file_list_parser->init(storageAllData, info[NINE_PATCH].offset, info[NINE_PATCH].size, &parser_info_provider);
+ m_nine_patch_file_list_parser->init(storageAllData, m_info[NINE_PATCH].offset, m_info[NINE_PATCH].size, &parser_info_provider);
}
SCLLOG_TIME_END("Parsing binary XML files");
return &instance;
}
-void BinDefaultConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
- m_storage.set_str_provider(parser_info_provider);
+void BinDefaultConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+ m_storage.set_str_provider(provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_default_configure();
}
void
}
int FileStorage::
-offset() const {
+get_offset() const {
return m_offset;
}
void FileStorage::
return m_size;
}
int FileStorage::
-size()const{
+get_size() const{
return m_size;
}
int FileStorage::
get_storage(const FileStorage& storage, int offset, int block_size) {
if (offset < 0 || block_size <= 0) return -1;
- if (storage.size() < offset + block_size) return -1;
+ if (storage.get_size() < offset + block_size) return -1;
if (m_storage != NULL) {
delete[] m_storage;
}
template <class T>
-void set_key_coordinate_record_width(T& md_helper,
+void set_key_coordinate_record_width(T *md_helper,
Key_coordinate_record_width & record_width) {
- md_helper.set_current_metadata_record("key_coordinate_record");
- memset(&record_width, 0x00, sizeof(Key_coordinate_record_width));
+ if (md_helper) {
+ md_helper->set_current_metadata_record("key_coordinate_record");
+ memset(&record_width, 0x00, sizeof(Key_coordinate_record_width));
- record_width.x = md_helper.get_width("x");
- record_width.y = md_helper.get_width("y");
- record_width.width = md_helper.get_width("width");
- record_width.height = md_helper.get_width("height");
- record_width.add_hit_left = md_helper.get_width("add_hit_left");
- record_width.add_hit_right = md_helper.get_width("add_hit_right");
- record_width.add_hit_top = md_helper.get_width("add_hit_top");
- record_width.add_hit_bottom = md_helper.get_width("add_hit_bottom");
- record_width.popup_relative_x = md_helper.get_width("popup_relative_x");
- record_width.popup_relative_y = md_helper.get_width("popup_relative_y");
- record_width.extract_offset_x = md_helper.get_width("extract_offset_x");
- record_width.extract_offset_y = md_helper.get_width("extract_offset_y");
- record_width.sub_layout = md_helper.get_width("sub_layout");
- record_width.magnifier_offset_x = md_helper.get_width("magnifier_offset_x");
- record_width.magnifier_offset_y = md_helper.get_width("magnifier_offset_y");
- record_width.custom_id = md_helper.get_width("custom_id");
- record_width.button_type = md_helper.get_width("button_type");
- record_width.key_type = md_helper.get_width("key_type");
- record_width.popup_type = md_helper.get_width("popup_type");
- record_width.use_magnifier = md_helper.get_width("use_magnifier");
- record_width.use_long_key_magnifier = md_helper.get_width("use_long_key_magnifier");
- record_width.popup_input_mode = md_helper.get_width("popup_input_mode");
- record_width.sound_style = md_helper.get_width("sound_style");
- record_width.vibe_style = md_helper.get_width("vibe_style");
- record_width.is_side_button = md_helper.get_width("is_side_button");
- record_width.label_count = md_helper.get_width("label_count");
- record_width.label = md_helper.get_width("label");
- record_width.label_type = md_helper.get_width("label_type");
- record_width.image_label_path = md_helper.get_width("image_label_path");
- record_width.image_label_type = md_helper.get_width("image_label_type");
- record_width.bg_image_path = md_helper.get_width("bg_image_path");
- record_width.key_value_count = md_helper.get_width("key_value_count");
- record_width.key_value = md_helper.get_width("key_value");
- record_width.key_event = md_helper.get_width("key_event");
- record_width.long_key_type = md_helper.get_width("long_key_type");
- record_width.long_key_value = md_helper.get_width("long_key_value");
- record_width.long_key_event = md_helper.get_width("long_key_event");
- record_width.use_repeat_key = md_helper.get_width("use_repeat_key");
- record_width.autopopup_key_labels = md_helper.get_width("autopopup_key_labels");
- record_width.autopopup_key_values = md_helper.get_width("autopopup_key_values");
- record_width.autopopup_key_events = md_helper.get_width("autopopup_key_events");
- record_width.dont_close_popup = md_helper.get_width("dont_close_popup");
- record_width.extra_option = md_helper.get_width("extra_option");
- record_width.multitouch_type = md_helper.get_width("multitouch_type");
- record_width.modifier_decorator = md_helper.get_width("modifier_decorator");
- record_width.magnifier_label = md_helper.get_width("magnifier_label");
- record_width.hint_string = md_helper.get_width("hint_string");
+ record_width.x = md_helper->get_width("x");
+ record_width.y = md_helper->get_width("y");
+ record_width.width = md_helper->get_width("width");
+ record_width.height = md_helper->get_width("height");
+ record_width.add_hit_left = md_helper->get_width("add_hit_left");
+ record_width.add_hit_right = md_helper->get_width("add_hit_right");
+ record_width.add_hit_top = md_helper->get_width("add_hit_top");
+ record_width.add_hit_bottom = md_helper->get_width("add_hit_bottom");
+ record_width.popup_relative_x = md_helper->get_width("popup_relative_x");
+ record_width.popup_relative_y = md_helper->get_width("popup_relative_y");
+ record_width.extract_offset_x = md_helper->get_width("extract_offset_x");
+ record_width.extract_offset_y = md_helper->get_width("extract_offset_y");
+ record_width.sub_layout = md_helper->get_width("sub_layout");
+ record_width.magnifier_offset_x = md_helper->get_width("magnifier_offset_x");
+ record_width.magnifier_offset_y = md_helper->get_width("magnifier_offset_y");
+ record_width.custom_id = md_helper->get_width("custom_id");
+ record_width.button_type = md_helper->get_width("button_type");
+ record_width.key_type = md_helper->get_width("key_type");
+ record_width.popup_type = md_helper->get_width("popup_type");
+ record_width.use_magnifier = md_helper->get_width("use_magnifier");
+ record_width.use_long_key_magnifier = md_helper->get_width("use_long_key_magnifier");
+ record_width.popup_input_mode = md_helper->get_width("popup_input_mode");
+ record_width.sound_style = md_helper->get_width("sound_style");
+ record_width.vibe_style = md_helper->get_width("vibe_style");
+ record_width.is_side_button = md_helper->get_width("is_side_button");
+ record_width.label_count = md_helper->get_width("label_count");
+ record_width.label = md_helper->get_width("label");
+ record_width.label_type = md_helper->get_width("label_type");
+ record_width.image_label_path = md_helper->get_width("image_label_path");
+ record_width.image_label_type = md_helper->get_width("image_label_type");
+ record_width.bg_image_path = md_helper->get_width("bg_image_path");
+ record_width.key_value_count = md_helper->get_width("key_value_count");
+ record_width.key_value = md_helper->get_width("key_value");
+ record_width.key_event = md_helper->get_width("key_event");
+ record_width.long_key_type = md_helper->get_width("long_key_type");
+ record_width.long_key_value = md_helper->get_width("long_key_value");
+ record_width.long_key_event = md_helper->get_width("long_key_event");
+ record_width.use_repeat_key = md_helper->get_width("use_repeat_key");
+ record_width.autopopup_key_labels = md_helper->get_width("autopopup_key_labels");
+ record_width.autopopup_key_values = md_helper->get_width("autopopup_key_values");
+ record_width.autopopup_key_events = md_helper->get_width("autopopup_key_events");
+ record_width.dont_close_popup = md_helper->get_width("dont_close_popup");
+ record_width.extra_option = md_helper->get_width("extra_option");
+ record_width.multitouch_type = md_helper->get_width("multitouch_type");
+ record_width.modifier_decorator = md_helper->get_width("modifier_decorator");
+ record_width.magnifier_label = md_helper->get_width("magnifier_label");
+ record_width.hint_string = md_helper->get_width("hint_string");
+ }
}
template <class T>
#include "magnifier_configure_bin_parser.h"
#include "nine_patch_file_list_bin_parser.h"
#include "sclres.h"
-struct info_t{
+struct resource_info_t{
int offset;
int size;
};
int get_modifier_decoration_id(const char *name);
bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info);
- const char* name() {
+ const char* get_name() {
return "binary_xmlparser";
}
void destroy();
- struct info_t info[MAX_DATATYPE];
+ struct resource_info_t m_info[MAX_DATATYPE];
private:
BinResource();
FileStorage(const IString_Provider* string_provider = NULL);
~FileStorage();
- int offset() const;
+ int get_offset() const;
void set_str_provider(const IString_Provider*);
template <typename T>
T get(int width);
int get_storage(const FileStorage&, int offset, int block_size);
void advance(int bytes);
- int size()const;
+ int get_size() const;
private:
/** brief unify get_xx method name
public:
~BinInputModeConfigParser();
static BinInputModeConfigParser *get_instance();
- void init(const FileStorage&, int, int, IParserInfo_Provider* parser_info_provider);
+ void init(const FileStorage&, int, int, IParserInfo_Provider* provider);
PSclInputModeConfigure get_input_mode_configure_table();
int get_inputmode_id(const char *name);
const char* get_inputmode_name(int id);
}
void
-BinInputModeConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
+BinInputModeConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
m_storage.set_str_provider(parser_info_provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_input_mode_configure_table();
}
FileStorage alldata;
alldata.loadFile(path);
- String_Bin_Parser stringBinParser(alldata, bin_xmlres->info[STRING].offset, bin_xmlres->info[STRING].size);
- Metadata_Bin_Parser metadataBinParser(alldata, bin_xmlres->info[METADATA].offset, bin_xmlres->info[METADATA].size);
+ String_Bin_Parser stringBinParser(alldata, bin_xmlres->m_info[STRING].offset, bin_xmlres->m_info[STRING].size);
+ Metadata_Bin_Parser metadataBinParser(alldata, bin_xmlres->m_info[METADATA].offset, bin_xmlres->m_info[METADATA].size);
String_Provider stringProvider(&stringBinParser);
Metadata_Provider metadataProvider(&metadataBinParser);
- ParserInfo_Provider parser_info_provider(&metadataProvider, &stringProvider);
- storage.set_str_provider(&parser_info_provider);
- this->parser_info_provider = &parser_info_provider;
+ ParserInfo_Provider provider(&metadataProvider, &stringProvider);
+ storage.set_str_provider(&provider);
+ this->parser_info_provider = &provider;
storage.get_storage(
alldata,
- bin_xmlres->info[KEY_COORDINATE_FRAME].offset,
- bin_xmlres->info[KEY_COORDINATE_FRAME].size);
+ bin_xmlres->m_info[KEY_COORDINATE_FRAME].offset,
+ bin_xmlres->m_info[KEY_COORDINATE_FRAME].size);
// 4 byte (range[0-4,294,967,295))
const int DATA_SIZE_BYTES = 4;
}
}
void
-BinKeyCoordFrameParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
+BinKeyCoordFrameParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
m_storage.set_str_provider(parser_info_provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
}
PSclLayoutKeyCoordinatePointerTable
static BinLabelPropertyParser instance;
return &instance;
}
-void BinLabelPropertyParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
+void BinLabelPropertyParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
m_storage.set_str_provider(parser_info_provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_label_properties_frame();
}
const int
return &instance;
}
void BinLayoutParser::
-init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
- m_storage.set_str_provider(parser_info_provider);
+init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+ m_storage.set_str_provider(provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_layout_table();
}
return &instance;
}
-void BinMagnifierConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
- m_storage.set_str_provider(parser_info_provider);
+void BinMagnifierConfigParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+ m_storage.set_str_provider(provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_magnifier_configure();
}
return &instance;
}
void
-BinModifierDecorationParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* parser_info_provider) {
- m_storage.set_str_provider(parser_info_provider);
+BinModifierDecorationParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+ m_storage.set_str_provider(provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_modifier_decoration_table();
}
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);
+void BinNinePatchFileParser::init(const FileStorage& storage, int offset, int size, IParserInfo_Provider* provider) {
+ m_storage.set_str_provider(provider);
m_storage.get_storage(storage, offset, size);
- this->parser_info_provider = parser_info_provider;
+ this->parser_info_provider = provider;
parsing_nine_patch_file_list();
}
utils->get_composed_path(composed_path, IMG_PATH_PREFIX, SCL_HIGHLIGHT_UI_IMAGE);
evas_object_image_file_set(m_highlight_ui_object_alternate, composed_path, NULL);
}
- SclWindowContext *winctx = windows->get_window_context(windows->get_base_window());
- if (winctx) {
+ SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context) {
if (rect.x < 0) {
evas_object_move(m_highlight_ui_object_alternate,
- winctx->geometry.width + rect.x, rect.y);
+ window_context->geometry.width + rect.x, rect.y);
evas_object_image_fill_set(m_highlight_ui_object_alternate,
0, 0, rect.width, rect.height);
evas_object_resize(m_highlight_ui_object_alternate,
evas_object_raise(m_highlight_ui_object_alternate);
evas_object_show(m_highlight_ui_object_alternate);
circular = TRUE;
- } else if (rect.x + rect.width > winctx->geometry.width) {
+ } else if (rect.x + rect.width > window_context->geometry.width) {
evas_object_move(m_highlight_ui_object_alternate,
- -(winctx->geometry.width - rect.x), rect.y);
+ -(window_context->geometry.width - rect.x), rect.y);
evas_object_image_fill_set(m_highlight_ui_object_alternate,
0, 0, rect.width, rect.height);
evas_object_resize(m_highlight_ui_object_alternate,
}
}
break;
+ default:
+ break;
}
}
}
\ No newline at end of file
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLContext *context = CSCLContext::get_instance();
if (windows && context && utils && rect) {
- SclWindowContext *winctx = windows->get_window_context(window);
+ SclWindowContext *window_context = windows->get_window_context(window);
sclint scr_w, scr_h;
/* get window size */
utils->get_screen_resolution(&scr_w, &scr_h);
- if (winctx) {
+ if (window_context) {
switch (context->get_rotation()) {
case ROTATION_90_CW:
{
- rect->height = winctx->geometry.width;
- rect->width = winctx->geometry.height;
- rect->y = scr_w - rect->height - winctx->geometry.x;
- rect->x = winctx->geometry.y;
+ rect->height = window_context->geometry.width;
+ rect->width = window_context->geometry.height;
+ rect->y = scr_w - rect->height - window_context->geometry.x;
+ rect->x = window_context->geometry.y;
}
break;
case ROTATION_180:
{
- rect->width = winctx->geometry.width;
- rect->height = winctx->geometry.height;
- rect->x = scr_w - winctx->geometry.x - rect->width;
- rect->y = scr_h - winctx->geometry.y - rect->height;
+ rect->width = window_context->geometry.width;
+ rect->height = window_context->geometry.height;
+ rect->x = scr_w - window_context->geometry.x - rect->width;
+ rect->y = scr_h - window_context->geometry.y - rect->height;
}
break;
case ROTATION_90_CCW:
{
- rect->height = winctx->geometry.width;
- rect->width = winctx->geometry.height;
- rect->y = winctx->geometry.x;
- rect->x= scr_h - winctx->geometry.y - rect->width;
+ rect->height = window_context->geometry.width;
+ rect->width = window_context->geometry.height;
+ rect->y = window_context->geometry.x;
+ rect->x= scr_h - window_context->geometry.y - rect->width;
}
break;
default:
{
- rect->x = winctx->geometry.x;
- rect->y = winctx->geometry.y;
- rect->width = winctx->geometry.width;
- rect->height = winctx->geometry.height;
+ rect->x = window_context->geometry.x;
+ rect->y = window_context->geometry.y;
+ rect->width = window_context->geometry.width;
+ rect->height = window_context->geometry.height;
}
break;
}
}
/** Here x and y contains "actual" x and y position relative to portrait root window,
- and winctx->width,height contains the window's orientation dependant width and height */
+ and window_context->width,height contains the window's orientation dependant width and height */
SclPoint get_rotated_local_coords(sclint x, sclint y, SCLRotation rotation, SclRectangle *rect) {
SclPoint ret = {0, 0};
} else {
do {
window = windows->get_nth_window_in_Z_order_list(index);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- if (winctx->is_virtual) {
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->is_virtual) {
is_scl_window = TRUE;
} else if (elm_win_xwindow_get(static_cast<Evas_Object*>(window)) == ev->window) {
is_scl_window = TRUE;
}
if (!is_scl_window) return TRUE;
- SclRectangle rect = {0};
+ SclRectangle rect = {0,0,0,0};
do {
window = windows->get_nth_window_in_Z_order_list(index);
if (window) {
// Update the position of the target window
//windows->get_window_context(window, TRUE);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- windows->get_window_rect(window, &(winctx->geometry));
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ windows->get_window_rect(window, &(window_context->geometry));
if (get_window_rect(window, &rect)) {
int adjustx = ev->root.x;
int adjusty = ev->root.y;
}
if (default_configure) {
SCLDisplayMode display_mode = context->get_display_mode();
- CSCLErrorAdjustment *adjustment = CSCLErrorAdjustment::get_instance();
- if (adjustment && scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
+ if (scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &adjustx, &adjusty);
}
}
sclwindow window = SCLWINDOW_INVALID;
SclRectangle rect;
sclboolean dimwinevent = FALSE;
- SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
- if (dimctx) {
- if (!(dimctx->is_virtual)) {
+ SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+ if (dim_window_context) {
+ if (!(dim_window_context->is_virtual)) {
if (elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_dim_window())) == ev->window) {
dimwinevent = TRUE;
}
do {
window = windows->get_nth_window_in_Z_order_list(index);
if (window) {
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- windows->get_window_rect(window, &(winctx->geometry));
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ windows->get_window_rect(window, &(window_context->geometry));
if (get_window_rect(window, &rect)) {
int adjustx = ev->root.x;
int adjusty = ev->root.y;
LOGD("=-=-=-=- ev->string(string) = %s \n",ev->string);
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
- SclButtonContext *prevbtncontext = NULL;
+ SclButtonContext *prev_button_context = NULL;
const SclLayoutKeyCoordinate *prevcoordinate = NULL;
- SclButtonContext *btncontext = NULL;
+ SclButtonContext *button_context = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
CSCLWindows *windows = CSCLWindows::get_instance();
} else if (strcmp(ev->keyname, "Down") == 0) {
key_index = focus_handler->get_next_key_index(NAVIGATE_DOWN);
} else if ((strcmp(ev->keyname, "Return") == 0)||(strcmp(ev->keyname, "Enter") == 0)) {
- btncontext = cache->get_cur_button_context(window, current_key_index);
+ button_context = cache->get_cur_button_context(window, current_key_index);
coordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
- btncontext->state = BUTTON_STATE_NORMAL;
+ button_context->state = BUTTON_STATE_NORMAL;
controller->mouse_press(window, coordinate->x, coordinate->y, TRUE);
controller->mouse_release(window, coordinate->x, coordinate->y, TRUE);
if (KEY_TYPE_MODECHANGE != coordinate->key_type) {
- btncontext->state = BUTTON_STATE_PRESSED;
+ button_context->state = BUTTON_STATE_PRESSED;
windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
} else {
focus_handler->init_key_index();
}
if (current_key_index != key_index) {
- btncontext = cache->get_cur_button_context(window, key_index);
- prevbtncontext = cache->get_cur_button_context(window, current_key_index);
+ button_context = cache->get_cur_button_context(window, key_index);
+ prev_button_context = cache->get_cur_button_context(window, current_key_index);
prevcoordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
- prevbtncontext->state = BUTTON_STATE_NORMAL;
- btncontext->state = BUTTON_STATE_PRESSED;
+ prev_button_context->state = BUTTON_STATE_NORMAL;
+ button_context->state = BUTTON_STATE_PRESSED;
sclshort x,y,width,height;
if (prevcoordinate->x < coordinate->x) {
x = prevcoordinate->x;
do {
window = windows->get_nth_window_in_Z_order_list(index);
if (window) {
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- windows->get_window_rect(window, &(winctx->geometry));
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ windows->get_window_rect(window, &(window_context->geometry));
if (get_window_rect(window, &rect)) {
int adjustx = ev->root.x;
int adjusty = ev->root.y;
CSCLEventsImplEfl::generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y)
{
CSCLWindows *windows = CSCLWindows::get_instance();
- SclWindowContext *winctx = NULL;
+ SclWindowContext *window_context = NULL;
static const sclint MAX_DEVICES = 100;
static sclboolean pressed[MAX_DEVICES] = { FALSE };
pressed[loop] = TRUE;
Ecore_Event_Mouse_Button evt;
evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
- //winctx = windows->get_window_context(windows->get_base_window(), FALSE);
- winctx = windows->get_window_context(windows->get_base_window());
- if (winctx) {
- evt.root.x = x + winctx->geometry.x;
- evt.root.y = y + winctx->geometry.y;
+ //window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+ window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context) {
+ evt.root.x = x + window_context->geometry.x;
+ evt.root.y = y + window_context->geometry.y;
evt.multi.device = loop;
mouse_press(NULL, 0, &evt);
}
pressed[loop] = FALSE;
Ecore_Event_Mouse_Button evt;
evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
- //winctx = windows->get_window_context(windows->get_base_window(), FALSE);
- winctx = windows->get_window_context(windows->get_base_window());
- if (winctx) {
- evt.root.x = x + winctx->geometry.x;
- evt.root.y = y + winctx->geometry.y;
+ //window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+ window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context) {
+ evt.root.x = x + window_context->geometry.x;
+ evt.root.y = y + window_context->geometry.y;
evt.multi.device = loop;
mouse_release(NULL, 0, &evt);
}
if (pressed[loop] == TRUE) {
Ecore_Event_Mouse_Move evt;
evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
- //winctx = windows->get_window_context(windows->get_base_window(), FALSE);
- winctx = windows->get_window_context(windows->get_base_window());
- if (winctx) {
- evt.root.x = x + winctx->geometry.x;
- evt.root.y = y + winctx->geometry.y;
+ //window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+ window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context) {
+ evt.root.x = x + window_context->geometry.x;
+ evt.root.y = y + window_context->geometry.y;
evt.multi.device = loop;
mouse_move(NULL, 0, &evt);
}
}
}
break;
+ default:
+ break;
}
}
}
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
- SclWindowContext *winctx = NULL;
- SclWindowContext *targetctx = NULL;
+ SclWindowContext *window_context = NULL;
+ SclWindowContext *target_window_context = NULL;
if (windows && window) {
- //winctx = windows->get_window_context(window, FALSE);
- winctx = windows->get_window_context(window);
- //targetctx = windows->get_window_context(draw_ctx, FALSE);
- targetctx = windows->get_window_context(draw_ctx);
+ //window_context = windows->get_window_context(window, FALSE);
+ window_context = windows->get_window_context(window);
+ //target_window_context = windows->get_window_context(draw_ctx, FALSE);
+ target_window_context = windows->get_window_context(draw_ctx);
}
- if (winctx && targetctx && image_path && utils && cache && windows) {
+ if (window_context && target_window_context && image_path && utils && cache && windows) {
sclboolean is_highlight_ui = FALSE;
sclchar buf[_POSIX_PATH_MAX] = {0};
utils->get_decomposed_path(buf, IMG_PATH_PREFIX, image_path);
EFLObject *clip_object = NULL;
Evas_Object *window_object = (Evas_Object*)window;
- if (winctx->is_virtual) {
+ if (window_context->is_virtual) {
window_object = static_cast<Evas_Object*>(windows->get_base_window());
}
if (is_highlight_ui) {
delete object;
} else {
- targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), object);
+ target_window_context->etc_info =
+ eina_list_append((Eina_List*)(target_window_context->etc_info), object);
if (clip_object) {
- targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), clip_object);
+ target_window_context->etc_info =
+ eina_list_append((Eina_List*)(target_window_context->etc_info), clip_object);
}
}
//SclRectangle rt;
//windows->get_window_rect(window, &rt);
//if (rt.width == dest_width && rt.height == dest_height) {
- if (winctx->geometry.width == dest_width && winctx->geometry.height == dest_height) {
+ if (window_context->geometry.width == dest_width &&
+ window_context->geometry.height == dest_height) {
//evas_object_lower(image_object);
evas_object_layer_set(image_object, window_layer + 0);
} else {
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
- SclWindowContext *winctx = NULL;
- SclWindowContext *targetctx = NULL;
+ SclWindowContext *window_context = NULL;
+ SclWindowContext *target_window_context = NULL;
if (windows && window) {
- //winctx = windows->get_window_context(window, FALSE);
- winctx = windows->get_window_context(window);
- //targetctx = windows->get_window_context(draw_ctx, FALSE);
- targetctx = windows->get_window_context(draw_ctx);
+ //window_context = windows->get_window_context(window, FALSE);
+ window_context = windows->get_window_context(window);
+ //target_window_context = windows->get_window_context(draw_ctx, FALSE);
+ target_window_context = windows->get_window_context(draw_ctx);
}
- if (winctx && targetctx && str && windows) {
+ if (window_context && target_window_context && str && windows) {
if (strlen(str) > 0) {
#ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
if (window == windows->get_magnifier_window()) {
if (object) {
object->extracted = FALSE;
Evas_Object *window_object = (Evas_Object*)window;
- if (winctx->is_virtual) {
+ if (window_context->is_virtual) {
window_object = static_cast<Evas_Object*>(windows->get_base_window());
}
Evas *evas = evas_object_evas_get(window_object);
object->position.y = pos_y;
object->position.width = width;
object->position.height = height;
- object->etc_info = (char*)str;
+ object->etc_info = str;
object->data = st;
sclint calwidth, calheight;
color.r, color.g, color.b, color.a, padding_x, padding_x);
evas_textblock_style_set(st, strStyle);
evas_object_textblock_style_set(text_object, st);
- char *markup = evas_textblock_text_utf8_to_markup(text_object, str);
+ markup = evas_textblock_text_utf8_to_markup(text_object, str);
if (markup) {
evas_object_textblock_text_markup_set(text_object, markup);
free(markup);
/*evas_object_event_callback_add((Evas_Object*)text_object, EVAS_CALLBACK_MOUSE_UP, mouse_release, window);
evas_object_event_callback_add((Evas_Object*)text_object, EVAS_CALLBACK_MOUSE_MOVE, mouse_move, window);*/
- targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), object);
+ target_window_context->etc_info =
+ eina_list_append((Eina_List*)(target_window_context->etc_info), object);
sclint window_layer = 29000;
if (!windows->is_base_window(reinterpret_cast<sclwindow>(draw_ctx))) {
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
- SclWindowContext *winctx = NULL;
- SclWindowContext *targetctx = NULL;
+ SclWindowContext *window_context = NULL;
+ SclWindowContext *target_window_context = NULL;
if (windows && window) {
- //winctx = windows->get_window_context(window, FALSE);
- winctx = windows->get_window_context(window);
- //targetctx = windows->get_window_context(draw_ctx, FALSE);
- targetctx = windows->get_window_context(draw_ctx);
+ //window_context = windows->get_window_context(window, FALSE);
+ window_context = windows->get_window_context(window);
+ //target_window_context = windows->get_window_context(draw_ctx, FALSE);
+ target_window_context = windows->get_window_context(draw_ctx);
}
- if (winctx && utils && cache && windows && targetctx) {
+ if (window_context && utils && cache && windows && target_window_context) {
EFLObject *object = new EFLObject;
if (object) {
Evas_Object *window_object = (Evas_Object*)window;
- if (winctx->is_virtual) {
+ if (window_context->is_virtual) {
window_object = static_cast<Evas_Object*>(windows->get_base_window());
- // //winctx = windows->get_window_context(windows->get_base_window());
+ // //window_context = windows->get_window_context(windows->get_base_window());
}
Evas *evas = evas_object_evas_get(window_object);
object->etc_info = NULL;
object->data = NULL;
- targetctx->etc_info = eina_list_append((Eina_List*)(targetctx->etc_info), object);
+ target_window_context->etc_info =
+ eina_list_append((Eina_List*)(target_window_context->etc_info), object);
sclint window_layer = 29000;
if (!windows->is_base_window(reinterpret_cast<sclwindow>(draw_ctx))) {
SCLLabelAlignment align, sclint padding_x, sclint padding_y, sclint inner_width, sclint inner_height);
void draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y,
- scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color, sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
+ scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color,
+ sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE);
void end_paint(const sclwindow window, scldrawctx draw_ctx);
SclSize get_image_size(sclchar* image_path);
CSCLWindows *windows = CSCLWindows::get_instance();
Evas_Object *window = (Evas_Object *)windows->get_base_window();
Ecore_X_Event_Window_Show *e = (Ecore_X_Event_Window_Show*)event;
- CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
if(e->win == elm_win_xwindow_get(window)) {
LOGD("INSIDE =-=-=-=- x_event_window_show_cb, Trying to Grab Key Board : \n");
#ifdef USING_KEY_GRAB
+ CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
focus_handler->grab_keyboard(windows->get_base_window());
#endif
}
* Create a content window and binds it into given parent window as a child
*/
sclwindow
-CSCLWindowsImplEfl::create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
sclwindow ret = SCLWINDOW_INVALID;
- if (winctx) {
- winctx->etc_info = NULL;
- winctx->window = parent;
+ if (window_context) {
+ window_context->etc_info = NULL;
+ window_context->window = parent;
//Adding window show event handler:mrunal.s
_candidate_show_handler = ecore_event_handler_add (ECORE_X_EVENT_WINDOW_SHOW, x_event_window_show_cb, NULL);
}
#endif
- ret = winctx->window;
+ ret = window_context->window;
}
CSCLUtils *utils = CSCLUtils::get_instance();
* Creates a window
*/
sclwindow
-CSCLWindowsImplEfl::create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
* Creates a window
*/
sclwindow
-CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_magnifier_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
sclint scrx, scry, winx, winy;
utils->get_screen_resolution(&scrx, &scry);
- SclWindowContext *winctx = windows->get_window_context(windows->get_base_window());
- evas_object_resize(win, scrx, height + winctx->height);
+ SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+ evas_object_resize(win, scrx, height + window_context->height);
#else
//evas_object_resize(win, width, height);
#endif
* Creates the dim window
*/
sclwindow
-CSCLWindowsImplEfl::create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplEfl::create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
- SclWindowContext *winctx = NULL;
+ SclWindowContext *window_context = NULL;
if (windows && window) {
- winctx = windows->get_window_context(window);
+ window_context = windows->get_window_context(window);
}
utils->log("WinEfl_destroywin %p %p (basewin %p mag %p)\n",
window,
- (winctx && !(winctx->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+ (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
windows->get_base_window(), windows->get_magnifier_window());
- if (windows && utils && winctx) {
- if (winctx->etc_info) {
- Eina_List *list = (Eina_List*)(winctx->etc_info);
+ if (windows && utils && window_context) {
+ if (window_context->etc_info) {
+ Eina_List *list = (Eina_List*)(window_context->etc_info);
Eina_List *iter = NULL;
Eina_List *iter_next = NULL;
void *data = NULL;
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);
+ void *image_data = evas_object_image_data_get(eo, 1);
+ if (image_data) {
+ free(image_data);
}
}
if (eo) {
}
list = eina_list_remove_list(list, iter);
}
- winctx->etc_info = NULL;
+ window_context->etc_info = NULL;
}
- if (!(winctx->is_virtual)) {
+ if (!(window_context->is_virtual)) {
/* FIXME : A workaround for the bug that event on a window being hidden is delivered to
e17, instead of the window itself or the window right below - Should report to WM */
if (window == windows->get_nth_popup_window(SCL_WINDOW_Z_TOP)) {
}
utils->log("WinEfl_destroywin %p %p (basewin %p mag %p)\n",
window,
- (winctx && !(winctx->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+ (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
windows->get_base_window(), windows->get_magnifier_window());
}
CSCLContext *context = CSCLContext::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
if (windows && context && window) {
- SclWindowContext *winctx = windows->get_window_context(window);
+ SclWindowContext *window_context = windows->get_window_context(window);
if (!(context->get_hidden_state())) {
- if (winctx) {
- if (!(winctx->is_virtual)) {
+ if (window_context) {
+ if (!(window_context->is_virtual)) {
evas_object_show((Evas_Object*)window);
}
#ifdef APPLY_WINDOW_MANAGER_CHANGE
*
* N_SE-52548: ...and modified if() for other popup windows as well...
*/
- if (winctx && !(winctx->is_virtual)) {
+ if (window_context && !(window_context->is_virtual)) {
ecore_x_icccm_transient_for_set
(elm_win_xwindow_get(static_cast<Evas_Object*>(window)), app_window);
elm_win_raise((Evas_Object *)window);
#endif
utils->log("WinEfl_showwin %p %p (basewin %p mag %p)\n",
window,
- (winctx && !(winctx->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+ (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
windows->get_base_window(), windows->get_magnifier_window());
}
}
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
- SclWindowContext *winctx = NULL;
+ SclWindowContext *window_context = NULL;
if (windows && window) {
#ifdef USING_KEY_GRAB
}
#endif
- winctx = windows->get_window_context(window);
- if (winctx) {
- if (!(winctx->is_virtual)) {
+ window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (!(window_context->is_virtual)) {
Evas_Object *win = (Evas_Object*)window;
#ifdef APPLY_WINDOW_MANAGER_CHANGE
if (windows->is_base_window(window)) {
// Memory optimization */
//if (window == windows->get_magnifier_window() || TRUE) {
if (window == windows->get_magnifier_window() || window == windows->get_dim_window()) {
- if (winctx) {
- if (winctx->etc_info) {
+ if (window_context) {
+ if (window_context->etc_info) {
- Eina_List *list = (Eina_List*)(winctx->etc_info);
+ Eina_List *list = (Eina_List*)(window_context->etc_info);
Eina_List *iter = NULL;
Eina_List *iter_next = NULL;
void *data = NULL;
if (bShouldRemove) {
Evas_Object* eo = object->object;
if (object->extracted) {
- void *data = evas_object_image_data_get(eo, 1);
- if (data) {
- free(data);
+ void *image_data = evas_object_image_data_get(eo, 1);
+ if (image_data) {
+ free(image_data);
}
}
if (eo) {
iIndex++;
}
}
- winctx->etc_info = list;
+ window_context->etc_info = list;
#endif
}
}
}
utils->log("WinEfl_hidewin %p %p (basewin %p mag %p)\n",
window,
- (winctx && !(winctx->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+ (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
windows->get_base_window(), windows->get_magnifier_window());
}
}
CSCLWindows *windows = CSCLWindows::get_instance();
if (utils && context && windows && window) {
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
unsigned short win_width = 0;
unsigned short win_height = 0;
- if (winctx) {
- win_width = winctx->geometry.width;
- win_height = winctx->geometry.height;
+ if (window_context) {
+ win_width = window_context->geometry.width;
+ win_height = window_context->geometry.height;
}
scl16 rotatex = x;
#ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
if (window == windows->get_magnifier_window()) {
- SclWindowContext *basewinctx = windows->get_window_context(windows->get_base_window(), FALSE);
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window(), FALSE);
rotatex = orgx = 0;
if (context->get_rotation_degree() == 90 || context->get_rotation_degree() == 270) {
- rotatey = orgy = scr_w - basewinctx->height - win_height;
- win_width = basewinctx->width;
- win_height = basewinctx->height + win_height;
+ rotatey = orgy = scr_w - base_window_context->height - win_height;
+ win_width = base_window_context->width;
+ win_height = base_window_context->height + win_height;
} else {
- rotatey = orgy = scr_h - basewinctx->height - win_height;
- win_width = basewinctx->width;
- win_height = basewinctx->height + win_height;
+ rotatey = orgy = scr_h - base_window_context->height - win_height;
+ win_width = base_window_context->width;
+ win_height = base_window_context->height + win_height;
}
magnifierx = x;
magnifiery = y - orgy;
#ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
if (window == windows->get_magnifier_window()) {
- if (rotatex == winctx->x && rotatey == winctx->y) return;
+ if (rotatex == window_context->x && rotatey == windonw_context->y) return;
}
#endif
utils->log("WinEfl_movewin %p %p %d %d %d %d (basewin %p mag %p)\n",
window,
- (winctx && !(winctx->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+ (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
x, y, rotatex, rotatey,
windows->get_base_window(), windows->get_magnifier_window());
}
#ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
if (window == windows->get_magnifier_window()) {
- SclWindowContext *winctx = windows->get_window_context(windows->get_base_window());
- if (winctx->width != width || winctx->height != height) {
+ SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context->width != width || window_context->height != height) {
CSCLUtils *utils = CSCLUtils::get_instance();
sclint scrx, scry, winx, winy;
utils->get_screen_resolution(&scrx, &scry);
if (context->get_rotation_degree() == 90 || context->get_rotation_degree() == 270) {
- evas_object_resize((Evas_Object*)window, scry, height + winctx->height);
+ evas_object_resize((Evas_Object*)window, scry, height + window_context->height);
} else {
- evas_object_resize((Evas_Object*)window, scrx, height + winctx->height);
+ evas_object_resize((Evas_Object*)window, scrx, height + window_context->height);
}
}
return;
Evas_Object *win = (Evas_Object*)window;
#ifndef FULL_SCREEN_TEST
if (windows && utils && window) {
- SclWindowContext *winctx = windows->get_window_context(window);
+ SclWindowContext *window_context = windows->get_window_context(window);
utils->log("WinEfl_resizewin %p %p %d %d (basewin %p mag %p)\n",
window,
- (winctx && !(winctx->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
+ (window_context && !(window_context->is_virtual)) ? elm_win_xwindow_get(static_cast<Evas_Object*>(window)) : 0x01,
windows->get_base_window(), windows->get_magnifier_window());
}
#endif
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
- SclWindowContext *winctx = NULL;
+ SclWindowContext *window_context = NULL;
if (windows && window) {
- //winctx = windows->get_window_context(window, FALSE);
- winctx = windows->get_window_context(window);
+ //window_context = windows->get_window_context(window, FALSE);
+ window_context = windows->get_window_context(window);
}
- if (windows && utils && winctx) {
- if (winctx->is_virtual) {
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- updatearea.x += (winctx->geometry.x - basectx->geometry.x);
- updatearea.y += (winctx->geometry.y - basectx->geometry.y);
+ if (windows && utils && window_context) {
+ if (window_context->is_virtual) {
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ updatearea.x += (window_context->geometry.x - base_window_context->geometry.x);
+ updatearea.y += (window_context->geometry.y - base_window_context->geometry.y);
}
}
- if (winctx->etc_info) {
+ if (window_context->etc_info) {
- Eina_List *list = (Eina_List*)(winctx->etc_info);
+ Eina_List *list = (Eina_List*)(window_context->etc_info);
Eina_List *iter = NULL;
Eina_List *iter_next = NULL;
void *data = NULL;
//if (object->type == EFLOBJECT_IMAGE) {
SCL_DEBUG_ELAPASED_TIME_START();
if (TRUE) {
- if (winctx->width != object->position.width || winctx->height != object->position.height ||
+ if (window_context->width != object->position.width || window_context->height != object->position.height ||
object->type == EFLOBJECT_TEXTBLOCK || window == windows->get_magnifier_window()) {
evas_object_hide(object->object);
}
} else {
#else
if (object->extracted) {
- void *data = evas_object_image_data_get(eo, 1);
- if (data) {
- free(data);
+ void *image_data = evas_object_image_data_get(eo, 1);
+ if (image_data) {
+ free(image_data);
}
}
if (eo) {
iIndex++;
}
}
- winctx->etc_info = list;
+ window_context->etc_info = list;
- /*while ((Eina_List*)(winctx->etc_info))
+ /*while ((Eina_List*)(window_context->etc_info))
{
- EFLObject *object = (EFLObject*)eina_list_data_get((Eina_List*)(winctx->etc_info));
+ EFLObject *object = (EFLObject*)eina_list_data_get((Eina_List*)(window_context->etc_info));
if (object) {
Evas_Object* eo = object->object;
if (eo) {
object->object = NULL;
}
}
- winctx->etc_info = eina_list_remove_list((Eina_List*)(winctx->etc_info), (Eina_List*)(winctx->etc_info));
+ window_context->etc_info = eina_list_remove_list((Eina_List*)(window_context->etc_info), (Eina_List*)(winctx->etc_info));
delete object;
}
- winctx->etc_info = NULL;*/
+ window_context->etc_info = NULL;*/
}
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
builder->show_layout(window, x, y, width, height);
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
- SclWindowContext *winctx = NULL;
+ SclWindowContext *window_context = NULL;
if (windows && window) {
- //winctx = windows->get_window_context(window, FALSE);
- winctx = windows->get_window_context(window);
+ //window_context = windows->get_window_context(window, FALSE);
+ window_context = windows->get_window_context(window);
- if (winctx) {
- if (winctx->is_virtual) {
+ if (window_context) {
+ if (window_context->is_virtual) {
return;
}
}
hint.flags |= USPosition;
XSetWMNormalHints(dpy, win, &hint);
- /*if (winctx) {
- windows->resize_window(winctx->window, winctx->width, winctx->height);
+ /*if (window_context) {
+ windows->resize_window(window_context->window, window_context->width, winctx->height);
}*/
}
}
CSCLWindows *windows = CSCLWindows::get_instance();
//if (window == windows->get_magnifier_window()) {
- //SclWindowContext *winctx = windows->get_window_context(win, FALSE);
- SclWindowContext *winctx = windows->get_window_context(win);
- if (winctx && win) {
- if (winctx->etc_info) {
+ //SclWindowContext *window_context = windows->get_window_context(win, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(win);
+ if (window_context && win) {
+ if (window_context->etc_info) {
- Eina_List *list = (Eina_List*)(winctx->etc_info);
+ Eina_List *list = (Eina_List*)(window_context->etc_info);
Eina_List *iter = NULL;
Eina_List *iter_next = NULL;
void *data = NULL;
if (bShouldRemove) {
Evas_Object* eo = object->object;
if (object->extracted) {
- void *data = evas_object_image_data_get(eo, 1);
- if (data) {
- free(data);
+ void *image_data = evas_object_image_data_get(eo, 1);
+ if (image_data) {
+ free(image_data);
}
}
if (eo) {
iIndex++;
}
}
- winctx->etc_info = list;
+ window_context->etc_info = list;
#endif
}
}
EFLOBJECT_TYPE type;
SclRectangle position;
Evas_Object *object;
- char *etc_info;
+ const char *etc_info;
sclboolean extracted;
void *data;
} EFLObject;
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);
- sclwindow create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
+ sclwindow create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+ sclwindow create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+ sclwindow create_magnifier_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+ sclwindow create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
bool destroy_window(sclwindow window);
void show_window(const sclwindow window, sclboolean queue);
void hide_window(const sclwindow window, sclboolean fForce = FALSE);
GtkWidget* magnifier = static_cast<GtkWidget*>(windows->get_magnifier_window());
gdk_window_raise(magnifier->window);
if (widget == windows->get_magnifier_window()) {
- SclWindowContext *magctx = windows->get_window_context(widget, FALSE);
- if (magctx) {
- magpressposx = magctx->x;
- magpressposy = magctx->y;
+ SclWindowContext *magnifier_window_context = windows->get_window_context(widget, FALSE);
+ if (magnifier_window_context) {
+ magpressposx = magnifier_window_context->x;
+ magpressposy = magnifier_window_context->y;
}
/* First convert the local coordinate to global coordinate */
sclwindow window = SCLWINDOW_INVALID;
* - show_base_layout (when the expost event has occured)
*/
void
-CSCLEventsImplGtk::connect_window_events(const sclwindow wnd, const sclint evt)
+CSCLEventsImplGtk::connect_window_events(const sclwindow window, const sclint event)
{
SCL_DEBUG();
/* pre-condition */
* In this function, it should call timer_event of CSCLController class
*/
void
-CSCLEventsImplGtk::create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean addToMap)
+CSCLEventsImplGtk::create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean add_to_map)
{
SCL_DEBUG();
sclint data = SCL_MAKELONG(id, value);
gint timerId = gtk_timeout_add (static_cast<guint32>(interval), timer_event, (gpointer)data);
- if (addToMap) {
- idMap[id] = timerId;
+ if (add_to_map) {
+ id_map[id] = timerId;
}
}
CSCLEventsImplGtk::destroy_timer(const scl32 id)
{
SCL_DEBUG();
- for ( std::map<int, int>::iterator idx = idMap.begin(); idx != idMap.end(); ++idx) {
+ for ( std::map<int, int>::iterator idx = id_map.begin(); idx != id_map.end(); ++idx) {
if ((*idx).first == id) {
gtk_timeout_remove ((*idx).second);
- idMap.erase((*idx).first);
+ id_map.erase((*idx).first);
break;
}
}
CSCLEventsImplGtk::destroy_all_timer()
{
SCL_DEBUG();
- for ( std::map<int, int>::iterator idx = idMap.begin(); idx != idMap.end(); ++idx) {
+ for ( std::map<int, int>::iterator idx = id_map.begin(); idx != id_map.end(); ++idx) {
gtk_timeout_remove ((*idx).second);
}
- idMap.clear();
+ id_map.clear();
}
~CSCLEventsImplGtk();
/* 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);
+ void connect_window_events(const sclwindow window, const sclint event);
+ void create_timer(const scl16 id, const scl32 interval, scl16 value, sclboolean add_to_map);
void destroy_timer(const scl32 id);
void destroy_all_timer();
private:
- std::map<int, int> idMap;
+ std::map<int, int> id_map;
};
} /* End of scl namespace */
#endif __SCL_EVENTS_GTK_H__
* Draws the given text on cairo-surface
*/
void
-CSCLGraphicsImplCairo::draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
+CSCLGraphicsImplCairo::draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& fontinfo, const SclColor& color,
const sclchar *str, sclint posx, sclint posy, sclint width, sclint height,
SCLLabelAlignment align, sclbyte padding)
{
SCL_DEBUG();
/* pre-condition */
scl_assert_return(str);
- scl_assert_return(drawCtx);
+ scl_assert_return(draw_ctx);
- cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+ cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
cairo_identity_matrix(cr);
cairo_set_source_rgba(cr, color.r / 256.0, color.g / 256.0, color.b / 256.0, 1.0);
cairo_select_font_face(cr, fontinfo.fontname,
* Draws the given image on cairo-surface
*/
void
-CSCLGraphicsImplCairo::draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, sclint destX, sclint destY,
+CSCLGraphicsImplCairo::draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* imgPath, sclint destX, sclint destY,
sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight)
{
SCL_DEBUG();
/* pre-condition */
scl_assert_return(imgPath);
- scl_assert_return(drawCtx);
+ scl_assert_return(draw_ctx);
- cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+ cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLImageProxy *proxy = CSCLImageProxy::get_instance();
* Draws a rectangle on cairo-surface
*/
void
-CSCLGraphicsImplCairo::draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
+CSCLGraphicsImplCairo::draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble posx, scldouble posy,
scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha)
{
SCL_DEBUG();
/* pre-condition */
- scl_assert_return(drawCtx);
+ scl_assert_return(draw_ctx);
- cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+ cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
cairo_identity_matrix(cr);
/* a custom shape that could be wrapped in a function */
* Notices that drawing tasks have done.
*/
void
-CSCLGraphicsImplCairo::end_paint(const sclwindow window, scldrawctx drawCtx)
+CSCLGraphicsImplCairo::end_paint(const sclwindow window, scldrawctx draw_ctx)
{
- cairo_destroy(static_cast<cairo_t*>(drawCtx));
+ cairo_destroy(static_cast<cairo_t*>(draw_ctx));
}
sclfont
CSCLGraphicsImplCairo();
~CSCLGraphicsImplCairo();
- void draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, sclint destX, sclint destY,
- sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight);
- void draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
- const sclchar *str, sclint posx, sclint posy, sclint width, sclint height,
+ void draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path,
+ sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
+ sclint src_x, sclint src_y, sclint src_width, sclint src_height);
+ void draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
+ const sclchar *str, sclint pos_x, sclint pos_y, sclint width, sclint height,
SCLLabelAlignment align, sclbyte padding);
- sclimage load_image(const sclchar* imgPath);
- void unload_image(sclimage imgData);
- scldrawctx begin_paint(const sclwindow window, const sclboolean forcedraw = FALSE);
- void end_paint(const sclwindow window, scldrawctx drawCtx);
+ sclimage load_image(const sclchar* image_path);
+ void unload_image(sclimage image_data);
+ scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE);
+ void end_paint(const sclwindow window, scldrawctx draw_ctx);
sclfont create_font(const SclFontInfo& info);
void destroy_font(sclfont font);
- void draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
- scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha);
- SclSize get_image_size(sclchar* imgPath);
+ void draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y,
+ scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color,
+ sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
+ SclSize get_image_size(sclchar* image_path);
private:
};
} /* End of scl namespace */
void
-CSCLGraphicsImplGtk::draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, SclImageCachedInfo *cachedinfo, sclint destX, sclint destY,
- sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight)
+CSCLGraphicsImplGtk::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)
{
SCL_DEBUG();
//printf("\n %d destX, %d destY,\n %d destWidth, %d destHeight, %d srcX, %d srcY,\n %d srcWidth, %d srcHeight\n", destX, destY, destWidth, destHeight, srcX, srcWidth, srcHeight);
}
sclimage
-CSCLGraphicsImplGtk::load_image(const sclchar *imgPath)
+CSCLGraphicsImplGtk::load_image(const sclchar* image_path)
{
SCL_DEBUG();
GdkPixmap* imgData = NULL;
}
void
-CSCLGraphicsImplGtk::unload_image(sclimage imgData)
+CSCLGraphicsImplGtk::unload_image(sclimage image_data)
{
SCL_DEBUG();
/* pre-condition */
* This func should be called before using a drawing primitive at first.
*/
scldrawctx
-CSCLGraphicsImplGtk::begin_paint(const sclwindow window, const sclboolean forcedraw /* = FALSE */)
+CSCLGraphicsImplGtk::begin_paint(const sclwindow window, const sclboolean force_draw /* = FALSE */)
{
SCL_DEBUG();
/* pre-condition */
* Notices that drawing tasks have done.
*/
void
-CSCLGraphicsImplGtk::end_paint(const sclwindow window, scldrawctx drawCtx)
+CSCLGraphicsImplGtk::end_paint(const sclwindow window, scldrawctx draw_ctx)
{
- cairo_destroy(static_cast<cairo_t*>(drawCtx));
+ cairo_destroy(static_cast<cairo_t*>(draw_ctx));
}
sclfont
* Draws the given text on cairo-surface
*/
void
-CSCLGraphicsImplGtk::draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
- const sclchar *str, SclTextCachedInfo *cachedinfo, sclint posx, sclint posy, sclint width, sclint height,
+CSCLGraphicsImplGtk::draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info,
+ const SclColor& color, const sclchar *str, SclTextCachedInfo *cachedinfo,
+ sclint pos_x, sclint pos_y, sclint width, sclint height,
SCLLabelAlignment align, sclbyte padding)
{
SCL_DEBUG();
/* pre-condition */
scl_assert_return(str);
- scl_assert_return(drawCtx);
+ scl_assert_return(draw_ctx);
- cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+ cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
cairo_identity_matrix(cr);
cairo_set_source_rgba(cr, color.r / 256.0, color.g / 256.0, color.b / 256.0, 1.0);
cairo_select_font_face(cr, fontinfo.fontname,
* Draws a rectangle on cairo-surface
*/
void
-CSCLGraphicsImplGtk::draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
- scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha)
+CSCLGraphicsImplGtk::draw_rectangle(sclwindow window, const scldrawctx draw_ctx,
+ scldouble pos_x, scldouble pos_y, scldouble width, scldouble height,
+ const scldouble line_width, const SclColor& line_color, sclboolean fill,
+ const SclColor& fill_color, scldouble radius, sclfloat alpha)
{
SCL_DEBUG();
/* pre-condition */
- scl_assert_return(drawCtx);
+ scl_assert_return(draw_ctx);
- cairo_t* cr = static_cast<cairo_t*>(drawCtx);
+ cairo_t* cr = static_cast<cairo_t*>(draw_ctx);
cairo_identity_matrix(cr);
/* a custom shape that could be wrapped in a function */
}
SclSize
-CSCLGraphicsImplGtk::get_image_size(sclchar* imgPath)
+CSCLGraphicsImplGtk::get_image_size(sclchar* image_path)
{
SCL_DEBUG();
SclSize ret = { 0, 0 };
CSCLGraphicsImplGtk();
~CSCLGraphicsImplGtk();
- void draw_image(sclwindow window, const scldrawctx drawCtx, sclchar* imgPath, SclImageCachedInfo *cachedinfo, sclint destX, sclint destY,
- sclint destWidth, sclint destHeight, sclint srcX, sclint srcY, sclint srcWidth, sclint srcHeight);
- sclimage load_image(const sclchar* imgPath);
- void unload_image(sclimage imgData);
+ 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);
+ sclimage load_image(const sclchar* image_path);
+ void unload_image(sclimage image_data);
sclfont create_font(const SclFontInfo& info);
void destroy_font(sclfont font);
- void draw_text(sclwindow window, const scldrawctx drawCtx, const SclFontInfo& fontinfo, const SclColor& color,
- const sclchar *str, SclTextCachedInfo *cachedinfo, sclint posx, sclint posy, sclint width, sclint height,
+ void draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
+ const sclchar *str, SclTextCachedInfo *cachedinfo, sclint pos_x, sclint pos_y, sclint width, sclint height,
SCLLabelAlignment align, sclbyte padding);
- void draw_rectangle(sclwindow window, const scldrawctx drawCtx, scldouble posx, scldouble posy,
- scldouble width, scldouble height, const scldouble lineWidth, const SclColor& lineColor, sclboolean fill, const SclColor& fillColor, scldouble radius, sclfloat alpha);
- scldrawctx begin_paint(const sclwindow window, const sclboolean forcedraw = FALSE);
- void end_paint(const sclwindow window, scldrawctx drawCtx);
- SclSize get_image_size(sclchar* imgPath);
+ void draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y,
+ scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color,
+ sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha);
+ scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE);
+ void end_paint(const sclwindow window, scldrawctx draw_ctx);
+ SclSize get_image_size(sclchar* image_path);
SclSize get_text_size(const SclFontInfo &fontinfo, const sclchar *str);
private:
};
* Create a content window and binds it into given parent window as a child
*/
sclwindow
-CSCLWindowsImplGtk::create_base_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplGtk::create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
/* pre-condition */
scl_assert(parent != NULL);
- scl_assert(winctx != NULL);
- scl_assert(winctx->etc_info == NULL);
+ scl_assert(window_context != NULL);
+ scl_assert(window_context->etc_info == NULL);
- if (winctx->window == NULL) {
+ if (window_context->window == NULL) {
window = (GtkWidget*)parent;
if (GTK_WIDGET_TOPLEVEL(window)) {
window = (GtkWidget*)parent;
- winctx->etc_info = NULL;
- winctx->window = window;
+ window_context->etc_info = NULL;
+ window_context->window = window;
//gtk_window_set_keep_above(GTK_WINDOW(window), TRUE);
make_transparent_window(window);
} else {
gtk_box_pack_start(GTK_BOX(window), drawarea, TRUE, TRUE, 0);
gtk_widget_show (drawarea);
gtk_widget_show (window);
- winctx->etc_info = static_cast<void*>(drawarea);
- winctx->window = drawarea;
+ window_context->etc_info = static_cast<void*>(drawarea);
+ window_context->window = drawarea;
make_transparent_window(drawarea);
}
}
/* post-condition */
- return winctx->window;
+ return window_context->window;
}
/**
* Creates a window
*/
sclwindow
-CSCLWindowsImplGtk::create_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplGtk::create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
/* pre-condition */
scl_assert(parent);
- scl_assert(winctx);
- scl_assert(winctx->etc_info == NULL);
+ scl_assert(window_context);
+ scl_assert(window_context->etc_info == NULL);
GtkWidget* window = NULL;
- if (winctx->window == NULL) {
+ if (window_context->window == NULL) {
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint(GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_UTILITY);
#ifdef NO_SOCKETPLUG
gtk_widget_set_app_paintable(window, TRUE);
#endif
//gtk_effect_set_enable (GTK_WIDGET(window), FALSE);
- winctx->etc_info = NULL;
- winctx->window = window;
+ window_context->etc_info = NULL;
+ window_context->window = window;
/* Window rotation*/
* Creates the dim window
*/
sclwindow
-CSCLWindowsImplGtk::create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindowsImplGtk::create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
/* pre-condition */
scl_assert(parent);
- scl_assert(winctx);
- scl_assert(winctx->etc_info == NULL);
+ scl_assert(window_context);
+ scl_assert(window_context->etc_info == NULL);
GtkWidget* window = NULL;
- if (winctx->window == NULL) {
+ if (window_context->window == NULL) {
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_type_hint(GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_UTILITY);
#ifdef NO_SOCKETPLUG
gtk_window_set_opacity(GTK_WINDOW(window), 0.5);
gtk_widget_realize(window);
//gtk_effect_set_enable (GTK_WIDGET(window), FALSE);
- winctx->etc_info = NULL;
- winctx->window = window;
+ window_context->etc_info = NULL;
+ window_context->window = window;
}
return window;
* Caution: Currently, If we use transient_for them the ISE will occure some crash. It needs to check X11
*/
void
-CSCLWindowsImplGtk::set_parent(const sclwindow parentWindow, const sclwindow window)
+CSCLWindowsImplGtk::set_parent(const sclwindow parent_window, const sclwindow window)
{
SCL_DEBUG();
scl_assert_return(window);
* Hides the given window
*/
void
-CSCLWindowsImplGtk::hide_window(const sclwindow window, sclboolean fForce)
+CSCLWindowsImplGtk::hide_window(const sclwindow window, sclboolean force)
{
SCL_DEBUG();
scl_assert_return(window);
GtkWidget* widget = static_cast<GtkWidget*>(window);
CSCLWindows *windows = CSCLWindows::get_instance();
- if (windows->get_magnifier_window() == window && fForce == FALSE) {
+ if (windows->get_magnifier_window() == window && force == FALSE) {
/* Fix me : The below is a temporary code for magnifier speed enhancement */
#ifdef NO_SOCKETPLUG
gint root_x, root_y;
* Shows a message box
*/
void
-CSCLWindowsImplGtk::show_message_box(const sclwindow parent, scl8 msgType, sclchar* title, sclchar* msg) {
+CSCLWindowsImplGtk::show_message_box(const sclwindow parent, scl8 msg_type, sclchar* title, sclchar* msg) {
SCL_DEBUG();
scl_assert_return(strlen(msg) > 0);
void
-CSCLWindowsImplGtk::set_keep_above(const sclwindow window, sclboolean keepabove) {
+CSCLWindowsImplGtk::set_keep_above(const sclwindow window, sclboolean keep_above) {
SCL_DEBUG();
- gtk_window_set_keep_above(GTK_WINDOW(window), keepabove);
+ gtk_window_set_keep_above(GTK_WINDOW(window), keep_above);
}
CSCLWindowsImplGtk();
~CSCLWindowsImplGtk();
- 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_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
+ sclwindow create_base_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+ sclwindow create_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
+ sclwindow create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
bool destroy_window(sclwindow window);
void show_window(const sclwindow window, sclboolean queue);
- void hide_window(const sclwindow window, sclboolean fForce = FALSE);
+ void hide_window(const sclwindow window, sclboolean force = FALSE);
void move_window(const sclwindow window, scl16 x, scl16 y);
void resize_window(const sclwindow window, scl16 width, scl16 height);
void move_resize_window(const sclwindow window, scl16 x, scl16 y, scl16 width, scl16 height);
void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0);
void set_window_rotation(const sclwindow window, sclint degree);
- void show_message_box(const sclwindow parent, scl8 msgType, sclchar* title, sclchar* msg);
+ void show_message_box(const sclwindow parent, scl8 msg_type, sclchar* title, sclchar* msg);
sclboolean get_window_rect(const sclwindow window, SclRectangle *rect);
- void set_parent(const sclwindow parentWindow, const sclwindow window);
- void set_keep_above(const sclwindow window, sclboolean keepabove);
+ void set_parent(const sclwindow parent_window, const sclwindow window);
+ void set_keep_above(const sclwindow window, sclboolean keep_above);
};
} /* End of scl namespace */
#endif __SCL_WINDOWS_GTK_H__
SclPoint cur_pressed_point;
struct timeval cur_pressed_time;
- sclwindow cur_move_window;
- SclPoint cur_move_point;
+ sclwindow cur_moving_window;
+ SclPoint cur_moving_point;
SCLDragState cur_drag_state;
SCLKeyModifier cur_key_modifier;
scl8 prev_pressed_key;
sclwindow prev_pressed_window;
- SclPoint prev_move_point;
+ SclPoint prev_moving_point;
SCLDragState prev_drag_state;
scl16 event_id;
return m_cur_highlighted_window;
}
- void create_multi_touch_context(scltouchdevice touch_id, sclboolean isSubEvent = FALSE);
+ void create_multi_touch_context(scltouchdevice touch_id, sclboolean is_sub_event = FALSE);
void destroy_multi_touch_context(scltouchdevice touch_id);
MultiTouchContext* find_multi_touch_context(scltouchdevice touch_id);
void set_custom_magnifier_label(scltouchdevice touch_id, sclint index, const sclchar* label);
const sclchar* get_custom_magnifier_label(scltouchdevice touch_id, sclint index);
- SclPoint get_cur_move_point(scltouchdevice touch_id);
- void set_cur_move_point(scltouchdevice touch_id, sclint x, sclint y);
- sclwindow get_cur_move_window(scltouchdevice touch_id);
- void set_cur_move_window(scltouchdevice touch_id, sclwindow window);
+ SclPoint get_cur_moving_point(scltouchdevice touch_id);
+ void set_cur_moving_point(scltouchdevice touch_id, sclint x, sclint y);
+ sclwindow get_cur_moving_window(scltouchdevice touch_id);
+ void set_cur_moving_window(scltouchdevice touch_id, sclwindow window);
SclPoint get_farthest_move_point(scltouchdevice touch_id);
void set_farthest_move_point(scltouchdevice touch_id, sclint x, sclint y);
sclint get_farthest_move_dist(scltouchdevice touch_id);
sclwindow get_prev_pressed_window(scltouchdevice touch_id);
void set_prev_pressed_window(scltouchdevice touch_id, sclwindow window);
- SclPoint get_prev_move_point(scltouchdevice touch_id);
- void set_prev_move_point(scltouchdevice touch_id, sclint x, sclint y);
+ SclPoint get_prev_moving_point(scltouchdevice touch_id);
+ void set_prev_moving_point(scltouchdevice touch_id, sclint x, sclint y);
SCLDragState get_prev_drag_state(scltouchdevice touch_id);
void set_prev_drag_state(scltouchdevice touch_id, SCLDragState state);
sclint get_multi_touch_context_num();
- sclboolean get_multi_touch_event(sclint seqorder, SclUIEventDesc *desc);
+ sclboolean get_multi_touch_event(sclint order, SclUIEventDesc *desc);
sclint get_multi_touch_event_order(scltouchdevice touch_id);
sclchar* get_cur_sublayout();
scltouchdevice touch_id, sclboolean actual_event = TRUE);
sclboolean process_button_move_event(sclwindow window, sclint x, sclint y, sclbyte key_index,
scltouchdevice touch_id, sclboolean actual_event = TRUE);
- sclboolean process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte keyindex);
+ sclboolean process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte key_index);
sclboolean process_button_release_event(sclwindow window, sclint x, sclint y, sclbyte key_index,
scltouchdevice touch_id, sclboolean actual_event = TRUE);
sclboolean check_farthest,scltouchdevice touch_id, sclbyte extra_option);
public:
- void handle_engine_signal(SclInternalSignal signal, sclwindow skipwindow = SCLWINDOW_INVALID);
+ void handle_engine_signal(SclInternalSignal signal, sclwindow skip_window = SCLWINDOW_INVALID);
sclboolean process_input_mode_change(const sclbyte mode);
sclboolean process_rotation_change(const SCLRotation rotation);
namespace scl
{
-typedef struct {
+struct SclUIEventDesc {
+ SclUIEventDesc() {
+ key_value = NULL;
+ key_event = 0;
+ key_type = KEY_TYPE_NONE;
+ key_modifier = KEY_MODIFIER_NONE;
+ touch_id = 0;
+ touch_event_order = 0;
+ event_type = EVENT_TYPE_NONE;
+ }
const sclchar *key_value;
sclulong key_event;
SCLKeyType key_type;
SclPoint mouse_farthest_point;
SCLEventType event_type;
-} SclUIEventDesc;
+};
struct SclNotiDesc {
SclUIEventDesc *ui_event_desc;
SclSize actual_size;
}SclTextCachedInfo;
-const SclColor SCLCOLOR_WHITE = {255, 255, 255};
-const SclColor SCLCOLOR_GREY = {128, 128, 128};
-const SclColor SCLCOLOR_BLACK = {0, 0, 0};
-const SclColor SCLCOLOR_RED = {255, 0, 0};
-const SclColor SCLCOLOR_BLUE = {0, 0, 255};
+const SclColor SCLCOLOR_WHITE = {255, 255, 255, 255};
+const SclColor SCLCOLOR_GREY = {128, 128, 128, 255};
+const SclColor SCLCOLOR_BLACK = {0, 0, 0, 255};
+const SclColor SCLCOLOR_RED = {255, 0, 0, 255};
+const SclColor SCLCOLOR_BLUE = {0, 0, 255, 255};
/**
* @brief The base class to work as a soft-based keyboard
const sclchar* get_cur_themename();
sclint set_private_key(SclPrivateKeyProperties* properties, sclboolean fRedraw, sclboolean fPendingUpdate);
- sclint set_private_key(sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate);
+ sclint set_private_key(const sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate);
void unset_private_key(sclshort input_mode_index, sclbyte layout_index, sclbyte key_index);
void unset_private_key(const sclchar* custom_id);
/**
* @brief This API requests SCL library to hide the S/W keyboard from the screen
- * @param[in] ctx target SCL context
*/
void hide();
sclint timeout;
SclPoint layout_image_offset;
- void* etc_info;
+ const void* etc_info;
} SclWindowContext;
/**
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;
- virtual sclwindow create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height) = 0;
+ virtual sclwindow create_base_window(const sclwindow parent,
+ SclWindowContext *window_context, scl16 width, scl16 height) = 0;
+ virtual sclwindow create_window(const sclwindow parent,
+ SclWindowContext *window_context, scl16 width, scl16 height) = 0;
+ virtual sclwindow create_magnifier_window(const sclwindow parent,
+ SclWindowContext *window_context, scl16 width, scl16 height) = 0;
+ virtual sclwindow create_dim_window(const sclwindow parent,
+ SclWindowContext *window_context, scl16 width, scl16 height) = 0;
virtual bool destroy_window(sclwindow window) = 0;
virtual void set_parent(const sclwindow parent, const sclwindow window) = 0;
virtual void show_window(const sclwindow window, sclboolean queue) = 0;
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);
+ 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);
sclwindow get_nth_popup_window(sclbyte index);
sclbyte get_Z_order(sclwindow window);
- sclwindow create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height);
+ sclwindow create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height);
sclwindow get_dim_window();
void set_update_pending(sclboolean pend);
protected :
CSCLWindowsImpl* get_scl_windows_impl();
- sclwindow create_window(const SclWindowOpener opener, const SclRectangle &geometry, sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual, sclint img_offset_x = 0, sclint img_offset_y = 0, sclint timeout = 0);
+ sclwindow create_window(const SclWindowOpener opener, const SclRectangle &geometry,
+ sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual,
+ sclint img_offset_x = 0, sclint img_offset_y = 0, sclint timeout = 0);
bool destroy_window(sclwindow window);
void push_window_in_Z_order_list(sclwindow window);
private :
CSCLWindowsImpl* m_impl;
- SclWindowContext m_base_winctx;
- SclWindowContext m_popup_winctx[MAX_POPUP_WINDOW];
+ SclWindowContext m_base_window_context;
+ SclWindowContext m_popup_window_context[MAX_POPUP_WINDOW];
- SclWindowContext m_magnifier_winctx;
- SclWindowContext m_dim_winctx;
+ SclWindowContext m_magnifier_window_context;
+ SclWindowContext m_dim_window_context;
sclboolean m_pending_update;
sclboolean m_initialized;
{
sclboolean ret = TRUE;
- std::map<sclint, SclAnimationState>::iterator iter = m_animators.find(id);
+ std::map<sclint, SclAnimationState>::iterator iter;
+ iter = m_animators.find(id);
if (iter != m_animators.end()) {
SclAnimationState *state = &(iter->second);
state->active = FALSE;
}
sclboolean destroy_timer = TRUE;
- for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
- iter != m_animators.end();std::advance(iter, 1)) {
- if (iter != m_animators.end()) {
- SclAnimationState *state = &(iter->second);
- if (state->active) {
- destroy_timer = FALSE;
- }
+ for(iter = m_animators.begin();iter != m_animators.end();std::advance(iter, 1)) {
+ if (iter != m_animators.end()) {
+ SclAnimationState *state = &(iter->second);
+ if (state->active) {
+ destroy_timer = FALSE;
}
+ }
}
if (destroy_timer) {
{
sclboolean ret = TRUE;
- std::map<sclint, SclAnimationState>::iterator iter = m_animators.find(id);
+ std::map<sclint, SclAnimationState>::iterator iter;
+ iter = m_animators.find(id);
if (iter != m_animators.end()) {
SclAnimationState *state = &(iter->second);
state->active = FALSE;
}
sclboolean destroy_timer = TRUE;
- for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
- iter != m_animators.end();std::advance(iter, 1)) {
- if (iter != m_animators.end()) {
- SclAnimationState *state = &(iter->second);
- if (state->active) {
- destroy_timer = FALSE;
- }
+ for(iter = m_animators.begin();iter != m_animators.end();std::advance(iter, 1)) {
+ if (iter != m_animators.end()) {
+ SclAnimationState *state = &(iter->second);
+ if (state->active) {
+ destroy_timer = FALSE;
}
+ }
}
if (destroy_timer) {
((delta_height) * state->step * SCL_ANIMATION_TIMER_INTERVAL) / state->desc.length;
if (state->desc.circular) {
- SclWindowContext *base_winctx = windows->get_window_context(windows->get_base_window());
- if (base_winctx) {
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
if (rect_from.x > rect_to.x) {
delta_x = rect_to.x;
- delta_x += (base_winctx->geometry.width - rect_from.x);
+ delta_x += (base_window_context->geometry.width - rect_from.x);
} else {
delta_x = -(rect_from.x);
- delta_x -= (base_winctx->geometry.width - rect_to.x);
+ delta_x -= (base_window_context->geometry.width - rect_to.x);
}
state->rect_cur.x = rect_from.x +
if (state->rect_cur.x + state->rect_cur.width <= 0) {
/* Make the highlight UI come out from the right side of the window */
- state->rect_cur.x += base_winctx->geometry.width;
- } else if (state->rect_cur.x > base_winctx->geometry.width) {
- state->rect_cur.x -= base_winctx->geometry.width;
+ state->rect_cur.x += base_window_context->geometry.width;
+ } else if (state->rect_cur.x > base_window_context->geometry.width) {
+ state->rect_cur.x -= base_window_context->geometry.width;
}
}
} else {
CSCLAnimator::animator_timer()
{
sclboolean destroy_timer = TRUE;
- SclAnimationState* cur = NULL;
for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
iter != m_animators.end();std::advance(iter, 1)) {
if (iter != m_animators.end()) {
}
if (state->active == FALSE) {
- CSCLWindows *windows = CSCLWindows::get_instance();
- if (windows) {
- windows->update_window(state->desc.window_to,
- state->desc.rect_to.x, state->desc.rect_to.y,
- state->desc.rect_to.width, state->desc.rect_to.height);
- }
+ windows->update_window(state->desc.window_to,
+ state->desc.rect_to.x, state->desc.rect_to.y,
+ state->desc.rect_to.width, state->desc.rect_to.height);
} else {
destroy_timer = FALSE;
}
sclshort ret = NOT_USED;
CSCLWindows *windows = CSCLWindows::get_instance();
- //SclWindowContext *ctx = windows->get_window_context(window, FALSE);
- SclWindowContext *ctx = windows->get_window_context(window);
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
- if (ctx) {
- ret = ctx->layout;
+ if (window_context) {
+ ret = window_context->layout;
}
return ret;
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
- //SclWindowContext *ctx = windows->get_window_context(window, FALSE);
- SclWindowContext *ctx = windows->get_window_context(window);
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
- if (ctx) {
- ctx->layout = val;
+ if (window_context) {
+ window_context->layout = val;
}
}
{
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
- //SclWindowContext *ctx = windows->get_window_context(windows->get_base_window(), FALSE);
- SclWindowContext *ctx = windows->get_window_context(windows->get_base_window());
- if (ctx) {
- ctx->layout = val;
+ //SclWindowContext *window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+ SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context) {
+ window_context->layout = val;
}
}
sclshort ret = NOT_USED;
CSCLWindows *windows = CSCLWindows::get_instance();
- //SclWindowContext *ctx = windows->get_window_context(windows->get_base_window(), FALSE);
- SclWindowContext *ctx = windows->get_window_context(windows->get_base_window());
- if (ctx) {
- ret = ctx->layout;
+ //SclWindowContext *window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+ SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context) {
+ ret = window_context->layout;
}
return ret;
CSCLContext::get_cur_pressed_event_id(scltouchdevice touch_id)
{
scl16 ret = NOT_USED;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->event_id;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->event_id;
}
return ret;
}
void
CSCLContext::set_cur_pressed_event_id(scltouchdevice touch_id, scl16 id)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->event_id = id;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->event_id = id;
}
}
CSCLContext::get_cur_pressed_key(scltouchdevice touch_id)
{
scl8 ret = NOT_USED;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_pressed_key;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_pressed_key;
}
return ret;
}
void
CSCLContext::set_cur_pressed_key(scltouchdevice touch_id, scl8 val)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->cur_pressed_key = val;
+ MultiTouchContext *window_context = find_multi_touch_context(touch_id);
+ if (window_context) {
+ window_context->cur_pressed_key = val;
}
}
CSCLContext::get_cur_pressed_window(scltouchdevice touch_id)
{
sclwindow ret = SCLWINDOW_INVALID;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_pressed_window;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_pressed_window;
}
return ret;
}
void
CSCLContext::set_cur_pressed_window(scltouchdevice touch_id, sclwindow val)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->cur_pressed_window = val;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->cur_pressed_window = val;
}
}
CSCLContext::get_cur_pressed_point(scltouchdevice touch_id)
{
SclPoint ret = {0, 0};
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_pressed_point;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_pressed_point;
}
return ret;
}
void
CSCLContext::set_cur_pressed_point(scltouchdevice touch_id, sclint x, sclint y)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->cur_pressed_point.x = x;
- ctx->cur_pressed_point.y = y;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->cur_pressed_point.x = x;
+ multi_touch_context->cur_pressed_point.y = y;
set_farthest_move_point(touch_id, x, y); // reset farthest move point
}
}
SclPoint
-CSCLContext::get_cur_move_point(scltouchdevice touch_id)
+CSCLContext::get_cur_moving_point(scltouchdevice touch_id)
{
SclPoint ret = {0, 0};
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_move_point;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_moving_point;
}
return ret;
}
void
-CSCLContext::set_cur_move_point(scltouchdevice touch_id, sclint x, sclint y)
+CSCLContext::set_cur_moving_point(scltouchdevice touch_id, sclint x, sclint y)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->cur_move_point.x = x;
- ctx->cur_move_point.y = y;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->cur_moving_point.x = x;
+ multi_touch_context->cur_moving_point.y = y;
}
}
sclwindow
-CSCLContext::get_cur_move_window(scltouchdevice touch_id)
+CSCLContext::get_cur_moving_window(scltouchdevice touch_id)
{
sclwindow ret = SCLWINDOW_INVALID;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_move_window;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_moving_window;
}
return ret;
}
void
-CSCLContext::set_cur_move_window(scltouchdevice touch_id, sclwindow window)
+CSCLContext::set_cur_moving_window(scltouchdevice touch_id, sclwindow window)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->cur_move_window = window;
+ MultiTouchContext *window_context = find_multi_touch_context(touch_id);
+ if (window_context) {
+ window_context->cur_moving_window = window;
}
}
struct timeval
CSCLContext::get_cur_pressed_time(scltouchdevice touch_id)
{
- struct timeval ret = {0};
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_pressed_time;
+ struct timeval ret = {0,0};
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_pressed_time;
}
return ret;
}
void
CSCLContext::set_cur_pressed_time(scltouchdevice touch_id)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- gettimeofday(&(ctx->cur_pressed_time), NULL);
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ gettimeofday(&(multi_touch_context->cur_pressed_time), NULL);
}
}
CSCLContext::get_farthest_move_point(scltouchdevice touch_id)
{
SclPoint ret = {0, 0};
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->farthest_move_point;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->farthest_move_point;
}
return ret;
}
void
CSCLContext::set_farthest_move_point(scltouchdevice touch_id, sclint x, sclint y)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
CSCLUtils *utils = CSCLUtils::get_instance();
- ctx->farthest_move_dist = utils->get_approximate_distance(x, y, ctx->cur_pressed_point.x, ctx->cur_pressed_point.y);
+ multi_touch_context->farthest_move_dist =
+ utils->get_approximate_distance(x, y,
+ multi_touch_context->cur_pressed_point.x, multi_touch_context->cur_pressed_point.y);
- ctx->farthest_move_point.x = x;
- ctx->farthest_move_point.y = y;
+ multi_touch_context->farthest_move_point.x = x;
+ multi_touch_context->farthest_move_point.y = y;
}
}
CSCLContext::get_farthest_move_dist(scltouchdevice touch_id)
{
sclint ret = 0;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->farthest_move_dist;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->farthest_move_dist;
}
return ret;
}
CSCLContext::get_cur_drag_state(scltouchdevice touch_id)
{
SCLDragState ret = SCL_DRAG_STATE_NONE;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_drag_state;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_drag_state;
}
return ret;
}
void
CSCLContext::set_cur_drag_state(scltouchdevice touch_id, SCLDragState state)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->cur_drag_state = state;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->cur_drag_state = state;
}
}
CSCLContext::get_cur_key_modifier(scltouchdevice touch_id)
{
SCLKeyModifier ret = KEY_MODIFIER_NONE;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->cur_key_modifier;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->cur_key_modifier;
}
return ret;
}
void
CSCLContext::set_cur_key_modifier(scltouchdevice touch_id, SCLKeyModifier modifier)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->cur_key_modifier = modifier;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->cur_key_modifier = modifier;
}
}
CSCLContext::get_prev_pressed_key(scltouchdevice touch_id)
{
scl8 ret = NOT_USED;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->prev_pressed_key;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->prev_pressed_key;
}
return ret;
}
void
CSCLContext::set_prev_pressed_key(scltouchdevice touch_id, scl8 val)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->prev_pressed_key = val;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->prev_pressed_key = val;
}
}
CSCLContext::get_prev_pressed_window(scltouchdevice touch_id)
{
sclwindow ret = SCLWINDOW_INVALID;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->prev_pressed_window;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->prev_pressed_window;
}
return ret;
}
void
CSCLContext::set_prev_pressed_window(scltouchdevice touch_id, sclwindow val)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->prev_pressed_window = val;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->prev_pressed_window = val;
}
}
SclPoint
-CSCLContext::get_prev_move_point(scltouchdevice touch_id)
+CSCLContext::get_prev_moving_point(scltouchdevice touch_id)
{
SclPoint ret = {0, 0};
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->prev_move_point;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->prev_moving_point;
}
return ret;
}
void
-CSCLContext::set_prev_move_point(scltouchdevice touch_id, sclint x, sclint y)
+CSCLContext::set_prev_moving_point(scltouchdevice touch_id, sclint x, sclint y)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->prev_move_point.x = x;
- ctx->prev_move_point.y = y;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->prev_moving_point.x = x;
+ multi_touch_context->prev_moving_point.y = y;
}
}
CSCLContext::get_prev_drag_state(scltouchdevice touch_id)
{
SCLDragState ret = SCL_DRAG_STATE_NONE;
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ret = ctx->prev_drag_state;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ ret = multi_touch_context->prev_drag_state;
}
return ret;
}
void
CSCLContext::set_prev_drag_state(scltouchdevice touch_id, SCLDragState state)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- ctx->prev_drag_state = state;
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ multi_touch_context->prev_drag_state = state;
}
}
void
-CSCLContext::create_multi_touch_context(scltouchdevice touch_id, sclboolean isSubEvent)
-{
- MultiTouchContext newctx;
- memset(&newctx, 0x00, sizeof(MultiTouchContext));
- newctx.used = TRUE;
- newctx.cur_pressed_key = NOT_USED;
- newctx.cur_pressed_window = SCLWINDOW_INVALID;
- newctx.event_id = 0;
- newctx.prev_pressed_key = NOT_USED;
- newctx.prev_pressed_window = SCLWINDOW_INVALID;
- newctx.cur_pressed_point.x = newctx.cur_pressed_point.y = 0;
- newctx.cur_pressed_time.tv_sec = newctx.cur_pressed_time.tv_usec = 0;
- newctx.cur_drag_state = SCL_DRAG_STATE_NONE;
- newctx.is_sub_event = isSubEvent;
- m_multi_touch_context[touch_id] = newctx;
+CSCLContext::create_multi_touch_context(scltouchdevice touch_id, sclboolean is_sub_event)
+{
+ MultiTouchContext new_multi_touch_context;
+ memset(&new_multi_touch_context, 0x00, sizeof(MultiTouchContext));
+ new_multi_touch_context.used = TRUE;
+ new_multi_touch_context.cur_pressed_key = NOT_USED;
+ new_multi_touch_context.cur_pressed_window = SCLWINDOW_INVALID;
+ new_multi_touch_context.event_id = 0;
+ new_multi_touch_context.prev_pressed_key = NOT_USED;
+ new_multi_touch_context.prev_pressed_window = SCLWINDOW_INVALID;
+ new_multi_touch_context.cur_pressed_point.x = new_multi_touch_context.cur_pressed_point.y = 0;
+ new_multi_touch_context.cur_pressed_time.tv_sec = new_multi_touch_context.cur_pressed_time.tv_usec = 0;
+ new_multi_touch_context.cur_drag_state = SCL_DRAG_STATE_NONE;
+ new_multi_touch_context.is_sub_event = is_sub_event;
+ m_multi_touch_context[touch_id] = new_multi_touch_context;
m_multi_touch_seq.insert(m_multi_touch_seq.end(), touch_id);
void
CSCLContext::destroy_multi_touch_context(scltouchdevice touch_id)
{
- MultiTouchContext *ctx = find_multi_touch_context(touch_id);
- if (ctx) {
- memset(ctx, 0x00, sizeof(MultiTouchContext));
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ memset(multi_touch_context, 0x00, sizeof(MultiTouchContext));
m_multi_touch_context.erase(touch_id);
}
}
} while (bFound);
+ /*
CSCLUtils *utils = CSCLUtils::get_instance();
if (utils) {
- for(std::list<scltouchdevice>::iterator iter = m_multi_touch_seq.begin();iter != m_multi_touch_seq.end();std::advance(iter, 1)) {
+ for(iter = m_multi_touch_seq.begin();iter != m_multi_touch_seq.end();std::advance(iter, 1)) {
utils->log("LIST : %d\n", *iter);
}
utils->log("\n");
}
+ */
}
MultiTouchContext*
}
sclboolean
-CSCLContext::get_multi_touch_event(sclint seqorder, SclUIEventDesc *desc)
+CSCLContext::get_multi_touch_event(sclint order, SclUIEventDesc *desc)
{
sclboolean ret = FALSE;
- sclint iSeqIndex = 0;
+ sclint index = 0;
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
for(std::list<scltouchdevice>::iterator list_iter = m_multi_touch_seq.begin();
!ret && list_iter != m_multi_touch_seq.end();std::advance(list_iter, 1)) {
- if (iSeqIndex == seqorder) {
- MultiTouchContext *pContext = find_multi_touch_context(*list_iter);
- if (pContext) {
+ if (index == order) {
+ MultiTouchContext *multi_touch_context = find_multi_touch_context(*list_iter);
+ if (multi_touch_context) {
const SclLayoutKeyCoordinate *coordinate =
- cache->get_cur_layout_key_coordinate(pContext->cur_pressed_window, pContext->cur_pressed_key);
+ cache->get_cur_layout_key_coordinate(multi_touch_context->cur_pressed_window,
+ multi_touch_context->cur_pressed_key);
if (coordinate) {
- SCLShiftState shiftidx = get_shift_state();
- if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
- desc->key_event = coordinate->key_event[shiftidx][0];
- desc->key_value = coordinate->key_value[shiftidx][0];
+ SCLShiftState shift_index = get_shift_state();
+ if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+ desc->key_event = coordinate->key_event[shift_index][0];
+ desc->key_value = coordinate->key_value[shift_index][0];
desc->key_type = coordinate->key_type;
} else {
desc->key_event = 0;
desc->key_value = NULL;
desc->key_type = KEY_TYPE_NONE;
}
- desc->key_modifier = pContext->cur_key_modifier;
+ desc->key_modifier = multi_touch_context->cur_key_modifier;
desc->touch_id = (*list_iter);
- desc->mouse_pressed_point = pContext->cur_pressed_point;
- desc->mouse_current_point = pContext->cur_move_point;
- desc->mouse_farthest_point = pContext->farthest_move_point;
+ desc->mouse_pressed_point = multi_touch_context->cur_pressed_point;
+ desc->mouse_current_point = multi_touch_context->cur_moving_point;
+ desc->mouse_farthest_point = multi_touch_context->farthest_move_point;
- desc->touch_event_order = iSeqIndex;
+ desc->touch_event_order = index;
desc->event_type = EVENT_TYPE_NONE;
ret = TRUE;
}
}
- iSeqIndex++;
+ index++;
}
return ret;
if (context && windows && cache && utils) {
if (mode == context->get_input_mode() || mode == (sclbyte)NOT_USED) {
- /* BtnContext does not get initialized if we don't call here */
+ /* ButtonContext does not get initialized if we don't call here */
cache->recompute_layout(windows->get_base_window());
return FALSE;
}
handle_engine_signal(SCL_SIG_INPMODE_CHANGE, window);
#ifdef TEST_NEWBACKEND
- SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- if (winctx) {
- if (winctx->etc_info) {
+ SclWindowContext *window_context= windows->get_window_context(window, FALSE);
+ if (window_context) {
+ if (window_context->etc_info) {
- Eina_List *list = (Eina_List*)(winctx->etc_info);
+ Eina_List *list = (Eina_List*)(window_context->etc_info);
Eina_List *iter = NULL;
Eina_List *iter_next = NULL;
void *data = NULL;
}
iIndex++;
}
- winctx->etc_info= list;
+ window_context->etc_info= list;
}
}
#endif
CSCLContext *context = CSCLContext::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
const SclLayout *layout = NULL;
- SclButtonContext *btncontext = NULL;
+ SclButtonContext *button_context = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
if (context && cache) {
layout = cache->get_cur_layout(window);
- btncontext = cache->get_cur_button_context(window, key_index);
+ button_context = cache->get_cur_button_context(window, key_index);
coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- if (layout && coordinate && btncontext && context->get_magnifier_enabled() ) {
+ if (layout && coordinate && button_context && context->get_magnifier_enabled() ) {
if (coordinate->key_type != KEY_TYPE_CONTROL &&
coordinate->key_type != KEY_TYPE_MODECHANGE &&
coordinate->key_type != KEY_TYPE_NONE) {
}
}
if (!custom_label) {
- //if (coordinate->key_value[shiftidx][btncontext->multikeyIdx] == NULL) {
- if (coordinate->label[shiftidx][btncontext->multikeyIdx] == NULL) {
- //utils->log("show_magnifier coordinate->key_value[shift][btncontext->multikeyIdx] == NULL \n");
+ //if (coordinate->key_value[shift_index][button_context->multikeyIdx] == NULL) {
+ if (coordinate->label[shift_index][button_context->multikeyIdx] == NULL) {
+ //utils->log("show_magnifier coordinate->key_value[shift][button_context->multikeyIdx] == NULL \n");
ret = FALSE;
- //} else if (strlen(coordinate->key_value[shiftidx][btncontext->multikeyIdx]) == 0) {
- } else if (strlen(coordinate->label[shiftidx][btncontext->multikeyIdx]) == 0) {
- //utils->log("show_magnifier coordinate->key_value[shift][btncontext->multikeyIdx]) == 0 \n");
+ //} else if (strlen(coordinate->key_value[shift_index][button_context->multikeyIdx]) == 0) {
+ } else if (strlen(coordinate->label[shift_index][button_context->multikeyIdx]) == 0) {
+ //utils->log("show_magnifier coordinate->key_value[shift][button_context->multikeyIdx]) == 0 \n");
ret = FALSE;
}
}
assert(sclres_input_mode_configure != NULL);
assert(sclres_layout != NULL);
- SclButtonContext *btncontext = NULL;
+ SclButtonContext *button_context = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
if (context && cache) {
- btncontext = cache->get_cur_button_context(window, key_index);
+ button_context = cache->get_cur_button_context(window, key_index);
coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
}
- static sclwindow prevwin = SCLWINDOW_INVALID;
- static sclbyte prevkey = NOT_USED;
-
- if (context && cache && windows && events && utils && feedback && handler && btncontext && coordinate) {
+ if (context && cache && windows && events && utils && feedback && handler && button_context && coordinate) {
/* First check if this button is enabled in current active sublayout */
sclboolean sub_layout_match = TRUE;
if (coordinate->sub_layout && context->get_cur_sublayout()) {
for(loop = 0;loop < multi_touch_context_num;loop++) {
SclUIEventDesc desc = multi_touch_events[loop];
if (desc.touch_id != touch_id) {
- mouse_release(context->get_cur_move_window(desc.touch_id),
- context->get_cur_move_point(desc.touch_id).x, context->get_cur_move_point(desc.touch_id).y,
+ mouse_release(context->get_cur_moving_window(desc.touch_id),
+ context->get_cur_moving_point(desc.touch_id).x,
+ context->get_cur_moving_point(desc.touch_id).y,
desc.touch_id, FALSE);
}
}
context->set_cur_pressed_key(touch_id, key_index);
context->set_cur_pressed_window(touch_id, window);
- btncontext->state = BUTTON_STATE_PRESSED;
+ button_context->state = BUTTON_STATE_PRESSED;
redraw = TRUE;
ret = TRUE;
/*CSCLGraphics *grps = CSCLGraphics::get_instance();
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
scldrawctx draw_ctx = grps->begin_paint(window, TRUE);
- builder->draw_button(window, draw_ctx, key_index, btncontext->state, TRUE);
+ builder->draw_button(window, draw_ctx, key_index, button_context->state, TRUE);
grps->end_paint(window, draw_ctx);*/
#endif
events->create_timer(SCL_TIMER_LONGKEY, m_long_key_duration, uniqId);
}
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- SclUIEventDesc key_event_desc = {0};
- key_event_desc.key_value = coordinate->key_value[shiftidx][0];
- key_event_desc.key_event = coordinate->key_event[shiftidx][0];
+ SclUIEventDesc key_event_desc;
+ key_event_desc.key_value = coordinate->key_value[shift_index][0];
+ key_event_desc.key_event = coordinate->key_event[shift_index][0];
key_event_desc.key_type = coordinate->key_type;
key_event_desc.key_modifier = KEY_MODIFIER_NONE;
key_event_desc.event_type = EVENT_TYPE_PRESS;
windows->hide_window(windows->get_magnifier_window());
/* FIXME : The parent key should be turned back to NORMAL state when RELEASED,
in case of POPUP_TYPE_BTN_PRESS_POPUP_DRAG type. Temporariliy setting NORMAL here. */
- btncontext->state = BUTTON_STATE_NORMAL;
+ button_context->state = BUTTON_STATE_NORMAL;
_play_tts_for_input_mode_name(popup_input_mode);
}
}
if (coordinate->use_magnifier) {
sclboolean showMagnifier = check_magnifier_available(window, key_index, touch_id);
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclMagnifierWndConfigure magnifier_configure = NULL;
if (sclres_manager) {
magnifier_configure = sclres_manager->get_magnifier_configure();
}
if (showMagnifier && magnifier_configure) {
- SclPoint pos = {0,};
+ SclPoint pos = {0,0};
/* calculates x position to be set */
pos.x = (coordinate->x + (coordinate->width / 2)) -
(magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
pos.y = coordinate->y - magnifier_configure->height * utils->get_custom_scale_rate_y();
/* FIXME : Temporary way of clearing magnifier window */
- /*SclWindowContext *winctx = windows->get_window_context(windows->get_magnifier_window(), FALSE);
+ /*SclWindowContext *window_context = windows->get_window_context(windows->get_magnifier_window(), FALSE);
sclboolean clearmagwin = FALSE;
- if (winctx) {
- clearmagwin = !(winctx->hidden);
+ if (window_context) {
+ clearmagwin = !(window_context->hidden);
}
static int clearnum = 0;
if (key_index == prevkey && window == prevwin) {
*/
windows->hide_window(windows->get_magnifier_window());
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- pos.x += winctx->geometry.x;
- pos.y += winctx->geometry.y;
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ pos.x += window_context->geometry.x;
+ pos.y += window_context->geometry.y;
}
if (pos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
windows->hide_window(windows->get_magnifier_window());
}
}
-
- prevwin = window;
- prevkey = key_index;
} else {
/* COMMENTED OUT FOR TESTING MULTITOUCH!! */
///* In case the current button is not the given key index */
- //if (btncontext->state == BUTTON_STATE_PRESSED) {
+ //if (button_context->state == BUTTON_STATE_PRESSED) {
// /* Even if the press event occured outside of this button's physical area, reset its context */
- // btncontext->state = BUTTON_STATE_NORMAL;
+ // button_context->state = BUTTON_STATE_NORMAL;
// redraw = TRUE;
//}
/* BUTTON_TYPE_MULTITAP type button should restore its multikey index when another button is clicked */
if (coordinate->button_type & BUTTON_TYPE_MULTITAP) {
- btncontext->multikeyIdx = 0;
+ button_context->multikeyIdx = 0;
}
}
#ifdef DIRECTLY_DRAW_ON_EVENTS
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
if (builder) {
- builder->draw_button(window, NULL, key_index, btncontext->state, TRUE);
+ builder->draw_button(window, NULL, key_index, button_context->state, TRUE);
}
#else
- CSCLWindows *windows = CSCLWindows::get_instance();
if (windows) {
windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
}
cache->get_cur_layout_key_coordinate(cur_pressed_window, cur_pressed_key);
if (cur_pressed_coordinate) {
if (cur_pressed_coordinate->multitouch_type == SCL_MULTI_TOUCH_TYPE_SETTLE_PREVIOUS) {
- mouse_release(context->get_cur_move_window(desc.touch_id),
- context->get_cur_move_point(desc.touch_id).x,
- context->get_cur_move_point(desc.touch_id).y,
+ mouse_release(context->get_cur_moving_window(desc.touch_id),
+ context->get_cur_moving_point(desc.touch_id).x,
+ context->get_cur_moving_point(desc.touch_id).y,
desc.touch_id, FALSE);
}
}
if (coordinate->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP ||
coordinate->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE ) {
- SclUIEventDesc key_event_desc = {0};
+ SclUIEventDesc key_event_desc;
key_event_desc.key_type = coordinate->long_key_type;
if (coordinate->long_key_value == NULL && coordinate->long_key_event == 0) {
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- key_event_desc.key_value = coordinate->key_value[shiftidx][0];
- key_event_desc.key_event = coordinate->key_event[shiftidx][0];
+ key_event_desc.key_value = coordinate->key_value[shift_index][0];
+ key_event_desc.key_event = coordinate->key_event[shift_index][0];
} else {
key_event_desc.key_value = coordinate->long_key_value;
key_event_desc.key_event = coordinate->long_key_event;
key_event_desc.event_type = EVENT_TYPE_LONGPRESS;
key_event_desc.touch_id = touch_id;
key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
}
} else if (coordinate->long_key_value) {
if (strlen(coordinate->long_key_value) > 0) {
- SclPoint ptMoving = context->get_cur_move_point(touch_id);
- /*if (ptMoving.x >= coordinate->x && ptMoving.x <= coordinate->x + coordinate->width &&
- ptMoving.y >= coordinate->y && ptMoving.y <= coordinate->y + coordinate->height) {*/
if (windows->is_base_window(window)) {
state->set_cur_action_state(ACTION_STATE_BASE_LONGKEY);
} else {
}
ret = TRUE;
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclMagnifierWndConfigure magnifier_configure = NULL;
if (sclres_manager) {
magnifier_configure = sclres_manager->get_magnifier_configure();
}
if (coordinate->use_long_key_magnifier && magnifier_configure) {
CSCLUtils *utils = CSCLUtils::get_instance();
- SclPoint pos = {0,};
+ SclPoint pos = {0,0};
const SclLayout* layout = cache->get_cur_layout(window);
if (layout) {
- sclfloat scale_rate_x, scale_rate_y;
- if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
- scale_rate_x = utils->get_scale_rate_x();
- scale_rate_y = utils->get_scale_rate_y();
- } else {
- scale_rate_x = utils->get_scale_rate_y();
- scale_rate_y = utils->get_scale_rate_x();
- }
sclint scnWidth, scnHeight;
utils->get_screen_resolution(&scnWidth, &scnHeight);
- //SclWindowContext *winctx = windows->get_window_context(window, TRUE);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- pos.x = winctx->geometry.x + (coordinate->x + (coordinate->width / 2)) -
+ //SclWindowContext *window_context = windows->get_window_context(window, TRUE);
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ pos.x = window_context->geometry.x + (coordinate->x + (coordinate->width / 2)) -
(magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
- pos.y = winctx->geometry.y + coordinate->y -
+ pos.y = window_context->geometry.y + coordinate->y -
magnifier_configure->height * utils->get_custom_scale_rate_y();
}
if (pos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
}
}
- SclUIEventDesc key_event_desc = {0};
+ SclUIEventDesc key_event_desc;
key_event_desc.key_type = coordinate->long_key_type;
key_event_desc.key_value = coordinate->long_key_value;
key_event_desc.key_event = coordinate->long_key_event;
key_event_desc.event_type = EVENT_TYPE_LONGPRESS;
key_event_desc.touch_id = touch_id;
key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
if (context && cache && windows && handler) {
const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
if (coordinate) {
//if (coordinate->key_type != KEY_TYPE_MODECHANGE && coordinate->key_type != KEY_TYPE_COMPOSITION) {
//if (coordinate->key_type != KEY_TYPE_MODECHANGE || coordinate->key_event[0][0] == MVK_BackSpace) {
if (coordinate->key_type != KEY_TYPE_MODECHANGE) {
- sclulong repeatKeyEvent = coordinate->key_event[shiftidx][0];
+ sclulong repeatKeyEvent = coordinate->key_event[shift_index][0];
/* In case of Delete key, Change from Char deletion to Word deletion
when the input accelation speed is reached to Max */
}
}
- SclUIEventDesc key_event_desc = {0};
- key_event_desc.key_value = coordinate->key_value[shiftidx][0];
+ SclUIEventDesc key_event_desc;
+ key_event_desc.key_value = coordinate->key_value[shift_index][0];
key_event_desc.key_event = repeatKeyEvent;
key_event_desc.key_type = coordinate->key_type;
key_event_desc.key_modifier = KEY_MODIFIER_NONE;
key_event_desc.event_type = EVENT_TYPE_REPEAT;
key_event_desc.touch_id = touch_id;
key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
CSCLEventHandler *handler = CSCLEventHandler::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
- SclButtonContext *btncontext = NULL;
+ SclButtonContext *button_context = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
if (cache) {
coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
- btncontext = cache->get_cur_button_context(window, key_index);
+ button_context = cache->get_cur_button_context(window, key_index);
}
- if (btncontext && coordinate && feedback && utils && context && handler && cache && events && windows) {
+ if (button_context && coordinate && feedback && utils && context && handler && cache && events && windows) {
/* If this key is the key previously pressed, add threshold value for avoiding unintended moving */
sclint thresholdX = 0;
sclint thresholdY = 0;
subLayoutMatch ) {
ret = TRUE;
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
const SclLayout* layout = cache->get_cur_layout(windows->get_base_window());
if (check_event_transition_enabled(pressed_coordinate, coordinate)) {
if (layout) {
- sclfloat scale_rate_x, scale_rate_y;
- if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
- scale_rate_x = utils->get_scale_rate_x();
- scale_rate_y = utils->get_scale_rate_y();
- } else {
- scale_rate_x = utils->get_scale_rate_y();
- scale_rate_y = utils->get_scale_rate_x();
- }
-
const scl16 uniqId = utils->get_unique_id();
context->set_cur_pressed_event_id(touch_id, uniqId);
/* Special routine for autopopup */
magnifier_configure = sclres_manager->get_magnifier_configure();
}
if (showMagnifier && magnifier_configure) {
- SclPoint pos = {0,};
+ SclPoint pos = {0,0};
/* calculates x position to be set */
pos.x = (coordinate->x + (coordinate->width / 2)) -
(magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
/* for feedback */
feedback->button_moved(window, key_index);
- btncontext->state = BUTTON_STATE_PRESSED;
+ button_context->state = BUTTON_STATE_PRESSED;
if (pressed_context) {
/* But, if this button should be in pressed state in other multitouch id, do not initialize it */
sclboolean found = FALSE;
SclUIEventDesc desc;
context->get_multi_touch_event(loop, &desc);
if (desc.touch_id != touch_id) {
- MultiTouchContext *mulctx = context->find_multi_touch_context(desc.touch_id);
- if (mulctx) {
- if (mulctx->cur_pressed_window == pressed_window &&
- mulctx->cur_pressed_key == pressed_key) {
+ MultiTouchContext *multi_touch_context =
+ context->find_multi_touch_context(desc.touch_id);
+ if (multi_touch_context) {
+ if (multi_touch_context->cur_pressed_window == pressed_window &&
+ multi_touch_context->cur_pressed_key == pressed_key) {
found = TRUE;
}
}
switch (coordinate->button_type) {
case BUTTON_TYPE_DRAG: {
- SclUIEventDesc key_event_desc = {0};
- key_event_desc.key_value = coordinate->key_value[shiftidx][0];
- key_event_desc.key_event = coordinate->key_event[shiftidx][0];
+ SclUIEventDesc key_event_desc;
+ key_event_desc.key_value = coordinate->key_value[shift_index][0];
+ key_event_desc.key_event = coordinate->key_event[shift_index][0];
key_event_desc.key_type = coordinate->key_type;
key_event_desc.key_modifier = KEY_MODIFIER_NONE;
key_event_desc.event_type = EVENT_TYPE_MOVE;
key_event_desc.touch_id = touch_id;
key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
- PSclMagnifierWndConfigure magnifier_configure = NULL;
if (sclres_manager) {
magnifier_configure = sclres_manager->get_magnifier_configure();
}
sclboolean processed = handler->on_event_drag_state_changed(key_event_desc);
if (processed && context->get_magnifier_enabled() && magnifier_configure) {
- SclPoint zoomwinpos = {0,};
- const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
- sclfloat scale_rate_x, scale_rate_y;
- if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
- scale_rate_x = utils->get_scale_rate_x();
- scale_rate_y = utils->get_scale_rate_y();
- } else {
- scale_rate_x = utils->get_scale_rate_y();
- scale_rate_y = utils->get_scale_rate_x();
- }
+ SclPoint zoomwinpos = {0,0};
/* calculates x position to be set */
zoomwinpos.x = (coordinate->x + (coordinate->width / 2)) -
(magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
zoomwinpos.y = coordinate->y -
magnifier_configure->height * utils->get_custom_scale_rate_y();
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- zoomwinpos.x += winctx->geometry.x;
- zoomwinpos.y += winctx->geometry.y;
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ zoomwinpos.x += window_context->geometry.x;
+ zoomwinpos.y += window_context->geometry.y;
}
if (zoomwinpos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
zoomwinpos.x = 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x();
handler->on_event_key_clicked(key_event_desc);
if (!(windows->is_base_window(window))) {
/* When press event occured in popup window, reset POPUP_TIMEOUT timer */
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- if (winctx->timeout > 0) {
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->timeout > 0) {
events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
- events->create_timer(SCL_TIMER_POPUP_TIMEOUT, winctx->timeout, 0, TRUE);
+ events->create_timer(SCL_TIMER_POPUP_TIMEOUT, window_context->timeout, 0, TRUE);
}
}
}
#ifdef DIRECTLY_DRAW_ON_EVENTS
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
if (builder) {
- if (btncontext) {
- builder->draw_button(window, NULL, key_index, btncontext->state);
+ if (button_context) {
+ builder->draw_button(window, NULL, key_index, button_context->state);
}
if (pressedContext) {
builder->draw_button(pressed_window, NULL, pressed_key, pressedContext->state, TRUE);
#else
windows->update_window(window,
coordinate->x, coordinate->y, coordinate->width, coordinate->height);
- const SclLayoutKeyCoordinate *pressed_coordinate =
- cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
if (pressed_coordinate) {
windows->update_window(pressed_window, pressed_coordinate->x, pressed_coordinate->y,
pressed_coordinate->width, pressed_coordinate->height);
}
sclboolean
-CSCLController::process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte keyindex)
+CSCLController::process_button_over_event(sclwindow window, sclint x, sclint y, sclbyte key_index)
{
SCL_DEBUG();
CSCLFeedback *feedback = CSCLFeedback::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
- SclButtonContext *btncontext = NULL;
+ SclButtonContext *button_context = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
if(cache) {
- coordinate = cache->get_cur_layout_key_coordinate(window, keyindex);
- btncontext = cache->get_cur_button_context(window, keyindex);
+ coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
+ button_context = cache->get_cur_button_context(window, key_index);
}
- if(btncontext && coordinate && feedback && utils && context && cache && events && windows) {
+ if(button_context && coordinate && feedback && utils && context && cache && events && windows) {
/* If this key is the key previously pressed, add threshold value for avoiding unintended moving */
sclboolean subLayoutMatch = TRUE;
if (coordinate->sub_layout && context->get_cur_sublayout()) {
subLayoutMatch ) {
ret = TRUE;
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
const SclLayout* layout = cache->get_cur_layout(windows->get_base_window());
sclwindow highlighted_window = context->get_cur_highlighted_window();
scl8 highlighted_key = context->get_cur_highlighted_key();
- SclButtonContext *cur_context = cache->get_cur_button_context(window, keyindex);
+ SclButtonContext *cur_context = cache->get_cur_button_context(window, key_index);
if(cur_context == NULL) {
return FALSE;
}
- if (keyindex != highlighted_key || window != highlighted_window ) {
- printf("%d != %d || %p != %p\n", keyindex, highlighted_key, window, highlighted_window);
+ if (key_index != highlighted_key || window != highlighted_window ) {
+ printf("%d != %d || %p != %p\n", key_index, highlighted_key, window, highlighted_window);
if(layout) {
- sclfloat scale_rate_x, scale_rate_y;
- if(layout->display_mode == DISPLAYMODE_PORTRAIT) {
- scale_rate_x = utils->get_scale_rate_x();
- scale_rate_y = utils->get_scale_rate_y();
- } else {
- scale_rate_x = utils->get_scale_rate_y();
- scale_rate_y = utils->get_scale_rate_x();
- }
-
if (coordinate->key_type != KEY_TYPE_NONE) {
if (context->get_tts_enabled()) {
- const sclchar *targetstr = coordinate->hint_string[shiftidx][btncontext->multikeyIdx];
+ const sclchar *targetstr = coordinate->hint_string[shift_index][button_context->multikeyIdx];
if (targetstr == NULL) {
- targetstr = coordinate->label[shiftidx][0];
+ targetstr = coordinate->label[shift_index][0];
}
if (targetstr == NULL) {
- targetstr = coordinate->key_value[shiftidx][btncontext->multikeyIdx];
+ targetstr = coordinate->key_value[shift_index][button_context->multikeyIdx];
}
/*if(state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY ||
state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY ) {
}
context->set_cur_highlighted_window(window);
- context->set_cur_highlighted_key(keyindex);
+ context->set_cur_highlighted_key(key_index);
}
}
}
PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
assert(sclres_layout != NULL);
assert(sclres_input_mode_configure != NULL);
- SclButtonContext *btncontext = NULL;
+ SclButtonContext *button_context = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
if (cache) {
- btncontext = cache->get_cur_button_context(window, key_index);
+ button_context = cache->get_cur_button_context(window, key_index);
coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
}
const SclLayoutKeyCoordinate *targetCoordinate = NULL;
- if (utils && feedback && windows && context && state && handler && cache && btncontext && coordinate) {
+ if (utils && feedback && windows && context && state && handler && cache && button_context && coordinate) {
scl8 savedInputMode = context->get_input_mode();
sclwindow pressed_window = context->get_cur_pressed_window(touch_id);
cache->get_cur_layout_key_coordinate(cur_pressed_window, cur_pressed_key);
if (cur_pressed_coordinate) {
if (cur_pressed_coordinate->multitouch_type == SCL_MULTI_TOUCH_TYPE_SETTLE_PREVIOUS) {
- mouse_release(context->get_cur_move_window(desc.touch_id),
- context->get_cur_move_point(desc.touch_id).x, context->get_cur_move_point(desc.touch_id).y,
+ mouse_release(context->get_cur_moving_window(desc.touch_id),
+ context->get_cur_moving_point(desc.touch_id).x,
+ context->get_cur_moving_point(desc.touch_id).y,
desc.touch_id, FALSE);
}
}
/* If the buttontype is RELATIVE_DIRECTION, get the distance from last move point */
if (coordinate->button_type == BUTTON_TYPE_RELATIVE_DIRECTION) {
- startx = context->get_prev_move_point(touch_id).x;
- starty = context->get_prev_move_point(touch_id).y;
+ startx = context->get_prev_moving_point(touch_id).x;
+ starty = context->get_prev_moving_point(touch_id).y;
} else {
startx = context->get_cur_pressed_point(touch_id).x;
starty = context->get_cur_pressed_point(touch_id).y;
/* An event occured? */
if (fireEvt) {
if (targetCoordinate) {
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- SclUIEventDesc key_event_desc = {0};
+ SclUIEventDesc key_event_desc;
key_event_desc.key_type = targetCoordinate->key_type;
key_event_desc.event_type = EVENT_TYPE_RELEASE;
key_event_desc.touch_id = touch_id;
key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
SclButtonContext *pressed_context = cache->get_cur_button_context(pressed_window, pressed_key);
if (pressed_context) {
if (!(targetCoordinate->use_repeat_key) && pressed_context->state == BUTTON_STATE_PRESSED) {
- key_event_desc.key_value = targetCoordinate->key_value[shiftidx][0];
- key_event_desc.key_event = targetCoordinate->key_event[shiftidx][0];
+ key_event_desc.key_value = targetCoordinate->key_value[shift_index][0];
+ key_event_desc.key_event = targetCoordinate->key_event[shift_index][0];
key_event_desc.key_modifier = key_modifier;
handler->on_event_key_clicked(key_event_desc);
}
} else {
key_modifier = KEY_MODIFIER_NONE;
}
- if (btncontext->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
- key_event_desc.key_value = coordinate->key_value[shiftidx][btncontext->multikeyIdx];
- key_event_desc.key_event = coordinate->key_event[shiftidx][btncontext->multikeyIdx];
+ if (button_context->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
+ key_event_desc.key_value = coordinate->key_value[shift_index][button_context->multikeyIdx];
+ key_event_desc.key_event = coordinate->key_event[shift_index][button_context->multikeyIdx];
key_event_desc.key_modifier = key_modifier;
handler->on_event_key_clicked(key_event_desc);
}
/* Check if the multikey index is in valid range, and increase by one */
- if (btncontext->multikeyIdx >= MAX_SIZE_OF_MULTITAP_CHAR - 1) {
- btncontext->multikeyIdx = 0;
+ if (button_context->multikeyIdx >= MAX_SIZE_OF_MULTITAP_CHAR - 1) {
+ button_context->multikeyIdx = 0;
} else {
- sclbyte orgindex = btncontext->multikeyIdx;
- btncontext->multikeyIdx = 0;
- if (targetCoordinate->key_value[shiftidx][orgindex + 1]) {
- if (strlen(targetCoordinate->key_value[shiftidx][orgindex + 1]) > 0) {
- btncontext->multikeyIdx = orgindex + 1;
+ sclbyte orgindex = button_context->multikeyIdx;
+ button_context->multikeyIdx = 0;
+ if (targetCoordinate->key_value[shift_index][orgindex + 1]) {
+ if (strlen(targetCoordinate->key_value[shift_index][orgindex + 1]) > 0) {
+ button_context->multikeyIdx = orgindex + 1;
}
}
}
SclButtonContext *pressed_context = cache->get_cur_button_context(pressed_window, pressed_key);
if (pressed_context) {
if (!(targetCoordinate->use_repeat_key) && pressed_context->state == BUTTON_STATE_PRESSED) {
- key_event_desc.key_value = targetCoordinate->key_value[shiftidx][0];
- key_event_desc.key_event = targetCoordinate->key_event[shiftidx][0];
+ key_event_desc.key_value = targetCoordinate->key_value[shift_index][0];
+ key_event_desc.key_event = targetCoordinate->key_event[shift_index][0];
if (pressed_context->toggled) {
key_event_desc.key_modifier = KEY_MODIFIER_NONE;
} else {
}
} else {
if (targetCoordinate) {
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- SclUIEventDesc key_event_desc = {0};
+ SclUIEventDesc key_event_desc;
key_event_desc.key_type = targetCoordinate->key_type;
- key_event_desc.key_value = targetCoordinate->key_value[shiftidx][btncontext->multikeyIdx];
- key_event_desc.key_event = targetCoordinate->key_event[shiftidx][btncontext->multikeyIdx];
+ key_event_desc.key_value = targetCoordinate->key_value[shift_index][button_context->multikeyIdx];
+ key_event_desc.key_event = targetCoordinate->key_event[shift_index][button_context->multikeyIdx];
key_event_desc.key_modifier = key_modifier;
key_event_desc.event_type = EVENT_TYPE_RELEASE;
key_event_desc.touch_id = touch_id;
key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
}
/* If this button was pressed, initialize the button context regardless of event */
- if (btncontext->state == BUTTON_STATE_PRESSED) {
+ if (button_context->state == BUTTON_STATE_PRESSED) {
/* But, if this button should be in pressed state in other multitouch id, do not initialize */
sclboolean found = FALSE;
for(sclint loop = 0;loop < context->get_multi_touch_context_num() && !found;loop++) {
SclUIEventDesc desc;
context->get_multi_touch_event(loop, &desc);
if (desc.touch_id != touch_id) {
- MultiTouchContext *mulctx = context->find_multi_touch_context(desc.touch_id);
- if (mulctx) {
- if (mulctx->cur_pressed_window == window && mulctx->cur_pressed_key == key_index) {
+ MultiTouchContext *multi_touch_context = context->find_multi_touch_context(desc.touch_id);
+ if (multi_touch_context) {
+ if (multi_touch_context->cur_pressed_window == window &&
+ multi_touch_context->cur_pressed_key == key_index) {
found = TRUE;
}
}
}
}
if (!found) {
- btncontext->state = BUTTON_STATE_NORMAL;
+ button_context->state = BUTTON_STATE_NORMAL;
redraw = TRUE;
}
}
#ifdef DIRECTLY_DRAW_ON_EVENTS
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
if (builder) {
- builder->draw_button(window, NULL, key_index, btncontext->state, TRUE);
+ builder->draw_button(window, NULL, key_index, button_context->state, TRUE);
}
#else
if (savedInputMode == context->get_input_mode()) {
- CSCLWindows *windows = CSCLWindows::get_instance();
- if (windows) {
- windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
- }
+ windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
}
#endif
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
- sclint btnIndex = NOT_USED;
- SclWindowContext *winctx = NULL;
+ sclint button_index = NOT_USED;
+ SclWindowContext *window_context = NULL;
if (windows) {
const SclLayout *layout = cache->get_cur_layout(window);
if (layout) {
x += layout->mouse_manipulate_x;
y += layout->mouse_manipulate_y;
}
- winctx = windows->get_window_context(window);
+ window_context = windows->get_window_context(window);
/* If the dim window is virtual and currently active, let's just skip this event */
if (windows->is_base_window(window)) {
- SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
- if (dimctx) {
- if (dimctx->is_virtual && !(dimctx->hidden)) {
+ SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+ if (dim_window_context) {
+ if (dim_window_context->is_virtual && !(dim_window_context->hidden)) {
window = windows->get_dim_window();
- winctx = dimctx;
+ window_context = dim_window_context;
}
}
}
}
- if (cache && state && windows && context && winctx) {
+ if (cache && state && windows && context && window_context) {
SCLDisplayMode display_mode = context->get_display_mode();
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclDefaultConfigure default_configure = NULL;
context->set_cur_pressed_window(touch_id, window);
context->set_cur_pressed_point(touch_id, x, y);
context->set_cur_pressed_time(touch_id);
- context->set_cur_move_window(touch_id, window);
- context->set_cur_move_point(touch_id, x, y);
+ context->set_cur_moving_window(touch_id, window);
+ context->set_cur_moving_point(touch_id, x, y);
context->set_last_touch_device_id(touch_id);
context->set_cur_drag_state(touch_id, SCL_DRAG_STATE_NONE);
context->set_cur_key_modifier(touch_id, KEY_MODIFIER_NONE);
context->set_prev_pressed_window(touch_id, SCLWINDOW_INVALID);
context->set_prev_pressed_key(touch_id, NOT_USED);
context->set_prev_drag_state(touch_id, SCL_DRAG_STATE_NONE);
- context->set_prev_move_point(touch_id, x, y);
+ context->set_prev_moving_point(touch_id, x, y);
/* Destroy key related timers */
events->destroy_timer(SCL_TIMER_BUTTON_DELAY);
handle_engine_signal(SCL_SIG_MOUSE_PRESS, window);
/* Adjust event x and y positions as relative position to the virtual window */
- if (winctx) {
- /*if (winctx->isVirtual) {
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- x -= (winctx->x - basectx->x);
- y -= (winctx->y - basectx->y);
+ if (window_context) {
+ /*if (window_context->isVirtual) {
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ x -= (window_context->x - base_window_context->x);
+ y -= (window_context->y - base_window_context->y);
}
}*/
}
/* Iterate all the buttons and inform the event */
sclboolean ended = FALSE;
for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
- SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
+ SclButtonContext *button_context = cache->get_cur_button_context(window, loop);
const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
+ if (button_context && coordinate) {
+ if (!(button_context->used)) {
ended = TRUE;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+ } else if (button_context->state != BUTTON_STATE_DISABLED &&
coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (process_button_pressed_event(window, x, y, loop, touch_id, actual_event)) {
if (windows->is_base_window(window)) {
} else {
state->set_cur_action_state(ACTION_STATE_POPUP_PRESS);
}
- btnIndex = loop;
+ button_index = loop;
ret = TRUE;
}
}
/* For covering a missing area about 1 pixel */
if (!ret) {
for (int loop = 0;loop < MAX_KEY;loop++) {
- SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
+ SclButtonContext *button_context = cache->get_cur_button_context(window, loop);
const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
+ if (button_context && coordinate) {
+ if (!(button_context->used)) {
break;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+ } else if (button_context->state != BUTTON_STATE_DISABLED &&
coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (process_button_pressed_event(window, x+1, y+1, loop, touch_id, actual_event)) {
if (windows->is_base_window(window)) {
} else {
state->set_cur_action_state(ACTION_STATE_POPUP_PRESS);
}
- btnIndex = loop;
+ button_index = loop;
break;
}
}
if (windows->is_base_window(window)) {
process_finished = TRUE;
- } else if (btnIndex != NOT_USED) {
+ } else if (button_index != NOT_USED) {
process_finished = TRUE;
} else {
const SclLayout *layout = cache->get_cur_layout(window);
if (layout) {
if (layout->use_sw_background && layout->bg_color.a == 0) {
/* If we could not find appropriate button in this popup window and the popup is transparent */
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- x = (winctx->geometry.x + x - basectx->geometry.x);
- y = (winctx->geometry.y + y - basectx->geometry.y);
+ SclWindowContext *base_window_context =
+ windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ x = (window_context->geometry.x + x - base_window_context->geometry.x);
+ y = (window_context->geometry.y + y - base_window_context->geometry.y);
}
window = windows->get_base_window();
} else {
} while (!process_finished);
}
- sclwindow skipwindow = window;
- if (ret && btnIndex != NOT_USED) {
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, btnIndex);
+ sclwindow skip_window = window;
+ if (ret && button_index != NOT_USED) {
+ const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, button_index);
if (coordinate) {
sclboolean dont_close_popup = FALSE;
if (coordinate->dont_close_popup) {
if (coordinate->popup_type == POPUP_TYPE_BTN_PRESS_POPUP_DRAG) {
/* Check the opened popup was opened by this button */
sclwindow popupwin = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
- SclWindowContext *popupctx = windows->get_window_context(popupwin);
- if (popupctx) {
- SclWindowOpener opener = popupctx->opener;
- if (opener.window == window && opener.key == btnIndex) {
+ SclWindowContext *popup_window_context = windows->get_window_context(popupwin);
+ if (popup_window_context) {
+ SclWindowOpener opener = popup_window_context->opener;
+ if (opener.window == window && opener.key == button_index) {
dont_close_popup = TRUE;
}
}
}
if (dont_close_popup) {
- skipwindow = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+ skip_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
}
}
}
- windows->close_all_popups(skipwindow);
+ windows->close_all_popups(skip_window);
/* When press event occured in popup window, reset POPUP_TIMEOUT timer */
if (!(windows->is_base_window(window))) {
- if (winctx->timeout > 0) {
+ if (window_context->timeout > 0) {
events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
- events->create_timer(SCL_TIMER_POPUP_TIMEOUT, winctx->timeout, 0, TRUE);
+ events->create_timer(SCL_TIMER_POPUP_TIMEOUT, window_context->timeout, 0, TRUE);
}
- } else if (skipwindow != window) { /* Or the pressed button has dont_close_popup property, reset POPUP_TIMEOUT timer */
- //SclWindowContext *skipwinctx = windows->get_window_context(skipwindow, FALSE);
- SclWindowContext *skipwinctx = windows->get_window_context(skipwindow);
- if (skipwinctx) {
- if (skipwinctx->timeout > 0) {
+ } else if (skip_window != window) { /* Or the pressed button has dont_close_popup property, reset POPUP_TIMEOUT timer */
+ //SclWindowContext *skip_window_context = windows->get_window_context(skip_window, FALSE);
+ SclWindowContext *skip_window_context = windows->get_window_context(skip_window);
+ if (skip_window_context) {
+ if (skip_window_context->timeout > 0) {
events->destroy_timer(SCL_TIMER_POPUP_TIMEOUT);
- events->create_timer(SCL_TIMER_POPUP_TIMEOUT, skipwinctx->timeout, 0, TRUE);
+ events->create_timer(SCL_TIMER_POPUP_TIMEOUT, skip_window_context->timeout, 0, TRUE);
}
}
}
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
CSCLEventHandler *handler = CSCLEventHandler::get_instance();
+ CSCLEvents *events = CSCLEvents::get_instance();
- sclint btnIndex = NOT_USED;
+ sclint button_index = NOT_USED;
- if (cache && state && windows && context && utils && handler && context->find_multi_touch_context(touch_id)) {
+ if (cache && state && windows && context && utils && handler && events &&
+ context->find_multi_touch_context(touch_id)) {
const SclLayout *layout = cache->get_cur_layout(window);
if (layout) {
x += layout->mouse_manipulate_x;
y += layout->mouse_manipulate_y;
}
- sclwindow skipwindow = SCLWINDOW_INVALID;
+ sclwindow skip_window = SCLWINDOW_INVALID;
SCLDisplayMode display_mode = context->get_display_mode();
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &x, &y);
}
- context->set_cur_move_window(touch_id, SCLWINDOW_INVALID);
+ context->set_cur_moving_window(touch_id, SCLWINDOW_INVALID);
sclwindow pressed_window = context->get_cur_pressed_window(touch_id);
scl8 pressed_key = context->get_cur_pressed_key(touch_id);
- //SclWindowContext *winctx = windows->get_window_context(window, TRUE);
- SclWindowContext *winctx = windows->get_window_context(window);
+ //SclWindowContext *window_context = windows->get_window_context(window, TRUE);
+ SclWindowContext *window_context = windows->get_window_context(window);
/* Adjust event x and y positions as relative position to the virtual window */
- if (winctx) {
- /*if (winctx->isVirtual) {
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- x -= (winctx->x - basectx->x);
- y -= (winctx->y - basectx->y);
+ if (window_context) {
+ /*if (window_context->isVirtual) {
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ x -= (window_context->x - base_window_context->x);
+ y -= (window_context->y - base_window_context->y);
}
}*/
/* If the dim window is virtual and currently active, consider base window's event is occured in dim window */
if (windows->is_base_window(window)) {
- SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
- if (dimctx) {
- if (dimctx->is_virtual && !(dimctx->hidden)) {
+ SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+ if (dim_window_context) {
+ if (dim_window_context->is_virtual && !(dim_window_context->hidden)) {
window = windows->get_dim_window();
- winctx = dimctx;
+ window_context = dim_window_context;
}
}
}
/* Iterate all the buttons and inform the event */
sclboolean ended = FALSE;
- CSCLUtils *utils = CSCLUtils::get_instance();
/* FIXME : The routine below seems to be removed, which was originally requested by Vodafone,
* to slow down the speed of repeat key right before stopping repeatkey event */
drag_type = DRAG_UP;
}
SclNotiGestureFlickDesc desc;
- SclUIEventDesc ui_event_desc = {0};
+ SclUIEventDesc ui_event_desc;
ui_event_desc.key_value = NULL;
ui_event_desc.key_event = NOT_USED;
ui_event_desc.key_modifier = KEY_MODIFIER_NONE;
ui_event_desc.event_type = EVENT_TYPE_RELEASE;
ui_event_desc.touch_id = touch_id;
ui_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- ui_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ ui_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
ui_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
ui_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
desc.ui_event_desc = &ui_event_desc;
/* FIXME : We should consider this kind of action in general manner, not only specific to autopopup */
/* And also, this kind of implementation only selects button that was highlighted at least once. */
// {
- //SclWindowContext *pressedCtx = windows->get_window_context(pressed_window, FALSE);
- SclWindowContext *pressedCtx = windows->get_window_context(pressed_window);
- if (pressedCtx) {
- utils->log("PRESSED CTX : %p %d %d\n", pressed_window, pressedCtx->geometry.x, pressedCtx->geometry.y);
+ //SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window, FALSE);
+ SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window);
+ if (pressed_window_context) {
+ utils->log("PRESSED CTX : %p %d %d\n", pressed_window,
+ pressed_window_context->geometry.x, pressed_window_context->geometry.y);
//if (pressedCtx->popuptype == POPUP_TYPE_AUTO_POPUP) {
sclboolean grab_event = FALSE;
- const SclLayout *layout = cache->get_cur_layout(pressed_window);
- if (layout) {
- if (layout->style == LAYOUT_STYLE_POPUP_GRAB) {
+ const SclLayout *pressed_layout = cache->get_cur_layout(pressed_window);
+ if (pressed_layout) {
+ if (pressed_layout->style == LAYOUT_STYLE_POPUP_GRAB) {
grab_event = TRUE;
}
/* If the topmost window has the POPUP_GRAB style, find the nearest button to the mouse pointer */
if (grab_event) {
/* If the layout's addGrab* values are defined, process this event only if the event occured inside grab area */
sclboolean in_grab_area = TRUE;
- if (layout->add_grab_left != NOT_USED && x < (pressedCtx->geometry.x - layout->add_grab_left)) {
+ if (pressed_layout->add_grab_left != NOT_USED &&
+ x < (pressed_window_context->geometry.x - pressed_layout->add_grab_left)) {
in_grab_area = FALSE;
}
- if (layout->add_grab_right != NOT_USED &&
- x > (pressedCtx->geometry.x + pressedCtx->geometry.width + layout->add_grab_right)) {
+ if (pressed_layout->add_grab_right != NOT_USED &&
+ x > (pressed_window_context->geometry.x + pressed_window_context->geometry.width
+ + pressed_layout->add_grab_right)) {
in_grab_area = FALSE;
}
- if (layout->add_grab_top != NOT_USED && y < (pressedCtx->geometry.y - layout->add_grab_top)) {
+ if (pressed_layout->add_grab_top != NOT_USED &&
+ y < (pressed_window_context->geometry.y - pressed_layout->add_grab_top)) {
in_grab_area = FALSE;
}
- if (layout->add_grab_bottom != NOT_USED &&
- y > (pressedCtx->geometry.y + pressedCtx->geometry.height + layout->add_grab_bottom)) {
+ if (pressed_layout->add_grab_bottom != NOT_USED &&
+ y > (pressed_window_context->geometry.y + pressed_window_context->geometry.height
+ + pressed_layout->add_grab_bottom)) {
in_grab_area = FALSE;
}
if (in_grab_area) {
y = coord->y + (coord->height / 2);
for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
- SclButtonContext *btncontext = cache->get_cur_button_context(pressed_window, loop);
+ SclButtonContext *button_context = cache->get_cur_button_context(pressed_window, loop);
const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
+ if (button_context && coordinate) {
+ if (!(button_context->used)) {
ended = TRUE;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+ } else if (button_context->state != BUTTON_STATE_DISABLED &&
coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (process_button_release_event(pressed_window, x, y, loop, touch_id, actual_event)) {
ret = TRUE;
}
// }
- SclButtonContext *btncontext = cache->get_cur_button_context(pressed_window, pressed_key);
+ SclButtonContext *button_context = cache->get_cur_button_context(pressed_window, pressed_key);
const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
/* FIXME : The rule below would not be a general requirement. A policy is needed regarding this. */
if (windows->is_base_window(window)) {
ended = TRUE;
/* In case of direction button, the release event on other window should be processed */
- if (coordinate && winctx && pressedCtx) {
+ if (coordinate && window_context && pressed_window_context) {
if (coordinate->button_type == BUTTON_TYPE_DIRECTION || coordinate->button_type == BUTTON_TYPE_RELATIVE_DIRECTION) {
- sclint relx = (winctx->geometry.x + x) - pressedCtx->geometry.x;
- sclint rely = (winctx->geometry.y + y) - pressedCtx->geometry.y;
+ sclint relx = (window_context->geometry.x + x) - pressed_window_context->geometry.x;
+ sclint rely = (window_context->geometry.y + y) - pressed_window_context->geometry.y;
if (process_button_release_event(pressed_window, relx, rely, pressed_key, touch_id, actual_event)) {
- btnIndex = pressed_key;
+ button_index = pressed_key;
ret = TRUE;
x = coordinate->x + (coordinate->width / 2);
y = coordinate->y + (coordinate->height / 2);
- skipwindow = pressed_window;
+ skip_window = pressed_window;
}
}
}
sclboolean process_finished = FALSE;
do {
- MultiTouchContext *mulctx = context->find_multi_touch_context(touch_id);
- if (mulctx) {
- if (!(mulctx->is_sub_event)) {
+ MultiTouchContext *multi_touch_context = context->find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ if (!(multi_touch_context->is_sub_event)) {
/* First check if the event occured in pressed key's threshold area */
- if (btncontext && coordinate && !ended) {
- if (btncontext->used && btncontext->state != BUTTON_STATE_DISABLED) {
+ if (button_context && coordinate && !ended) {
+ if (button_context->used && button_context->state != BUTTON_STATE_DISABLED) {
if (process_button_release_event(pressed_window, x, y, pressed_key, touch_id, actual_event)) {
- btnIndex = pressed_key;
+ button_index = pressed_key;
ret = TRUE;
x = coordinate->x + (coordinate->width / 2);
y = coordinate->y + (coordinate->height / 2);
}
}
for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
- SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
+ SclButtonContext *cur_context = cache->get_cur_button_context(window, loop);
+ const SclLayoutKeyCoordinate *cur_coordinate = cache->get_cur_layout_key_coordinate(window, loop);
+ if (cur_context && cur_coordinate) {
+ if (!(cur_context->used)) {
ended = TRUE;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
- coordinate->button_type != BUTTON_TYPE_UIITEM) {
+ } else if (cur_context->state != BUTTON_STATE_DISABLED &&
+ cur_coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (window != pressed_window || loop != pressed_key) {
if (process_button_release_event(window, x, y, loop, touch_id, actual_event)) {
- btnIndex = loop;
+ button_index = loop;
ret = TRUE;
}
}
} else {
process_finished = TRUE;
- SclUIEventDesc key_event_desc = {0};
+ SclUIEventDesc key_event_desc;
key_event_desc.key_value = NULL;
key_event_desc.key_event = NOT_USED;
key_event_desc.key_modifier = KEY_MODIFIER_NONE;
key_event_desc.event_type = EVENT_TYPE_NONE;
key_event_desc.touch_id = touch_id;
key_event_desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- key_event_desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ key_event_desc.mouse_current_point = context->get_cur_moving_point(touch_id);
key_event_desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
key_event_desc.touch_event_order = context->get_multi_touch_event_order(touch_id);
}
for (int loop = 0;loop < MAX_KEY && !ended;loop++) {
- SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
+ SclButtonContext *cur_context = cache->get_cur_button_context(window, loop);
+ if (cur_context && coordinate) {
+ if (!(cur_context->used)) {
ended = TRUE;
break;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+ } else if (cur_context->state != BUTTON_STATE_DISABLED &&
coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (process_button_release_event(window, x+1, y+1, loop, touch_id)) {
- btnIndex = loop;
+ button_index = loop;
ret = TRUE;
break;
}
}
if (windows->is_base_window(window)) {
process_finished = TRUE;
- } else if (btnIndex != NOT_USED) {
+ } else if (button_index != NOT_USED) {
process_finished = TRUE;
} else {
- const SclLayout *layout = cache->get_cur_layout(window);
- if (layout->use_sw_background && layout->bg_color.a == 0) {
+ if (layout && layout->use_sw_background && layout->bg_color.a == 0) {
/* If we could not find appropriate button in this popup window and the popup is transparent */
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- x = (winctx->geometry.x + x - basectx->geometry.x);
- y = (winctx->geometry.y + y - basectx->geometry.y);
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ x = (window_context->geometry.x + x - base_window_context->geometry.x);
+ y = (window_context->geometry.y + y - base_window_context->geometry.y);
}
window = windows->get_base_window();
} else {
}
/* Restore previously pressed button's context and redraw it */
- if (btncontext && coordinate) {
- btncontext->state = BUTTON_STATE_NORMAL;
+ if (button_context && coordinate) {
+ button_context->state = BUTTON_STATE_NORMAL;
/* Commented below line to postpone some of the feedback for releasing */
//windows->update_window(pressed_window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
}
/* If there is postponed update of button, update it now */
- CSCLEvents *events = CSCLEvents::get_instance();
sclwindow last_win = context->get_last_pressed_window();
scl8 last_key = context->get_last_pressed_key();
if (last_win != SCLWINDOW_INVALID && last_key != NOT_USED) {
case POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE:
{
/* Fix me : We should consider z-order */
- skipwindow = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
- handle_engine_signal(SCL_SIG_MOUSE_RELEASE, skipwindow);
+ skip_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+ handle_engine_signal(SCL_SIG_MOUSE_RELEASE, skip_window);
signaled = TRUE;
}
break;
}
}
if (!signaled) {
- //SclWindowContext *ctx = windows->get_window_context(window, FALSE);
- SclWindowContext *ctx = windows->get_window_context(window);
- if (ctx) {
- if (ctx->popup_type == POPUP_TYPE_BTN_RELEASE_POPUP ||
- ctx->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP) {
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->popup_type == POPUP_TYPE_BTN_RELEASE_POPUP ||
+ window_context->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP) {
/* Don't close window if the clicked button is a child of ReleasePopup window */
- skipwindow = window;
+ skip_window = window;
handle_engine_signal(SCL_SIG_MOUSE_RELEASE, window);
signaled = TRUE;
}
context->set_cur_pressed_key(touch_id, NOT_USED);
context->set_cur_pressed_window(touch_id, SCLWINDOW_INVALID);
- if (ret && btnIndex != NOT_USED) {
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, btnIndex);
- if (coordinate) {
- if (coordinate->dont_close_popup) {
- skipwindow = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+ if (ret && button_index != NOT_USED) {
+ const SclLayoutKeyCoordinate *cur_coordinate = cache->get_cur_layout_key_coordinate(window, button_index);
+ if (cur_coordinate) {
+ if (cur_coordinate->dont_close_popup) {
+ skip_window = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
}
}
} else {
if (pressed_window == windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP)) {
- if (pressedCtx) {
- if (pressedCtx->popup_type != POPUP_TYPE_BTN_RELEASE_POPUP_ONCE &&
- pressedCtx->popup_type != POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE &&
- pressedCtx->popup_type != POPUP_TYPE_AUTO_POPUP &&
- pressedCtx->popup_type != POPUP_TYPE_BTN_PRESS_POPUP_DRAG)
+ if (pressed_window_context) {
+ if (pressed_window_context->popup_type != POPUP_TYPE_BTN_RELEASE_POPUP_ONCE &&
+ pressed_window_context->popup_type != POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE &&
+ pressed_window_context->popup_type != POPUP_TYPE_AUTO_POPUP &&
+ pressed_window_context->popup_type != POPUP_TYPE_BTN_PRESS_POPUP_DRAG)
{
- skipwindow = pressed_window;
+ skip_window = pressed_window;
}
}
}
}
- windows->close_all_popups(skipwindow);
+ windows->close_all_popups(skip_window);
/* Destroy key related timers */
events->destroy_timer(SCL_TIMER_AUTOPOPUP);
/* To postpone some of the feedback for releasing */
events->create_timer(SCL_TIMER_BUTTON_DELAY, m_button_delay_duration, 0);
} else {
- sclwindow last_win = context->get_last_pressed_window();
- scl8 last_key = context->get_last_pressed_key();
+ last_win = context->get_last_pressed_window();
+ last_key = context->get_last_pressed_key();
if (last_win != SCLWINDOW_INVALID && last_key != NOT_USED) {
- const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(last_win, last_key);
- if (coordinate) {
+ const SclLayoutKeyCoordinate* last_coordinate = cache->get_cur_layout_key_coordinate(last_win, last_key);
+ if (last_coordinate) {
windows->update_window(last_win,
- coordinate->x, coordinate->y, coordinate->width, coordinate->height);
+ last_coordinate->x, last_coordinate->y, last_coordinate->width, last_coordinate->height);
}
}
PSclModifierDecoration sclres_modifier_decoration = sclres_manager->get_modifier_decoration_table();
assert(sclres_modifier_decoration != NULL);
- if (cache && state && windows && context && utils && adjustment) {
+ if (cache && state && windows && context && utils && adjustment && sclres_manager) {
const SclLayout *layout = cache->get_cur_layout(window);
if (layout) {
x += layout->mouse_manipulate_x;
if (!(context->find_multi_touch_context(touch_id))) return FALSE;
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
- PSclDefaultConfigure default_configure = NULL;
- if (sclres_manager) {
- default_configure = sclres_manager->get_default_configure();
- }
+ PSclDefaultConfigure default_configure = sclres_manager->get_default_configure();
if (default_configure) {
SCLDisplayMode display_mode = context->get_display_mode();
adjustment->apply_touch_offset(default_configure->touch_offset_level[display_mode], &x, &y);
}
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
/* Adjust event x and y positions as relative position to the virtual window */
- if (winctx) {
- /*if (winctx->isVirtual) {
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- x -= (winctx->x - basectx->x);
- y -= (winctx->y - basectx->y);
+ if (window_context) {
+ /*if (window_context->isVirtual) {
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ x -= (window_context->x - base_window_context->x);
+ y -= (window_context->y - base_window_context->y);
}
}*/
/* If the dim window is virtual and currently active, let's just skip this event */
if (windows->is_base_window(window)) {
- SclWindowContext *dimctx = windows->get_window_context(windows->get_dim_window());
- if (dimctx) {
- if (dimctx->is_virtual && !(dimctx->hidden)) {
+ SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
+ if (dim_window_context) {
+ if (dim_window_context->is_virtual && !(dim_window_context->hidden)) {
return FALSE;
}
}
sclwindow pressed_window = context->get_cur_pressed_window(touch_id);
scl8 pressed_key = context->get_cur_pressed_key(touch_id);
- SclButtonContext *btncontext = cache->get_cur_button_context(pressed_window, pressed_key);
+ SclButtonContext *button_context = cache->get_cur_button_context(pressed_window, pressed_key);
const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
/* If the multitouch type is SETTLE_PREVIOUS and is not the last touch device, let's ignore move events */
}
}
- context->set_cur_move_point(touch_id, x, y);
- context->set_cur_move_window(touch_id, window);
+ context->set_cur_moving_point(touch_id, x, y);
+ context->set_cur_moving_window(touch_id, window);
/* If in longkey state, do not process, just return */
if (state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY ||
sclint originx = x;
sclint originy = y;
if (pressed_window != window) {
- //SclWindowContext *pressedwinctx = windows->get_window_context(pressed_window, FALSE);
- SclWindowContext *pressedwinctx = windows->get_window_context(pressed_window);
- if (winctx && pressedwinctx) {
- originx = (winctx->geometry.x - pressedwinctx->geometry.x) + x;
- originy = (winctx->geometry.y - pressedwinctx->geometry.y) + y;
+ //SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window, FALSE);
+ SclWindowContext *pressed_window_context = windows->get_window_context(pressed_window);
+ if (window_context && pressed_window_context) {
+ originx = (window_context->geometry.x - pressed_window_context->geometry.x) + x;
+ originy = (window_context->geometry.y - pressed_window_context->geometry.y) + y;
}
}
sclint startx = originx;
starty = context->get_cur_pressed_point(touch_id).y;
sclint deltax = originx - startx;
sclint deltay = originy - starty;
- sclfloat dist = utils->get_approximate_distance(originx, originy, startx, starty);
- CSCLUtils *utils = CSCLUtils::get_instance();
+ sclfloat approximate_dist = utils->get_approximate_distance(originx, originy, startx, starty);
sclboolean update_magnifier = FALSE;
sclboolean drag_state_changed = FALSE;
if (coordinate->button_type == BUTTON_TYPE_DIRECTION) {
/* Do not check farthest move point if current drag state is SCL_DRAG_STATE_RETURN */
if (context->get_cur_drag_state(touch_id) != SCL_DRAG_STATE_RETURN) {
- if (dist > context->get_farthest_move_dist(touch_id)) {
+ if (approximate_dist > context->get_farthest_move_dist(touch_id)) {
context->set_farthest_move_point(touch_id, originx, originy);
}
}
} else if (cur_drag_state != SCL_DRAG_STATE_NONE) {
direction_recog_dist *= SCL_DRAG_RETURN_RECOG_THRESHOLD_OTHER;
}
- if (dist > direction_recog_dist) {
+ if (approximate_dist > direction_recog_dist) {
next_drag_state = get_drag_state(deltax, deltay);
/* Disable longkey if dragging is recognized */
events->destroy_timer(SCL_TIMER_LONGKEY);
}
}
if (dist > direction_recog_dist) {
- SclUIEventDesc desc = {0};
- SCLShiftState shiftidx = context->get_shift_state();
+ SclUIEventDesc desc;
+ SCLShiftState shift_index = context->get_shift_state();
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
desc.key_type = coordinate->key_type;
- desc.key_value = coordinate->key_value[shiftidx][0];
- desc.key_event = coordinate->key_event[shiftidx][0];
+ desc.key_value = coordinate->key_value[shift_index][0];
+ desc.key_event = coordinate->key_event[shift_index][0];
desc.event_type = EVENT_TYPE_MOVE;
desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ desc.mouse_current_point = context->get_cur_moving_point(touch_id);
desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
desc.key_modifier = key_modifier;
}
} else if (coordinate->button_type == BUTTON_TYPE_RELATIVE_DIRECTION) {
if (cur_drag_state != SCL_DRAG_STATE_NONE) {
- startx = context->get_prev_move_point(touch_id).x;
- starty = context->get_prev_move_point(touch_id).y;
- dist = utils->get_approximate_distance(originx, originy, startx, starty);
+ startx = context->get_prev_moving_point(touch_id).x;
+ starty = context->get_prev_moving_point(touch_id).y;
+ approximate_dist = utils->get_approximate_distance(originx, originy, startx, starty);
direction_recog_dist = SCL_DIRECTION_RELATIVE_RECOG_DIST * utils->get_smallest_scale_rate();
}
deltax = originx - startx;
deltay = originy - starty;
//printf("DIST : %f, RECOG : %f\n", dist, direction_recog_dist);
- if (dist > direction_recog_dist) {
+ if (approximate_dist > direction_recog_dist) {
next_drag_state = get_drag_state(deltax, deltay);
/* Disable longkey if dragging is recognized */
events->destroy_timer(SCL_TIMER_LONGKEY);
}
}
- SclUIEventDesc desc = {0};
- SCLShiftState shiftidx = context->get_shift_state();
+ SclUIEventDesc desc;
+ SCLShiftState shift_index = context->get_shift_state();
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
desc.key_type = coordinate->key_type;
- desc.key_value = coordinate->key_value[shiftidx][0];
- desc.key_event = coordinate->key_event[shiftidx][0];
+ desc.key_value = coordinate->key_value[shift_index][0];
+ desc.key_event = coordinate->key_event[shift_index][0];
desc.event_type = EVENT_TYPE_MOVE;
desc.mouse_pressed_point = context->get_cur_pressed_point(touch_id);
- desc.mouse_current_point = context->get_cur_move_point(touch_id);
+ desc.mouse_current_point = context->get_cur_moving_point(touch_id);
desc.mouse_farthest_point = context->get_farthest_move_point(touch_id);
desc.key_modifier = key_modifier;
update_magnifier = TRUE;
}
}
- context->set_prev_move_point(touch_id, originx, originy);
+ context->set_prev_moving_point(touch_id, originx, originy);
}
if (drag_state_changed) {
/* When the dragging direction changes, save the current position as farthest point for future comparison */
}
if (update_magnifier) {
- SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclMagnifierWndConfigure magnifier_configure = NULL;
if (sclres_manager) {
magnifier_configure = sclres_manager->get_magnifier_configure();
}
- const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
- if (layout && magnifier_configure) {
- sclfloat scale_rate_x, scale_rate_y;
- if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
- scale_rate_x = utils->get_scale_rate_x();
- scale_rate_y = utils->get_scale_rate_y();
- } else {
- scale_rate_x = utils->get_scale_rate_y();
- scale_rate_y = utils->get_scale_rate_x();
- }
-
- SclPoint zoomwinpos = {0,};
+ const SclLayout *base_layout = cache->get_cur_layout(windows->get_base_window());
+ if (base_layout && magnifier_configure) {
+ SclPoint zoomwinpos = {0,0};
/* calculates x position to be set */
zoomwinpos.x = (coordinate->x + (coordinate->width / 2)) -
(magnifier_configure->width * utils->get_custom_scale_rate_x() / 2);
utils->get_screen_resolution(&scnWidth, &scnHeight);
zoomwinpos.y = coordinate->y - magnifier_configure->height * utils->get_custom_scale_rate_y();
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- zoomwinpos.x += winctx->geometry.x;
- zoomwinpos.y += winctx->geometry.y;
+ if (window_context) {
+ zoomwinpos.x += window_context->geometry.x;
+ zoomwinpos.y += window_context->geometry.y;
}
if (zoomwinpos.x < 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x()) {
zoomwinpos.x = 0 - magnifier_configure->padding_x * utils->get_custom_scale_rate_x();
grab_event = TRUE;
}
/* If the topmost window has the POPUP_GRAB style, find the nearest button to the mouse pointer */
- if (grab_event && winctx) {
+ if (grab_event && window_context) {
/* If the layout's addGrab* values are defined, process this event only if the event occured inside grab area */
sclboolean in_grab_area = TRUE;
if (layout->add_grab_left != NOT_USED && x < -(layout->add_grab_left)) {
in_grab_area = FALSE;
}
- if (layout->add_grab_right != NOT_USED && x > (winctx->geometry.width + layout->add_grab_right)) {
+ if (layout->add_grab_right != NOT_USED && x >
+ (window_context->geometry.width + layout->add_grab_right)) {
in_grab_area = FALSE;
}
if (layout->add_grab_top != NOT_USED && y < -(layout->add_grab_top)) {
in_grab_area = FALSE;
}
- if (layout->add_grab_bottom != NOT_USED && y > (winctx->geometry.height + layout->add_grab_bottom)) {
+ if (layout->add_grab_bottom != NOT_USED && y >
+ (window_context->geometry.height + layout->add_grab_bottom)) {
in_grab_area = FALSE;
}
if (in_grab_area) {
- CSCLResourceCache *cache = CSCLResourceCache::get_instance();
- if (cache) {
- float min_dist = (float)((unsigned int)(-1));
- int min_dist_index = NOT_USED;
- for (int loop = 0;loop < MAX_KEY && !ended && !ret;loop++) {
- btncontext = cache->get_cur_button_context(window, loop);
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
- ended = TRUE;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
- coordinate->button_type != BUTTON_TYPE_UIITEM) {
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (coordinate) {
- float dist = utils->get_approximate_distance(x, y,
- coordinate->x + (coordinate->width / 2), coordinate->y + (coordinate->height / 2));
- if (dist < min_dist) {
- min_dist_index = loop;
- min_dist = dist;
- }
- }
+ float min_dist = (float)((unsigned int)(-1));
+ int min_dist_index = NOT_USED;
+ for (int loop = 0;loop < MAX_KEY && !ended && !ret;loop++) {
+ button_context = cache->get_cur_button_context(window, loop);
+ const SclLayoutKeyCoordinate *cur_coordinate = cache->get_cur_layout_key_coordinate(window, loop);
+ if (button_context && cur_coordinate) {
+ if (!(button_context->used)) {
+ ended = TRUE;
+ } else if (button_context->state != BUTTON_STATE_DISABLED &&
+ cur_coordinate->button_type != BUTTON_TYPE_UIITEM) {
+ float dist = utils->get_approximate_distance(x, y,
+ cur_coordinate->x + (cur_coordinate->width / 2),
+ cur_coordinate->y + (cur_coordinate->height / 2));
+ if (dist < min_dist) {
+ min_dist_index = loop;
+ min_dist = dist;
}
}
}
- /* When we found the nearest button, generate this event on the button */
- if (min_dist_index != NOT_USED) {
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, min_dist_index);
- x = coordinate->x + (coordinate->width / 2);
- y = coordinate->y + (coordinate->height / 2);
+ }
+ /* When we found the nearest button, generate this event on the button */
+ if (min_dist_index != NOT_USED) {
+ const SclLayoutKeyCoordinate *min_coordinate =
+ cache->get_cur_layout_key_coordinate(window, min_dist_index);
+ if (min_coordinate) {
+ x = min_coordinate->x + (min_coordinate->width / 2);
+ y = min_coordinate->y + (min_coordinate->height / 2);
if (process_button_move_event(window, x, y, min_dist_index, touch_id, actual_event)) {
ret = TRUE;
}
}
}
} else {
- MultiTouchContext *mulctx = context->find_multi_touch_context(touch_id);
- if (mulctx) {
- sclint btnIndex = NOT_USED;
- if (!(mulctx->is_sub_event)) {
+ MultiTouchContext *multi_touch_context = context->find_multi_touch_context(touch_id);
+ if (multi_touch_context) {
+ sclint button_index = NOT_USED;
+ if (!(multi_touch_context->is_sub_event)) {
sclboolean process_finished = FALSE;
do {
/* First check if the event occured in pressed key's threshold area */
- if (btncontext && coordinate) {
+ if (button_context && coordinate) {
if (pressed_window == window) { // Check only when the window is the one initally pressed
- if (btncontext->used && btncontext->state != BUTTON_STATE_DISABLED) {
+ if (button_context->used && button_context->state != BUTTON_STATE_DISABLED) {
if (process_button_move_event(pressed_window, x, y, pressed_key, touch_id, actual_event)) {
ret = TRUE;
x = coordinate->x + (coordinate->width / 2);
y = coordinate->y + (coordinate->height / 2);
- btnIndex = pressed_key;
+ button_index = pressed_key;
}
}
}
}
for (int loop = 0;loop < MAX_KEY && !ended && !ret;loop++) {
- btncontext = cache->get_cur_button_context(window, loop);
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
+ button_context = cache->get_cur_button_context(window, loop);
+ const SclLayoutKeyCoordinate *cur_coordinate =
+ cache->get_cur_layout_key_coordinate(window, loop);
+ if (button_context && cur_coordinate) {
+ if (!(button_context->used)) {
ended = TRUE;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
- coordinate->button_type != BUTTON_TYPE_UIITEM) {
+ } else if (button_context->state != BUTTON_STATE_DISABLED &&
+ cur_coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (window != pressed_window || loop != pressed_key) {
if (process_button_move_event(window, x, y, loop, touch_id, actual_event)) {
ret = TRUE;
- btnIndex = loop;
+ button_index = loop;
}
}
}
if (windows->is_base_window(window)) {
process_finished = TRUE;
- } else if (btnIndex != NOT_USED) {
+ } else if (button_index != NOT_USED) {
process_finished = TRUE;
} else {
- const SclLayout *layout = cache->get_cur_layout(window);
- if (layout->use_sw_background && layout->bg_color.a == 0) {
+ const SclLayout *cur_layout = cache->get_cur_layout(window);
+ if (cur_layout && cur_layout->use_sw_background && cur_layout->bg_color.a == 0) {
/* If we could not find appropriate button in this popup window and the popup is transparent */
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- x = (winctx->geometry.x + x - basectx->geometry.x);
- y = (winctx->geometry.y + y - basectx->geometry.y);
+ SclWindowContext *base_window_context =
+ windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ x = (window_context->geometry.x + x - base_window_context->geometry.x);
+ y = (window_context->geometry.y + y - base_window_context->geometry.y);
}
window = windows->get_base_window();
} else {
sclboolean ended = FALSE;
for (int loop = 0; loop < MAX_KEY && !ended && !ret; loop++) {
- SclButtonContext *btncontext = cache->get_cur_button_context(window, loop);
+ SclButtonContext *button_context = cache->get_cur_button_context(window, loop);
const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (btncontext && coordinate) {
- if (!(btncontext->used)) {
+ if (button_context && coordinate) {
+ if (!(button_context->used)) {
ended = TRUE;
- } else if (btncontext->state != BUTTON_STATE_DISABLED &&
+ } else if (button_context->state != BUTTON_STATE_DISABLED &&
coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (process_button_over_event(window, x, y, loop)) {
ret = TRUE;
return FALSE;
}
- SclRectangle rect = {0,};
+ SclRectangle rect = {0,0,0,0};
sclwindow window = context->get_cur_pressed_window(context->get_last_touch_device_id());
- sclbyte keyIndex = context->get_cur_pressed_key(context->get_last_touch_device_id());
+ sclbyte key_index = context->get_cur_pressed_key(context->get_last_touch_device_id());
- if (configure_autopopup_window(window, keyIndex, &rect)) {
+ if (configure_autopopup_window(window, key_index, &rect)) {
/* Let's change out pressed button's state back to normal */
- SclButtonContext *btncontext = cache->get_cur_button_context(window, keyIndex);
- const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, keyIndex);
+ SclButtonContext *button_context = cache->get_cur_button_context(window, key_index);
+ const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
- if (btncontext) {
- if (btncontext->state == BUTTON_STATE_PRESSED) {
- btncontext->state = BUTTON_STATE_NORMAL;
- CSCLWindows *windows = CSCLWindows::get_instance();
+ if (button_context) {
+ if (button_context->state == BUTTON_STATE_PRESSED) {
+ button_context->state = BUTTON_STATE_NORMAL;
if (windows && coordinate) {
windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
}
/* Currently, window does not support virtual window */
SclWindowOpener opener;
opener.window = window;
- opener.key = keyIndex;
+ opener.key = key_index;
popup_window = windows->open_popup(
opener,
windows->hide_window(windows->get_magnifier_window());
_play_tts_for_layout_autopopup_name();
- sclwindow move_window = context->get_cur_move_window(context->get_last_touch_device_id());
- SclPoint move_point = context->get_cur_move_point(context->get_last_touch_device_id());
- SclWindowContext *move_ctx = windows->get_window_context(move_window);
- SclWindowContext *popup_ctx = windows->get_window_context(popup_window);
- if (move_ctx && popup_ctx) {
- move_point.x = (move_ctx->geometry.x - popup_ctx->geometry.x) + move_point.x;
- move_point.y = (move_ctx->geometry.y - popup_ctx->geometry.y) + move_point.y;
+ sclwindow moving_window = context->get_cur_moving_window(context->get_last_touch_device_id());
+ SclPoint moving_point = context->get_cur_moving_point(context->get_last_touch_device_id());
+ SclWindowContext *moving_window_context = windows->get_window_context(moving_window);
+ SclWindowContext *popup_window_context = windows->get_window_context(popup_window);
+ if (moving_window_context && popup_window_context) {
+ moving_point.x = (moving_window_context->geometry.x - popup_window_context->geometry.x) + moving_point.x;
+ moving_point.y = (moving_window_context->geometry.y - popup_window_context->geometry.y) + moving_point.y;
}
- printf("AUTOPOPUP : %d %d\n", move_point.x, move_point.y);
+ //printf("AUTOPOPUP : %d %d\n", moving_point.x, moving_point.y);
- CSCLWindows *windows = CSCLWindows::get_instance();
if (windows && coordinate) {
windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
}
handle_engine_signal(SCL_SIG_MOUSE_LONG_PRESS, window);
windows->update_window(windows->get_magnifier_window());
/*
- SclButtonContext *btncontext = cache->get_cur_button_context(window, key_index);
- if (btncontext->state == BUTTON_STATE_PRESSED) {
- btncontext->state = BUTTON_STATE_NORMAL;
+ SclButtonContext *button_context = cache->get_cur_button_context(window, key_index);
+ if (button_context->state == BUTTON_STATE_PRESSED) {
+ button_context->state = BUTTON_STATE_NORMAL;
CSCLWindows *windows = CSCLWindows::get_instance();
if (windows) {
const SclLayoutKeyCoordinate *coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
return FALSE;
}
sclwindow window = context->get_cur_pressed_window(context->get_last_touch_device_id());
- sclbyte keyIndex = context->get_cur_pressed_key(context->get_last_touch_device_id());
+ sclbyte key_index = context->get_cur_pressed_key(context->get_last_touch_device_id());
scllong interval = m_repeat_key_duration - (m_key_repeated_num * SCL_REPEATKEY_ACCELERATION);
if (interval < SCL_REPEATKEY_MIN_DURATION) {
interval = SCL_REPEATKEY_MIN_DURATION;
}
- process_button_repeat_pressed_event(window, keyIndex, context->get_last_touch_device_id());
+ process_button_repeat_pressed_event(window, key_index, context->get_last_touch_device_id());
events->destroy_timer(id);
events->create_timer(SCL_TIMER_REPEATKEY, interval, value);
m_key_repeated_num++;
desc.timed_out = TRUE;
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
- CSCLWindows *windows = CSCLWindows::get_instance();
if (windows && sclres_manager) {
const PSclInputModeConfigure sclres_input_mode_configure =
sclres_manager->get_input_mode_configure_table();
sclwindow window = windows->get_nth_popup_window(SCL_WINDOW_Z_TOP);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx && sclres_input_mode_configure) {
- if (scl_check_arrindex(winctx->inputmode, MAX_SCL_INPUT_MODE)) {
- desc.input_mode = sclres_input_mode_configure[winctx->inputmode].name;
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context && sclres_input_mode_configure) {
+ if (scl_check_arrindex(window_context->inputmode, MAX_SCL_INPUT_MODE)) {
+ desc.input_mode = sclres_input_mode_configure[window_context->inputmode].name;
}
}
}
}
break;
case SCL_TIMER_AUTOTEST: {
- CSCLResourceCache *cache = CSCLResourceCache::get_instance();
-
sclint rnd = rand() % 100;
sclint x = (rand() % (cache->get_cur_layout(windows->get_base_window())->width));
sclint y = (rand() % (cache->get_cur_layout(windows->get_base_window())->height));
break;
case SIGACTION_INIT_INPUTMODE:
break;
+ default:
+ break;
}
}
}
}
if (utils && context && windows && cache && coordinate && rect && autopopup_configure) {
- SCLShiftState shiftidx = context->get_shift_state();
- if (!scl_check_arrindex(shiftidx, SCL_SHIFT_STATE_MAX)) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (!scl_check_arrindex(shift_index, SCL_SHIFT_STATE_MAX)) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shiftidx],
+ if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shift_index],
&num_keys, &num_columns, &num_rows, &rect->width, &rect->height)) {
/* There is no need for an autopopup window if number of keys are equal to or less than 0 */
* button A gets restored to its initial state and B gets pressed instead.
*/
sclboolean
-CSCLController::check_event_transition_enabled(const SclLayoutKeyCoordinate *btnFrom, const SclLayoutKeyCoordinate *btnTo)
+CSCLController::check_event_transition_enabled(const SclLayoutKeyCoordinate *btn_from, const SclLayoutKeyCoordinate *btn_to)
{
sclboolean ret = FALSE;
- sclbyte typeFrom = BUTTON_TYPE_NORMAL; /* To enable event transition even if no button is pressed currently */
- sclbyte typeTo = MAX_BUTTON_TYPE;
+ sclbyte type_from = BUTTON_TYPE_NORMAL; /* To enable event transition even if no button is pressed currently */
+ sclbyte type_to = MAX_BUTTON_TYPE;
const sclboolean TRANSITION_TABLE[MAX_BUTTON_TYPE][MAX_BUTTON_TYPE] = {
// NORMAL GRAB SELFISH DRAG MULTITAP ROTATION DIRECTION R_DIRECTION TOGGLE UIITEM
{ TRUE, 0, 0, TRUE, TRUE, TRUE, 0, 0, TRUE, 0},
};
- if (btnFrom) typeFrom = btnFrom->button_type;
- if (btnTo) typeTo = btnTo->button_type;
+ if (btn_from) type_from = btn_from->button_type;
+ if (btn_to) type_to = btn_to->button_type;
- scl_assert_return_false(typeFrom >= 0 && typeFrom < MAX_BUTTON_TYPE);
- scl_assert_return_false(typeTo >= 0 && typeTo < MAX_BUTTON_TYPE);
+ scl_assert_return_false(type_from >= 0 && type_from < MAX_BUTTON_TYPE);
+ scl_assert_return_false(type_to >= 0 && type_to < MAX_BUTTON_TYPE);
- if (typeFrom < MAX_BUTTON_TYPE && typeTo < MAX_BUTTON_TYPE) {
- ret = TRANSITION_TABLE[typeFrom][typeTo];
+ if (type_from < MAX_BUTTON_TYPE && type_to < MAX_BUTTON_TYPE) {
+ ret = TRANSITION_TABLE[type_from][type_to];
}
return ret;
/* The default next state should be LOCK state */
SCLShiftState next_state = SCL_SHIFT_STATE_LOCK;
if (context->get_shift_multi_touch_enabled()) {
- CSCLContext *context = CSCLContext::get_instance();
if (context) {
if (context->get_shift_multi_touch_state() == SCL_SHIFT_MULTITOUCH_ON_PRESSED) {
/* If the shift multi touch state is ON_PRESSED, don't leave ON state now */
}
/* If we are in ON_PRESSED or ON_KEY_ENTERED mode of shift multi touch state, do not turn it off now */
if (context->get_shift_multi_touch_enabled() && turn_shift_off) {
- CSCLContext *context = CSCLContext::get_instance();
if (context) {
if (context->get_shift_multi_touch_state() == SCL_SHIFT_MULTITOUCH_ON_PRESSED) {
context->set_shift_multi_touch_state(SCL_SHIFT_MULTITOUCH_ON_KEY_ENTERED);
CSCLEvents::connect_window_events( sclwindow wnd, const sclint evt )
{
CSCLWindows *windows = CSCLWindows::get_instance();
- //SclWindowContext *winctx = windows->get_window_context(wnd, FALSE);
- SclWindowContext *winctx = windows->get_window_context(wnd);
- if (winctx) {
- if (!(winctx->is_virtual)) {
+ //SclWindowContext *window_context = windows->get_window_context(wnd, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(wnd);
+ if (window_context) {
+ if (!(window_context->is_virtual)) {
get_scl_events_impl()->connect_window_events(wnd, evt);
}
}
LOGD("=-=-=-=- keyname(char) = %s \n",keyname);
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
- SclButtonContext *prevbtncontext = NULL;
const SclLayoutKeyCoordinate *prevcoordinate = NULL;
- SclButtonContext *btncontext = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
CSCLWindows *windows = CSCLWindows::get_instance();
focus_window = focus_handler->get_current_focus_window();
key_index = focus_handler->get_current_focus_key();
} else if ((strcmp(keyname, "Return") == 0)||(strcmp(keyname, "Enter") == 0)) {
- btncontext = cache->get_cur_button_context(current_focus_window, current_key_index);
coordinate = cache->get_cur_layout_key_coordinate(current_focus_window, current_key_index);
- //btncontext->state = BUTTON_STATE_NORMAL;
+ //button_context->state = BUTTON_STATE_NORMAL;
controller->mouse_press(current_focus_window, coordinate->x, coordinate->y, TRUE);
controller->mouse_release(current_focus_window, coordinate->x, coordinate->y, TRUE);
if (KEY_TYPE_MODECHANGE != coordinate->key_type) {
- //btncontext->state = BUTTON_STATE_PRESSED;
+ //button_context->state = BUTTON_STATE_PRESSED;
//windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
} else {
focus_handler->init_key_index();
if (current_key_index != key_index || current_focus_window != focus_window) {
prevcoordinate = cache->get_cur_layout_key_coordinate(current_focus_window, current_key_index);
coordinate = cache->get_cur_layout_key_coordinate(focus_window, key_index);
- //prevbtncontext->state = BUTTON_STATE_NORMAL;
- //btncontext->state = BUTTON_STATE_PRESSED;
+ //prev_button_context->state = BUTTON_STATE_NORMAL;
+ //button_context->state = BUTTON_STATE_PRESSED;
if (current_focus_window == focus_window) {
sclshort x,y,width,height;
if (prevcoordinate->x < coordinate->x) {
if (sclres_layout_key_coordinate_pointer_frame &&
scl_check_arrindex(layout, MAX_SCL_LAYOUT) && scl_check_arrindex(m_focus_key, MAX_KEY)) {
SclLayoutKeyCoordinatePointer cur = sclres_layout_key_coordinate_pointer_frame[layout][m_focus_key];
- SclWindowContext *winctx = windows->get_window_context(m_focus_window);
+ SclWindowContext *window_context = windows->get_window_context(m_focus_window);
SclRectangle cur_key_coordinate;
- if (winctx) {
- cur_key_coordinate.x = cur->x + winctx->geometry.x;
- cur_key_coordinate.y = cur->y + winctx->geometry.y;
+ if (window_context) {
+ cur_key_coordinate.x = cur->x + window_context->geometry.x;
+ cur_key_coordinate.y = cur->y + window_context->geometry.y;
cur_key_coordinate.width = cur->width;
cur_key_coordinate.height = cur->height;
}
continue;
}
}
- SclWindowContext *winctx = windows->get_window_context(window);
+ SclWindowContext *window_context = windows->get_window_context(window);
SclRectangle btn;
- if (winctx) {
- btn.x = p->x + winctx->geometry.x;
- btn.y = p->y + winctx->geometry.y;
+ if (window_context) {
+ btn.x = p->x + window_context->geometry.x;
+ btn.y = p->y + window_context->geometry.y;
btn.width = p->width;
btn.height = p->height;
}
}
/* Save for otherside */
otherside_candidate = loop;
- int temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
+ temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
if (temp_distance_x < candidate_distance_x) {
if (btn.x < cur.x) {
candidate = loop;
default:
temp_distance_y = calculate_distance(btn.y, btn.y + btn.height, cur.y, cur.y + cur.height);
if (temp_distance_y <= candidate_distance_y) {
- int temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
+ temp_distance_x = calculate_distance(btn.x, btn.x + btn.width, cur.x, cur.x + cur.width);
if (temp_distance_x <= candidate_distance_x) {
candidate = loop;
candidate_distance_x = temp_distance_x;
SclLayoutKeyCoordinatePointer cur = sclres_layout_key_coordinate_pointer_frame[layout][m_focus_key];
/* To compare with buttons in popup window, let's convert to global coordinates */
- SclWindowContext *winctx = windows->get_window_context(m_focus_window);
+ SclWindowContext *window_context = windows->get_window_context(m_focus_window);
SclRectangle cur_key_coordinate;
- if (winctx && cur && cache) {
- cur_key_coordinate.x = cur->x + winctx->geometry.x;
- cur_key_coordinate.y = cur->y + winctx->geometry.y;
+ if (window_context && cur && cache) {
+ cur_key_coordinate.x = cur->x + window_context->geometry.x;
+ cur_key_coordinate.y = cur->y + window_context->geometry.y;
cur_key_coordinate.width = cur->width;
cur_key_coordinate.height = cur->height;
sclboolean exclude_popup_covered_area = FALSE;
if (!windows->is_base_window(windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP))) {
- CSCLResourceCache *cache = CSCLResourceCache::get_instance();
- if (cache && scl_check_arrindex(winctx->inputmode, MAX_SCL_INPUT_MODE)) {
- const SclLayout *layout =
+ if (cache && 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));
- if (!(layout->use_sw_background) || layout->bg_color.a != 0) {
- const PSclInputModeConfigure sclres_input_mode_configure =
- sclres_manager->get_input_mode_configure_table();
- if (sclres_input_mode_configure[winctx->inputmode].use_dim_window) {
- search_in_base_window = FALSE;
- } else {
- exclude_popup_covered_area = TRUE;
+ if (cur_layout) {
+ if (!(cur_layout->use_sw_background) || cur_layout->bg_color.a != 0) {
+ const PSclInputModeConfigure sclres_input_mode_configure =
+ sclres_manager->get_input_mode_configure_table();
+ if (sclres_input_mode_configure[window_context->inputmode].use_dim_window) {
+ search_in_base_window = FALSE;
+ } else {
+ exclude_popup_covered_area = TRUE;
+ }
}
}
}
SclLayoutKeyCoordinatePointer popup_key =
sclres_layout_key_coordinate_pointer_frame[popup_layout][popup_candidate.candidate];
- SclWindowContext *base_winctx = windows->get_window_context(windows->get_base_window());
- SclWindowContext *popup_winctx = windows->get_window_context(popup_window);
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ SclWindowContext *popup_window_context = windows->get_window_context(popup_window);
SclRectangle base_key_coordinate;
- if (base_winctx) {
- base_key_coordinate.x = base_key->x + base_winctx->geometry.x;
- base_key_coordinate.y = base_key->y + base_winctx->geometry.y;
+ if (base_window_context) {
+ base_key_coordinate.x = base_key->x + base_window_context->geometry.x;
+ base_key_coordinate.y = base_key->y + base_window_context->geometry.y;
base_key_coordinate.width = base_key->width;
base_key_coordinate.height = base_key->height;
}
SclRectangle popup_key_coordinate;
- if (popup_winctx) {
- popup_key_coordinate.x = popup_key->x + popup_winctx->geometry.x;
- popup_key_coordinate.y = popup_key->y + popup_winctx->geometry.y;
+ if (popup_window_context) {
+ popup_key_coordinate.x = popup_key->x + popup_window_context->geometry.x;
+ popup_key_coordinate.y = popup_key->y + popup_window_context->geometry.y;
popup_key_coordinate.width = popup_key->width;
popup_key_coordinate.height = popup_key->height;
}
CSCLUtils *utils = CSCLUtils::get_instance();
if (utils) {
/* If the base candidate key is covered by popup window, do not choose it */
- if (utils->is_rect_overlap(base_key_coordinate, popup_winctx->geometry)) {
+ if (utils->is_rect_overlap(base_key_coordinate, popup_window_context->geometry)) {
base_candidate.candidate = NOT_USED;
}
}
start_animation = TRUE;
}
} else {
- SclWindowContext *winctx_from = windows->get_window_context(desc.window_from);
- SclWindowContext *winctx_to = windows->get_window_context(desc.window_to);
- if (winctx_from && winctx_to) {
- if ((windows->is_base_window(desc.window_from) || winctx_from->is_virtual) &&
- (windows->is_base_window(desc.window_to) || winctx_to->is_virtual)) {
+ SclWindowContext *window_context_from = windows->get_window_context(desc.window_from);
+ SclWindowContext *window_context_to = windows->get_window_context(desc.window_to);
+ if (window_context_from && window_context_to) {
+ if ((windows->is_base_window(desc.window_from) || window_context_from->is_virtual) &&
+ (windows->is_base_window(desc.window_to) || window_context_to->is_virtual)) {
start_animation = TRUE;
}
}
prev_rect.y += cache->get_custom_starting_coordinates().y;
} else {
/* Convert popup window coordinates relative to base window */
- SclWindowContext *base_winctx = windows->get_window_context(windows->get_base_window());
- SclWindowContext *prev_winctx = windows->get_window_context(desc.window_from);
- if (base_winctx && prev_winctx) {
- prev_rect.x += (prev_winctx->geometry.x - base_winctx->geometry.x);
- prev_rect.y += (prev_winctx->geometry.y - base_winctx->geometry.y);
+ SclWindowContext *base_window_context =
+ windows->get_window_context(windows->get_base_window());
+ SclWindowContext *prev_window_context =
+ windows->get_window_context(desc.window_from);
+ if (base_window_context && prev_window_context) {
+ prev_rect.x += (prev_window_context->geometry.x - base_window_context->geometry.x);
+ prev_rect.y += (prev_window_context->geometry.y - base_window_context->geometry.y);
}
}
if (windows->is_base_window(desc.window_to)) {
next_rect.y += cache->get_custom_starting_coordinates().y;
} else {
/* Convert popup window coordinates relative to base window */
- SclWindowContext *base_winctx = windows->get_window_context(windows->get_base_window());
- SclWindowContext *next_winctx = windows->get_window_context(desc.window_to);
- if (base_winctx && next_winctx) {
- next_rect.x += (next_winctx->geometry.x - base_winctx->geometry.x);
- next_rect.y += (next_winctx->geometry.y - base_winctx->geometry.y);
+ SclWindowContext *base_window_context =
+ windows->get_window_context(windows->get_base_window());
+ SclWindowContext *next_window_context =
+ windows->get_window_context(desc.window_to);
+ if (base_window_context && next_window_context) {
+ next_rect.x += (next_window_context->geometry.x - base_window_context->geometry.x);
+ next_rect.y += (next_window_context->geometry.y - base_window_context->geometry.y);
}
}
/* Let's check if the navigation animation should be in circular movement */
for (inner_loop = 0;inner_loop < MAX_SIZE_OF_LABEL_FOR_ONE;inner_loop++) {
if (!(privProperties->label[loop][inner_loop].empty())) {
coordinate->label[loop][inner_loop] =
- (sclchar*)privProperties->label[loop][inner_loop].c_str();
+ const_cast<sclchar*>(privProperties->label[loop][inner_loop].c_str());
}
}
}
for (inner_loop = 0;inner_loop < SCL_BUTTON_STATE_MAX;inner_loop++) {
if (!(privProperties->image_label_path[loop][inner_loop].empty())) {
coordinate->image_label_path[loop][inner_loop] =
- (sclchar*)privProperties->image_label_path[loop][inner_loop].c_str();
+ const_cast<sclchar*>(privProperties->image_label_path[loop][inner_loop].c_str());
}
}
}
for (inner_loop = 0;inner_loop < SCL_BUTTON_STATE_MAX;inner_loop++) {
if (!(privProperties->bg_image_path[loop][inner_loop].empty())) {
coordinate->bg_image_path[loop][inner_loop] =
- (sclchar*)privProperties->bg_image_path[loop][inner_loop].c_str();
+ const_cast<sclchar*>(privProperties->bg_image_path[loop][inner_loop].c_str());
}
}
}
for (inner_loop = 0;inner_loop < MAX_SIZE_OF_MULTITAP_CHAR;inner_loop++) {
if (!(privProperties->key_value[loop][inner_loop].empty())) {
coordinate->key_value[loop][inner_loop] =
- (sclchar*)privProperties->key_value[loop][inner_loop].c_str();
+ const_cast<sclchar*>(privProperties->key_value[loop][inner_loop].c_str());
}
}
}
for (inner_loop = 0;inner_loop < MAX_SIZE_OF_MULTITAP_CHAR;inner_loop++) {
if (!(privProperties->hint_string[loop][inner_loop].empty())) {
coordinate->hint_string[loop][inner_loop] =
- (sclchar*)privProperties->hint_string[loop][inner_loop].c_str();
+ const_cast<sclchar*>(privProperties->hint_string[loop][inner_loop].c_str());
}
}
}
ret = loop;
sclboolean found = FALSE;
- for (sclint loop = 0;loop < MAX_KEY; loop++) {
+ for (loop = 0;loop < MAX_KEY; loop++) {
if ((!(privProperties->custom_id.empty())) && mCurBaseLayoutKeyCoordinates[loop].custom_id) {
if (privProperties->custom_id.compare(mCurBaseLayoutKeyCoordinates[loop].custom_id) == 0) {
/* sets the current properties to private key properties */
return FALSE;
}
if (scl_check_arrindex(layout, MAX_SCL_LAYOUT)) {
- for (sclint loop = 0;loop < MAX_KEY; loop++) {
+ for (loop = 0;loop < MAX_KEY; loop++) {
if ((!(mPrivateKeyProperties[id].custom_id.empty())) && mCurBaseLayoutKeyCoordinates[loop].custom_id) {
if (mPrivateKeyProperties[id].custom_id.compare(mCurBaseLayoutKeyCoordinates[loop].custom_id) == 0) {
SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout][loop];
if (popupindex >= 0 && popupindex < MAX_POPUP_WINDOW) {
if (!(windows->is_base_window(window))) {
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- if (winctx->inputmode != NOT_USED) {
- inputmode = winctx->inputmode;
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->inputmode != NOT_USED) {
+ inputmode = window_context->inputmode;
}
- if (winctx->layout != NOT_USED) {
- layout = winctx->layout;
+ if (window_context->layout != NOT_USED) {
+ layout = window_context->layout;
}
}
}
if (utils && context && coordinate && autopopup_configure) {
sclbyte num_keys, num_columns, num_rows;
sclint x, y, width, height;
- SCLShiftState shiftidx = context->get_shift_state();
- if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shiftidx], &num_keys, &num_columns, &num_rows, &width, &height)) {
+ if (utils->get_autopopup_window_variables(coordinate->autopopup_key_labels[shift_index], &num_keys, &num_columns, &num_rows, &width, &height)) {
int row = 0, column = 0;
pCurLayout->use_magnifier_window = FALSE;
(*pCurLayoutKeyCoordinates)[loop + decoidx].height =
autopopup_configure->decoration_size * utils->get_smallest_custom_scale_rate();
break;
+ default:
+ break;
}
(*pCurButtonContext)[loop + decoidx].used = TRUE;
clear_privatekeyproperties(priv);
/* gets the value of the previous key properties */
- SclLayoutKeyCoordinate keyCoordinate = { 0 };
+ SclLayoutKeyCoordinate keyCoordinate;
+ memset(&keyCoordinate, 0x00, sizeof(keyCoordinate));
if (scl_check_arrindex_unsigned(layout_index, MAX_SCL_LAYOUT) &&
scl_check_arrindex_unsigned(key_index, MAX_KEY)) {
SclLayoutKeyCoordinatePointer p = sclres_layout_key_coordinate_pointer_frame[layout_index][key_index];
* @param fRedraw If true, it will redraw the current key
*/
sclint
-CSCLResourceCache::set_private_key(sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate)
+CSCLResourceCache::set_private_key(const sclchar* custom_id, sclchar* label, sclchar* imagelabel[SCL_BUTTON_STATE_MAX], sclchar* imagebg[SCL_BUTTON_STATE_MAX], sclulong key_event, sclchar *key_value, sclboolean fRedraw, sclboolean fPendingUpdate)
{
SCL_DEBUG();
SclRectangle
CSCLUI::get_main_window_rect()
{
- SclRectangle ret = {0};
+ SclRectangle ret = {0,0,0,0};
if (m_impl) {
ret = m_impl->get_main_window_rect();
SclSize
CSCLUI::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode display_mode)
{
- SclSize ret = {0};
+ SclSize ret = {0,0};
if (m_impl) {
ret = m_impl->get_input_mode_size(input_mode, display_mode);
mode = sclres_manager->get_inputmode_id(default_configure->input_mode);
}
/* Make sure these variables does not exceed the size of our array */
- if (!scl_check_arrindex(mode, MAX_SCL_INPUT_MODE) || !scl_check_arrindex(mode, sclres_manager->get_inputmode_size())) {
+ if (!scl_check_arrindex(mode, MAX_SCL_INPUT_MODE) ||
+ !scl_check_arrindex(mode, sclres_manager->get_inputmode_size())) {
mode = 0;
}
if (!scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
/* For the magnifier window */
ret = show_magnifier(window, draw_ctx);
} else if (window == windows->get_dim_window()) {
- SclWindowContext *dimctx = windows->get_window_context(window);
- if (dimctx) {
+ SclWindowContext *dim_window_context = windows->get_window_context(window);
+ if (dim_window_context) {
SclSize size;
SclColor color;
- size.width = dimctx->geometry.width;
- size.height = dimctx->geometry.height;
+ size.width = dim_window_context->geometry.width;
+ size.height = dim_window_context->geometry.height;
color = default_configure->dim_color;
draw_window_bg_by_sw(window, draw_ctx, size, 0.0, color, color);
/*sclchar composed_path[_POSIX_PATH_MAX] = {0,};
// FIXME implement later
// SclLayoutInfoCache *info_cache = cache->get_cur_layout_info_cache(window);
if (layout) {
- CSCLWindows *windows = CSCLWindows::get_instance();
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
scl_assert_return_false(layout);
if (layout->use_sw_background) {
- if (winctx) {
+ if (window_context) {
SclSize size;
- size.width = winctx->geometry.width;
- size.height = winctx->geometry.height;
+ size.width = window_context->geometry.width;
+ size.height = window_context->geometry.height;
draw_window_bg_by_sw(window, draw_ctx, size, layout->bg_line_width, layout->bg_line_color, layout->bg_color);
}
} else if (layout->image_path[BUTTON_STATE_NORMAL]) {
sclint targetx = cache->get_custom_starting_coordinates().x;
sclint targety = cache->get_custom_starting_coordinates().y;
sclwindow targetwin = window;
- if (winctx) {
- if (winctx->is_virtual) {
- //SclWindowContext *basectx = windows->get_window_context(windows->get_base_window(), FALSE);
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
+ if (window_context) {
+ if (window_context->is_virtual) {
+ /*SclWindowContext *base_window_context =
+ windows->get_window_context(windows->get_base_window(), FALSE);*/
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
targetwin = windows->get_base_window();
- targetx = winctx->geometry.x - basectx->geometry.x;
- targety = winctx->geometry.y - basectx->geometry.y;
+ targetx = window_context->geometry.x - base_window_context->geometry.x;
+ targety = window_context->geometry.y - base_window_context->geometry.y;
}
}
if (strlen(layout->image_path[BUTTON_STATE_NORMAL]) > 0) {
sclchar composed_path[_POSIX_PATH_MAX] = {0,};
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, layout->image_path[BUTTON_STATE_NORMAL]);
// Temporary testing for EFL backend.. Otherwise the background image covers other buttons
- if (winctx && (x + y + width + height == 0)) {
- //graphics->draw_image(targetwin, draw_ctx, composed_path, &cached_info, targetx, targety, layout->width, layout->height, winctx->layout_image_offset.x, winctx->layout_image_offset.y, -1, -1, layout->extract_background);
+ if (window_context && (x + y + width + height == 0)) {
+ //graphics->draw_image(targetwin, draw_ctx, composed_path, &cached_info, targetx, targety, layout->width, layout->height, window_context->layout_image_offset.x, winctx->layout_image_offset.y, -1, -1, layout->extract_background);
graphics->draw_image(targetwin, draw_ctx, composed_path, NULL,
targetx, targety, layout->width, layout->height,
- winctx->layout_image_offset.x, winctx->layout_image_offset.y,
+ window_context->layout_image_offset.x, window_context->layout_image_offset.y,
-1, -1, layout->extract_background);
}
}
sclint startx = 0;
sclint starty = 0;
- SclWindowContext *winctx = windows->get_window_context(window);
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (winctx && basectx) {
- if (winctx->is_virtual) {
- startx += (winctx->geometry.x - basectx->geometry.x);
- starty += (winctx->geometry.y - basectx->geometry.y);
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context && base_window_context) {
+ if (window_context->is_virtual) {
+ startx += (window_context->geometry.x - base_window_context->geometry.x);
+ starty += (window_context->geometry.y - base_window_context->geometry.y);
}
}
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
CSCLUtils *utils = CSCLUtils::get_instance();
SclLayoutKeyCoordinate* coordinate = NULL;
- SclButtonContext* btncontext = NULL;
+ SclButtonContext* button_context = NULL;
if (context && cache && utils) {
for (sclint idx = 0; idx < MAX_KEY; idx++) {
coordinate = cache->get_cur_layout_key_coordinate(window, idx);
- btncontext = cache->get_cur_button_context(window, idx);
- if (coordinate && btncontext) {
+ button_context = cache->get_cur_button_context(window, idx);
+ if (coordinate && button_context) {
/* First check if this button is enabled in current active sublayout */
sclboolean subLayoutMatch = TRUE;
if (coordinate->sub_layout && context->get_cur_sublayout()) {
if (coordinate->valid && subLayoutMatch) {
SclRectangle itemrect = {coordinate->x, coordinate->y, coordinate->width, coordinate->height};
if (drawall || utils->is_rect_overlap(itemrect, updatearea)) {
- SCLButtonState state = btncontext->state;
- if (btncontext->toggled) {
+ SCLButtonState state = button_context->state;
+ if (button_context->toggled) {
state = BUTTON_STATE_TOGGLED;
}
if (!draw_button(window, draw_ctx, idx, state)) {
CSCLGraphics *graphics = CSCLGraphics::get_instance();
if (cache && context && graphics) {
- SclButtonContext* btncontext = cache->get_cur_button_context(window, key_index);
+ SclButtonContext* button_context = cache->get_cur_button_context(window, key_index);
- if (btncontext) {
- if (!btncontext->used) {
+ if (button_context) {
+ if (!button_context->used) {
return FALSE;
}
/* FIXME : There is a case that begin_pain fails. Inspection on the root cause is needed */
if (draw_ctx) {
- SCLShiftState shiftidx = context->get_shift_state();
- if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
+ SCLShiftState shift_index = context->get_shift_state();
+ if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
const SclLayout* layout = cache->get_cur_layout(window);
const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
draw_button_bg_by_sw(window, draw_ctx, key_index, state);
} else {
/* check it whether uses an individual images */
- if (coordinate->bg_image_path[shiftidx][state]) {
- if (strcmp(coordinate->bg_image_path[shiftidx][state], SCL_BACKGROUND_IMAGE_STRING) != 0) {
+ if (coordinate->bg_image_path[shift_index][state]) {
+ if (strcmp(coordinate->bg_image_path[shift_index][state], SCL_BACKGROUND_IMAGE_STRING) != 0) {
/* case 2 (uses an indivisual image) */
- draw_button_bg_by_img(window, draw_ctx, key_index, state, shiftidx);
+ draw_button_bg_by_img(window, draw_ctx, key_index, state, shift_index);
} else {
/* case 3 (uses the layout background image) */
- draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shiftidx);
+ draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index);
}
} else if (force_draw_bg) {
- draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shiftidx);
+ draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index);
}
/* case 4 (don't draw anything for button's background if image_path is NULL) */
}
/* 2. displaying the label of the button */
- draw_button_label(window, draw_ctx, key_index, state, shiftidx);
+ draw_button_label(window, draw_ctx, key_index, state, shift_index);
}
}
sclint targetaddx = 0;
sclint targetaddy = 0;
sclwindow targetwin = window;
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- if (winctx->is_virtual) {
- //SclWindowContext *basectx = windows->get_window_context(windows->get_base_window(), FALSE);
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->is_virtual) {
+ //SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
targetwin = windows->get_base_window();
- targetaddx = winctx->geometry.x - basectx->geometry.x;
- targetaddy = winctx->geometry.y - basectx->geometry.y;
+ targetaddx = window_context->geometry.x - base_window_context->geometry.x;
+ targetaddy = window_context->geometry.y - base_window_context->geometry.y;
}
}
}
imgSize.height = coordinate->height;
}
- SclPoint pos = {0,};
+ SclPoint pos = {0,0};
const SclLabelProperties *labelproperties = cache->get_label_properties(coordinate->image_label_type, 0);
if (labelproperties) {
SCLLabelAlignment align = labelproperties->alignment;
/* for text */
for (int idx = 0; idx < coordinate->label_count; idx++) {
SclFontInfo info;
- CSCLResourceCache *cache = CSCLResourceCache::get_instance();
const SclLabelProperties *labelproperties = cache->get_label_properties(coordinate->label_type, idx);
if (labelproperties) {
const sclchar *label = coordinate->label[shift][idx];
/* If the button type is BUTTON_TYPE_ROTATION, display current keyvalue */
if (idx == 0) {
if (coordinate->button_type == BUTTON_TYPE_ROTATION) {
- SclButtonContext* btncontext = cache->get_cur_button_context(window, key_index);
- if (btncontext) {
- if (btncontext->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
- label = coordinate->key_value[shift][btncontext->multikeyIdx];
+ SclButtonContext* button_context = cache->get_cur_button_context(window, key_index);
+ if (button_context) {
+ if (button_context->multikeyIdx < MAX_SIZE_OF_MULTITAP_CHAR) {
+ label = coordinate->key_value[shift][button_context->multikeyIdx];
}
}
}
if (graphics && windows && cache) {
/* If the target window is virtual window, let's draw it on the base window */
sclwindow targetwin = window;
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- if (winctx->is_virtual) {
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->is_virtual) {
targetwin = windows->get_base_window();
}
}
sclint targetx = coordinate->x;
sclint targety = coordinate->y;
sclwindow targetwin = window;
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- if (winctx->is_virtual) {
- //SclWindowContext *basectx = windows->get_window_context(windows->get_base_window(), FALSE);
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->is_virtual) {
+ //SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window(), FALSE);
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
targetwin = windows->get_base_window();
- targetx += winctx->geometry.x - basectx->geometry.x;
- targety += winctx->geometry.y - basectx->geometry.y;
+ targetx += window_context->geometry.x - base_window_context->geometry.x;
+ targety += window_context->geometry.y - base_window_context->geometry.y;
}
}
}
scl_assert_return_false(state >= BUTTON_STATE_NORMAL && state < SCL_BUTTON_STATE_MAX);
CSCLWindows *windows = CSCLWindows::get_instance();
- //SclWindowContext *winctx = windows->get_window_context(window, FALSE);
- SclWindowContext *winctx = windows->get_window_context(window);
+ //SclWindowContext *window_context = windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window);
sclchar composed_path[_POSIX_PATH_MAX] = {0,};
- if (context && cache && coordinate && winctx) {
+ if (context && cache && coordinate && window_context) {
sclboolean path_composed = FALSE;
/* Check if we need to decorate the button's drag state */
//if (context->get_cur_drag_state(context->get_last_touch_device_id()) != SCL_DRAG_STATE_NONE &&
(sclint)coordinate->y - (sclint)coordinate->add_hit_top,
(sclint)coordinate->width + (sclint)coordinate->add_hit_left + (sclint)coordinate->add_hit_right,
(sclint)coordinate->height + (sclint)coordinate->add_hit_top + (sclint)coordinate->add_hit_bottom,
- winctx->imgOffsetx + (sclint)coordinate->x - (sclint)coordinate->add_hit_left,
- winctx->imgOffsety + (sclint)coordinate->y - (sclint)coordinate->add_hit_top,
+ window_context->imgOffsetx + (sclint)coordinate->x - (sclint)coordinate->add_hit_left,
+ window_context->imgOffsety + (sclint)coordinate->y - (sclint)coordinate->add_hit_top,
(sclint)coordinate->width + (sclint)coordinate->add_hit_left + (sclint)coordinate->add_hit_right,
(sclint)coordinate->height + (sclint)coordinate->add_hit_top + (sclint)coordinate->add_hit_bottom,
TRUE
} else {*/
sclint dest_x = coordinate->x;
sclint dest_y = coordinate->y;
- if (winctx->is_virtual) {
- SclWindowContext *basectx = windows->get_window_context(windows->get_base_window());
- if (basectx) {
- dest_x += (winctx->geometry.x - basectx->geometry.x);
- dest_y += (winctx->geometry.y - basectx->geometry.y);
+ if (window_context->is_virtual) {
+ SclWindowContext *base_window_context = windows->get_window_context(windows->get_base_window());
+ if (base_window_context) {
+ dest_x += (window_context->geometry.x - base_window_context->geometry.x);
+ dest_y += (window_context->geometry.y - base_window_context->geometry.y);
}
}
dest_y,
(sclint)coordinate->width,
(sclint)coordinate->height,
- winctx->layout_image_offset.x + (sclint)coordinate->x,
- winctx->layout_image_offset.y + (sclint)coordinate->y,
+ window_context->layout_image_offset.x + (sclint)coordinate->x,
+ window_context->layout_image_offset.y + (sclint)coordinate->y,
(sclint)coordinate->width,
(sclint)coordinate->height,
TRUE
CSCLWindows *windows = CSCLWindows::get_instance();
const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
- SclButtonContext* btncontext = cache->get_cur_button_context(pressed_window, pressed_key);
- SCLShiftState shiftidx = context->get_shift_state();
- if (shiftidx < 0 || shiftidx >= SCL_SHIFT_STATE_MAX) shiftidx = SCL_SHIFT_STATE_OFF;
+ SclButtonContext* button_context = cache->get_cur_button_context(pressed_window, pressed_key);
+ SCLShiftState shift_index = context->get_shift_state();
+ if (shift_index < 0 || shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
if (context->get_caps_lock_mode()) {
- shiftidx = (shiftidx == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
+ shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
/* Do not show if current layout does not allow magnifier */
}
/* FIXME : workaround for not showing magnifier for recent symbols */
/* Do not show if there's nothing to show */
- //const char *targetstr = coordinate->key_value[shiftidx][btncontext->multikeyIdx];
- const char *targetstr = coordinate->label[shiftidx][0];
+ //const char *targetstr = coordinate->key_value[shift_index][button_context->multikeyIdx];
+ const char *targetstr = coordinate->label[shift_index][0];
if (state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY ||
state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY ) {
targetstr = coordinate->long_key_value;
}
if (targetstr == NULL) {
if (utils) {
- utils->log("coordinate->key_value[shift][btncontext->multikeyIdx] == NULL \n");
+ utils->log("coordinate->key_value[shift][button_context->multikeyIdx] == NULL \n");
}
return FALSE;
} else if (strlen(targetstr) == 0) {
if (utils) {
- utils->log("coordinate->key_value[shift][btncontext->multikeyIdx]) == 0 \n");
+ utils->log("coordinate->key_value[shift][button_context->multikeyIdx]) == 0 \n");
}
return FALSE;
}
}
#if 0
- SclPoint pos = {0,};
+ SclPoint pos = {0,0};
/* calculates x position to be set */
pos.x = (coordinate->x + (coordinate->width / 2)) - (utils->get_scale_x(scl_magnifier_configure.width) / 2);
}
if (coordinate && magnifier_configure) {
sclchar composed_path[_POSIX_PATH_MAX] = {0,};
- sclfloat scale_rate_x, scale_rate_y;
- if (layout->display_mode == DISPLAYMODE_PORTRAIT) {
- scale_rate_x = m_utils->get_scale_rate_x();
- scale_rate_y = m_utils->get_scale_rate_y();
- } else {
- scale_rate_x = m_utils->get_scale_rate_y();
- scale_rate_y = m_utils->get_scale_rate_x();
- }
if (state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY) {
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_long_key_image_path);
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
magnifier_configure->width * utils->get_custom_scale_rate_x(),
magnifier_configure->height * utils->get_custom_scale_rate_y());
} else {
- if (shiftidx == SCL_SHIFT_STATE_LOCK) {
+ if (shift_index == SCL_SHIFT_STATE_LOCK) {
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_shift_lock_image_path);
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
magnifier_configure->width * utils->get_custom_scale_rate_x(),
magnifier_configure->height * utils->get_custom_scale_rate_y());
- } else if (shiftidx == SCL_SHIFT_STATE_ON) {
+ } else if (shift_index == SCL_SHIFT_STATE_ON) {
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_shift_image_path);
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
magnifier_configure->width * utils->get_custom_scale_rate_x(),
if (labelproperties) {
if (labelproperties->valid) {
if (magnifier_configure->show_shift_label) {
- shiftidx = SCL_SHIFT_STATE_ON;
+ shift_index = SCL_SHIFT_STATE_ON;
}
if ((coordinate->use_long_key_magnifier && state->get_cur_action_state() == ACTION_STATE_BASE_LONGKEY) ||
state->get_cur_action_state() == ACTION_STATE_POPUP_LONGKEY) {
const sclchar* customstr = context->get_custom_magnifier_label(context->get_last_touch_device_id(), loop);
if (customstr) {
targetstr = customstr;
- } else if (coordinate->magnifier_label[shiftidx][loop]) {
- targetstr = coordinate->magnifier_label[shiftidx][loop];
+ } else if (coordinate->magnifier_label[shift_index][loop]) {
+ targetstr = coordinate->magnifier_label[shift_index][loop];
targetstr = cache->find_substituted_string(targetstr);
} else if (loop == 0) {
/* Don't display sublabels of each buttons in magnifier window - this policy can be changed, but for now */
- targetstr = coordinate->label[shiftidx][btncontext->multikeyIdx];
+ targetstr = coordinate->label[shift_index][button_context->multikeyIdx];
targetstr = cache->find_substituted_string(targetstr);
}
if (targetstr) {
scl8 mode = NOT_USED;
sclshort layout = NOT_USED;
- SclWindowContext *winctx = NULL;
+ SclWindowContext *window_context = NULL;
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
if (sclres_manager && windows && context) {
SCLDisplayMode display_mode = context->get_display_mode();
PSclInputModeConfigure sclres_input_mode_configure = sclres_manager->get_input_mode_configure_table();
mode = sclres_manager->get_inputmode_id(input_mode);
- winctx = windows->get_window_context(window);
+ window_context = windows->get_window_context(window);
if (sclres_input_mode_configure &&
scl_check_arrindex(mode, MAX_SCL_INPUT_MODE) &&
scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
}
}
- if (cache && windows && winctx) {
- if (mode != NOT_USED && mode != winctx->inputmode && layout != NOT_USED) {
- winctx->inputmode = mode;
- winctx->layout = layout;
+ if (cache && windows && window_context) {
+ if (mode != NOT_USED && mode != window_context->inputmode && layout != NOT_USED) {
+ window_context->inputmode = mode;
+ window_context->layout = layout;
cache->recompute_layout(window);
windows->update_window(window);
ret = TRUE;
CSCLWindows *windows = CSCLWindows::get_instance();
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
if (windows && sclres_manager) {
- SclWindowContext *winctx = windows->get_window_context(window);
- if (winctx) {
- if (scl_check_arrindex(winctx->inputmode, MAX_SCL_INPUT_MODE)) {
- ret = sclres_manager->get_inputmode_name(winctx->inputmode);
+ SclWindowContext *window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (scl_check_arrindex(window_context->inputmode, MAX_SCL_INPUT_MODE)) {
+ ret = sclres_manager->get_inputmode_name(window_context->inputmode);
}
}
}
CSCLWindows *windows = CSCLWindows::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
if (windows && cache) {
- ret = cache->set_private_key((sclchar*)custom_id, label, imagelabel, imagebg,
+ ret = cache->set_private_key(custom_id, label, imagelabel, imagebg,
key_event, key_value, fRedraw, windows->get_update_pending());
}
}
sclbyte index = 0;
sclboolean timerset = FALSE;
sclwindow window = SCLWINDOW_INVALID;
- SclWindowContext *winctx = NULL;
+ SclWindowContext *window_context = NULL;
do {
window = windows->get_nth_window_in_Z_order_list(index);
- //winctx = windows->get_window_context(window, FALSE);
- winctx = windows->get_window_context(window);
- if (winctx) {
- if (winctx->timeout != 0) {
- events->create_timer(SCL_TIMER_POPUP_TIMEOUT, winctx->timeout, 0, TRUE);
+ //window_context = windows->get_window_context(window, FALSE);
+ window_context = windows->get_window_context(window);
+ if (window_context) {
+ if (window_context->timeout != 0) {
+ events->create_timer(SCL_TIMER_POPUP_TIMEOUT, window_context->timeout, 0, TRUE);
timerset = TRUE;
}
index++;
SclRectangle
CSCLUIImpl::get_main_window_rect()
{
- SclRectangle ret = {0};
+ SclRectangle ret = {0,0,0,0};
if (m_initialized) {
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
if (cache && windows) {
//const SclLayout *layout = cache->get_cur_layout(windows->get_base_window());
- SclWindowContext *winctx = windows->get_window_context(windows->get_base_window());
- if (winctx) {
- ret.x = winctx->geometry.x;
- ret.y = winctx->geometry.y;
- ret.width = winctx->geometry.width;
- ret.height = winctx->geometry.height;
+ SclWindowContext *window_context = windows->get_window_context(windows->get_base_window());
+ if (window_context) {
+ ret.x = window_context->geometry.x;
+ ret.y = window_context->geometry.y;
+ ret.width = window_context->geometry.width;
+ ret.height = window_context->geometry.height;
}
}
}
SclSize
CSCLUIImpl::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode display_mode)
{
- SclSize ret = {0};
+ SclSize ret = {0,0};
if (m_initialized) {
CSCLUtils *utils = CSCLUtils::get_instance();
m_impl = NULL;
- memset(&m_base_winctx, 0x00, sizeof(SclWindowContext));
- memset(&m_magnifier_winctx, 0x00, sizeof(SclWindowContext));
- memset(&m_dim_winctx, 0x00, sizeof(SclWindowContext));
- memset(m_popup_winctx, 0x00, sizeof(SclWindowContext) * MAX_POPUP_WINDOW);
+ memset(&m_base_window_context, 0x00, sizeof(SclWindowContext));
+ memset(&m_magnifier_window_context, 0x00, sizeof(SclWindowContext));
+ memset(&m_dim_window_context, 0x00, sizeof(SclWindowContext));
+ memset(m_popup_window_context, 0x00, sizeof(SclWindowContext) * MAX_POPUP_WINDOW);
m_pending_update = FALSE;
if (impl) {
impl->fini();
- if (SCLWINDOW_INVALID != m_base_winctx.window) {
- impl->destroy_window(m_base_winctx.window);
- m_base_winctx.window = SCLWINDOW_INVALID;
+ if (SCLWINDOW_INVALID != m_base_window_context.window) {
+ impl->destroy_window(m_base_window_context.window);
+ m_base_window_context.window = SCLWINDOW_INVALID;
}
- if (SCLWINDOW_INVALID != m_magnifier_winctx.window) {
- impl->destroy_window(m_magnifier_winctx.window);
- m_magnifier_winctx.window = SCLWINDOW_INVALID;
+ if (SCLWINDOW_INVALID != m_magnifier_window_context.window) {
+ impl->destroy_window(m_magnifier_window_context.window);
+ m_magnifier_window_context.window = SCLWINDOW_INVALID;
}
- if (SCLWINDOW_INVALID != m_dim_winctx.window) {
- impl->destroy_window(m_dim_winctx.window);
- m_dim_winctx.window = SCLWINDOW_INVALID;
+ if (SCLWINDOW_INVALID != m_dim_window_context.window) {
+ impl->destroy_window(m_dim_window_context.window);
+ m_dim_window_context.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);
+ if (m_popup_window_context[loop].window != SCLWINDOW_INVALID) {
+ if (!m_popup_window_context[loop].is_virtual) {
+ impl->destroy_window(m_popup_window_context[loop].window);
}
- m_popup_winctx[loop].window = SCLWINDOW_INVALID;
+ m_popup_window_context[loop].window = SCLWINDOW_INVALID;
}
}
}
if (events && state && controller && cache && context && windows && utils) {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window != SCLWINDOW_INVALID) {
- if (m_popup_winctx[loop].layout == layout) return SCLWINDOW_INVALID;
+ if (m_popup_window_context[loop].window != SCLWINDOW_INVALID) {
+ if (m_popup_window_context[loop].layout == layout) return SCLWINDOW_INVALID;
}
}
events->connect_window_events(window, SCL_EVENT_MOUSE | SCL_EVENT_EXPOSE);
controller->handle_engine_signal(SCL_SIG_POPUP_SHOW, window);
- /* Shows the dim window if it uses the dimwindow */
+ /* Shows the dim window if it uses the dim_window */
if (use_dim_window) {
- sclwindow dimWindow = get_dim_window();
+ sclwindow dim_window = get_dim_window();
/* Currently, get_window_rect does not work normally (need to check X). So I have commented it*/
SclRectangle rect;
get_window_rect(get_base_window(), &rect);
- resize_window(dimWindow, rect.width, rect.height);
- move_window(dimWindow, rect.x, rect.y);
- events->connect_window_events(dimWindow, SCL_EVENT_MOUSE);
+ resize_window(dim_window, rect.width, rect.height);
+ move_window(dim_window, rect.x, rect.y);
+ events->connect_window_events(dim_window, SCL_EVENT_MOUSE);
/*If we use transient_for them the ISE will occure some crash. It needs to check X11*/
- set_parent(opener.window, dimWindow);
- SclWindowContext *dimctx = get_window_context(get_dim_window());
- if (dimctx) {
- if (dimctx->is_virtual) {
+ set_parent(opener.window, dim_window);
+ SclWindowContext *dim_window_context = get_window_context(get_dim_window());
+ if (dim_window_context) {
+ if (dim_window_context->is_virtual) {
set_parent(opener.window, window);
} else {
- set_parent(dimWindow, window);
+ set_parent(dim_window, window);
}
}
- show_window(dimWindow);
+ show_window(dim_window);
} else {
/*If we use transient_for them the ISE will occure some crash. It needs to check X11*/
set_parent(opener.window, window);
state->set_cur_action_state(ACTION_STATE_POPUP_INIT);
- const SclLayout *layout = cache->get_cur_layout(window);
- if (layout) {
+ const SclLayout *cur_layout = cache->get_cur_layout(window);
+ if (cur_layout) {
/* If the newly opened popup window has POPUP_GRAB style, lets press the nearest button on the new window */
- if (layout->style == LAYOUT_STYLE_POPUP_GRAB) {
+ if (cur_layout->style == LAYOUT_STYLE_POPUP_GRAB) {
sclwindow pressed_window = context->get_cur_pressed_window(context->get_last_touch_device_id());
sclbyte pressed_key = context->get_cur_pressed_key(context->get_last_touch_device_id());
const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(pressed_window, pressed_key);
- sclwindow move_window = context->get_cur_move_window(context->get_last_touch_device_id());
- SclPoint move_point = context->get_cur_move_point(context->get_last_touch_device_id());
- SclWindowContext *move_ctx = windows->get_window_context(move_window);
- SclWindowContext *popup_ctx = windows->get_window_context(window);
- if (move_ctx && popup_ctx) {
- move_point.x = (move_ctx->geometry.x - popup_ctx->geometry.x) + move_point.x;
- move_point.y = (move_ctx->geometry.y - popup_ctx->geometry.y) + move_point.y;
+ sclwindow moving_window = context->get_cur_moving_window(context->get_last_touch_device_id());
+ SclPoint moving_point = context->get_cur_moving_point(context->get_last_touch_device_id());
+ SclWindowContext *moving_window_context = windows->get_window_context(moving_window);
+ SclWindowContext *popup_window_context = windows->get_window_context(window);
+ if (moving_window_context && popup_window_context) {
+ moving_point.x =
+ (moving_window_context->geometry.x - popup_window_context->geometry.x) + moving_point.x;
+ moving_point.y =
+ (moving_window_context->geometry.y - popup_window_context->geometry.y) + moving_point.y;
}
/* Find the nearest button on the autopopup window */
sclfloat min_dist = (float)((sclu32)(-1));
sclint min_dist_index = NOT_USED;
for (sclint loop = 0;loop < MAX_KEY && !ended;loop++) {
- SclButtonContext *popup_btncontext = cache->get_cur_button_context(window, loop);
+ SclButtonContext *popup_button_context = cache->get_cur_button_context(window, loop);
const SclLayoutKeyCoordinate *popup_coordinate = cache->get_cur_layout_key_coordinate(window, loop);
- if (popup_btncontext && popup_coordinate) {
- if (!(popup_btncontext->used)) {
+ if (popup_button_context && popup_coordinate) {
+ if (!(popup_button_context->used)) {
ended = TRUE;
- } else if (popup_btncontext->state != BUTTON_STATE_DISABLED &&
+ } else if (popup_button_context->state != BUTTON_STATE_DISABLED &&
popup_coordinate->button_type != BUTTON_TYPE_UIITEM) {
if (popup_coordinate) {
- float dist = utils->get_approximate_distance(move_point.x, move_point.y,
- popup_coordinate->x + (popup_coordinate->width / 2) - layout->mouse_manipulate_x,
- popup_coordinate->y + (popup_coordinate->height / 2) - layout->mouse_manipulate_y);
+ float dist = utils->get_approximate_distance(moving_point.x, moving_point.y,
+ popup_coordinate->x + (popup_coordinate->width / 2) -
+ cur_layout->mouse_manipulate_x,
+ popup_coordinate->y + (popup_coordinate->height / 2) -
+ cur_layout->mouse_manipulate_y);
if (dist < min_dist) {
min_dist_index = loop;
min_dist = dist;
const SclLayoutKeyCoordinate *popup_coordinate =
cache->get_cur_layout_key_coordinate(window, min_dist_index);
if (popup_coordinate) {
- sclint x = popup_coordinate->x + (popup_coordinate->width / 2) - layout->mouse_manipulate_x;
- sclint y = popup_coordinate->y + (popup_coordinate->height / 2) - layout->mouse_manipulate_y;
+ sclint x = popup_coordinate->x + (popup_coordinate->width / 2) -
+ cur_layout->mouse_manipulate_x;
+ sclint y = popup_coordinate->y + (popup_coordinate->height / 2) -
+ cur_layout->mouse_manipulate_y;
controller->mouse_press(window, x, y, context->get_last_touch_device_id());
}
}
/* The below code block seems unnecessary since we already invoked mouse_press() */
/*context->set_cur_pressed_window(context->get_last_touch_device_id(), window);
context->set_cur_pressed_key(context->get_last_touch_device_id(), min_dist_index);
- if (btncontext) {
- btncontext->state = BUTTON_STATE_NORMAL;
+ if (button_context) {
+ button_context->state = BUTTON_STATE_NORMAL;
}*/
windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
SCL_DEBUG();
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);
+ m_base_window_context.hidden = TRUE;
+ m_base_window_context.geometry.width = width;
+ m_base_window_context.geometry.height = height;
+ m_base_window_context.is_virtual = FALSE;
+ m_base_window_context.popup_type = POPUP_TYPE_NONE;
+ m_base_window_context.opener.window = parent;
+ m_base_window_context.geometry.x = m_base_window_context.geometry.y = 0;
+ m_base_window_context.etc_info = NULL;
+ m_base_window_context.window =
+ get_scl_windows_impl()->create_base_window(parent, &m_base_window_context, width, height);
+
+ push_window_in_Z_order_list(m_base_window_context.window);
}
// Update the position information
//get_window_context(parent, TRUE);
- return m_base_winctx.window;
+ return m_base_window_context.window;
}
/**
if (impl) {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == SCLWINDOW_INVALID) {
- m_popup_winctx[loop].hidden = TRUE;
- m_popup_winctx[loop].opener = opener;
- m_popup_winctx[loop].etc_info = NULL;
- m_popup_winctx[loop].inputmode = inputmode;
- m_popup_winctx[loop].layout = layout;
- m_popup_winctx[loop].popup_type = popup_type;
- m_popup_winctx[loop].is_virtual = is_virtual;
+ if (m_popup_window_context[loop].window == SCLWINDOW_INVALID) {
+ m_popup_window_context[loop].hidden = TRUE;
+ m_popup_window_context[loop].opener = opener;
+ m_popup_window_context[loop].etc_info = NULL;
+ m_popup_window_context[loop].inputmode = inputmode;
+ m_popup_window_context[loop].layout = layout;
+ m_popup_window_context[loop].popup_type = popup_type;
+ m_popup_window_context[loop].is_virtual = is_virtual;
- m_popup_winctx[loop].geometry = geometry;
+ m_popup_window_context[loop].geometry = geometry;
- m_popup_winctx[loop].layout_image_offset.x = img_offset_x;
- m_popup_winctx[loop].layout_image_offset.y = img_offset_y;
+ m_popup_window_context[loop].layout_image_offset.x = img_offset_x;
+ m_popup_window_context[loop].layout_image_offset.y = img_offset_y;
- m_popup_winctx[loop].timeout = timeout;
+ m_popup_window_context[loop].timeout = timeout;
if (!is_virtual) {
- window = impl->create_window(opener.window, &(m_popup_winctx[loop]), geometry.width, geometry.height);
+ window = impl->create_window(opener.window,
+ &(m_popup_window_context[loop]), geometry.width, geometry.height);
} else {
window = reinterpret_cast<sclwindow>(loop + 1);
}
if (window) {
- m_popup_winctx[loop].window = window;
+ m_popup_window_context[loop].window = window;
}
//set_window_rotation(window, context->get_rotation_degree());
- if (!m_popup_winctx[loop].is_virtual) {
+ if (!m_popup_window_context[loop].is_virtual) {
impl->move_window(window, geometry.x, geometry.y);
}
break;
sclwindow window = SCLWINDOW_INVALID;
if (impl && m_initialized) {
- if (m_magnifier_winctx.window == SCLWINDOW_INVALID) {
- window = impl->create_magnifier_window(parent, &m_magnifier_winctx, width, height);
+ if (m_magnifier_window_context.window == SCLWINDOW_INVALID) {
+ window = impl->create_magnifier_window(parent, &m_magnifier_window_context, width, height);
impl->set_keep_above(window, TRUE);
if (window) {
- m_magnifier_winctx.window = window;
- m_magnifier_winctx.geometry.width = width;
- m_magnifier_winctx.geometry.height = height;
- m_magnifier_winctx.hidden = TRUE;
+ m_magnifier_window_context.window = window;
+ m_magnifier_window_context.geometry.width = width;
+ m_magnifier_window_context.geometry.height = height;
+ m_magnifier_window_context.hidden = TRUE;
}
} else {
- window = m_magnifier_winctx.window;
+ window = m_magnifier_window_context.window;
}
set_parent(parent, window);
CSCLWindows::get_magnifier_window()
{
SCL_DEBUG();
- return m_magnifier_winctx.window;
+ return m_magnifier_window_context.window;
}
sclwindow
-CSCLWindows::create_dim_window(const sclwindow parent, SclWindowContext *winctx, scl16 width, scl16 height)
+CSCLWindows::create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height)
{
SCL_DEBUG();
}
if (impl && m_initialized && default_configure) {
- if (m_dim_winctx.window == NULL) {
- m_dim_winctx.hidden = TRUE;
+ if (m_dim_window_context.window == NULL) {
+ m_dim_window_context.hidden = TRUE;
if (default_configure->use_actual_dim_window) {
- window = impl->create_dim_window(parent, &m_dim_winctx, width, height);
+ window = impl->create_dim_window(parent, &m_dim_window_context, width, height);
} else {
window = reinterpret_cast<sclwindow>(SCLWINDOW_VIRTUAL_DIM);
- m_dim_winctx.is_virtual = TRUE;
+ m_dim_window_context.is_virtual = TRUE;
}
if (window) {
- m_dim_winctx.window = window;
+ m_dim_window_context.window = window;
}
} else {
- window = m_dim_winctx.window;
+ window = m_dim_window_context.window;
}
if (window == NULL) {
CSCLWindows::get_dim_window()
{
SCL_DEBUG();
- return m_dim_winctx.window;
+ return m_dim_window_context.window;
}
bool
sclboolean ret = FALSE;
if (impl) {
- if (window == m_base_winctx.window) {
+ if (window == m_base_window_context.window) {
impl->destroy_window(window);
- memset(&m_base_winctx, 0x00, sizeof(SclWindowContext));
- m_base_winctx.window = SCLWINDOW_INVALID;
+ memset(&m_base_window_context, 0x00, sizeof(SclWindowContext));
+ m_base_window_context.window = SCLWINDOW_INVALID;
ret = TRUE;
- } else if (window == m_magnifier_winctx.window) {
+ } else if (window == m_magnifier_window_context.window) {
impl->destroy_window(window);
- memset(&m_magnifier_winctx, 0x00, sizeof(SclWindowContext));
- m_magnifier_winctx.window = SCLWINDOW_INVALID;
+ memset(&m_magnifier_window_context, 0x00, sizeof(SclWindowContext));
+ m_magnifier_window_context.window = SCLWINDOW_INVALID;
ret = TRUE;
- } else if (window == m_dim_winctx.window) {
+ } else if (window == m_dim_window_context.window) {
impl->destroy_window(window);
- memset(&m_dim_winctx, 0x00, sizeof(SclWindowContext));
- m_dim_winctx.window = SCLWINDOW_INVALID;
+ memset(&m_dim_window_context, 0x00, sizeof(SclWindowContext));
+ m_dim_window_context.window = SCLWINDOW_INVALID;
ret = TRUE;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
+ if (m_popup_window_context[loop].window == window) {
impl->destroy_window(window);
- memset(&m_popup_winctx[loop], 0x00, sizeof(SclWindowContext));
+ memset(&m_popup_window_context[loop], 0x00, sizeof(SclWindowContext));
ret = TRUE;
- m_popup_winctx[loop].window = SCLWINDOW_INVALID;
+ m_popup_window_context[loop].window = SCLWINDOW_INVALID;
break;
}
}
{
SCL_DEBUG();
- return m_base_winctx.window;
+ return m_base_window_context.window;
}
sclboolean
sclboolean ret = FALSE;
if (window != SCLWINDOW_INVALID) {
- if (window == m_base_winctx.window) {
+ if (window == m_base_window_context.window) {
ret = TRUE;
}
}
sclwindow ret = SCLWINDOW_INVALID;
- if (etc_info == m_base_winctx.etc_info) {
- ret = m_base_winctx.window;
- } else if (etc_info == m_magnifier_winctx.etc_info) {
- ret = m_magnifier_winctx.window;
- } else if (etc_info == m_dim_winctx.etc_info) {
- ret = m_dim_winctx.window;
+ if (etc_info == m_base_window_context.etc_info) {
+ ret = m_base_window_context.window;
+ } else if (etc_info == m_magnifier_window_context.etc_info) {
+ ret = m_magnifier_window_context.window;
+ } else if (etc_info == m_dim_window_context.etc_info) {
+ ret = m_dim_window_context.window;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (etc_info == m_popup_winctx[loop].etc_info) {
- ret = m_popup_winctx[loop].window;
+ if (etc_info == m_popup_window_context[loop].etc_info) {
+ ret = m_popup_window_context[loop].window;
break;
}
}
SclWindowContext* ret = NULL;
- if (window == m_base_winctx.window) {
+ if (window == m_base_window_context.window) {
/*if (geometry_update) {
SclRectangle rect;
get_window_rect(window, &rect);
- m_base_winctx.geometry.x = rect.x;
- m_base_winctx.geometry.y = rect.y;
+ m_base_window_context.geometry.x = rect.x;
+ m_base_window_context.geometry.y = rect.y;
}*/
- ret = &m_base_winctx;
- } else if (window == m_magnifier_winctx.window) {
- ret = &m_magnifier_winctx;
- } else if (window == m_dim_winctx.window) {
- ret = &m_dim_winctx;
+ ret = &m_base_window_context;
+ } else if (window == m_magnifier_window_context.window) {
+ ret = &m_magnifier_window_context;
+ } else if (window == m_dim_window_context.window) {
+ ret = &m_dim_window_context;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
+ if (m_popup_window_context[loop].window == window) {
/*if (geometry_update) {
SclRectangle rect;
get_window_rect(window, &rect);
- m_popup_winctx[loop].geometry.x = rect.x;
- m_popup_winctx[loop].geometry.y = rect.y;
+ m_popup_window_context[loop].geometry.x = rect.x;
+ m_popup_window_context[loop].geometry.y = rect.y;
}*/
- ret = &m_popup_winctx[loop];
+ ret = &m_popup_window_context[loop];
break;
}
}
{
SCL_DEBUG();
- if (window == m_base_winctx.window) {
- memcpy(&m_base_winctx,context, sizeof(SclWindowContext));
+ if (window == m_base_window_context.window) {
+ memcpy(&m_base_window_context,context, sizeof(SclWindowContext));
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
- memcpy(&m_popup_winctx[loop], context, sizeof(SclWindowContext));
+ if (m_popup_window_context[loop].window == window) {
+ memcpy(&m_popup_window_context[loop], context, sizeof(SclWindowContext));
break;
}
}
scl8 ret = NOT_USED;
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
+ if (m_popup_window_context[loop].window == window) {
ret = loop;
break;
}
SCL_DEBUG();
sclboolean is_virtual = FALSE;
- if (window == m_base_winctx.window) {
- m_base_winctx.geometry.x = x;
- m_base_winctx.geometry.y = y;
- is_virtual = m_base_winctx.is_virtual;
- } else if (window == m_magnifier_winctx.window) {
- m_magnifier_winctx.geometry.x = x;
- m_magnifier_winctx.geometry.y = y;
- is_virtual = m_magnifier_winctx.is_virtual;
- } else if (window == m_dim_winctx.window) {
- m_dim_winctx.geometry.x = x;
- m_dim_winctx.geometry.y = y;
- is_virtual = m_dim_winctx.is_virtual;
+ if (window == m_base_window_context.window) {
+ m_base_window_context.geometry.x = x;
+ m_base_window_context.geometry.y = y;
+ is_virtual = m_base_window_context.is_virtual;
+ } else if (window == m_magnifier_window_context.window) {
+ m_magnifier_window_context.geometry.x = x;
+ m_magnifier_window_context.geometry.y = y;
+ is_virtual = m_magnifier_window_context.is_virtual;
+ } else if (window == m_dim_window_context.window) {
+ m_dim_window_context.geometry.x = x;
+ m_dim_window_context.geometry.y = y;
+ is_virtual = m_dim_window_context.is_virtual;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
- m_popup_winctx[loop].geometry.x = x;
- m_popup_winctx[loop].geometry.y = y;
- is_virtual = m_popup_winctx[loop].is_virtual;
+ if (m_popup_window_context[loop].window == window) {
+ m_popup_window_context[loop].geometry.x = x;
+ m_popup_window_context[loop].geometry.y = y;
+ is_virtual = m_popup_window_context[loop].is_virtual;
break;
}
}
SCL_DEBUG();
sclboolean is_virtual = FALSE;
- if (window == m_base_winctx.window) {
- m_base_winctx.geometry.width = width;
- m_base_winctx.geometry.height = height;
- is_virtual = m_base_winctx.is_virtual;
- } else if (window == m_magnifier_winctx.window) {
- m_magnifier_winctx.geometry.width = width;
- m_magnifier_winctx.geometry.height = height;
- is_virtual = m_magnifier_winctx.is_virtual;
- } else if (window == m_dim_winctx.window) {
- m_dim_winctx.geometry.width = width;
- m_dim_winctx.geometry.height = height;
- is_virtual = m_dim_winctx.is_virtual;
+ if (window == m_base_window_context.window) {
+ m_base_window_context.geometry.width = width;
+ m_base_window_context.geometry.height = height;
+ is_virtual = m_base_window_context.is_virtual;
+ } else if (window == m_magnifier_window_context.window) {
+ m_magnifier_window_context.geometry.width = width;
+ m_magnifier_window_context.geometry.height = height;
+ is_virtual = m_magnifier_window_context.is_virtual;
+ } else if (window == m_dim_window_context.window) {
+ m_dim_window_context.geometry.width = width;
+ m_dim_window_context.geometry.height = height;
+ is_virtual = m_dim_window_context.is_virtual;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
- m_popup_winctx[loop].geometry.width = width;
- m_popup_winctx[loop].geometry.height = height;
- is_virtual = m_popup_winctx[loop].is_virtual;
+ if (m_popup_window_context[loop].window == window) {
+ m_popup_window_context[loop].geometry.width = width;
+ m_popup_window_context[loop].geometry.height = height;
+ is_virtual = m_popup_window_context[loop].is_virtual;
break;
}
}
SCL_DEBUG();
sclboolean is_virtual = FALSE;
- if (window == m_base_winctx.window) {
- m_base_winctx.geometry.x = x;
- m_base_winctx.geometry.y = y;
- m_base_winctx.geometry.width = width;
- m_base_winctx.geometry.height = height;
- is_virtual = m_base_winctx.is_virtual;
- } else if (window == m_magnifier_winctx.window) {
- m_magnifier_winctx.geometry.x = x;
- m_magnifier_winctx.geometry.y = y;
- m_magnifier_winctx.geometry.width = width;
- m_magnifier_winctx.geometry.height = height;
- is_virtual = m_magnifier_winctx.is_virtual;
- } else if (window == m_dim_winctx.window) {
- m_dim_winctx.geometry.x = x;
- m_dim_winctx.geometry.y = y;
- m_dim_winctx.geometry.width = width;
- m_dim_winctx.geometry.height = height;
- is_virtual = m_dim_winctx.is_virtual;
+ if (window == m_base_window_context.window) {
+ m_base_window_context.geometry.x = x;
+ m_base_window_context.geometry.y = y;
+ m_base_window_context.geometry.width = width;
+ m_base_window_context.geometry.height = height;
+ is_virtual = m_base_window_context.is_virtual;
+ } else if (window == m_magnifier_window_context.window) {
+ m_magnifier_window_context.geometry.x = x;
+ m_magnifier_window_context.geometry.y = y;
+ m_magnifier_window_context.geometry.width = width;
+ m_magnifier_window_context.geometry.height = height;
+ is_virtual = m_magnifier_window_context.is_virtual;
+ } else if (window == m_dim_window_context.window) {
+ m_dim_window_context.geometry.x = x;
+ m_dim_window_context.geometry.y = y;
+ m_dim_window_context.geometry.width = width;
+ m_dim_window_context.geometry.height = height;
+ is_virtual = m_dim_window_context.is_virtual;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
- m_popup_winctx[loop].geometry.x = x;
- m_popup_winctx[loop].geometry.y = y;
- m_popup_winctx[loop].geometry.width = width;
- m_popup_winctx[loop].geometry.height = height;
- is_virtual = m_popup_winctx[loop].is_virtual;
+ if (m_popup_window_context[loop].window == window) {
+ m_popup_window_context[loop].geometry.x = x;
+ m_popup_window_context[loop].geometry.y = y;
+ m_popup_window_context[loop].geometry.width = width;
+ m_popup_window_context[loop].geometry.height = height;
+ is_virtual = m_popup_window_context[loop].is_virtual;
break;
}
}
scl_assert_return_null(index >= 0 && index < MAX_POPUP_WINDOW);
if (index < MAX_POPUP_WINDOW) {
- return m_popup_winctx[index].window;
+ return m_popup_window_context[index].window;
}
return SCLWINDOW_INVALID;
void CSCLWindows::set_parent( const sclwindow parent, const sclwindow window )
{
/* Do not set parent if the window is a virtual window */
- //SclWindowContext *winctx = get_window_context(window, FALSE);
- SclWindowContext *winctx = get_window_context(window);
- if (winctx) {
- if (!(winctx->is_virtual)) {
+ //SclWindowContext *window_context = get_window_context(window, FALSE);
+ SclWindowContext *window_context = get_window_context(window);
+ if (window_context) {
+ if (!(window_context->is_virtual)) {
CSCLWindowsImpl* impl = get_scl_windows_impl();
if (impl) {
impl->set_parent(parent, window);
if (impl) {
if (window == NULL) {
- impl->set_window_rotation(m_base_winctx.window, rotation);
- if (SCLWINDOW_INVALID != m_magnifier_winctx.window) {
+ impl->set_window_rotation(m_base_window_context.window, rotation);
+ if (SCLWINDOW_INVALID != m_magnifier_window_context.window) {
CSCLUtils *utils = CSCLUtils::get_instance();
- sclfloat scale_rate_x, scale_rate_y;
- if (rotation == ROTATION_90_CW || rotation == ROTATION_90_CCW) {
- scale_rate_x = utils->get_scale_rate_y();
- scale_rate_y = utils->get_scale_rate_x();
- } else {
- scale_rate_x = utils->get_scale_rate_x();
- scale_rate_y = utils->get_scale_rate_y();
- }
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
PSclMagnifierWndConfigure magnifier_configure = NULL;
magnifier_configure = sclres_manager->get_magnifier_configure();
}
if (magnifier_configure) {
- m_magnifier_winctx.geometry.width =
+ m_magnifier_window_context.geometry.width =
magnifier_configure->width * utils->get_custom_scale_rate_x();
- m_magnifier_winctx.geometry.height =
+ m_magnifier_window_context.geometry.height =
magnifier_configure->height * utils->get_custom_scale_rate_y();
- impl->set_window_rotation(m_magnifier_winctx.window, rotation);
+ impl->set_window_rotation(m_magnifier_window_context.window, rotation);
}
}
- if (SCLWINDOW_INVALID != m_dim_winctx.window) {
+ if (SCLWINDOW_INVALID != m_dim_window_context.window) {
/* For indivisual window rotation */
- impl->set_window_rotation(m_dim_winctx.window, rotation);
- //resize_window(m_dim_winctx.window, m_base_winctx.width, m_base_winctx.height);
- //move_window(m_dim_winctx.window, m_base_winctx.x, m_base_winctx.y);
- hide_window(m_dim_winctx.window);
+ impl->set_window_rotation(m_dim_window_context.window, rotation);
+ //resize_window(m_dim_window_context.window, m_base_window_context.width, m_base_winctx.height);
+ //move_window(m_dim_window_context.window, m_base_window_context.x, m_base_winctx.y);
+ hide_window(m_dim_window_context.window);
}
/* For indivisual window rotation
for (int loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window != SCLWINDOW_INVALID) {
- if (!m_popup_winctx[loop].isVirtual) {
- get_scl_windows_impl()->set_window_rotation(m_popup_winctx[loop].window, degree);
+ if (m_popup_window_context[loop].window != SCLWINDOW_INVALID) {
+ if (!m_popup_window_context[loop].isVirtual) {
+ get_scl_windows_impl()->set_window_rotation(m_popup_window_context[loop].window, degree);
}
}
}
// Update the position information
//get_window_context(window, TRUE);
- SclWindowContext *winctx = get_window_context(window);
- if (winctx) {
- get_window_rect(window, &(winctx->geometry));
+ SclWindowContext *window_context = get_window_context(window);
+ if (window_context) {
+ get_window_rect(window, &(window_context->geometry));
}
}
{
SCL_DEBUG();
- if (window == m_base_winctx.window) {
- m_base_winctx.hidden = FALSE;
- } else if (window == m_magnifier_winctx.window) {
- m_magnifier_winctx.hidden = FALSE;
- } else if (window == m_dim_winctx.window) {
- m_dim_winctx.hidden = FALSE;
+ if (window == m_base_window_context.window) {
+ m_base_window_context.hidden = FALSE;
+ } else if (window == m_magnifier_window_context.window) {
+ m_magnifier_window_context.hidden = FALSE;
+ } else if (window == m_dim_window_context.window) {
+ m_dim_window_context.hidden = FALSE;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
- m_popup_winctx[loop].hidden = FALSE;
+ if (m_popup_window_context[loop].window == window) {
+ m_popup_window_context[loop].hidden = FALSE;
break;
}
}
{
SCL_DEBUG();
- if (window == m_base_winctx.window) {
- m_base_winctx.hidden = TRUE;
- } else if (window == m_magnifier_winctx.window) {
- m_magnifier_winctx.hidden = TRUE;
- } else if (window == m_dim_winctx.window) {
- m_dim_winctx.hidden = TRUE;
+ if (window == m_base_window_context.window) {
+ m_base_window_context.hidden = TRUE;
+ } else if (window == m_magnifier_window_context.window) {
+ m_magnifier_window_context.hidden = TRUE;
+ } else if (window == m_dim_window_context.window) {
+ m_dim_window_context.hidden = TRUE;
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
- m_popup_winctx[loop].hidden = TRUE;
+ if (m_popup_window_context[loop].window == window) {
+ m_popup_window_context[loop].hidden = TRUE;
break;
}
}
{
m_pending_update = pend;
if (!pend) {
- update_window(m_base_winctx.window);
+ update_window(m_base_window_context.window);
}
}
sclboolean is_virtual = FALSE;
sclboolean ret = FALSE;
if (rect) {
- if (window == m_base_winctx.window) {
- is_virtual = m_base_winctx.is_virtual;
+ if (window == m_base_window_context.window) {
+ is_virtual = m_base_window_context.is_virtual;
if (is_virtual) {
- *rect = m_base_winctx.geometry;
+ *rect = m_base_window_context.geometry;
}
- } else if (window == m_magnifier_winctx.window) {
- is_virtual = m_magnifier_winctx.is_virtual;
+ } else if (window == m_magnifier_window_context.window) {
+ is_virtual = m_magnifier_window_context.is_virtual;
if (is_virtual) {
- *rect = m_magnifier_winctx.geometry;
+ *rect = m_magnifier_window_context.geometry;
}
- } else if (window == m_dim_winctx.window) {
- is_virtual = m_dim_winctx.is_virtual;
+ } else if (window == m_dim_window_context.window) {
+ is_virtual = m_dim_window_context.is_virtual;
if (is_virtual) {
- *rect = m_dim_winctx.geometry;
+ *rect = m_dim_window_context.geometry;
}
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
- if (m_popup_winctx[loop].window == window) {
- is_virtual = m_popup_winctx[loop].is_virtual;
+ if (m_popup_window_context[loop].window == window) {
+ is_virtual = m_popup_window_context[loop].is_virtual;
if (is_virtual) {
- *rect = m_popup_winctx[loop].geometry;
+ *rect = m_popup_window_context[loop].geometry;
}
break;
}
virtual bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info) = 0;
/* Function returning the name of current SclRes instance */
- virtual const char* name() = 0;
+ virtual const char* get_name() = 0;
private:
std::string m_resource_directory;
}
const char*
-SclResParserManager::name() {
+SclResParserManager::get_name() {
if (_current_parser == NULL) return NULL;
- return _current_parser->name();
+ return _current_parser->get_name();
}
int get_modifier_decoration_id(const char *name);
bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info);
- const char* name();
+ const char* get_name();
void destroy();
private:
SclResParserManager();
#include "sclstructs.h"
#include "sclresource.h"
-#define MAX_SCL_INPUT_MODE 128
-#define MAX_SCL_LAYOUT 255
+#define MAX_SCL_INPUT_MODE 64
+#define MAX_SCL_LAYOUT 128
#define MAX_SCL_LABEL_PROPERTIES 128
-#define MAX_SCL_MODIFIER_DECORATION_NUM 128
+#define MAX_SCL_MODIFIER_DECORATION_NUM 64
typedef SclInputModeConfigure (*PSclInputModeConfigure);
typedef SclLayout (*PSclLayout);
int
encode_autopopup_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
PSclAutoPopupConfigure autopopupConfigure = xmlresource->get_autopopup_configure();
encode_autopopup_configure_record(storage, autopopupConfigure, record_width);
- int size = storage.size() - init_size;
+ int size = storage.get_size() - init_size;
storage.random_put<sint_t>(size, 8, init_size);
- return storage.size();
+ return storage.get_size();
}
int
ResourceStorage storage;
encode_autopopup_configure_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
int
encode_autopopup_configure_file(const char* file, int &offset, IMetaData_Helper& md_helper) {
encode_autopopup_configure_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int
encode_default_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
PSclDefaultConfigure defaultConfigure = xmlresource->get_default_configure();
storage.reserve(8);
encode_default_configure_record(storage, defaultConfigure, record_width);
- int size = storage.size() - init_size;
+ int size = storage.get_size() - init_size;
storage.random_put<sint_t>(size, 8, init_size);
- return storage.size();
+ return storage.get_size();
}
int
encode_default_configure_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
int
encode_default_configure_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int encode_input_mode_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
/*size 4bytes*/
const int INPUT_MODE_CONFIGURE_SIZE_WIDTH = 4;
cur++;
}
- int advance_size = storage.size() - init_size;
+ int advance_size = storage.get_size() - init_size;
storage.random_put<sint_t>(advance_size, 8, init_size);
- return storage.size();
+ return storage.get_size();
}
int encode_input_mode_configure_file(const char* file, int& offset, IMetaData_Helper& md_helper) {
encode_input_mode_configure_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int encode_input_mode_configure_file(const char* file, IMetaData_Helper& md_helper) {
encode_input_mode_configure_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
// 2 byte (range[0-65536))
const int KEY_COORDIANTE_REC_DATA_SIZE_BYTES = 2;
- int init_size = storage.size();
+ int init_size = storage.get_size();
// data size
storage.reserve(DATA_SIZE_BYTES);
storage.reserve(KEY_COORDIANTE_REC_DATA_SIZE_BYTES);
Key_coordinate_record_width record_width;
- set_key_coordinate_record_width(md_helper, record_width);
+ set_key_coordinate_record_width(&md_helper, record_width);
int key_coordinate_rec_data_size = 0;
for ( int i = 0; i < layout_num; ++i) {
for ( int j = 0; j < pKey_num_array[i]; ++j) {
- int pre_size = storage.size();
+ int pre_size = storage.get_size();
SclLayoutKeyCoordinatePointer cur = _key_coordinate_pointer_frame[i][j];
if (!cur) break;
encode_key_coordinate_record(storage, cur, record_width);
- int aft_size = storage.size();
+ int aft_size = storage.get_size();
if (key_coordinate_rec_data_size == 0) {
key_coordinate_rec_data_size = aft_size - pre_size;
}
delete[] pKey_num_array;
- int advance_size = storage.size() - init_size;
+ int advance_size = storage.get_size() - init_size;
storage.random_put<sint_t>(advance_size, DATA_SIZE_BYTES, init_size);
// random put key_coordinate_rec_data_size
KEY_COORDIANTE_REC_DATA_SIZE_BYTES,
key_coordinate_rec_data_offset);
- return storage.size();
+ return storage.get_size();
}
int
encode_key_coordinate_frame_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int
encode_key_coordinate_frame_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
int
encode_label_properties_frame_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
/*size 4bytes*/
const int SIZE_WIDTH = 4;
}
}
- int advance_size = storage.size() - init_size;
+ int advance_size = storage.get_size() - init_size;
storage.random_put<sint_t>(advance_size, 8, init_size);
- return storage.size();
+ return storage.get_size();
}
int
encode_label_properties_frame_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int
encode_label_properties_frame_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
// 2 byte (range[0-65536))
const int LAYOUT_REC_DATA_SIZE_BYTES = 2;
- const int init_size = storage.size();
+ const int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
PSclLayout layoutTable = xmlresource->get_layout_table();
int layout_rec_data_size = 0;
for ( int i = 0; i < size; ++i) {
- int pre_size = storage.size();
+ int pre_size = storage.get_size();
encode_layout_record(storage, cur, record_width);
- int aft_size = storage.size();
+ int aft_size = storage.get_size();
if (layout_rec_data_size == 0) {
layout_rec_data_size = aft_size - pre_size;
}
}
// back write data size
- int advance_size = storage.size() - init_size;
+ int advance_size = storage.get_size() - init_size;
// random put advance_size
int data_size_offset = init_size;
int layout_rec_data_offset = init_size + DATA_SIZE_BYTES + REC_NUM_BYTES;
storage.random_put<sint_t>(layout_rec_data_size, LAYOUT_REC_DATA_SIZE_BYTES, layout_rec_data_offset);
- return storage.size();
+ return storage.get_size();
}
int
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
int
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int
encode_magnifier_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
PSclMagnifierWndConfigure magnifierConfigure = xmlresource->get_magnifier_configure();
storage.reserve(8);
encode_magnifier_configure_record(storage, magnifierConfigure, record_width);
- int advance_size = storage.size() - init_size;
+ int advance_size = storage.get_size() - init_size;
storage.random_put<sint_t>(advance_size, 8, init_size);
- return storage.size();
+ return storage.get_size();
}
int
encode_magnifier_configure_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int
encode_magnifier_configure_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
}
void
encode_metadata(ResourceStorage& storage, const MetaData& metadata ) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
storage.reserve(8);
storage.put(metadata.m_version);
encode_metadata_record(storage, metadata.m_vec_metadata_record.at(i));
}
- int block_size = storage.size() - init_size;
+ int block_size = storage.get_size() - init_size;
storage.random_put<sint_t>(block_size, 8, init_size);
}
int
encode_modifier_decoration_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
PSclModifierDecoration modifierDecorationTable = xmlresource->get_modifier_decoration_table();
cur++;
}
- int advance_size = storage.size() - init_size;
+ int advance_size = storage.get_size() - init_size;
storage.random_put<sint_t>(advance_size, 8, init_size);
- return storage.size();
+ return storage.get_size();
}
int
encode_modifier_decoration_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
int
encode_modifier_decoration_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int
encode_nine_patch_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
- int init_size = storage.size();
+ int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
if (xmlresource == NULL) {
cur++;
}
- int size = storage.size() - init_size;
+ int size = storage.get_size() - init_size;
storage.random_put<sint_t>(size, 8, init_size);
- return storage.size();
+ return storage.get_size();
}
int
encode_nine_patch_file(storage, md_helper);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
int
encode_nine_patch_file(storage, md_helper);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int random_put(T data, int width, int random_offset);
// get the current used size
- const int size()const;
+ const int get_size() const;
// get the capability of the storage
const int capability() const;
}
inline const int ResourceStorage::
-size()const{
+get_size() const{
return m_size;
}
}
inline int ResourceStorage::
storage_cat(ResourceStorage& storage) {
- if (storage.size() == 0) return 0;
+ if (storage.get_size() == 0) return 0;
- int size = storage.size();
+ int size = storage.get_size();
check_storage(size);
memcpy(m_storage + m_size, storage.m_storage, size);
}
void set_path(const char* file) {
- this->file = file;
+ this->m_file = file;
}
/* @ insert str to string vector */
int encode() const{
ResourceStorage storage;
encode(storage);
- storage.toFile(file);
- return storage.size();
+ storage.toFile(m_file);
+ return storage.get_size();
}
int encode(int& offset) const{
ResourceStorage storage;
encode(storage);
- storage.toFile(file, offset);
+ storage.toFile(m_file, offset);
- return storage.size();
+ return storage.get_size();
}
int encode(ResourceStorage& storage) const{
storage.put(it->c_str());
}
- return storage.size();
+ return storage.get_size();
}
private:
std::vector<std::string> m_vec_string;
- const char* file;
+ const char* m_file;
};
#endif
+++ /dev/null
-/*
- * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __XML2DAT_H__
-#define __XML2DAT_H__
-extern const char* xml_file;
-extern const char* bin_file;
-void xml2dat();
-#endif
encode_metadata(storage, metadata);
storage.toFile(file);
- return storage.size();
+ return storage.get_size();
}
int MetaData_Handler::
encode_metadata(storage, metadata);
storage.toFile(file, offset);
- return storage.size();
+ return storage.get_size();
}
int MetaData_Handler::
encode(ResourceStorage& storage)const{
encode_metadata(storage, metadata);
- return storage.size();
+ return storage.get_size();
}
const unsigned short MetaData_Handler::
#include <limits.h>
#include <unistd.h>
-#include "xml2dat.h"
#include "string_encoder.h"
#include "metadata_handler.h"
#include "encode_layout.h"
rs.put<sint_t>(offset_table[i], OFFSET_WIDTH);
}
- int offset = 0;
- int ret = rs.toFile(bin_file, offset);
+ int bin_offset = 0;
+ int ret = rs.toFile(bin_file, bin_offset);
if (ret < 0) {
printf("error\n");
return -1;
int get_modifier_decoration_id(const char *name);
bool get_nine_patch_info(const char *filename, SclNinePatchInfo *info);
- const char* name() {
+ const char* get_name() {
return "xmlparser";
}
get_layout_files(PSclInputModeConfigure input_mode_table,
size_t input_mode_size, vector<string> &vec_file) {
vec_file.clear();
- for (int mode = 0; mode < input_mode_size; mode++) {
+ for (unsigned int mode = 0; mode < input_mode_size; mode++) {
SclInputModeConfigure &input_mode = input_mode_table[mode];
for (int direct = 0; direct < DISPLAYMODE_MAX; direct++) {
char * layout_file_path = input_mode.layouts[direct];