snprintf(path, _POSIX_PATH_MAX, "%s/%s", get_resource_directory(), "sclresource.bin");
FileStorage storageAllData;
- if ( storageAllData.loadFile(path) <= 0) {
+ if (storageAllData.loadFile(path) <= 0) {
return;
}
}
}
- for ( int i = ALLDATA; i < MAX_DATATYPE; ++i) {
+ for (int i = ALLDATA; i < MAX_DATATYPE; ++i) {
m_info[i].offset = offset_table[i];
m_info[i].size = size_table[i];
}
}
void BinDefaultConfigParser::parsing_default_configure() {
-
PSclDefaultConfigure cur = &m_default_configure;
Default_configure_width record_width;
int FileStorage::
loadFile(const char* file_name) {
-
if (file_name == NULL) return -1;
FILE* fp = fopen(file_name, "rb");
fclose(fp);
return -1;
}
- if ( 1 != fread(m_storage, size, 1, fp)) {
+ if (1 != fread(m_storage, size, 1, fp)) {
if (m_storage) {
delete []m_storage;
}
return m_size;
}
int FileStorage::
-get_size() const{
+get_size() const {
return m_size;
}
int FileStorage::
STRING,
MAX_DATATYPE
};
-namespace binary_xmlresource{
+namespace binary_xmlresource {
class BinResource: public sclres::SclRes{
public:
~BinResource();
class IParserInfo_Provider: public IString_Provider{
public:
virtual void set_current_metadata_record(const char* record_name) = 0;
- virtual const int get_width(const char* field_name) const= 0;
+ virtual const int get_width(const char* field_name) const = 0;
virtual const char* get_string_by_id(const int id) const = 0;
virtual ~IParserInfo_Provider() {}
-
};
#endif
static const int FIELD_NUM_WIDTH = 2;
Metadata_Bin_Parser(const FileStorage& storage, int, int);
~Metadata_Bin_Parser();
- const MetaData* get_metadata()const{
+ const MetaData* get_metadata()const {
return &metadata;
}
private:
curRecordIndex = -1;
}
- const int get_width(const char* field_name)const{
+ const int get_width(const char* field_name)const {
const MetaData* metadata = m_metadataParser->get_metadata();
const MetaData_Record& metadata_record = metadata->m_vec_metadata_record.at(curRecordIndex);
std::vector<MetaData_Field>::const_iterator it;
- for(it = metadata_record.vField.begin(); it != metadata_record.vField.end(); ++it) {
+ for (it = metadata_record.vField.begin(); it != metadata_record.vField.end(); ++it) {
if (0 == strcmp(it->m_name, field_name)) {
return it->m_width;
}
}
return 0;
-
}
void set_current_metadata_record(const char*record_name) {
assert(record_name != NULL);
- if ( current_record_name == NULL ||0 != strcmp(current_record_name, record_name)) {
+ if (current_record_name == NULL ||0 != strcmp(current_record_name, record_name)) {
current_record_name = record_name;
curRecordIndex = (int)find_metadata_record_index(record_name);
if (curRecordIndex == -1) {
}
}
}
+
private:
- size_t find_metadata_record_index(const char* name)const{
+ size_t find_metadata_record_index(const char* name)const {
if (name == NULL) return -1;
const MetaData* metadata = m_metadataParser->get_metadata();
- for ( size_t i = 0; i < metadata->m_vec_metadata_record.size(); ++i) {
+ for (size_t i = 0; i < metadata->m_vec_metadata_record.size(); ++i) {
const MetaData_Record& metadata_record = metadata->m_vec_metadata_record.at(i);
if (0 == strcmp(metadata_record.m_name, name)) {
m_metadataProvider->set_current_metadata_record(record_name);
}
}
- const int get_width(const char* field_name)const{
+ const int get_width(const char* field_name)const {
assert(m_metadataProvider != NULL);
if (m_metadataProvider != NULL)
return m_metadataProvider->get_width(field_name);
return 0 ;
}
- const char* get_string_by_id(const int id)const{
+ const char* get_string_by_id(const int id)const {
if (m_stringProvider != NULL) {
return m_stringProvider->get_string_by_id(id);
}
return NULL;
}
+
private:
IMetadata_Provider *m_metadataProvider;
const IString_Provider *m_stringProvider;
public:
String_Bin_Parser(const FileStorage& storage, int offset, int size);
~String_Bin_Parser();
- const std::vector<const char*>& get_string_depository()const{
+ const std::vector<const char*>& get_string_depository()const {
return m_vec_str_depository;
}
private:
}
m_vec_string_collection.clear();
-
}
+
private:
std::vector<char*> m_vec_string_collection;
};
class String_Provider: public IString_Provider{
public:
String_Provider(const String_Bin_Parser* sp): m_sp(sp) {}
- const char* get_string_by_id(int id)const{
+ const char* get_string_by_id(int id)const {
if (m_sp == NULL) return NULL;
const std::vector<const char*>& string_depository = m_sp->get_string_depository();
BinInputModeConfigParser::get_inputmode_id(const char *name) {
if (name == NULL) return -1;
- for(int i = 0; i < MAX_SCL_INPUT_MODE; ++i) {
- if ( m_input_mode_configure_table[i].name) {
+ for (int i = 0; i < MAX_SCL_INPUT_MODE; ++i) {
+ if ( m_input_mode_configure_table[i].name ) {
if ( 0 == strcmp(m_input_mode_configure_table[i].name, name) ) {
return i;
}
void
BinInputModeConfigParser::parsing_input_mode_configure_table() {
-
// skip data_size
m_storage.advance(8);
m_key_coordinate_pointer_frame[i][j] = curPointer;
}
break;
- }else{
+ } else {
storage.advance(pKey_num_array[i] * key_coordinate_rec_data_size);
}
}
m_storage.get_storage(storage, offset, size);
this->parser_info_provider = provider;
parsing_layout_table();
-
}
int BinLayoutParser::
get_layout_index(const char *name) {
int ret = NOT_USED;
if (name) {
- for(int loop = 0;loop < MAX_SCL_LAYOUT && ret == NOT_USED;loop++) {
+ for (int loop = 0;loop < MAX_SCL_LAYOUT && ret == NOT_USED;loop++) {
if (m_layout_table[loop].name) {
if (strcmp(m_layout_table[loop].name, name) == 0) {
ret = loop;
#ifdef __SCL_TXT_DEBUG
put_layout_table(DECODE, m_layout_table);
#endif
-
}
void
}
int
-BinModifierDecorationParser::get_modifier_decoration_id( const char *name )
+BinModifierDecorationParser::get_modifier_decoration_id(const char *name )
{
if (name == NULL) return -1;
- for(int i = 0; i < MAX_SCL_MODIFIER_DECORATION_NUM; ++i) {
- if ( m_modifier_decoration_table[i].name) {
+ for (int i = 0; i < MAX_SCL_MODIFIER_DECORATION_NUM; ++i) {
+ if ( m_modifier_decoration_table[i].name ) {
if ( 0 == strcmp(m_modifier_decoration_table[i].name, name) ) {
return i;
}
}
void BinNinePatchFileParser::parsing_nine_patch_file_list() {
-
Nine_patch_width record_width;
set_nine_patch_width(*parser_info_provider, record_width);
BinNinePatchFileParser::get_nine_patch_info(const char* filename, SclNinePatchInfo *info) {
if (filename == NULL) return false;
- for(int i = 0; i < MAX_NINE_PATCH_FILE_LIST && i < m_size; ++i) {
+ for (int i = 0; i < MAX_NINE_PATCH_FILE_LIST && i < m_size; ++i) {
if ( m_nine_patch_file_list[i].image_path != NULL &&
0 == strcmp(m_nine_patch_file_list[i].image_path, filename) ) {
if (info) {
}
return false;
-
}
const char* temp = m_storage.get_str();
m_vec_str_depository.push_back(temp);
}
-
}
for (int i = 0; i < SCL_SHIFT_STATE_MAX; ++i) {
for (int j = 0; j < MAX_SIZE_OF_LABEL_FOR_ONE; ++j) {
put_int(fp, record.key_event[i][j]);
-
}
}
put_seperator(fp);
put_int(fp, record.add_grab_top);
put_int(fp, record.add_grab_bottom);
put_seperator(fp);
- for(int i = 0; i < SCL_BUTTON_STATE_MAX; ++i) {
+ for (int i = 0; i < SCL_BUTTON_STATE_MAX; ++i) {
put_str(fp, record.image_path[i]);
}
put_seperator(fp);
string file_name;
if (flag == ENCODE) {
file_name = "encode_key_coordinate_frame.txt";
- } else if (flag == DECODE){
+ } else if (flag == DECODE) {
file_name = "decode_key_coordinate_frame.txt";
} else
file_name = "sclres_key_coordinate_frame.txt";
string file_name;
if (flag == ENCODE) {
file_name = "encode_label_properties_frame.txt";
- } else if (flag == DECODE){
+ } else if (flag == DECODE) {
file_name = "decode_label_properties_frame.txt";
} else
file_name = "sclres_label_properties_frame.txt";
return;
}
for (int i = 0; i < MAX_SCL_LABEL_PROPERTIES; ++i) {
- for(int j = 0; j < MAX_SIZE_OF_LABEL_FOR_ONE; ++j) {
+ for (int j = 0; j < MAX_SIZE_OF_LABEL_FOR_ONE; ++j) {
put_note(fp, i, j);
put_label_properties_record(fp, frame[i][j]);
}
static void
put_default_configure(int flag, const SclDefaultConfigure& record) {
-
string file_name;
if (flag == ENCODE) {
file_name = "encode_default_configure.txt";
static void
put_autopopup_configure(int flag, const SclAutoPopupConfigure& record) {
-
string file_name;
if (flag == ENCODE) {
file_name = "encode_autopopup_configure.txt";
- } else if (flag == DECODE){
+ } else if (flag == DECODE) {
file_name = "decode_autopopup_configure.txt";
} else
file_name = "sclres_autopopup_configure.txt";
void CSCLAnimatorImplEfl::init()
{
-
}
void CSCLAnimatorImplEfl::fini()
Evas_Object *window_object = static_cast<Evas_Object*>(windows->get_base_window());
Evas *evas = evas_object_evas_get(window_object);
m_highlight_ui_object = evas_object_image_add(evas);
- sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+ sclchar composed_path[POSIX_PATH_MAX] = {0, };
utils->get_composed_path(composed_path, IMG_PATH_PREFIX, SCL_HIGHLIGHT_UI_IMAGE);
evas_object_image_file_set(m_highlight_ui_object, composed_path, NULL);
}
Evas_Object *window_object = static_cast<Evas_Object*>(windows->get_base_window());
Evas *evas = evas_object_evas_get(window_object);
m_highlight_ui_object_alternate = evas_object_image_add(evas);
- sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+ sclchar composed_path[_POSIX_PATH_MAX] = {0, };
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);
}
#define MIN_XY_DIFF 14
Eina_Bool mouse_press(void *data, int type, void *event_info);
-Eina_Bool mouse_move (void *data, int type, void *event_info);
-Eina_Bool mouse_release (void *data, int type, void *event_info);
+Eina_Bool mouse_move(void *data, int type, void *event_info);
+Eina_Bool mouse_release(void *data, int type, void *event_info);
Eina_Bool client_message_cb(void *data, int type, void *event);
if (m_key_pressed_handler) ecore_event_handler_del(m_key_pressed_handler);
#endif
m_key_pressed_handler = NULL;
-
}
sclboolean get_window_rect(const sclwindow window, SclRectangle *rect)
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;
+ rect->x = scr_h - window_context->geometry.y - rect->width;
}
break;
default:
#ifndef WAYLAND
Ecore_X_Window inputWindow = 0;
- Ecore_X_Atom inputAtom = ecore_x_atom_get ("DeviceMgr Input Window");
- ecore_x_window_prop_xid_get (ecore_x_window_root_first_get(),
+ Ecore_X_Atom inputAtom = ecore_x_atom_get("DeviceMgr Input Window");
+ ecore_x_window_prop_xid_get(ecore_x_window_root_first_get(),
inputAtom, ECORE_X_ATOM_WINDOW, &inputWindow, 1);
if (inputWindow == 0) {
utils->log("Error : input window NULL!");
}
if (!is_scl_window) return TRUE;
- SclRectangle rect = {0,0,0,0};
+ SclRectangle rect = {0, 0, 0, 0};
do {
window = windows->get_nth_window_in_Z_order_list(index);
if (window) {
}
//void mouse_release (void *data, Evas *e, Evas_Object *object, void *event_info)
-Eina_Bool mouse_release (void *data, int type, void *event_info)
+Eina_Bool mouse_release(void *data, int type, void *event_info)
{
SCL_DEBUG();
CSCLController *controller = CSCLController::get_instance();
Ecore_Event_Key *ev = (Ecore_Event_Key *)event_info;
const char *ckey_val = ev->key;
- LOGD("=-=-=-=- ev->key(char) = %c \n",ev->key);
- LOGD("=-=-=-=- ev->key(string) = %s \n",ev->key);
- LOGD("=-=-=-=- ev->keyname(char) = %c \n",ev->keyname);
- LOGD("=-=-=-=- ev->keyname(string) = %s \n",ev->keyname);
- LOGD("=-=-=-=- ev->string(char) = %c \n",ev->string);
- LOGD("=-=-=-=- ev->string(string) = %s \n",ev->string);
+ LOGD("=-=-=-=- ev->key(char) = %c \n", ev->key);
+ LOGD("=-=-=-=- ev->key(string) = %s \n", ev->key);
+ LOGD("=-=-=-=- ev->keyname(char) = %c \n", ev->keyname);
+ LOGD("=-=-=-=- ev->keyname(string) = %s \n", ev->keyname);
+ LOGD("=-=-=-=- ev->string(char) = %c \n", ev->string);
+ LOGD("=-=-=-=- ev->string(string) = %s \n", ev->string);
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
SclButtonContext *prev_button_context = NULL;
key_index = focus_handler->get_next_key_index(NAVIGATE_UP);
} 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)) {
+ } else if ((strcmp(ev->keyname, "Return") == 0) || (strcmp(ev->keyname, "Enter") == 0)) {
button_context = cache->get_cur_button_context(window, current_key_index);
coordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
button_context->state = BUTTON_STATE_NORMAL;
coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
prev_button_context->state = BUTTON_STATE_NORMAL;
button_context->state = BUTTON_STATE_PRESSED;
- sclshort x,y,width,height;
+ sclshort x, y, width, height;
if (prevcoordinate->x < coordinate->x) {
x = prevcoordinate->x;
} else {
#endif /*HANDLE_KEY_EVENTS*/
//int mouse_move (void *data, Evas *e, Evas_Object *object, void *event_info)
-Eina_Bool mouse_move (void *data, int type, void *event_info)
+Eina_Bool mouse_move(void *data, int type, void *event_info)
{
SCL_DEBUG();
int root_x = ev->x + rect.x;
int root_y = ev->y + rect.y;
- Ecore_Wl_Window *wl_base_window = elm_win_wl_window_get (static_cast<Evas_Object*>(windows->get_base_window ()));
- if (wl_base_window && (unsigned int)ecore_wl_window_id_get (wl_base_window) == ev->window) {
+ Ecore_Wl_Window *wl_base_window = elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
+ if (wl_base_window && (unsigned int)ecore_wl_window_id_get(wl_base_window) == ev->window) {
SclRectangle base_rect;
- get_window_rect (windows->get_base_window (), &base_rect);
+ get_window_rect(windows->get_base_window(), &base_rect);
root_x = ev->x + base_rect.x;
root_y = ev->y + base_rect.y;
}
Evas_Object *base_win = (Evas_Object *)windows->get_base_window();
if (base_win == NULL) return FALSE;
- if ((unsigned int)ev->data.l[0] == elm_win_xwindow_get(base_win) ) {
+ if ((unsigned int)ev->data.l[0] == elm_win_xwindow_get(base_win)) {
if ((unsigned int)ev->data.l[1] == ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_ACTIVATE) {
// 1 finger double tap
controller->mouse_press(base_win, last_pos_x, last_pos_y);
CSCLEventsImplEfl::destroy_all_timer()
{
SCL_DEBUG();
- for ( std::map<int, Ecore_Timer*>::iterator idx = idMap.begin(); idx != idMap.end(); ++idx) {
+ for ( std::map<int, Ecore_Timer*>::iterator idx = idMap.begin(); idx != idMap.end(); ++idx ) {
ecore_timer_del((*idx).second);
CSCLUtils *utils = CSCLUtils::get_instance();
#ifdef WAYLAND
Ecore_Wl_Window *wl_base_window;
wl_base_window = elm_win_wl_window_get(static_cast<Evas_Object*>(windows->get_base_window()));
- if(wl_base_window)
+ if (wl_base_window)
evt.window = (unsigned int)ecore_wl_window_id_get(wl_base_window);
#else
evt.window = elm_win_xwindow_get(static_cast<Evas_Object*>(windows->get_base_window()));
sclint hash_string(const sclchar* str) {
sclint ret = 0;
sclint len = strlen(str);
- for(sclint loop = 0;loop < len && str[loop];loop++) {
+ for (sclint loop = 0;loop < len && str[loop];loop++) {
ret = ((loop + 1) * str[loop]);
}
int iNumCreate = 0;
-extern void mouse_press (void *data, Evas *e, Evas_Object *object, void *event_info);
-extern void mouse_release (void *data, Evas *e, Evas_Object *object, void *event_info);
-extern void mouse_move (void *data, Evas *e, Evas_Object *object, void *event_info);
+extern void mouse_press(void *data, Evas *e, Evas_Object *object, void *event_info);
+extern void mouse_release(void *data, Evas *e, Evas_Object *object, void *event_info);
+extern void mouse_move(void *data, Evas *e, Evas_Object *object, void *event_info);
/**
* Constructor
Evas_Object* extract_partimage_from_fullimage(
Evas_Object* fullimage,
- int img_x,int img_y,
- int cell_x,int cell_y,
+ int img_x, int img_y,
+ int cell_x, int cell_y,
int cell_cx, int cell_cy)
{
unsigned int *data;
unsigned int *t_data;
- int i,j;
- int w,h;
+ int i, j;
+ int w, h;
Evas_Object *image_ob;
if (fullimage == NULL) {
}
evas_object_image_size_get(fullimage, &w, &h);
- data = (unsigned int*)evas_object_image_data_get(fullimage,0);
+ data = (unsigned int*)evas_object_image_data_get(fullimage, 0);
if (data == NULL) {
return NULL;
}
- t_data=(unsigned int*)malloc(sizeof(unsigned int)*cell_cx*cell_cy);
+ t_data = (unsigned int*)malloc(sizeof(unsigned int)*cell_cx*cell_cy);
if (t_data == NULL) {
return NULL;
}
- for (i=img_y; i<img_y+cell_cy; i++) {
- for (j=img_x; j<img_x+cell_cx; j++) {
+ for (i=img_y; i < img_y+cell_cy; i++) {
+ for (j=img_x; j < img_x+cell_cx; j++) {
t_data[(i-img_y)*cell_cx+(j-img_x)] = data[i*w+j];
}
}
free(t_data);
return NULL;
}
- evas_object_image_size_set(image_ob,cell_cx,cell_cy);
- evas_object_image_data_set(image_ob,t_data);
- evas_object_image_fill_set(image_ob,0,0,cell_cx,cell_cy);
- evas_object_resize(image_ob,cell_cx,cell_cy);
+ evas_object_image_size_set(image_ob, cell_cx, cell_cy);
+ evas_object_image_data_set(image_ob, t_data);
+ evas_object_image_fill_set(image_ob, 0, 0, cell_cx, cell_cy);
+ evas_object_resize(image_ob, cell_cx, cell_cy);
evas_object_show(image_ob);
sclint hashval = hash_string(image_path);
/*for(std::list<ImageCache>::iterator iter = g_ImageCache.begin();
bFound && iter != g_ImageCache.end();std::advance(iter, 1)) {*/
- for(sclint loop = 0;loop < g_ImageCache.size() && !bFound;loop++) {
+ for (sclint loop = 0;loop < g_ImageCache.size() && !bFound;loop++) {
if (
/* (*iter).used &&
window == (*iter).window &&
image_object = newobj;
evas_object_move(image_object, dest_x, dest_y);
if (dest_width > 0 && dest_height > 0) {
- evas_object_image_fill_set(image_object, 0, 0, dest_width,dest_height);
+ evas_object_image_fill_set(image_object, 0, 0, dest_width, dest_height);
evas_object_resize(image_object, dest_width, dest_height);
}
#else
} else {
evas_object_move(image_object, dest_x, dest_y);
if (dest_width > 0 && dest_height > 0) {
- evas_object_image_fill_set(image_object, 0, 0, dest_width,dest_height);
+ evas_object_image_fill_set(image_object, 0, 0, dest_width, dest_height);
evas_object_resize(image_object, dest_width, dest_height);
}
}
cache.src_width = src_width;
cache.src_height = src_height;
}
- cache.extrace_image= extrace_image;
+ cache.extrace_image = extrace_image;
cache.image = object->object;
if (clip_object) {
cache.clipper = clip_object->object;
//g_ImageCache.insert(g_ImageCache.end(), cache);
sclboolean bInserted = FALSE;
- for(sclint loop = 0;loop < g_ImageCache.size() && !bInserted;loop++) {
+ for (sclint loop = 0;loop < g_ImageCache.size() && !bInserted;loop++) {
if (!g_ImageCache[loop].used) {
g_ImageCache[loop] = cache;
}
sclint org_posy = pos_y;
/*for(std::list<TextCache>::iterator iter = g_TextCache.begin();
bFound && iter != g_TextCache.end();std::advance(iter, 1)) {*/
- for(sclint loop = 0;loop < g_TextCache.size() && !bFound;loop++) {
+ for (sclint loop = 0;loop < g_TextCache.size() && !bFound;loop++) {
if (
/*
(*iter).used &&
snprintf(strStyle, 128,
"DEFAULT='font=%s font_size=%d align=%s color=#%02X%02X%02X%02X wrap=word left_margin=%d right_margin=%d'",
font_info.font_name, font_info.font_size,
- (((int)align % 3) == 1 ) ? "center" : ((((int)align % 3) == 2 ) ? "right" : "left"),
+ (((int)align % 3) == 1) ? "center" : ((((int)align % 3) == 2) ? "right" : "left"),
color.r, color.g, color.b, color.a, padding_x, padding_x);
Evas_Textblock_Style *st;
"DEFAULT='font=%s font_size=%d align=%s color=#%02X%02X%02X%02X wrap=word left_margin=%d right_margin=%d'",
font_info.font_name,
(int)(SCL_LABEL_OVERLENGTH_TEXT_RESIZE_RATE * font_info.font_size * resize_rate),
- (((int)align % 3) == 1 ) ? "center" : ((((int)align % 3) == 2 ) ? "right" : "left"),
+ (((int)align % 3) == 1) ? "center" : ((((int)align % 3) == 2) ? "right" : "left"),
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);
//g_TextCache.insert(g_TextCache.end(), cache);
sclboolean bInserted = FALSE;
- for(sclint loop = 0;loop < g_TextCache.size() && !bInserted;loop++) {
+ for (sclint loop = 0;loop < g_TextCache.size() && !bInserted;loop++) {
if (!g_TextCache[loop].used) {
g_TextCache[loop] = cache;
}
SCL_DEBUG();
}
-static void window_show_cb (void *data, Evas *e, Evas_Object *obj, void *event)
+static void window_show_cb(void *data, Evas *e, Evas_Object *obj, void *event)
{
LOGD("INSIDE =-=-=-=- window_show_cb, Trying to Grab Key Board : \n");
#ifdef USING_KEY_GRAB
void CSCLWindowsImplEfl::init()
{
-
}
void CSCLWindowsImplEfl::fini()
{
-
}
/**
#ifndef APPLY_WINDOW_MANAGER_CHANGE
#ifndef WAYLAND
- ecore_x_icccm_name_class_set(elm_win_xwindow_get(static_cast<Evas_Object*>(parent)), "Virtual Keyboard", "ISF" );
+ ecore_x_icccm_name_class_set(elm_win_xwindow_get(static_cast<Evas_Object*>(parent)), "Virtual Keyboard", "ISF");
#endif
#else
if (parent) {
scl16 new_width;
scl16 new_height;
CSCLContext *context = CSCLContext::get_instance();
- if(context->get_rotation() == ROTATION_90_CW || context->get_rotation() == ROTATION_90_CCW) {
+ if (context->get_rotation() == ROTATION_90_CW || context->get_rotation() == ROTATION_90_CCW) {
new_width = height;
new_height = width;
} else {
set_window_accepts_focus(win, FALSE);
- int rots[4] = {0,90,180,270};
+ int rots[4] = {0, 90, 180, 270};
elm_win_wm_rotation_available_rotations_set(win, rots, 4);
#ifdef DO_NOT_MOVE_MAGNIFIER_WINDOW
evas_object_resize(win, width, height);
- int rots[4] = {0,90,180,270};
+ int rots[4] = {0, 90, 180, 270};
elm_win_wm_rotation_available_rotations_set(win, rots, 4);
set_window_accepts_focus(win, FALSE);
evas_textblock_style_free(st);
}
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_TextCache.size();loop++) {
+ for (sclint loop = 0;loop < g_TextCache.size();loop++) {
if (g_TextCache[loop].text == object->object) {
g_TextCache[loop].used = FALSE;
}
#endif
} else if (object->type == EFLOBJECT_IMAGE) {
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
+ for (sclint loop = 0;loop < g_ImageCache.size();loop++) {
if (g_ImageCache[loop].image == object->object) {
g_ImageCache[loop].used = FALSE;
}
CSCLUtils *utils = CSCLUtils::get_instance();
if (windows && context && window) {
#ifdef USING_DIM_BG
- if (window == windows->get_dim_window ()) {
- Evas_Object *base_window = static_cast<Evas_Object*>(windows->get_base_window ());
+ if (window == windows->get_dim_window()) {
+ Evas_Object *base_window = static_cast<Evas_Object*>(windows->get_base_window());
static Evas_Object *dim_bg = NULL;
if (dim_bg == NULL) {
- dim_bg = elm_bg_add (static_cast<Evas_Object*>(windows->get_base_window ()));
+ dim_bg = elm_bg_add(static_cast<Evas_Object*>(windows->get_base_window()));
SclColor color;
color.r = color.g = color.b = 0;
color.a = 102;
- SclResParserManager *sclres_manager = SclResParserManager::get_instance ();
+ SclResParserManager *sclres_manager = SclResParserManager::get_instance();
if (sclres_manager) {
- PSclDefaultConfigure default_configure = sclres_manager->get_default_configure ();
+ PSclDefaultConfigure default_configure = sclres_manager->get_default_configure();
if (default_configure)
color = default_configure->dim_color;
}
- evas_object_color_set (dim_bg, color.r, color.g, color.b, color.a);
- evas_object_data_set (base_window, "dim_bg", (void *)dim_bg);
+ evas_object_color_set(dim_bg, color.r, color.g, color.b, color.a);
+ evas_object_data_set(base_window, "dim_bg", (void *)dim_bg);
}
SclRectangle rect;
- get_window_rect (windows->get_base_window (), &rect);
- evas_object_resize (dim_bg, rect.width, rect.height);
- evas_object_move (dim_bg, 0, 0);
- evas_object_show (dim_bg);
- evas_object_layer_set (dim_bg, SHRT_MAX);
+ get_window_rect(windows->get_base_window(), &rect);
+ evas_object_resize(dim_bg, rect.width, rect.height);
+ evas_object_move(dim_bg, 0, 0);
+ evas_object_show(dim_bg);
+ evas_object_layer_set(dim_bg, SHRT_MAX);
return;
}
#endif
unsigned char *data = NULL;
Ecore_X_Window win = elm_win_xwindow_get(static_cast<Evas_Object*>(window));
- ret = XGetWindowProperty ((Display *)ecore_x_display_get (),
- ecore_x_window_root_get (win),
- ecore_x_atom_get ("_ISF_ACTIVE_WINDOW"),
+ ret = XGetWindowProperty((Display *)ecore_x_display_get(),
+ ecore_x_window_root_get(win),
+ ecore_x_atom_get("_ISF_ACTIVE_WINDOW"),
0, G_MAXLONG, False, XA_WINDOW, &type_return,
&format_return, &nitems_return, &bytes_after_return,
&data);
if ((type_return == XA_WINDOW) && (format_return == 32) && (data)) {
app_window = *(Window *)data;
if (data)
- XFree (data);
+ XFree(data);
}
}
}
if (windows && window) {
#ifdef USING_DIM_BG
- if (window == windows->get_dim_window ()) {
- Evas_Object *base_window = static_cast<Evas_Object*>(windows->get_base_window ());
- Evas_Object *dim_bg = (Evas_Object *)evas_object_data_get (base_window, "dim_bg");
- evas_object_hide (dim_bg);
+ if (window == windows->get_dim_window()) {
+ Evas_Object *base_window = static_cast<Evas_Object*>(windows->get_base_window());
+ Evas_Object *dim_bg = (Evas_Object *)evas_object_data_get(base_window, "dim_bg");
+ evas_object_hide(dim_bg);
return;
}
#endif
if (window == windows->get_magnifier_window() || window == windows->get_dim_window()) {
if (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;
evas_textblock_style_free(st);
}
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_TextCache.size();loop++) {
+ for (sclint loop = 0;loop < g_TextCache.size();loop++) {
if (g_TextCache[loop].text == object->object) {
g_TextCache[loop].used = FALSE;
}
#endif
} else if (object->type == EFLOBJECT_IMAGE) {
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
+ for (sclint loop = 0;loop < g_ImageCache.size();loop++) {
if (g_ImageCache[loop].image == object->object) {
g_ImageCache[loop].used = FALSE;
}
}
}
if (window_context->etc_info) {
-
Eina_List *list = (Eina_List*)(window_context->etc_info);
Eina_List *iter = NULL;
Eina_List *iter_next = NULL;
evas_textblock_style_free(st);
}
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_TextCache.size();loop++) {
+ for sclint loop = 0;loop < g_TextCache.size();loop++) {
if (g_TextCache[loop].text == object->object) {
g_TextCache[loop].used = FALSE;
}
#endif
} else if (object->type == EFLOBJECT_IMAGE) {
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
+ for (sclint loop = 0;loop < g_ImageCache.size();loop++) {
if (g_ImageCache[loop].image == object->object) {
g_ImageCache[loop].used = FALSE;
}
SclWindowContext *window_context = windows->get_window_context(win);
if (window_context && win) {
if (window_context->etc_info) {
-
Eina_List *list = (Eina_List*)(window_context->etc_info);
Eina_List *iter = NULL;
Eina_List *iter_next = NULL;
evas_textblock_style_free(st);
}
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_TextCache.size();loop++) {
+ for (sclint loop = 0;loop < g_TextCache.size();loop++) {
if (g_TextCache[loop].text == object->object) {
g_TextCache[loop].used = FALSE;
}
#endif
} else if (object->type == EFLOBJECT_IMAGE) {
#ifdef TEST_NEWBACKEND
- for(sclint loop = 0;loop < g_ImageCache.size();loop++) {
+ for (sclint loop = 0;loop < g_ImageCache.size();loop++) {
if (g_ImageCache[loop].image == object->object) {
g_ImageCache[loop].used = FALSE;
}
* Generates a update window event to CSCLController class
*/
bool
-update_window (GtkWidget *widget, GdkEventExpose *event,gpointer user_data)
+update_window(GtkWidget *widget, GdkEventExpose *event, gpointer user_data)
{
SCL_DEBUG();
/* pre-condition */
CSCLGwes* gwes = CSCLGwes::get_instance();
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
- if (gwes && builder) {
+ if (gwes && builder) {
sclwindow window = static_cast<sclwindow>(widget);
#if 0
/* For making the transparent window */
cairo_t *cr;
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create(widget->window);
/* Make it transparent */
- cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
- gdk_cairo_region (cr, event->region);
- cairo_fill_preserve (cr);
+ cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
+ gdk_cairo_region(cr, event->region);
+ cairo_fill_preserve(cr);
/* Make it half-transparent */
if (gwes->mWnd->get_base_window() == window) {
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.9);
+ cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.9);
} else {
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.0);
+ cairo_set_source_rgba(cr, 0.0, 0.0, 0.0, 0.0);
}
- cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
- cairo_fill (cr);
- cairo_destroy (cr);
+ cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
+ cairo_fill(cr);
+ cairo_destroy(cr);
#endif
return builder->show_layout(window);
GtkWidget* widget = static_cast<GtkWidget*>(wnd);
- gtk_widget_add_events ((GtkWidget*)widget, GDK_BUTTON_PRESS_MASK |
+ gtk_widget_add_events((GtkWidget*)widget, GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_POINTER_MOTION_HINT_MASK);
{
SCL_DEBUG();
sclint data = SCL_MAKELONG(id, value);
- gint timerId = gtk_timeout_add (static_cast<guint32>(interval), timer_event, (gpointer)data);
+ gint timerId = gtk_timeout_add(static_cast<guint32>(interval), timer_event, (gpointer)data);
if (add_to_map) {
id_map[id] = timerId;
}
CSCLEventsImplGtk::destroy_timer(const scl32 id)
{
SCL_DEBUG();
- for ( std::map<int, int>::iterator idx = id_map.begin(); idx != id_map.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);
+ gtk_timeout_remove((*idx).second);
id_map.erase((*idx).first);
break;
}
CSCLEventsImplGtk::destroy_all_timer()
{
SCL_DEBUG();
- for ( std::map<int, int>::iterator idx = id_map.begin(); idx != id_map.end(); ++idx) {
- gtk_timeout_remove ((*idx).second);
+ for ( std::map<int, int>::iterator idx = id_map.begin(); idx != id_map.end(); ++idx ) {
+ gtk_timeout_remove((*idx).second);
}
id_map.clear();
}
cairo_translate(cr, destX - srcX, destY - srcY);
if (destWidth > 0 && destHeight > 0 && srcWidth == -1) {
- sclint imagew = cairo_image_surface_get_width (imgSurface);
- sclint imageh = cairo_image_surface_get_height (imgSurface);
+ sclint imagew = cairo_image_surface_get_width(imgSurface);
+ sclint imageh = cairo_image_surface_get_height(imgSurface);
double scaleX = (double)destWidth / imagew;
double scaleY = (double)destHeight / imageh;
}
if (srcWidth > 0) {
- cairo_rectangle (cr, srcX, srcY, srcWidth, srcHeight);
- cairo_clip (cr);
- cairo_new_path (cr);
+ cairo_rectangle(cr, srcX, srcY, srcWidth, srcHeight);
+ cairo_clip(cr);
+ cairo_new_path(cr);
}
cairo_set_source_surface(cr, imgSurface, 0, 0);
/* a custom shape that could be wrapped in a function */
//double radius = 0;//102.4; /* and an approximate curvature radius */
- double x1,y1;
+ double x1, y1;
- x1=posx+width;
- y1=posy+height;
+ x1 = posx+width;
+ y1 = posy+height;
if (!width || !height)
return;
- if (width/2<radius) {
- if (height/2<radius) {
- cairo_move_to (cr, posx, (posy + y1)/2);
- cairo_curve_to (cr, posx ,posy, posx, posy, (posx + x1)/2, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, (posy + y1)/2);
- cairo_curve_to (cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, (posy + y1)/2);
+ if (width/2 < radius) {
+ if (height/2 < radius) {
+ cairo_move_to(cr, posx, (posy + y1)/2);
+ cairo_curve_to(cr, posx, posy, posx, posy, (posx + x1)/2, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, (posy + y1)/2);
+ cairo_curve_to(cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, (posy + y1)/2);
} else {
- cairo_move_to (cr, posx, posy + radius);
- cairo_curve_to (cr, posx ,posy, posx, posy, (posx + x1)/2, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, posy + radius);
- cairo_line_to (cr, x1 , y1 - radius);
- cairo_curve_to (cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, y1- radius);
+ cairo_move_to(cr, posx, posy + radius);
+ cairo_curve_to(cr, posx, posy, posx, posy, (posx + x1)/2, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, posy + radius);
+ cairo_line_to(cr, x1 , y1 - radius);
+ cairo_curve_to(cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, y1- radius);
}
} else {
- if (height/2<radius) {
- cairo_move_to (cr, posx, (posy + y1)/2);
- cairo_curve_to (cr, posx , posy, posx , posy, posx + radius, posy);
- cairo_line_to (cr, x1 - radius, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, (posy + y1)/2);
- cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
- cairo_line_to (cr, posx + radius, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, (posy + y1)/2);
+ if (height/2 < radius) {
+ cairo_move_to(cr, posx, (posy + y1)/2);
+ cairo_curve_to(cr, posx , posy, posx , posy, posx + radius, posy);
+ cairo_line_to(cr, x1 - radius, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, (posy + y1)/2);
+ cairo_curve_to(cr, x1, y1, x1, y1, x1 - radius, y1);
+ cairo_line_to(cr, posx + radius, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, (posy + y1)/2);
} else {
- cairo_move_to (cr, posx, posy + radius);
- cairo_curve_to (cr, posx , posy, posx , posy, posx + radius, posy);
- cairo_line_to (cr, x1 - radius, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, posy + radius);
- cairo_line_to (cr, x1 , y1 - radius);
- cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
- cairo_line_to (cr, posx + radius, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, y1- radius);
+ cairo_move_to(cr, posx, posy + radius);
+ cairo_curve_to(cr, posx , posy, posx , posy, posx + radius, posy);
+ cairo_line_to(cr, x1 - radius, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, posy + radius);
+ cairo_line_to(cr, x1 , y1 - radius);
+ cairo_curve_to(cr, x1, y1, x1, y1, x1 - radius, y1);
+ cairo_line_to(cr, posx + radius, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, y1- radius);
}
}
- cairo_close_path (cr);
+ cairo_close_path(cr);
if (fill) {
- cairo_set_source_rgba (cr, fillColor.r / 256.0, fillColor.g / 256.0, fillColor.b / 256.0, alpha); //0.9
- cairo_fill_preserve (cr);
+ cairo_set_source_rgba(cr, fillColor.r / 256.0, fillColor.g / 256.0, fillColor.b / 256.0, alpha); //0.9
+ cairo_fill_preserve(cr);
}
- cairo_set_source_rgb (cr, lineColor.r / 256.0, lineColor.g / 256.0, lineColor.b / 256.0); // 1 . 0
- cairo_set_line_width (cr, lineWidth);//5.0
- cairo_stroke (cr);
+ cairo_set_source_rgb(cr, lineColor.r / 256.0, lineColor.g / 256.0, lineColor.b / 256.0); // 1 . 0
+ cairo_set_line_width(cr, lineWidth);//5.0
+ cairo_stroke(cr);
}
rgba = gdk_screen_get_rgba_colormap(gdk_screen_get_default());
pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
- gdk_pixbuf_render_pixmap_and_mask_for_colormap (pixbuf, rgba, &pixmap, &mask, 128);
+ gdk_pixbuf_render_pixmap_and_mask_for_colormap(pixbuf, rgba, &pixmap, &mask, 128);
return GDK_DRAWABLE_GET_CLASS (GDK_DRAWABLE (pixmap))->ref_cairo_surface (GDK_DRAWABLE (pixmap));
-
-
}
#else
/**
if (!GTK_WIDGET_REALIZED(widget)) {
gtk_widget_realize(widget);
}
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create(widget->window);
return static_cast<scldrawctx>(cr);
}
imgdata,
srcX, srcY,
destX, destY,
- destWidth, destHeight
- );
+ destWidth, destHeight);
}
}
}
int width = 0;
int height = 0;
int stride = 0;
- int i =0;
+ int i = 0;
GdkPixmap *pixmap = NULL;
GdkColormap *rgba;
GdkBitmap* mask = NULL;
- if (g_file_test(filename,G_FILE_TEST_EXISTS)) {
+ if (g_file_test(filename, G_FILE_TEST_EXISTS)) {
pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
} else {
return NULL;
width = gdk_pixbuf_get_width(pixbuf);
height = gdk_pixbuf_get_height(pixbuf);
pixmap = gdk_pixmap_new(NULL, width, height, 32);
- gdk_draw_pixbuf (pixmap,
+ gdk_draw_pixbuf(pixmap,
NULL,
pixbuf,
0,
if (!GTK_WIDGET_REALIZED(widget)) {
gtk_widget_realize(widget);
}
- cr = gdk_cairo_create (widget->window);
+ cr = gdk_cairo_create(widget->window);
return static_cast<scldrawctx>(cr);
}
/* a custom shape that could be wrapped in a function */
//double radius = 0;//102.4; /* and an approximate curvature radius */
- double x1,y1;
+ double x1, y1;
- x1=posx+width;
- y1=posy+height;
+ x1 = posx+width;
+ y1 = posy+height;
if (!width || !height)
return;
- if (width/2<radius) {
- if (height/2<radius) {
- cairo_move_to (cr, posx, (posy + y1)/2);
- cairo_curve_to (cr, posx ,posy, posx, posy, (posx + x1)/2, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, (posy + y1)/2);
- cairo_curve_to (cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, (posy + y1)/2);
+ if (width/2 < radius) {
+ if (height/2 < radius) {
+ cairo_move_to(cr, posx, (posy + y1)/2);
+ cairo_curve_to(cr, posx, posy, posx, posy, (posx + x1)/2, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, (posy + y1)/2);
+ cairo_curve_to(cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, (posy + y1)/2);
} else {
- cairo_move_to (cr, posx, posy + radius);
- cairo_curve_to (cr, posx ,posy, posx, posy, (posx + x1)/2, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, posy + radius);
- cairo_line_to (cr, x1 , y1 - radius);
- cairo_curve_to (cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, y1- radius);
+ cairo_move_to(cr, posx, posy + radius);
+ cairo_curve_to(cr, posx, posy, posx, posy, (posx + x1)/2, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, posy + radius);
+ cairo_line_to(cr, x1 , y1 - radius);
+ cairo_curve_to(cr, x1, y1, x1, y1, (x1 + posx)/2, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, y1- radius);
}
} else {
- if (height/2<radius) {
- cairo_move_to (cr, posx, (posy + y1)/2);
- cairo_curve_to (cr, posx , posy, posx , posy, posx + radius, posy);
- cairo_line_to (cr, x1 - radius, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, (posy + y1)/2);
- cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
- cairo_line_to (cr, posx + radius, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, (posy + y1)/2);
+ if (height/2 < radius) {
+ cairo_move_to(cr, posx, (posy + y1)/2);
+ cairo_curve_to(cr, posx , posy, posx , posy, posx + radius, posy);
+ cairo_line_to(cr, x1 - radius, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, (posy + y1)/2);
+ cairo_curve_to(cr, x1, y1, x1, y1, x1 - radius, y1);
+ cairo_line_to(cr, posx + radius, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, (posy + y1)/2);
} else {
- cairo_move_to (cr, posx, posy + radius);
- cairo_curve_to (cr, posx , posy, posx , posy, posx + radius, posy);
- cairo_line_to (cr, x1 - radius, posy);
- cairo_curve_to (cr, x1, posy, x1, posy, x1, posy + radius);
- cairo_line_to (cr, x1 , y1 - radius);
- cairo_curve_to (cr, x1, y1, x1, y1, x1 - radius, y1);
- cairo_line_to (cr, posx + radius, y1);
- cairo_curve_to (cr, posx, y1, posx, y1, posx, y1- radius);
+ cairo_move_to(cr, posx, posy + radius);
+ cairo_curve_to(cr, posx , posy, posx , posy, posx + radius, posy);
+ cairo_line_to(cr, x1 - radius, posy);
+ cairo_curve_to(cr, x1, posy, x1, posy, x1, posy + radius);
+ cairo_line_to(cr, x1 , y1 - radius);
+ cairo_curve_to(cr, x1, y1, x1, y1, x1 - radius, y1);
+ cairo_line_to(cr, posx + radius, y1);
+ cairo_curve_to(cr, posx, y1, posx, y1, posx, y1- radius);
}
}
- cairo_close_path (cr);
+ cairo_close_path(cr);
if (fill) {
- cairo_set_source_rgba (cr, fillColor.r / 256.0, fillColor.g / 256.0, fillColor.b / 256.0, alpha); //0.9
- cairo_fill_preserve (cr);
+ cairo_set_source_rgba(cr, fillColor.r / 256.0, fillColor.g / 256.0, fillColor.b / 256.0, alpha); //0.9
+ cairo_fill_preserve(cr);
}
- cairo_set_source_rgb (cr, lineColor.r / 256.0, lineColor.g / 256.0, lineColor.b / 256.0); // 1 . 0
- cairo_set_line_width (cr, lineWidth);//5.0
- cairo_stroke (cr);
+ cairo_set_source_rgb(cr, lineColor.r / 256.0, lineColor.g / 256.0, lineColor.b / 256.0); // 1 . 0
+ cairo_set_line_width(cr, lineWidth);//5.0
+ cairo_stroke(cr);
}
SclSize
SCL_DEBUG();
SclSize ret = { 0, 0 };
GdkPixbuf *pixbuf = NULL;
- if (g_file_test(imgPath,G_FILE_TEST_EXISTS)) {
+ if (g_file_test(imgPath, G_FILE_TEST_EXISTS)) {
pixbuf = gdk_pixbuf_new_from_file(imgPath, NULL);
} else {
return ret;
* Make a transparent window
*/
static void
-make_transparent_window (GtkWidget *window)
+make_transparent_window(GtkWidget *window)
{
SCL_DEBUG();
GdkScreen *screen;
GdkColormap *colormap;
- screen = gtk_widget_get_screen (window);
+ screen = gtk_widget_get_screen(window);
if (!screen) {
- g_warning ("failed to get window's screen");
+ g_warning("failed to get window's screen");
return;
}
- colormap = gdk_screen_get_rgba_colormap (screen);
+ colormap = gdk_screen_get_rgba_colormap(screen);
if (!colormap) {
- g_warning ("failed to get RGBA colormap");
+ g_warning("failed to get RGBA colormap");
return;
}
- gtk_widget_set_colormap (window, colormap);
- gtk_widget_set_app_paintable (window, TRUE);
- gtk_widget_realize (window);
+ gtk_widget_set_colormap(window, colormap);
+ gtk_widget_set_app_paintable(window, TRUE);
+ gtk_widget_realize(window);
//gdk_gc_set_alpha(window->style->bg_gc[GTK_STATE_NORMAL], 0);
//gdk_window_set_alpha(window->window, 0);
}
gtk_widget_set_size_request(window, width, height);
gtk_widget_set_size_request(drawarea, width, height);
gtk_box_pack_start(GTK_BOX(window), drawarea, TRUE, TRUE, 0);
- gtk_widget_show (drawarea);
- gtk_widget_show (window);
+ gtk_widget_show(drawarea);
+ gtk_widget_show(window);
window_context->etc_info = static_cast<void*>(drawarea);
window_context->window = drawarea;
make_transparent_window(drawarea);
GtkWidget* 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);
+ 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_type_hint(GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_NOTIFICATION);
//gtk_window_set_keep_above(GTK_WINDOW(window), TRUE);
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);
+ gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_UTILITY);
#ifdef NO_SOCKETPLUG
//gtk_window_set_type_hint(GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_NOTIFICATION);
#endif
/* Fix me : The below is a temporary code for magnifier speed enhancement */
#ifdef NO_SOCKETPLUG
gint root_x, root_y;
- gtk_window_get_position (GTK_WINDOW(widget), &root_x, &root_y);
+ gtk_window_get_position(GTK_WINDOW(widget), &root_x, &root_y);
if (GTK_WIDGET_MAPPED(widget)) {
-
/* Window rotation*/
CSCLContext* context = CSCLContext::get_instance();
if (context->get_display() == DISPLAY_LANDSCAPE) {
sclboolean ret = FALSE;
GtkWidget* widget = static_cast<GtkWidget*>(window);
if (rect && GTK_WIDGET_REALIZED(widget)) {
-
#if 0
/* FIXME : We need to get appropriate position of the base window somehow */
// {
CSCLContext *context = CSCLContext::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
if (context->get_display() == DISPLAY_LANDSCAPE) {
- gdk_window_get_root_origin (GDK_WINDOW(gtk_widget_get_toplevel(widget)->window), &(rect->x), &(rect->y));
+ gdk_window_get_root_origin(GDK_WINDOW(gtk_widget_get_toplevel(widget)->window), &(rect->x), &(rect->y));
if (window == windows->get_base_window()) {
CSCLUtils *utils = CSCLUtils::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
rect->y = scnWidth - cache->get_cur_layout(window)->height;
}
} else {
- gdk_window_get_root_origin (GDK_WINDOW(gtk_widget_get_toplevel(widget)->window), &(rect->x), &(rect->y));
+ gdk_window_get_root_origin(GDK_WINDOW(gtk_widget_get_toplevel(widget)->window), &(rect->x), &(rect->y));
if (window == windows->get_base_window()) {
CSCLUtils *utils = CSCLUtils::get_instance();
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
rect->y = scnHeight - cache->get_cur_layout(window)->height;
}
}
- gtk_window_get_size (GTK_WINDOW(gtk_widget_get_toplevel(widget)), &(rect->width), &(rect->height));
+ gtk_window_get_size(GTK_WINDOW(gtk_widget_get_toplevel(widget)), &(rect->width), &(rect->height));
ret = TRUE;
}
friend class CSCLAnimator;
private:
-
};
class CSCLAnimator
}SCLKeyType;
/**@brief Key Event Type definition */
-typedef enum _SCLEventType{
+typedef enum _SCLEventType {
EVENT_TYPE_NONE = 0, /**< none */
EVENT_TYPE_PRESS, /**< button press event */
EVENT_TYPE_MOVE, /**< button move event */
} MagnifierCustomLabelIdx;
class MagnifierCustomLabelIdxCompare { // Comparison class for MagnifierCustomLabelIdx
public:
- bool operator()(const MagnifierCustomLabelIdx x ,const MagnifierCustomLabelIdx y) {
+ bool operator()(const MagnifierCustomLabelIdx x, const MagnifierCustomLabelIdx y) {
if (x.touch_id != y.touch_id) {
return x.touch_id > y.touch_id;
} else {
sclboolean check_magnifier_available(sclwindow window, sclbyte key_index, scltouchdevice touch_id);
SCLKeyModifier get_drag_key_modifier(sclint deltax, sclint deltay, sclfloat dist,
- sclboolean check_farthest,scltouchdevice touch_id, sclbyte extra_option);
+ sclboolean check_farthest, scltouchdevice touch_id, sclbyte extra_option);
public:
void handle_engine_signal(SclInternalSignal signal, sclwindow skip_window = SCLWINDOW_INVALID);
/* Definition for debug message trace */
#define scldebugc(m_code) "\x1b[" # m_code
#define scldebug_sync() (void)fflush(stdout)
-#define scldebug_puts(m_code) (void)fputs(m_code,stdout)
+#define scldebug_puts(m_code) (void)fputs(m_code, stdout)
#define scldebug_clear_screen() scldebug_puts(scldebugc(H) scldebugc(J))
-#define scldebug_move(m_x,m_y) scldebug_puts(scldebugc(m_y;m_x ## H))
+#define scldebug_move(m_x, m_y) scldebug_puts(scldebugc(m_y;m_x ## H))
#define scldebug_move_x(m_y) scldebug_puts(scldebugc(;m_y ## H))
#define scldebug_move_y(m_y) scldebug_puts(scldebugc(m_y ## d))
-#define scldebug_puts_xy(m_x,m_y,m_message) scldebug_puts(scldebugc(m_y;m_x ## H) m_message)
+#define scldebug_puts_xy(m_x, m_y, m_message) scldebug_puts(scldebugc(m_y;m_x ## H) m_message)
#define mc_normal scldebugc(0m)
#define mc_black scldebugc(1;30m)
#define mc_red scldebugc(1;31m)
static CSCLErrorAdjustment* get_instance();
private:
-
public:
void enable_touch_offset(sclboolean enable);
sclboolean apply_touch_offset(SCLTouchOffsetLevel level, sclint *x, sclint *y);
virtual void destroy_all_timer() = 0;
virtual void generate_mouse_event(SCLMouseEvent type, scl16 x, scl16 y) = 0;
-
};
class CSCLEvents
sclboolean button_pressed(sclwindow window, sclbyte key_index);
sclboolean button_moved(sclwindow window, sclbyte key_index);
sclboolean button_released(sclwindow window, sclbyte key_index);
-
protected:
-
};
}
static CSCLGwes* get_instance();
private:
-
public:
void init(sclwindow parent, scl16 width, scl16 height);
void fini();
#ifdef USING_KEY_GRAB
bool m_keyboard_grabbed;
#endif
- bool sub_layout_match(sclchar *layout1,sclchar *layout2);
+ bool sub_layout_match(sclchar *layout1, sclchar *layout2);
CSCLKeyFocusHandler();
#ifdef TARGET_EMULATOR
void create_sniffer_window(void);
void set_window_accepts_focus(const sclwindow window, sclboolean acceptable);
#endif
-
};
}
SclButtonContext (*pCurButtonContext)[MAX_KEY]);
protected:
-
SclLayout mCurBaseLayout;
SclLayoutKeyCoordinate mCurBaseLayoutKeyCoordinates[MAX_KEY];
sclboolean draw_magnifier_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 label_index, const sclchar* label);
protected:
-
/* Backend Primitive */
CSCLGwes *m_gwes;
CSCLUtils *m_utils;
namespace scl
{
#define MAX_POPUP_WINDOW 1
-#define MAX_ZORDER_NUM ( MAX_POPUP_WINDOW + 1 ) /* Popup + Base */
+#define MAX_ZORDER_NUM (MAX_POPUP_WINDOW + 1 ) /* Popup + Base */
#define SCL_WINDOW_Z_TOP 0
void
CSCLActionState::clear_action_buf()
{
-
}
}
sclboolean destroy_timer = TRUE;
- for(iter = m_animators.begin();iter != m_animators.end();std::advance(iter, 1)) {
+ 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) {
{
sclint ret = NOT_USED;
- for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
+ 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);
}
sclboolean destroy_timer = TRUE;
- for(iter = m_animators.begin();iter != m_animators.end();std::advance(iter, 1)) {
+ 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) {
CSCLAnimator::animator_timer()
{
sclboolean destroy_timer = TRUE;
- for(std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
+ for (std::map<sclint, SclAnimationState>::iterator iter = m_animators.begin();
iter != m_animators.end();std::advance(iter, 1)) {
if (iter != m_animators.end()) {
CSCLWindows *windows = CSCLWindows::get_instance();
}
sclshort
-CSCLContext::get_popup_layout( sclwindow window ) const
+CSCLContext::get_popup_layout(sclwindow window) const
{
SCL_DEBUG();
}
void
-CSCLContext::set_popup_layout( sclwindow window, sclshort val )
+CSCLContext::set_popup_layout(clwindow window, sclshort val )
{
SCL_DEBUG();
}
void
-CSCLContext::set_base_layout( sclshort val )
+CSCLContext::set_base_layout(sclshort val )
{
SCL_DEBUG();
CSCLWindows *windows = CSCLWindows::get_instance();
struct timeval
CSCLContext::get_cur_pressed_time(scltouchdevice touch_id)
{
- struct timeval ret = {0,0};
+ 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;
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 (std::list<scltouchdevice>::iterator 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");
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
- for(std::list<scltouchdevice>::iterator list_iter = m_multi_touch_seq.begin();
+ 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 (index == order) {
MultiTouchContext *multi_touch_context = find_multi_touch_context(*list_iter);
sclint ret = -1;
sclint iSeqIndex = 0;
- for(std::list<scltouchdevice>::iterator list_iter = m_multi_touch_seq.begin();
+ for (std::list<scltouchdevice>::iterator list_iter = m_multi_touch_seq.begin();
(ret == -1) && list_iter != m_multi_touch_seq.end();std::advance(list_iter, 1)) {
if (touch_id == (*list_iter)) {
ret = iSeqIndex;
handle_engine_signal(SCL_SIG_INPMODE_CHANGE, window);
#ifdef TEST_NEWBACKEND
- SclWindowContext *window_context= windows->get_window_context(window, FALSE);
+ SclWindowContext *window_context = windows->get_window_context(window, FALSE);
if (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;
}
sclint loop;
- for(loop = 0;loop < g_ImageCache.size();loop++) {
+ for (loop = 0;loop < g_ImageCache.size();loop++) {
if (g_ImageCache[loop].image == object->object) {
g_ImageCache[loop].used = FALSE;
}
}
- for(loop = 0;loop < g_TextCache.size();loop++) {
+ for (loop = 0;loop < g_TextCache.size();loop++) {
if (g_TextCache[loop].text == object->object) {
g_TextCache[loop].used = FALSE;
}
}
iIndex++;
}
- window_context->etc_info= list;
+ window_context->etc_info = list;
}
}
#endif
shift_index = (shift_index == SCL_SHIFT_STATE_OFF) ? SCL_SHIFT_STATE_ON : SCL_SHIFT_STATE_OFF;
}
- if (layout && coordinate && button_context && 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) {
-
ret = TRUE;
/* Do not show if current layout does not allow magnifier */
/* Do not show if there's nothing to show */
const sclchar* custom_label = NULL;
- for(sclint label_index = 0;label_index < MAX_SIZE_OF_LABEL_FOR_ONE && !custom_label;label_index++) {
+ for (sclint label_index = 0;label_index < MAX_SIZE_OF_LABEL_FOR_ONE && !custom_label;label_index++) {
const sclchar *temp_label = context->get_custom_magnifier_label(touch_id, label_index);
if (temp_label) {
custom_label = temp_label;
sclint loop = 0;
sclint multi_touch_context_num = context->get_multi_touch_context_num();
std::vector<SclUIEventDesc> multi_touch_events;
- for(loop = 0;loop < multi_touch_context_num;loop++) {
+ for (loop = 0;loop < multi_touch_context_num;loop++) {
SclUIEventDesc desc;
context->get_multi_touch_event(loop, &desc);
multi_touch_events.push_back(desc);
}
- for(loop = 0;loop < multi_touch_context_num;loop++) {
+ 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_moving_window(desc.touch_id),
//popupRect.width = utils->get_scale_x(layout->width);
//popupRect.height= utils->get_scale_y(layout->height);
popupRect.width = layout->width;
- popupRect.height= layout->height;
+ popupRect.height = layout->height;
windows->close_all_popups();
SclWindowOpener opener;
sclres_input_mode_configure[popup_input_mode].use_dim_window,
coordinate->extract_offset_x,
coordinate->extract_offset_y,
- sclres_input_mode_configure[popup_input_mode].timeout
- );
+ sclres_input_mode_configure[popup_input_mode].timeout);
SclNotiPopupOpenedDesc opened_desc;
opened_desc.ui_event_desc = &key_event_desc;
magnifier_configure = sclres_manager->get_magnifier_configure();
}
if (showMagnifier && magnifier_configure) {
- SclPoint pos = {0,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);
if (coordinate) {
if (coordinate->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP ||
coordinate->popup_type == POPUP_TYPE_BTN_LONGPRESS_POPUP_ONCE ) {
-
SclUIEventDesc key_event_desc;
key_event_desc.key_type = coordinate->long_key_type;
if (coordinate->long_key_value == NULL && coordinate->long_key_event == 0) {
//popupRect.width = utils->get_scale_x(layout->width);
//popupRect.height= utils->get_scale_y(layout->height);
popupRect.width = layout->width;
- popupRect.height= layout->height;
+ popupRect.height = layout->height;
SclWindowOpener opener;
opener.window = window;
sclres_input_mode_configure[popup_input_mode].use_dim_window,
coordinate->extract_offset_x,
coordinate->extract_offset_y,
- sclres_input_mode_configure[popup_input_mode].timeout
- );
+ sclres_input_mode_configure[popup_input_mode].timeout);
SclNotiPopupOpenedDesc opened_desc;
opened_desc.ui_event_desc = &key_event_desc;
}
if (coordinate->use_long_key_magnifier && magnifier_configure) {
CSCLUtils *utils = CSCLUtils::get_instance();
- SclPoint pos = {0,0};
+ SclPoint pos = {0, 0};
const SclLayout* layout = cache->get_cur_layout(window);
if (layout) {
pos.y += coordinate->magnifier_offset_y;
windows->move_window(windows->get_magnifier_window(), pos.x, pos.y);
windows->update_window(windows->get_magnifier_window());
- windows->show_window(windows->get_magnifier_window(),TRUE);
+ windows->show_window(windows->get_magnifier_window(), TRUE);
}
}
return FALSE;
}
- if (key_index != pressed_key || window != pressed_window ) {
+ if (key_index != pressed_key || window != pressed_window) {
/* When the focus has moved to another button, destroy all the timers */
events->destroy_all_timer();
magnifier_configure = sclres_manager->get_magnifier_configure();
}
if (showMagnifier && magnifier_configure) {
- SclPoint pos = {0,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);
if (pressed_context) {
/* But, if this button should be in pressed state in other multitouch id, do not initialize it */
sclboolean found = FALSE;
- for(sclint loop = 0;loop < context->get_multi_touch_context_num() && !found;loop++) {
+ 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) {
}
sclboolean processed = handler->on_event_drag_state_changed(key_event_desc);
if (processed && context->get_magnifier_enabled() && magnifier_configure) {
- SclPoint zoomwinpos = {0,0};
+ 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);
SclButtonContext *button_context = NULL;
const SclLayoutKeyCoordinate *coordinate = NULL;
- if(cache) {
+ if (cache) {
coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
button_context = cache->get_cur_button_context(window, key_index);
}
- if(button_context && 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()) {
scl8 highlighted_key = context->get_cur_highlighted_key();
SclButtonContext *cur_context = cache->get_cur_button_context(window, key_index);
- if(cur_context == NULL) {
+ if (cur_context == NULL) {
return FALSE;
}
- if (key_index != highlighted_key || window != highlighted_window ) {
+ if (key_index != highlighted_key || window != highlighted_window) {
SECURE_LOGD("%d != %d || %p != %p", key_index, highlighted_key, window, highlighted_window);
- if(layout) {
+ if (layout) {
if (coordinate->key_type != KEY_TYPE_NONE) {
if (context->get_tts_enabled()) {
const sclchar *targetstr = coordinate->hint_string[shift_index][button_context->multikeyIdx];
sclint loop = 0;
sclint multi_touch_context_num = context->get_multi_touch_context_num();
std::vector<SclUIEventDesc> multi_touch_events;
- for(loop = 0;loop < multi_touch_context_num;loop++) {
+ for (loop = 0;loop < multi_touch_context_num;loop++) {
SclUIEventDesc desc;
context->get_multi_touch_event(loop, &desc);
multi_touch_events.push_back(desc);
}
- for(loop = 0;loop < multi_touch_context_num && !finished;loop++) {
+ for (loop = 0;loop < multi_touch_context_num && !finished;loop++) {
SclUIEventDesc desc = multi_touch_events[loop];
if (desc.touch_id != touch_id) {
sclwindow cur_pressed_window = context->get_cur_pressed_window(desc.touch_id);
case BUTTON_TYPE_UIITEM: break;
case MAX_BUTTON_TYPE: break;
default: break;
-
}
switch (coordinate->popup_type) {
case POPUP_TYPE_BTN_RELEASE_POPUP:
scl_check_arrindex(display_mode, DISPLAYMODE_MAX)) {
sclshort popupLayoutId =
sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
- if (popupLayoutId == NOT_USED){
+ if (popupLayoutId == NOT_USED) {
// deal with NOT_USED
LOGD("popupLayoutID is not used.");
}
//popupRect.width = utils->get_scale_x(layout->width);
//popupRect.height= utils->get_scale_y(layout->height);
popupRect.width = layout->width;
- popupRect.height= layout->height;
+ popupRect.height = layout->height;
/* Let's make sure this popup window does not go beyond the screen area */
sclint scr_w, scr_h;
sclres_input_mode_configure[popup_input_mode].use_dim_window,
coordinate->extract_offset_x,
coordinate->extract_offset_y,
- sclres_input_mode_configure[popup_input_mode].timeout
- );
+ sclres_input_mode_configure[popup_input_mode].timeout);
SclNotiPopupOpenedDesc opened_desc;
opened_desc.ui_event_desc = &key_event_desc;
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++) {
+ 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) {
if (windows->is_base_window(window)) {
SclWindowContext *dim_window_context = windows->get_window_context(windows->get_dim_window());
if (dim_window_context) {
- LOGD ("dim window is_virtual:%d, hidden:%d", dim_window_context->is_virtual, dim_window_context->hidden);
+ LOGD("dim window is_virtual:%d, hidden:%d", dim_window_context->is_virtual, dim_window_context->hidden);
if (/*dim_window_context->is_virtual &&*/ !(dim_window_context->hidden)) {
window = windows->get_dim_window();
window_context = dim_window_context;
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);
- for(sclint labelidx = 0;labelidx < MAX_SIZE_OF_LABEL_FOR_ONE;labelidx++) {
+ for (sclint labelidx = 0;labelidx < MAX_SIZE_OF_LABEL_FOR_ONE;labelidx++) {
context->set_custom_magnifier_label(touch_id, labelidx, NULL);
}
const SclLayout *base_layout = cache->get_cur_layout(windows->get_base_window());
if (base_layout && magnifier_configure) {
- SclPoint zoomwinpos = {0,0};
+ 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);
SCL_DEBUG();
sclboolean ret = FALSE;
- if(m_input_events_disabled)
+ if (m_input_events_disabled)
return FALSE;
/* Adjust x,y coordinate by touch offset */
return FALSE;
}
- SclRectangle rect = {0,0,0,0};
+ SclRectangle rect = {0, 0, 0, 0};
sclwindow window = context->get_cur_pressed_window(context->get_last_touch_device_id());
sclbyte key_index = context->get_cur_pressed_key(context->get_last_touch_device_id());
NOT_USED,
SCL_LAYOUT_AUTOPOPUP, POPUP_TYPE_AUTO_POPUP,
FALSE,
- FALSE
- );
+ FALSE);
SclNotiPopupOpenedDesc opened_desc;
opened_desc.ui_event_desc = NULL;
}
/* Handles signals to manage contexts mainly focusing on resetting variables and cleaning up states */
-void CSCLController::handle_engine_signal( SclInternalSignal signal, sclwindow targetWindow )
+void CSCLController::handle_engine_signal(SclInternalSignal signal, sclwindow targetWindow )
{
SCL_DEBUG();
case SIGACTION_UNSET_SHIFT: {
CSCLEventHandler *handler = CSCLEventHandler::get_instance();
if (handler) {
-
SclNotiShiftStateChangeDesc desc;
desc.ui_event_desc = NULL;
desc.shift_state = SCL_SHIFT_STATE_OFF;
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 */
if (!(num_keys > 0)) {
ret = FALSE;
gettimeofday(&s_tv2, NULL);
s_end_line = line;
char printStr[100];
- sprintf(printStr,"%s(Line:%d~%d)", str, s_start_line, s_end_line);
+ sprintf(printStr, "%s(Line:%d~%d)", str, s_start_line, s_end_line);
_SCL_DEBUG_ELAPASED_TIME(printStr, s_tv1, s_tv2);
}
}
pos = events->get_touch_event_offset();
if (m_enabled) {
- if (level == TOUCH_OFFSET_LEVEL_1 ) {
+ if (level == TOUCH_OFFSET_LEVEL_1) {
*x = *x + utils->get_scaled_x(pos->x);
} else if (level == TOUCH_OFFSET_LEVEL_2) {
*x = *x + utils->get_scaled_x(pos->x);
}
void
-CSCLEvents::connect_window_events( sclwindow wnd, const sclint evt )
+CSCLEvents::connect_window_events(sclwindow wnd, const sclint evt )
{
CSCLWindows *windows = CSCLWindows::get_instance();
//SclWindowContext *window_context = windows->get_window_context(wnd, FALSE);
const char *keyname = key;
LOGD("=-=-=-=- key_pressed \n");
CSCLController *controller = CSCLController::get_instance();
- LOGD("=-=-=-=- keyname(char) = %s \n",keyname);
+ LOGD("=-=-=-=- keyname(char) = %s \n", keyname);
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
const SclLayoutKeyCoordinate *prevcoordinate = NULL;
focus_handler->process_navigation(HIGHLIGHT_NAVIGATE_DOWN);
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)) {
+ } else if ((strcmp(keyname, "Return") == 0) || (strcmp(keyname, "Enter") == 0)) {
coordinate = cache->get_cur_layout_key_coordinate(current_focus_window, current_key_index);
//button_context->state = BUTTON_STATE_NORMAL;
if (coordinate && controller) {
//button_context->state = BUTTON_STATE_PRESSED;
if (coordinate && prevcoordinate) {
if (current_focus_window == focus_window) {
- sclshort x,y,width,height;
+ sclshort x, y, width, height;
if (prevcoordinate->x < coordinate->x) {
x = prevcoordinate->x;
} else {
Display *x_display = (Display *)ecore_x_display_get();
int grab_result;
grab_result = utilx_ungrab_key(x_display, x_window, "Return");
- if(0 == grab_result) {
+ if (0 == grab_result) {
LOGD("Return Key UnGrabbed successfully\n");
} else {
LOGD("Failed to UnGrab Return key\n");
void
CSCLKeyFocusHandler::popup_opened(sclwindow window)
{
-
}
void
* Compares the sub-layout values
*/
inline bool
-CSCLKeyFocusHandler::sub_layout_match(sclchar *layout1,sclchar *layout2)
+CSCLKeyFocusHandler::sub_layout_match(sclchar *layout1, sclchar *layout2)
{
if (layout1) {
if (layout2) {
void
CSCLKeyFocusHandler::update_key_navigation_info(sclwindow window, scl8 index, SclLayoutKeyCoordinatePointer p_next_key)
{
-
}
/**
void
CSCLKeyFocusHandler::finalize_key_navigation_info(sclwindow window)
{
-
}
/**
void
CSCLKeyFocusHandler::init_key_index()
{
-
}
/**
}
#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define min(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
-#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif
/* If 2 lines overlap, this will return minus value of overlapping length,
and return positive distance value otherwise */
int temp_distance_x;
int temp_distance_y;
- switch(direction) {
+ switch (direction) {
case HIGHLIGHT_NAVIGATE_LEFT:
temp_distance_y = calculate_distance(btn.y, btn.y + btn.height, cur.y, cur.y + cur.height);
//if (temp_distance_y <= candidate_distance_y) {
if (animator) {
sclboolean start_animation = FALSE;
if (windows->is_base_window(desc.window_to) && windows->is_base_window(desc.window_from)) {
- if(desc.key_to != desc.key_from) {
+ if (desc.key_to != desc.key_from) {
start_animation = TRUE;
}
} else {
SclRectangle prev_rect;
SclRectangle next_rect;
- copy_rectangle( prev_coordinate, &(prev_rect) );
- copy_rectangle( next_coordinate, &(next_rect) );
+ copy_rectangle(prev_coordinate, &(prev_rect));
+ copy_rectangle(next_coordinate, &(next_rect));
if (windows->is_base_window(desc.window_from)) {
prev_rect.x += cache->get_custom_starting_coordinates().x;
/**
* callback for window show event (sniffer window)
*/
-static void sniffer_window_show_cb (void *data, Evas *e, Evas_Object *obj, void *event)
+static void sniffer_window_show_cb(void *data, Evas *e, Evas_Object *obj, void *event)
{
LOGD("INSIDE =-=-=-=- x_event_sniffer_window_show_cb, Trying to Grab Key Board : \n");
#ifndef WAYLAND
elm_win_borderless_set(win, EINA_TRUE);
elm_win_alpha_set(win, EINA_FALSE);
elm_win_title_set(win, "KEY_SNIFFER");
- elm_win_fullscreen_set(win,EINA_FALSE);
+ elm_win_fullscreen_set(win, EINA_FALSE);
set_window_accepts_focus(win, FALSE);
evas_object_show(win);
evas_object_resize(win, 100, 100);
/* FIXME */
//for (loop = 0;loop < MODIFIER_DECORATION_NUM;loop++) {
for (loop = 0;loop < MAX_SCL_MODIFIER_DECORATION_NUM;loop++) {
- for(innerLoop = 0;innerLoop < KEY_MODIFIER_MAX;innerLoop++) {
+ for (innerLoop = 0;innerLoop < KEY_MODIFIER_MAX;innerLoop++) {
sclchar *temp;
temp = sclres_modifier_decoration[loop].bg_image_path[0][innerLoop];
sclres_modifier_decoration[loop].bg_image_path[0][innerLoop] = sclres_modifier_decoration[loop].bg_image_path[1][innerLoop];
SclLayoutKeyCoordinatePointer the_key = mCurBaseLayoutKeyCoordinates + loop;
assert(the_key != NULL);
memcpy(the_key, p, sizeof(SclLayoutKeyCoordinate));
-
}
}
}
if (sclres_label_properties && label_type) {
/* FIXME */
//if (scl_check_arrindex(labeltype, MAX_LABEL_PROPERTIES) && scl_check_arrindex(index, MAX_SIZE_OF_LABEL_FOR_ONE)) {
- for(sclshort labeltype = 0;
+ for (sclshort labeltype = 0;
labeltype < MAX_SCL_LABEL_PROPERTIES && labeltype < sclres_manager->get_labelproperty_size();
labeltype++) {
if (sclres_label_properties[labeltype][0].label_type) {
}
/* Generate and fill autopopup layout data */
-void CSCLResourceCache::generate_autopopup_layout( const SclLayoutKeyCoordinate *coordinate,
+void CSCLResourceCache::generate_autopopup_layout(const SclLayoutKeyCoordinate *coordinate,
SclLayout *pCurLayout, SclLayoutKeyCoordinate (*pCurLayoutKeyCoordinates)[MAX_KEY],
SclButtonContext (*pCurButtonContext)[MAX_KEY] )
{
* Sets the current theme name
*/
sclboolean
-CSCLResourceCache::set_cur_themename( const sclchar *themename )
+CSCLResourceCache::set_cur_themename(const sclchar *themename)
{
if (themename) {
strncpy(mCurThemename, themename, _POSIX_PATH_MAX - 1);
{
int loop;
if (custom_id) {
- for(loop = 0;loop < MAX_PRIVATE_KEY;loop++) {
+ for (loop = 0;loop < MAX_PRIVATE_KEY;loop++) {
if (mPrivateKeyProperties[loop].valid &&
mPrivateKeyProperties[loop].custom_id.compare(custom_id) == 0) {
remove_private_key(loop);
SclRectangle
CSCLUI::get_main_window_rect()
{
- SclRectangle ret = {0,0,0,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,0};
+ SclSize ret = {0, 0};
if (m_impl) {
ret = m_impl->get_input_mode_size(input_mode, display_mode);
}
m_gwes->init(parent,
m_utils->get_scaled_x(sclres_layout[layout].width),
- m_utils->get_scaled_y(sclres_layout[layout].height)
- );
+ m_utils->get_scaled_y(sclres_layout[layout].height));
CSCLContext *context = CSCLContext::get_instance();
context->set_display_mode(display_mode);
cached_info.nine_patch_top = info_cache->bg_image_path[BUTTON_STATE_NORMAL].top;
cached_info.nine_patch_bottom = info_cache->bg_image_path[BUTTON_STATE_NORMAL].bottom;*/
- sclchar composed_path[_POSIX_PATH_MAX] = {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 (window_context && (x + y + width + height == 0)) {
}
if (draw_highlight_ui && context->get_highlight_ui_enabled()) {
- sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+ sclchar composed_path[_POSIX_PATH_MAX] = {0, };
const SclLayoutKeyCoordinate *coordinate = NULL;
scl8 current_key_index = focus_handler->get_current_focus_key();
coordinate = cache->get_cur_layout_key_coordinate(window, current_key_index);
/* for image label */
if (coordinate->image_label_path[shift][state]) {
if (strlen(coordinate->image_label_path[shift][state]) > 0) {
- sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+ sclchar composed_path[_POSIX_PATH_MAX] = {0, };
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, coordinate->image_label_path[shift][state]);
SclSize imgSize = m_gwes->m_graphics->get_image_size(composed_path);
imgSize.height = coordinate->height;
}
- SclPoint pos = {0,0};
+ SclPoint pos = {0, 0};
const SclLabelProperties *labelproperties = cache->get_label_properties(coordinate->image_label_type, 0);
if (labelproperties) {
SCLLabelAlignment align = labelproperties->alignment;
pos.x + targetaddx,
pos.y + targetaddy,
imgSize.width,
- imgSize.height
- );
+ imgSize.height);
}
}
labelproperties->padding_x * utils->get_custom_scale_rate_x(),
labelproperties->padding_y * utils->get_custom_scale_rate_y(),
labelproperties->inner_width * utils->get_custom_scale_rate_x(),
- labelproperties->inner_height * utils->get_custom_scale_rate_y()
- );
+ labelproperties->inner_height * utils->get_custom_scale_rate_y());
}
graphics->draw_text(
targetwin,
labelproperties->padding_x * utils->get_custom_scale_rate_x(),
labelproperties->padding_y * utils->get_custom_scale_rate_y(),
labelproperties->inner_width * utils->get_custom_scale_rate_x(),
- labelproperties->inner_height * utils->get_custom_scale_rate_y()
- );
+ labelproperties->inner_height * utils->get_custom_scale_rate_y());
}
}
}
scl_assert_return_false(state >= BUTTON_STATE_NORMAL && state < SCL_BUTTON_STATE_MAX);
- sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+ sclchar composed_path[_POSIX_PATH_MAX] = {0, };
if (context && graphics && cache && coordinate) {
sclboolean path_composed = FALSE;
(sclint)targetx,
(sclint)targety,
(sclint)coordinate->width,
- (sclint)coordinate->height
- );
+ (sclint)coordinate->height);
//}
}
//SclWindowContext *window_context = windows->get_window_context(window, FALSE);
SclWindowContext *window_context = windows->get_window_context(window);
- sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+ sclchar composed_path[_POSIX_PATH_MAX] = {0, };
if (context && cache && coordinate && window_context) {
sclboolean path_composed = FALSE;
/* Check if we need to decorate the button's drag state */
window_context->layout_image_offset.y + (sclint)coordinate->y,
(sclint)coordinate->width,
(sclint)coordinate->height,
- TRUE
- );
+ TRUE);
//}
}
return TRUE;
}
}
const sclchar* customstr = NULL;
- for(sclint label_index = 0;label_index < MAX_SIZE_OF_LABEL_FOR_ONE && !customstr;label_index++) {
+ for (sclint label_index = 0;label_index < MAX_SIZE_OF_LABEL_FOR_ONE && !customstr;label_index++) {
const sclchar *tempstr = context->get_custom_magnifier_label(context->get_last_touch_device_id(), label_index);
if (tempstr) {
customstr = tempstr;
}
#if 0
- SclPoint pos = {0,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);
magnifier_configure = sclres_manager->get_magnifier_configure();
}
if (coordinate && magnifier_configure) {
- sclchar composed_path[_POSIX_PATH_MAX] = {0,};
+ sclchar composed_path[_POSIX_PATH_MAX] = {0, };
if (state && 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,
}
sclboolean ended = FALSE;
- for(int loop = 0;loop < MAX_SIZE_OF_LABEL_FOR_ONE && !ended;loop++) {
+ for (int loop = 0;loop < MAX_SIZE_OF_LABEL_FOR_ONE && !ended;loop++) {
const SclLabelProperties *labelproperties = cache->get_label_properties(magnifier_configure->label_type, loop);
if (labelproperties) {
if (labelproperties->valid) {
}
return TRUE;
-
}
labelproperties->padding_x * utils->get_custom_scale_rate_x(),
labelproperties->padding_y * utils->get_custom_scale_rate_y(),
labelproperties->inner_width * utils->get_custom_scale_rate_x(),
- labelproperties->inner_height * utils->get_custom_scale_rate_y()
- );
+ labelproperties->inner_height * utils->get_custom_scale_rate_y());
}
}
}
SclRectangle
CSCLUIImpl::get_main_window_rect()
{
- SclRectangle ret = {0,0,0,0};
+ SclRectangle ret = {0, 0, 0, 0};
if (m_initialized) {
CSCLResourceCache *cache = CSCLResourceCache::get_instance();
SclSize
CSCLUIImpl::get_input_mode_size(const sclchar *input_mode, SCLDisplayMode display_mode)
{
- SclSize ret = {0,0};
+ SclSize ret = {0, 0};
if (m_initialized) {
CSCLUtils *utils = CSCLUtils::get_instance();
}
sclfloat
-CSCLUtils::get_distance( sclint x1, sclint y1, sclint x2, sclint y2 )
+CSCLUtils::get_distance(sclint x1, sclint y1, sclint x2, sclint y2)
{
sclint dx = x1 - x2;
sclint dy = y1 - y2;
}
sclfloat
-CSCLUtils::get_distance( SclPoint pt1, SclPoint pt2 )
+CSCLUtils::get_distance(SclPoint pt1, SclPoint pt2)
{
return get_distance(pt1.x, pt1.y, pt2.x, pt2.y);
}
sclfloat
-CSCLUtils::get_approximate_distance( sclint x1, sclint y1, sclint x2, sclint y2 )
+CSCLUtils::get_approximate_distance(sclint x1, sclint y1, sclint x2, sclint y2)
{
sclint dx = abs(x1 - x2);
sclint dy = abs(y1 - y2);
}
sclfloat
-CSCLUtils::get_approximate_distance( SclPoint pt1, SclPoint pt2 )
+CSCLUtils::get_approximate_distance(SclPoint pt1, SclPoint pt2)
{
return get_approximate_distance(pt1.x, pt1.y, pt2.x, pt2.y);
}
finished = TRUE;
}
}
-
SclResParserManager *sclres_manager = SclResParserManager::get_instance();
if (sclres_manager) {
if (sclres_manager->get_nine_patch_info(buf, &ret)) {
bool CSCLWindows::close_popup(sclwindow window)
{
- LOGD("close_popup window (%p)",window);
+ LOGD("close_popup window (%p)", window);
CSCLKeyFocusHandler *focus_handler = CSCLKeyFocusHandler::get_instance();
if (focus_handler) {
}
sclwindow
-CSCLWindows::find_by_etcinfo( void* etc_info )
+CSCLWindows::find_by_etcinfo(void* etc_info)
{
SCL_DEBUG();
SCL_DEBUG();
if (window == m_base_window_context.window) {
- memcpy(&m_base_window_context,context, sizeof(SclWindowContext));
+ memcpy(&m_base_window_context, context, sizeof(SclWindowContext));
} else {
for (sclint loop = 0;loop < MAX_POPUP_WINDOW;loop++) {
if (m_popup_window_context[loop].window == window) {
return SCLWINDOW_INVALID;
}
-sclwindow CSCLWindows::get_nth_popup_window( sclbyte index )
+sclwindow CSCLWindows::get_nth_popup_window(sclbyte index)
{
SCL_DEBUG();
return NOT_USED;
}
-void CSCLWindows::set_parent( const sclwindow parent, const sclwindow window )
+void CSCLWindows::set_parent(const sclwindow parent, const sclwindow window)
{
/* Do not set parent if the window is a virtual window */
//SclWindowContext *window_context = get_window_context(window, FALSE);
static tts_h tts = NULL;
#ifndef WAYLAND
-static Eina_Bool _get_default_zone_geometry_info (Ecore_X_Window root, scluint *x, scluint *y, scluint *w, scluint *h)
+static Eina_Bool _get_default_zone_geometry_info(Ecore_X_Window root, scluint *x, scluint *y, scluint *w, scluint *h)
{
Ecore_X_Atom zone_geometry_atom;
Ecore_X_Window* zone_lists;
if (zone_lists) {
/* We must free zone_lists */
- free (zone_lists);
+ free(zone_lists);
}
return ret;
if (TTS_ERROR_NONE != r) {
LOGD("tts_create FAILED : result(%d)", r);
} else {
- r = tts_set_mode (tts, TTS_MODE_SCREEN_READER);
+ r = tts_set_mode(tts, TTS_MODE_SCREEN_READER);
}
if (TTS_ERROR_NONE != r) {
LOGD("tts_set_mode FAILED : result(%d)", r);
SclRes::~SclRes()
{
-
}
void
#include "sclres_type.h"
#include <string>
-namespace sclres{
+namespace sclres {
class SclRes{
public:
SclRes();
virtual const char* get_resource_directory();
public: /* These are the functions need to be implemented by the descendants of SclRes */
-
/* Initialize SclRes, with the given entry file that exists under the resource directory */
virtual void init(const char *entry_filename) = 0;
const char* get_name();
void destroy();
+
private:
SclResParserManager();
bool m_initialized;
}
int encode_input_mode_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-
int init_size = storage.get_size();
/*size 4bytes*/
const int INPUT_MODE_CONFIGURE_SIZE_WIDTH = 4;
Input_mode_configure_width record_width;
set_input_mode_configure_width(md_helper, record_width);
- for ( int i = 0; i < size; ++i) {
+ for ( int i = 0; i < size; ++i ) {
encode_input_mode_configure_record(storage, cur, record_width);
cur++;
}
const int get_layout_num(const PSclLayoutKeyCoordinatePointerTable keyCoordinatePointerFrame) {
assert(keyCoordinatePointerFrame != NULL);
int layout_num = MAX_SCL_LAYOUT;
- for ( int i = 0; i < MAX_SCL_LAYOUT; ++i) {
+ for ( int i = 0; i < MAX_SCL_LAYOUT; ++i ) {
// NULL is the end flag
if (keyCoordinatePointerFrame[i][0] == NULL) {
layout_num = i;
int
encode_key_coordinate_frame_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-
XMLResource *xmlresource = XMLResource::get_instance();
int layout_num = xmlresource->get_layout_size();
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) {
+ for ( int i = 0; i < layout_num; ++i ) {
+ for ( int j = 0; j < pKey_num_array[i]; ++j ) {
int pre_size = storage.get_size();
SclLayoutKeyCoordinatePointer cur = _key_coordinate_pointer_frame[i][j];
int
encode_label_properties_frame_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-
int init_size = storage.get_size();
/*size 4bytes*/
Label_properties_record_width record_width;
set_label_properties_record_width(md_helper, record_width);
- for ( int i = 0; i < size; ++i) {
- for ( int j = 0; j < maxj; ++j) {
+ for ( int i = 0; i < size; ++i ) {
+ for ( int j = 0; j < maxj; ++j ) {
SclLabelProperties cur = labelPropertiesFrame[i][j];
encode_label_properties_record(storage, &cur, record_width);
}
set_layout_width(md_helper, record_width);
int layout_rec_data_size = 0;
- for ( int i = 0; i < size; ++i) {
+ for ( int i = 0; i < size; ++i ) {
int pre_size = storage.get_size();
encode_layout_record(storage, cur, record_width);
int
encode_magnifier_configure_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-
int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
int
encode_modifier_decoration_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-
int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
int
encode_nine_patch_file(ResourceStorage& storage, IMetaData_Helper& md_helper) {
-
int init_size = storage.get_size();
XMLResource *xmlresource = XMLResource::get_instance();
Nine_patch_width record_width;
set_nine_patch_width(md_helper, record_width);
SclNinePatchInfo* cur = ninePatchInfoTable;
- for (int i = 0; i < MAX_NINE_PATCH_FILE_LIST; ++i ) {
+ for (int i = 0; i < MAX_NINE_PATCH_FILE_LIST; ++i) {
encode_nine_patch_info(storage, cur, record_width);
cur++;
}
class IMetaData_Helper{
public:
virtual void set_current_metadata_record(const char* record_name) = 0;
- virtual const unsigned short get_width(const char* field_name) const= 0;
+ virtual const unsigned short get_width(const char* field_name) const = 0;
virtual ~IMetaData_Helper() {}
};
#endif
#include "metadata.h"
class IMetaData_Parser{
public:
- virtual const MetaData* get_metadata() const= 0;
+ virtual const MetaData* get_metadata() const = 0;
virtual ~IMetaData_Parser() {}
};
#endif
MetaData_Field(const char*name, const char* type, const int width) {
assert(name);
assert(type);
- assert(width >= 0 );
+ assert(width >= 0);
memset(m_name, 0, FIELD_NAME_WIDTH);
memset(m_type, 0, FIELD_TYPE_WIDTH);
#include "imetadata_helper.h"
class MetaData_Handler:private IMetaData_Encoder, IMetaData_Parser, public IMetaData_Helper{
private:
- typedef struct __Metadata_Width{
+ typedef struct __Metadata_Width {
int string_id_width;
}MetaData_Width;
+
public:
MetaData_Handler(const char* file);
void set_current_metadata_record(const char* record_name);
int encode(ResourceStorage& storage)const;
const unsigned short get_width(const char* field_name) const;
+
private:
const unsigned short
get_width(const char* name, const MetaData_Record& metadata_record) const;
int parsing_metadata_type(const xmlNodePtr curNode, MetaData_Width& metadataWidth);
void parsing_metadata();
const MetaData* get_metadata()const;
+
private:
MetaData metadata;
int m_current_metadata_record_id;
static const int __NEW_LENGTH__ = 0x10000;/*64k*/
static const int __RE_NEW_LENGTH__ = 0x10000;/*64k*/
static const int __MAX_NEW_SIZE__ = 0x2000000;/*32M*/
+
public:
ResourceStorage();
~ResourceStorage();
// put the storage array to a big storage
// return size that put
int storage_cat(ResourceStorage& storage);
+
private:
void init();
/*template <typename T>
void put_primitive_data(T data, MetaType type, bool ignore = false);*/
- // This function is used to check whether the
+ // This function is used to check whether the
// storage is enough
// the para "width" is the size of request to use
void check_storage(int width);
- // If the space is not enough, use this function to
+ // If the space is not enough, use this function to
// new a new storage
void expand_storage();
}
inline const int ResourceStorage::
-get_size() const{
+get_size() const {
return m_size;
}
}
inline const int ResourceStorage::
-capability() const{
+capability() const {
return m_capability;
}
inline void ResourceStorage::
check_storage(int width) {
-
if (m_size + width > m_capability) {
expand_storage();
}
}
char* _p = new char[_new_size];
- if(_p == NULL) {
+ if (_p == NULL) {
LOGW("expand_storage error");
return;
}
m_vec_string.push_back(str_temp);
return m_vec_string.size() -1;
}
- int encode() const{
+ int encode() const {
ResourceStorage storage;
encode(storage);
storage.toFile(m_file);
return storage.get_size();
}
- int encode(int& offset) const{
+ int encode(int& offset) const {
ResourceStorage storage;
encode(storage);
storage.toFile(m_file, offset);
return storage.get_size();
}
- int encode(ResourceStorage& storage) const{
+ int encode(ResourceStorage& storage) const {
/* record the strings' num*/
storage.put<sint_t>(m_vec_string.size(), MAX_NUM_WIDTH);
}
int MetaData_Handler::
-encode(const char* file)const{
+encode(const char* file)const {
ResourceStorage storage;
encode_metadata(storage, metadata);
storage.toFile(file);
}
int MetaData_Handler::
-encode(const char* file, int& offset)const{
+encode(const char* file, int& offset)const {
ResourceStorage storage;
encode_metadata(storage, metadata);
storage.toFile(file, offset);
}
int MetaData_Handler::
-encode(ResourceStorage& storage)const{
+encode(ResourceStorage& storage)const {
encode_metadata(storage, metadata);
return storage.get_size();
}
const unsigned short MetaData_Handler::
-get_width(const char* field_name) const{
+get_width(const char* field_name) const {
if (field_name == NULL) return 0;
int idx = m_current_metadata_record_id;
}
const unsigned short MetaData_Handler::
-get_width(const char* name, const MetaData_Record& metadata_record) const{
+get_width(const char* name, const MetaData_Record& metadata_record) const {
assert(name);
for (size_t i = 0; i < metadata_record.vField.size(); ++i) {
- if ( 0 == strcmp(name, metadata_record.vField.at(i).m_name)) {
+ if (0 == strcmp(name, metadata_record.vField.at(i).m_name)) {
return metadata_record.vField.at(i).m_width;
}
}
}
const int MetaData_Handler::
-find_metadata_record_index(const char* name)const{
+find_metadata_record_index(const char* name)const {
assert(name);
- for ( size_t i = 0; i < metadata.m_vec_metadata_record.size(); ++i) {
+ for (size_t i = 0; i < metadata.m_vec_metadata_record.size(); ++i) {
const MetaData_Record& metadata_record = metadata.m_vec_metadata_record.at(i);
if (0 == strcmp(metadata_record.m_name, name)) {
}
return -1;
-
}
int MetaData_Handler::
strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
data.m_type[sizeof(data.m_type) - 1] = '\0';
data.m_width = metadataWidth.string_id_width;
- } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"int8")) {
+ } else if (0 == xmlStrcmp(type, (const xmlChar*)"int8")) {
strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
data.m_type[sizeof(data.m_type) - 1] = '\0';
data.m_width = 1;
- } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"int16")) {
+ } else if (0 == xmlStrcmp(type, (const xmlChar*)"int16")) {
strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
data.m_type[sizeof(data.m_type) - 1] = '\0';
data.m_width = 2;
- } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"int32")) {
+ } else if (0 == xmlStrcmp(type, (const xmlChar*)"int32")) {
strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
data.m_type[sizeof(data.m_type) - 1] = '\0';
data.m_width = 4;
- } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"float32")) {
+ } else if (0 == xmlStrcmp(type, (const xmlChar*)"float32")) {
strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
data.m_type[sizeof(data.m_type) - 1] = '\0';
data.m_width = 4;
- } else if ( 0 == xmlStrcmp(type, (const xmlChar*)"float64")) {
+ } else if (0 == xmlStrcmp(type, (const xmlChar*)"float64")) {
strncpy(data.m_type, (const char*)type, sizeof(data.m_type));
data.m_type[sizeof(data.m_type) - 1] = '\0';
data.m_width = 8;
}
- else{
+ else {
ret = -1;
}
/*FIXME how to assume that the atoi will get the correct num*/
int width = atoi((const char*)xmlwidth);
- if ( 0 == xmlStrcmp(xmlname, (const xmlChar*)"string_id")) {
+ if (0 == xmlStrcmp(xmlname, (const xmlChar*)"string_id")) {
metadataWidth.string_id_width = width;
}
if (0 == xmlStrcmp(curNode->name, (const xmlChar*)"metadata_type")) {
parsing_metadata_type(curNode, metadataWidth);
}
- else if ( 0 == xmlStrcmp(curNode->name, (const xmlChar*)"record")) {
+ else if (0 == xmlStrcmp(curNode->name, (const xmlChar*)"record")) {
MetaData_Record metadataRecord;
int ret = parsing_record(curNode, metadataRecord, metadataWidth);
if (ret != -1) {
curNode = curNode->next;
}
xmlFreeDoc(doc);
-
}
inline const MetaData* MetaData_Handler::
-get_metadata()const{
+get_metadata()const {
return &metadata;
}
String_Encoder actual_string_encoder;
IString_Encoder& string_encoder = actual_string_encoder;
-static inline void show_usage(){
+static inline void show_usage() {
static const char* message = { "xml2binary: missing folder operand\n"
"-------------------------------------------------------\n"
"| Usage: xml2binary operand1 operand2 |\n"
}
char* xml_text_dir = argv[1];
- if ( 0 != access(xml_text_dir, R_OK)) {
+ if (0 != access(xml_text_dir, R_OK)) {
perror(xml_text_dir);
return -1;
}
xml_bin_dir = argv[2];
}
- if ( 0 != access(xml_bin_dir, W_OK)) {
+ if (0 != access(xml_bin_dir, W_OK)) {
perror(xml_bin_dir);
return -1;
}
xmlresource->init("main_entry.xml");
static const char* metadata_path = "/usr/share/libscl-ui/metadata.xml";
- if ( 0 != access(metadata_path, R_OK)) {
+ if (0 != access(metadata_path, R_OK)) {
perror(metadata_path);
return -1;
}
m_autopopup_configure.add_grab_left = NOT_USED;
m_autopopup_configure.add_grab_right = NOT_USED;
m_autopopup_configure.add_grab_top = NOT_USED;
- m_autopopup_configure.add_grab_bottom= NOT_USED;
+ m_autopopup_configure.add_grab_bottom = NOT_USED;
}
~AutoPopupConfigureParserImpl() {
/* Let's create de-initializing function for this resource releasement */
sclint loop;
- for(loop = 0;loop < SCL_BUTTON_STATE_MAX;loop++) {
+ for (loop = 0;loop < SCL_BUTTON_STATE_MAX;loop++) {
if (m_autopopup_configure.button_image_path[loop]) {
xmlFree(m_autopopup_configure.button_image_path[loop]);
m_autopopup_configure.button_image_path[loop] = NULL;
}
}
- for(loop = 0;loop < MAX_WND_DECORATOR;loop++) {
+ for (loop = 0;loop < MAX_WND_DECORATOR;loop++) {
if (m_autopopup_configure.decoration_image_path[loop]) {
xmlFree(m_autopopup_configure.decoration_image_path[loop]);
m_autopopup_configure.decoration_image_path[loop] = NULL;
xmlFree(m_autopopup_configure.label_type);
m_autopopup_configure.label_type = NULL;
}
-
}
int parsing_autopopup_configure(const char* input_file) {
}
xmlFreeDoc(doc);
return 0;
-
}
void parsing_background_color(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"r") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"r")) {
m_autopopup_configure.bg_color.r = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"g") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"g")) {
m_autopopup_configure.bg_color.g = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"b") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"b")) {
m_autopopup_configure.bg_color.b = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"a") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"a")) {
m_autopopup_configure.bg_color.a = get_content_int(child_node);
}
child_node = child_node->next;
}
-
}
void parsing_background_line_color(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"r") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"r")) {
m_autopopup_configure.bg_line_color.r = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"g") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"g")) {
m_autopopup_configure.bg_line_color.g = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"b") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"b")) {
m_autopopup_configure.bg_line_color.b = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"a") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"a")) {
m_autopopup_configure.bg_line_color.a = get_content_int(child_node);
}
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"image") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"image")) {
int button_state = get_button_state_prop(child_node);
if (button_state >= 0 && button_state < SCL_BUTTON_STATE_MAX) {
m_autopopup_configure.button_image_path[button_state] = (sclchar*)xmlNodeGetContent(child_node);
}
child_node = child_node->next;
}
-
}
void parsing_button_size(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"width") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"width")) {
m_autopopup_configure.button_width = get_content_int(child_node);
- } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"height") ) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"height")) {
m_autopopup_configure.button_height = get_content_int(child_node);
}
child_node = child_node->next;
}
-
}
void parsing_window_decorator_image_path(const xmlNodePtr cur_node) {
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"image") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"image")) {
if (equal_prop(cur_node, "direction", "top_left")) {
m_autopopup_configure.decoration_image_path[WND_DECORATOR_TOP_LEFT] = (sclchar *)xmlNodeGetContent(cur_node);;
}
}
child_node = child_node->next;
}
-
}
void parsing_grab_area(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"left") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"left")) {
m_autopopup_configure.add_grab_left = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"right") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"right")) {
m_autopopup_configure.add_grab_right = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"top") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"top")) {
m_autopopup_configure.add_grab_top = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"bottom") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"bottom")) {
m_autopopup_configure.add_grab_bottom = get_content_int(child_node);
}
child_node = child_node->next;
}
-
}
int get_button_state_prop(const xmlNodePtr cur_node) {
button_state = BUTTON_STATE_TOGGLED;
}
return button_state;
-
}
SCLDisplayMode get_content_displaymode(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
}
return display_mode;
-
}
SclAutoPopupConfigure m_autopopup_configure;
};
xmlFree(m_default_configure.image_file_base_path);
m_default_configure.image_file_base_path = NULL;
}
-
}
int parsing_default_configure(const char* input_file) {
xmlFreeDoc(doc);
return 0;
-
}
void parsing_touch_offset(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"portrait") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"portrait")) {
xmlNodePtr grandChildNode = child_node->xmlChildrenNode;
- while (grandChildNode!=NULL) {
- if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"x") ) {
+ while (grandChildNode != NULL) {
+ if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"x")) {
m_default_configure.touch_offset[DISPLAYMODE_PORTRAIT].x = get_content_int(grandChildNode);
- } else if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"y") ) {
+ } else if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"y")) {
m_default_configure.touch_offset[DISPLAYMODE_PORTRAIT].y = get_content_int(grandChildNode);
}
grandChildNode = grandChildNode->next;
}
- } else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"landscape") ) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"landscape")) {
xmlNodePtr grandChildNode = child_node->xmlChildrenNode;
- while (grandChildNode!=NULL) {
- if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"x") ) {
+ while (grandChildNode != NULL) {
+ if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"x")) {
m_default_configure.touch_offset[DISPLAYMODE_LANDSCAPE].x = get_content_int(grandChildNode);
- } else if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"y") ) {
+ } else if (0 == xmlStrcmp(grandChildNode->name, (const xmlChar*)"y")) {
m_default_configure.touch_offset[DISPLAYMODE_LANDSCAPE].y = get_content_int(grandChildNode);
}
grandChildNode = grandChildNode->next;
child_node = child_node->next;
}
-
}
void parsing_dim_color(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"r") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"r")) {
m_default_configure.dim_color.r = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"g") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"g")) {
m_default_configure.dim_color.g = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"b") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"b")) {
m_default_configure.dim_color.b = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"a") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"a")) {
m_default_configure.dim_color.a = get_content_int(child_node);
}
child_node = child_node->next;
}
-
}
SCLDisplayMode get_content_display_mode(const xmlNodePtr cur_node) {
#include "nine_patch_file_list_parser.h"
#include "sclres.h"
-namespace xmlresource{
+namespace xmlresource {
class XMLResource: public sclres::SclRes{
public:
~XMLResource();
}
void destroy();
+
private:
XMLResource();
}
~InputModeConfigureParserImpl() {
- for(int input_mode = 0; input_mode < MAX_SCL_INPUT_MODE; ++input_mode) {
+ for (int input_mode = 0; input_mode < MAX_SCL_INPUT_MODE; ++input_mode) {
SclInputModeConfigure& cur_rec = m_input_mode_configure_table[input_mode];
if (cur_rec.name) {
xmlFree(cur_rec.name);
xmlFreeDoc(doc);
return 0;
-
}
void set_input_mode_configure_default_record(const PSclInputModeConfigure cur_rec) {
- cur_rec->name=NULL;
+ cur_rec->name = NULL;
cur_rec->layouts[DISPLAYMODE_PORTRAIT] = NULL;
cur_rec->layouts[DISPLAYMODE_LANDSCAPE] = NULL;
cur_rec->use_virtual_window = FALSE;
cur_rec->name = (sclchar *)temp;
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"text") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"text")) {
child_node = child_node->next;
continue;
}
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)INPUT_MODE_CONFIGURE_LAYOUT_TAG) ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)INPUT_MODE_CONFIGURE_LAYOUT_TAG)) {
parsing_layouts(child_node, cur_rec);
} else {
SCLLOG(SclLog::WARNING, "input_mode_configure has no such node name: %s\n", (char *)child_node->name);
return -1;
}
- for(int i = 0; i < get_inputmode_size(); ++i) {
- if ( config_table[i].name) {
+ for (int i = 0; i < get_inputmode_size(); ++i) {
+ if (config_table[i].name) {
if ( 0 == strcmp(config_table[i].name, name) ) {
return i;
}
match_alignment(const char* key) {
assert(key != NULL);
- typedef struct _match_table_t{
+ typedef struct _match_table_t {
int value;
const char* key;
}Match_table_t;
int value = LABEL_ALIGN_LEFT_TOP;
- for(size_t i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
+ for (size_t i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
if (0 == strcmp(key, table[i].key))
{
value = table[i].value;
match_shadow_direction(const char* key) {
assert(key != NULL);
- typedef struct _match_table_t{
+ typedef struct _match_table_t {
int value;
const char* key;
}Match_table_t;
int value = SHADOW_DIRECTION_NONE;
- for(size_t i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
+ for (size_t i = 0; i < sizeof(table)/sizeof(Match_table_t); ++i) {
if (0 == strcmp(key, table[i].key))
{
value = table[i].value;
}
~LabelPropertiesParserImpl() {
- for(int i = 0; i < MAX_SCL_LABEL_PROPERTIES && i < m_size; ++i) {
- for(int j = 0; j < MAX_SIZE_OF_LABEL_FOR_ONE; ++j) {
+ for (int i = 0; i < MAX_SCL_LABEL_PROPERTIES && i < m_size; ++i) {
+ for (int j = 0; j < MAX_SIZE_OF_LABEL_FOR_ONE; ++j) {
if (m_label_properties_frame[i][j].font_name)
delete m_label_properties_frame[i][j].font_name;
m_label_properties_frame[i][j].font_name = NULL;
}
}
m_size = 0;
-
}
int parsing_label_properties_frame(const char* input_file) {
PSclLabelPropertiesTable curTable = m_label_properties_frame;
while (cur_node != NULL) {
if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)"label_properties_table")) {
- parsing_label_properties_table( cur_node, curTable);
+ parsing_label_properties_table(cur_node, curTable);
xmlChar* key = xmlGetProp(cur_node, (const xmlChar*)"label_type");
PSclLabelProperties cur_rec = (PSclLabelProperties)curTable;
cur_rec->label_type = (sclchar *)key;
xmlFreeDoc(doc);
return 0;
-
}
void parsing_label_properties_table(const xmlNodePtr cur_node, const PSclLabelPropertiesTable curTable) {
assert(cur_node != NULL);
child_node = child_node->next;
}
-
}
void parsing_label_properties_record(const xmlNodePtr cur_node, const PSclLabelProperties cur_rec) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)"font_color_record")) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"font_color_record")) {
parsing_font_color_record(child_node, cur_rec);
- } else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)"shadow_color_record")) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"shadow_color_record")) {
parsing_shadow_color_record(child_node, cur_rec);
}
cur_rec->valid = true;
cur_rec->font_name = NULL;
cur_rec->font_size = 0;
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; ++shift_state) {
- for(int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; ++shift_state) {
+ for (int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
cur_rec->font_color[shift_state][button_state].r = 0;
cur_rec->font_color[shift_state][button_state].g = 0;
cur_rec->font_color[shift_state][button_state].b = 0;
cur_rec->shadow_direction = SHADOW_DIRECTION_NONE;
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; ++shift_state) {
- for(int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; ++shift_state) {
+ for (int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
cur_rec->shadow_color[shift_state][button_state].r = 0;
cur_rec->shadow_color[shift_state][button_state].g = 0;
cur_rec->shadow_color[shift_state][button_state].b = 0;
}
}
-
}
void parsing_font_color_record(const xmlNodePtr cur_node, const PSclLabelProperties cur_rec) {
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"color") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"color")) {
SclColor font_color = {0x00, 0x00, 0x00, 0xFF};
parsing_rgb(child_node, font_color);
int shift_state = get_shift_state_prop(child_node);
int button_state = get_button_state_prop(child_node);
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
- for(int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
if ((shift_state == shift_loop || shift_state == -1) &&
(button_state == button_loop || button_state == -1)) {
cur_rec->font_color[shift_loop][button_loop] = font_color;
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"color") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"color")) {
int shift_state = get_shift_state_prop(child_node);
int button_state = get_button_state_prop(child_node);
- if (shift_state != -1 && button_state != -1 ) {
+ if (shift_state != -1 && button_state != -1) {
parsing_rgb(child_node, cur_rec->shadow_color[shift_state][button_state]);
}
}
void
LayoutParserImpl::release_layout_strings() {
- for(size_t loop = 0; loop < m_vec_layout_strings.size(); loop++) {
+ for (size_t loop = 0; loop < m_vec_layout_strings.size(); loop++) {
if (m_vec_layout_strings[loop]) {
xmlFree(m_vec_layout_strings[loop]);
}
void
LayoutParserImpl::release_key_strings() {
- for(size_t loop = 0; loop < m_vec_key_strings.size(); loop++) {
+ for (size_t loop = 0; loop < m_vec_key_strings.size(); loop++) {
if (m_vec_key_strings[loop]) {
xmlFree(m_vec_key_strings[loop]);
}
assert(cur_layout != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while ( child_node != NULL) {
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_NORMAL_TAG) ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_BACKGROUND_NORMAL_TAG)) {
xmlChar *key = xmlNodeGetContent(child_node);
cur_layout->image_path[BUTTON_STATE_NORMAL] = (char *)key;
add_layout_string(key);
- } else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_PRESSED_TAG) ) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_BACKGROUND_PRESSED_TAG)) {
xmlChar *key = xmlNodeGetContent(child_node);
cur_layout->image_path[BUTTON_STATE_PRESSED] = (char *)key;
add_layout_string(key);
- } else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_DISABLED_TAG ) ) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_BACKGROUND_DISABLED_TAG )) {
xmlChar *key = xmlNodeGetContent(child_node);
cur_layout->image_path[BUTTON_STATE_DISABLED] = (char *)key;
add_layout_string(key);
- } else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )LAYOUT_BACKGROUND_TOGGLED_TAG ) ) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_BACKGROUND_TOGGLED_TAG )) {
xmlChar *key = xmlNodeGetContent(child_node);
cur_layout->image_path[BUTTON_STATE_TOGGLED] = (char *)key;
add_layout_string(key);
assert(cur_layout != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while ( child_node != NULL) {
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar* )"rec") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int button_state = get_button_state_prop(child_node);
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
- for(int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
if ((shift_state == shift_loop || shift_state == -1) &&
(button_state == button_loop || button_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
row->label_type = cur_rec_layout->label_type;
row->vibe_style = cur_rec_layout->vibe_style;
row->sound_style = cur_rec_layout->sound_style;
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
row->bg_image_path[shift_state][button_state] = cur_rec_layout->key_background_image[shift_state][button_state];
}
}
cur_rec_coordinate->use_magnifier = (sclboolean)true;
cur_rec_coordinate->use_long_key_magnifier = (sclboolean)false;
//cur_rec_coordinate->enabled =(sclboolean) TRUE;
- for(loop = 0;loop < SCL_DRAG_STATE_MAX;loop++) {
+ for (loop = 0;loop < SCL_DRAG_STATE_MAX;loop++) {
cur_rec_coordinate->popup_input_mode[loop] = NULL;
}
cur_rec_coordinate->sound_style = row->sound_style;
cur_rec_coordinate->image_label_type = NULL;
cur_rec_coordinate->label_count = 0;
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int label_for_one = 0; label_for_one < MAX_SIZE_OF_LABEL_FOR_ONE; ++ label_for_one) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int label_for_one = 0; label_for_one < MAX_SIZE_OF_LABEL_FOR_ONE; ++label_for_one) {
cur_rec_coordinate->label[shift_state][label_for_one] = NULL;
}
}
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
cur_rec_coordinate->image_label_path[shift_state][button_state] = NULL;
}
}
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
- //cur_rec_coordinate->bg_image_path[shift_state][button_state] = NULL;
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int button_state = 0; button_state < SCL_BUTTON_STATE_MAX; ++button_state) {
+ //cur_rec_coordinate->bg_image_path[shift_state]![button_state] = NULL;
cur_rec_coordinate->bg_image_path[shift_state][button_state] = row->bg_image_path[shift_state][button_state];
- }
+ }!
}
cur_rec_coordinate->key_value_count = 0;
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int multitap_state = 0; multitap_state < MAX_SIZE_OF_MULTITAP_CHAR; ++multitap_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int multitap_state = 0; multitap_state < MAX_SIZE_OF_MULTITAP_CHAR; ++multitap_state) {
cur_rec_coordinate->key_value[shift_state][multitap_state] = NULL;
}
}
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int multitap_state = 0; multitap_state < MAX_SIZE_OF_MULTITAP_CHAR; ++multitap_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int multitap_state = 0; multitap_state < MAX_SIZE_OF_MULTITAP_CHAR; ++multitap_state) {
cur_rec_coordinate->key_event[shift_state][multitap_state] = 0;
}
}
cur_rec_coordinate->long_key_event = 0;
cur_rec_coordinate->use_repeat_key = false;
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int autopopup_state = 0; autopopup_state < MAX_SIZE_OF_AUTOPOPUP_STRING; ++autopopup_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int autopopup_state = 0; autopopup_state < MAX_SIZE_OF_AUTOPOPUP_STRING; ++autopopup_state) {
cur_rec_coordinate->autopopup_key_labels[shift_state][autopopup_state] = NULL;
cur_rec_coordinate->autopopup_key_events[shift_state][autopopup_state] = 0;
cur_rec_coordinate->autopopup_key_values[shift_state][autopopup_state] = NULL;
cur_rec_coordinate->extra_option = NOT_USED;
cur_rec_coordinate->multitouch_type = SCL_MULTI_TOUCH_TYPE_EXCLUSIVE;
cur_rec_coordinate->modifier_decorator = NULL;
- for(int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
- for( int multitap_state = 0; multitap_state < MAX_SIZE_OF_MULTITAP_CHAR; ++multitap_state) {
+ for (int shift_state = 0; shift_state < SCL_SHIFT_STATE_MAX; shift_state++) {
+ for (int multitap_state = 0; multitap_state < MAX_SIZE_OF_MULTITAP_CHAR; ++multitap_state) {
cur_rec_coordinate->hint_string[shift_state][multitap_state] = NULL;
}
}
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_LEFT_TAG) ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_LEFT_TAG)) {
cur_rec_layout->add_grab_left = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_RIGHT_TAG) ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_RIGHT_TAG)) {
cur_rec_layout->add_grab_right = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_TOP_TAG) ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_TOP_TAG)) {
cur_rec_layout->add_grab_top = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_BOTTOM_TAG) ) {
- cur_rec_layout->add_grab_bottom= get_content_int(child_node);
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ADD_GRAB_BOTTOM_TAG)) {
+ cur_rec_layout->add_grab_bottom = get_content_int(child_node);
}
child_node = child_node->next;
}
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
-
/* row node: layout coordinate resources is no need to parsing at this time */
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_BACKGROUND_TAG)) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_BACKGROUND_TAG)) {
parsing_background(child_node, cur_rec_layout);
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_KEY_BACKGROUND_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_KEY_BACKGROUND_TAG)) {
parsing_key_background(child_node, cur_rec_layout);
}
else if (0 == xmlStrcmp(cur_node->name, (const xmlChar *)LAYOUT_ADD_GRAB_TAG)) {
if (*cur_key == NULL) {
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_TAG)) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_TAG)) {
parsing_layout_row_node(child_node, cur_rec_layout, &row_y, &cur_key);
}
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_TAG)) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_TAG)) {
parsing_key_coordinate_record_node(child_node, &row, *cur_key);
(*cur_key)++;
}
int
LayoutParserImpl::get_drag_state_prop(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
- typedef struct _Match_Struct{
+ typedef struct _Match_Struct {
int value;
const char* key;
}Match_Struct;
int drag_state = SCL_DRAG_STATE_NONE;
- for(size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
+ for (size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
if (0 == strcmp((const char*)key, table[i].key))
{
drag_state = table[i].value;
int
LayoutParserImpl::get_multitouch_type_prop(const xmlNodePtr cur_node) {
assert(cur_node != NULL);
- typedef struct _Match_Struct{
+ typedef struct _Match_Struct {
int value;
const char* key;
}Match_Struct;
int type = SCL_MULTI_TOUCH_TYPE_EXCLUSIVE;
- for(size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
+ for (size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
if (0 == strcmp((const char*)key, table[i].key))
{
type = table[i].value;
LayoutParserImpl::get_extra_option_prop(
const xmlNodePtr cur_node) {
assert(cur_node != NULL);
- typedef struct _Match_Struct{
+ typedef struct _Match_Struct {
int value;
const char* key;
}Match_Struct;
int type = DIRECTION_EXTRA_OPTION_4_DIRECTIONS;
- for(size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
+ for (size_t i = 0; i < sizeof(table)/sizeof(Match_Struct); ++i) {
if (0 == strcmp((const char*)key, table[i].key))
{
type = table[i].value;
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int label_for_one_state = 0;
get_prop_bool(child_node, "auto_upper", &auto_upper);
if (label_for_one_state >= 0 && label_for_one_state < MAX_SIZE_OF_LABEL_FOR_ONE) {
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
cur_rec->label[shift_loop][label_for_one_state] = (sclchar*)key;
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int label_for_one_state = 0;
get_prop_number(child_node, "multi", &label_for_one_state);
if (label_for_one_state >= 0 && label_for_one_state < MAX_SIZE_OF_LABEL_FOR_ONE) {
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
cur_rec->magnifier_label[shift_loop][label_for_one_state] = (sclchar*)key;
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int multichar_state = 0;
get_prop_number(child_node, "multichar_state", &multichar_state);
if (multichar_state >= 0 && multichar_state < MAX_SIZE_OF_MULTITAP_CHAR) {
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
cur_rec->hint_string[shift_loop][multichar_state] = (sclchar*)key;
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int button_state = get_button_state_prop(child_node);
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
- for(int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
if ((shift_state == shift_loop || shift_state == -1) &&
(button_state == button_loop || button_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int button_state = get_button_state_prop(child_node);
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
- for(int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int button_loop = 0;button_loop < SCL_BUTTON_STATE_MAX;button_loop++) {
if ((shift_state == shift_loop || shift_state == -1) &&
(button_state == button_loop || button_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int multichar_state = 0;
get_prop_number(child_node, "multichar_state", &multichar_state);
get_prop_bool(child_node, "auto_upper", &auto_upper);
if (multichar_state >= 0 && multichar_state < MAX_SIZE_OF_MULTITAP_CHAR) {
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
cur_rec->key_value[shift_loop][multichar_state] = (sclchar*)key;
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"rec")) {
int shift_state = get_shift_state_prop(child_node);
int multichar_state = 0;
get_prop_number(child_node, "multichar_state", &multichar_state);
if (multichar_state >= 0 && multichar_state < MAX_SIZE_OF_MULTITAP_CHAR) {
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
cur_rec->key_event[shift_loop][multichar_state] = (sclulong)get_content_dex_string_int(child_node);
}
get_prop_bool(child_node, "auto_upper", &auto_upper);
if (autopopup_state >= 0 && autopopup_state < MAX_SIZE_OF_AUTOPOPUP_STRING) {
- for(int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
+ for (int shift_loop = 0;shift_loop < SCL_SHIFT_STATE_MAX;shift_loop++) {
if ((shift_state == shift_loop || shift_state == -1)) {
xmlChar* key = xmlNodeGetContent(child_node);
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"label") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"label")) {
if (auto_upper) {
if (xmlStrlen(key) == 1 && shift_loop != SCL_SHIFT_STATE_OFF) {
/* Let's manipulate the string for auto_upper */
if (cur_rec->autopopup_key_values[shift_loop][autopopup_state] == NULL) {
cur_rec->autopopup_key_values[shift_loop][autopopup_state] = (sclchar*)key;
}
- } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"value") ) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"value")) {
cur_rec->autopopup_key_values[shift_loop][autopopup_state] = (sclchar*)key;
- } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"event") ) {
+ } else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"event")) {
cur_rec->autopopup_key_events[shift_loop][autopopup_state] = atoi((sclchar*)key);
}
add_key_string(key);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_LABEL_TAG)) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_LABEL_TAG)) {
parsing_label_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_IMAGE_LABEL_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_IMAGE_LABEL_TAG)) {
parsing_label_image_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_BACKGROUND_IMAGE_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_BACKGROUND_IMAGE_TAG)) {
parsing_background_image_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_KEY_VALUE_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_KEY_VALUE_TAG)) {
parsing_key_value_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_KEY_EVENT_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_KEY_EVENT_TAG)) {
parsing_key_event_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_AUTOPOPUP_KEYS_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_AUTOPOPUP_KEYS_TAG)) {
parsing_auto_popup_keys_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_POPUP_INPUTMODE_RECORD_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_POPUP_INPUTMODE_RECORD_TAG)) {
parsing_popup_input_mode_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_MAGNIFIER_LABEL_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_MAGNIFIER_LABEL_TAG)) {
parsing_magnifier_label_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_HINT_STRING_TAG)) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_HINT_STRING_TAG)) {
parsing_hint_string_record_node(child_node, (*cur_rec_coordinate));
(*cur_rec_coordinate)->valid = TRUE;
}
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_POPUP_INPUTMODE_RECORD_INPUTMODE_TAG) ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)LAYOUT_ROW_KEY_POPUP_INPUTMODE_RECORD_INPUTMODE_TAG)) {
int drag_state = get_drag_state_prop(child_node);
assert(drag_state >=0);
assert(drag_state < SCL_DRAG_STATE_MAX);
xmlFree(m_magnifier_configure.label_type);
m_magnifier_configure.label_type = NULL;
}
-
}
int parsing_magnifier_configure(const char* input_file) {
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"left") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"left")) {
m_magnifier_configure.label_area_rect.left = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"top") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"top")) {
m_magnifier_configure.label_area_rect.top = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"right") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"right")) {
m_magnifier_configure.label_area_rect.right = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"bottom") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"bottom")) {
m_magnifier_configure.label_area_rect.bottom = get_content_int(child_node);
}
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"image") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"image")) {
if (equal_prop(child_node, "state", "normal")) {
xmlChar* temp = xmlNodeGetContent(child_node);
m_magnifier_configure.bg_image_path = (sclchar *)temp;
assert(cur_node != NULL);
xmlNodePtr child_node = cur_node->xmlChildrenNode;
- while (child_node!=NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"x") ) {
+ while (child_node != NULL) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"x")) {
m_magnifier_configure.padding_x = get_content_int(child_node);
}
- else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"y") ) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar *)"y")) {
m_magnifier_configure.padding_y = get_content_int(child_node);
}
child_node = child_node->next;
}
-
}
SclMagnifierWndConfigure m_magnifier_configure;
};
xmlFreeDoc(doc);
return 0;
-
}
void make_xml_files(const xmlNodePtr p_node) {
assert(p_node != NULL);
}
node = node->next;
}
-
}
void parsing_files_node(const xmlNodePtr p_node) {
}
node = node->next;
}
-
}
XMLFiles m_xml_files;
};
static int get_key_modifier_state_prop(const char*);
//UTILS
-typedef struct _Modifier_decoration_state_match_table{
+typedef struct _Modifier_decoration_state_match_table {
int modifier_decoration_state;
const char* key;
}Modifier_decoration_state_match_table_t;
-typedef struct _Key_modifier_state_match_table{
+typedef struct _Key_modifier_state_match_table {
int key_modifier_state;
const char* key;
}Key_modifier_state_match_table_t;
int key_modifier_state = KEY_MODIFIER_NONE;
- for(size_t i = 0; i < sizeof(table)/sizeof(Key_modifier_state_match_table_t); ++i) {
+ for (size_t i = 0; i < sizeof(table)/sizeof(Key_modifier_state_match_table_t); ++i) {
if (0 == strcmp(key, table[i].key) )
{
key_modifier_state = table[i].key_modifier_state;
}
~ModifierDecorationParserImpl() {
- for(int i = 0; i < MAX_SCL_MODIFIER_DECORATION_NUM; ++i) {
+ for (int i = 0; i < MAX_SCL_MODIFIER_DECORATION_NUM; ++i) {
SclModifierDecoration& cur_rec = m_modifier_decoration_table[i];
- for (int display_state = 0; display_state < DISPLAYMODE_MAX; ++display_state ) {
- for( int key_modifier_state = 0; key_modifier_state < KEY_MODIFIER_MAX; ++key_modifier_state) {
+ for (int display_state = 0; display_state < DISPLAYMODE_MAX; ++display_state) {
+ for (int key_modifier_state = 0; key_modifier_state < KEY_MODIFIER_MAX; ++key_modifier_state) {
if (cur_rec.bg_image_path[display_state][key_modifier_state])
delete cur_rec.bg_image_path[display_state][key_modifier_state];
cur_rec.bg_image_path[display_state][key_modifier_state] = NULL;
}
}
-
}
}
}
if (0 != xmlStrcmp(cur_node->name, (const xmlChar*)"modifier_decoration_table"))
{
- SCLLOG(SclLog::DEBUG, "ModifierDecorationParser: root name error: %s\n!", (char *)cur_node->name);
+ SCLLOG(SclLog::DEBUG!, "ModifierDecorationParser: root name error: %s\n!", (char *)cur_node->name);
xmlFreeDoc(doc);
return -1;
- }
+ }!
cur_node = cur_node->xmlChildrenNode;
xmlFreeDoc(doc);
return 0;
-
}
void parsing_modifier_decoration_record(const xmlNodePtr cur_node, const PSclModifierDecoration cur_rec) {
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)"name")) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"name")) {
xmlChar* temp = xmlNodeGetContent(child_node);
cur_rec->name = (sclchar *)temp;
cur_rec->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)"display_part_background")) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"display_part_background")) {
cur_rec->extract_background = get_content_bool(child_node);
cur_rec->valid = TRUE;
}
- else if ( 0 == xmlStrcmp(child_node->name, (const xmlChar*)"background_image_path")) {
+ else if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"background_image_path")) {
parsing_background_image_record_node(child_node, cur_rec);
cur_rec->valid = TRUE;
}
child_node = child_node->next;
}
-
}
void set_modifier_decoration_default_record(const PSclModifierDecoration cur_rec) {
cur_rec->valid = FALSE;
cur_rec->extract_background = false;
cur_rec->name = NULL;
- for (int display_state = 0; display_state < DISPLAYMODE_MAX; ++display_state ) {
- for( int key_modifier_state = 0; key_modifier_state < KEY_MODIFIER_MAX; ++key_modifier_state) {
+ for (int display_state = 0; display_state < DISPLAYMODE_MAX; ++display_state) {
+ for (int key_modifier_state = 0; key_modifier_state < KEY_MODIFIER_MAX; ++key_modifier_state) {
cur_rec->bg_image_path[display_state][key_modifier_state] = NULL;
}
}
xmlNodePtr child_node = cur_node->xmlChildrenNode;
while (child_node != NULL) {
- if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"image") ) {
+ if (0 == xmlStrcmp(child_node->name, (const xmlChar*)"image")) {
/* FIXME */
int display_state = DISPLAYMODE_PORTRAIT;
xmlChar* display_state_xml = xmlGetProp(child_node, (const xmlChar*)"display_state");
xmlFree(key_modifier_state_xml);
}
- if (display_state != -1 && key_modifier_state != -1 ) {
+ if (display_state != -1 && key_modifier_state != -1) {
sclchar* key = (sclchar*)xmlNodeGetContent(child_node);
cur_rec->bg_image_path[display_state][key_modifier_state] = key;
//Warning:: Donot xmlFree key
}
int
-ModifierDecorationParser::get_modifier_decoration_id( const char *name )
+ModifierDecorationParser::get_modifier_decoration_id(const char *name)
{
if (name == NULL) {
SCLLOG(SclLog::DEBUG, "get_modifier_decoration_id() has failed");
SCLLOG(SclLog::DEBUG, "get_modifier_decoration_id() has failed");
return -1;
}
- for(int i = 0; i < MAX_SCL_MODIFIER_DECORATION_NUM; ++i) {
- if ( modifier_decoration_table[i].name) {
- if ( 0 == strcmp(modifier_decoration_table[i].name, name) ) {
+ for (int i = 0; i < MAX_SCL_MODIFIER_DECORATION_NUM; ++i) {
+ if (modifier_decoration_table[i].name) {
+ if (0 == strcmp(modifier_decoration_table[i].name, name)) {
return i;
}
}
memset(m_nine_patch_file_list, 0x00, sizeof(SclNinePatchInfo) * MAX_NINE_PATCH_FILE_LIST);
}
~NinePatchFileListParserImpl() {
- for(int i = 0; i < m_size; ++i) {
+ for (int i = 0; i < m_size; ++i) {
if (m_nine_patch_file_list[i].image_path)
delete m_nine_patch_file_list[i].image_path;
m_nine_patch_file_list[i].image_path = NULL;
xmlFreeDoc(doc);
return 0;
-
}
SclNinePatchInfo m_nine_patch_file_list[MAX_NINE_PATCH_FILE_LIST];
int m_size;
-
};
NinePatchFileParser::NinePatchFileParser() {
return false;
}
- for(int i = 0; i < MAX_NINE_PATCH_FILE_LIST && i < m_impl->m_size; ++i) {
+ for (int i = 0; i < MAX_NINE_PATCH_FILE_LIST && i < m_impl->m_size; ++i) {
if ( nine_patch_list[i].image_path != NULL &&
0 == strcmp(nine_patch_list[i].image_path, filename) ) {
if (info) {
SCLLOG(SclLog::DEBUG, "get_nine_patch_info() has failed.");
return false;
-
}
SclNinePatchInfo*
if (0 == strcmp("NOT_USED", (const char*)key)) {
num = -1;
} else {
- num = atoi( (const char*)key );
+ num = atoi((const char*)key);
}
xmlFree(key);
}
assert(str != NULL);
int val = -1;
- sscanf(str, "%x",&val);
+ sscanf(str, "%x", &val);
return val;
}
m_main_entry_parser = MainEntryParser::get_instance();
char input_file[_POSIX_PATH_MAX] = {0};
snprintf(input_file, _POSIX_PATH_MAX, "%s/%s", get_resource_directory(), entry_filepath);
- if ( 0 != m_main_entry_parser->init(input_file)) {
+ if (0 != m_main_entry_parser->init(input_file)) {
/* main entry is necessary */
SCLLOG(SclLog::ERROR, "main entry init");
}