#define __METADATA_PROVIDER_H_
#include "imetadata_provider.h"
#include "metadata_bin_parser.h"
+#include <dlog.h>
+
class Metadata_Provider:public IMetadata_Provider{
public:
Metadata_Provider(const Metadata_Bin_Parser* metadataParser):m_metadataParser(metadataParser) {
current_record_name = record_name;
curRecordIndex = (int)find_metadata_record_index(record_name);
if (curRecordIndex == -1) {
- printf("Can not find %s metadata record.\n", record_name);
+ LOGW("Can not find %s metadata record.", record_name);
}
}
}
char str_log[128];
va_list ap;
va_start(ap, fmt);
- vsprintf(str_log, fmt, ap);
+ vsnprintf(str_log, sizeof(str_log), fmt, ap);
va_end(ap);
/*
char str_log[128];
va_list ap;
va_start(ap, fmt);
- vsprintf(str_log, fmt, ap);
+ vsnprintf(str_log, sizeof(str_log), fmt, ap);
va_end(ap);
log->log(level, str_log);
}
#include "sclres_manager.h"
#include "scleventhandler.h"
#include "sclanimator.h"
+#include <dlog.h>
//#define DIRECTLY_DRAW_ON_EVENTS
return FALSE;
}
if (key_index != highlighted_key || window != highlighted_window ) {
- printf("%d != %d || %p != %p\n", key_index, highlighted_key, window, highlighted_window);
+ SECURE_LOGD("%d != %d || %p != %p", key_index, highlighted_key, window, highlighted_window);
if(layout) {
if (coordinate->key_type != KEY_TYPE_NONE) {
if (context->get_tts_enabled()) {
sclres_manager->get_layout_id(sclres_input_mode_configure[popup_input_mode].layouts[display_mode]);
if (popupLayoutId == NOT_USED){
// deal with NOT_USED
- printf("popupLayoutID is not used.\n");
+ LOGD("popupLayoutID is not used.");
}
SclLayout *layout = NULL;
/* FIXME */
deltax = originx - startx;
deltay = originy - starty;
sclfloat dist_farthest = utils->get_approximate_distance(originx, originy, startx, starty);
- printf("%d %d %d %d %f, %d %d\n", originx, originy, startx, starty, dist_farthest, cur_drag_state, next_drag_state);
+ //printf("%d %d %d %d %f, %d %d\n", originx, originy, startx, starty, dist_farthest, cur_drag_state, next_drag_state);
/* Let's see how much we are away from the last farthest point */
sclfloat diffdir_recog_dist = SCL_DIRECTION_RELATIVE_DIFFDIR_RECOG_DIST * utils->get_smallest_scale_rate();
/* If we moved certain amount from the point where direction changed, process drag state change routine */
if (drag_state_changed) {
/* When the dragging direction changes, save the current position as farthest point for future comparison */
context->set_farthest_move_point(touch_id, originx, originy);
- printf("SET_FARTHEST : %d %d %d\n", originx, originy, context->get_cur_drag_state(touch_id));
+ LOGD("SET_FARTHEST : %d %d %d", originx, originy, context->get_cur_drag_state(touch_id));
}
}
#include "scluibuilder.h"
#include "sclres_manager.h"
#include <assert.h>
+#include <dlog.h>
//Includes for CSCLKeyFocusHandler
#include "sclkeyfocushandler.h"
if (mPrivateKeyProperties[loop].valid == FALSE) break;
}
if (loop == MAX_PRIVATE_KEY) {
- printf("Out of buffer!! could not insert new private data into buffer \n");
+ LOGW("Out of buffer!! could not insert new private data into buffer");
return ret;
}
}
#endif
if (ret == NOT_USED) {
- printf("Failed!. Out of private data buffer\n");
+ LOGW("Failed!. Out of private data buffer");
}
return ret;
}
#include "sclactionstate.h"
#include "sclres_manager.h"
#include "sclkeyfocushandler.h"
+#include <dlog.h>
using namespace scl;
events->create_timer(SCL_TIMER_POPUP_TIMEOUT, timeout, layout);
}
- printf("create window (%p) x: %d, y:%d, width:%d, height:%d , layout:%d, popuptype:%d\n",
+ LOGD("create window (%p) x: %d, y:%d, width:%d, height:%d , layout:%d, popuptype:%d",
window, geometry.x, geometry.y, geometry.width, geometry.height, layout, popup_type);
events->connect_window_events(window, SCL_EVENT_MOUSE | SCL_EVENT_EXPOSE);
bool CSCLWindows::close_popup(sclwindow window)
{
- printf("close_popup window (%p) \n",window);
+ LOGD("close_popup window (%p)",window);
CSCLKeyFocusHandler *focus_handler = CSCLKeyFocusHandler::get_instance();
if (focus_handler) {
//get_window_context(window, TRUE);
if (window == NULL) {
- printf("Failed to create a new window. The size of window buffer has exeeded.\n");
+ LOGW("Failed to create a new window. The size of window buffer has exeeded.");
}
}
return window;
set_parent(parent, window);
if (window == NULL) {
- printf("Failed to create a new window. The size of window buffer has exeeded.\n");
+ LOGW("Failed to create a new window. The size of window buffer has exeeded.");
} else {
- printf("Magnifier Window %p created\n", window);
+ LOGD("Magnifier Window %p created", window);
}
}
}
if (window == NULL) {
- printf("Failed to create a new window. The size of window buffer has exeeded.\n");
+ LOGW("Failed to create a new window. The size of window buffer has exeeded");
}
}
*/
} else {
impl->set_window_rotation(window, rotation);
- printf("## set_window_rotation : %d \n", rotation);
+ LOGD("## set_window_rotation : %d", rotation);
}
}
#include "resource_storage_impl.h"
#include "put_record.h"
#include "_auto_metadata.h"
+#include <dlog.h>
+
using namespace xmlresource;
static void
encode_modifier_decoration_record(ResourceStorage& storage, const PSclModifierDecoration cur, const Modifier_decoration_width& record_width) {
XMLResource *xmlresource = XMLResource::get_instance();
PSclModifierDecoration modifierDecorationTable = xmlresource->get_modifier_decoration_table();
if (modifierDecorationTable == NULL) {
- printf("Error. modifier decoration table is NULL\n");
+ LOGW("Error. modifier decoration table is NULL");
return 0;
}
#include "resource_storage_impl.h"
#include "put_record.h"
#include "_auto_metadata.h"
+#include <dlog.h>
+
using namespace std;
using namespace xmlresource;
static void
XMLResource *xmlresource = XMLResource::get_instance();
if (xmlresource == NULL) {
- printf("Error: failed to get xmlresource instance.\n");
+ LOGW("Error: failed to get xmlresource instance.");
return 0;
}
SclNinePatchInfo* ninePatchInfoTable = xmlresource->get_nine_patch_list();
if (ninePatchInfoTable == NULL) {
- printf("Warning: nine patch list is null\n");
+ LOGW("Warning: nine patch list is null");
return 0;
}
#ifdef __SCL_TXT_DEBUG
#ifndef __RESOURCE_STORAGE_IMPL_H__
#define __RESOURCE_STORAGE_IMPL_H__
#include "resource_storage.h"
+#include <dlog.h>
inline ResourceStorage::
ResourceStorage() {
expand_storage() {
unsigned int _new_size = (unsigned int)(m_capability + __RE_NEW_LENGTH__);
if (_new_size > (unsigned int)__MAX_NEW_SIZE__) {
- printf("expand_storage failed: size is limited to %d\n", __MAX_NEW_SIZE__);
+ LOGW("expand_storage failed: size is limited to %d", __MAX_NEW_SIZE__);
return;
}
char* _p = new char[_new_size];
if(_p == NULL) {
- printf("expand_storage error");
+ LOGW("expand_storage error");
return;
}
memset(_p, 0x00, _new_size);
doc = xmlReadFile(file_name, NULL, 0);
if (doc == NULL) {
- printf("Could not load file.\n");
- exit(1);
+ LOGE("Could not load file.\n");
+ return;
}
curNode = xmlDocGetRootElement(doc);
if (curNode == NULL) {
- printf("empty document.\n");
+ LOGE("empty document.\n");
xmlFreeDoc(doc);
- exit(1);
+ return;
}
if (0 != xmlStrcmp(curNode->name, (const xmlChar*)"metadata"))
{
- printf("root name %s error!\n", curNode->name);
+ LOGE("root name %s error!\n", curNode->name);
xmlFreeDoc(doc);
- exit(1);
+ return;
}
xmlChar* version = xmlGetProp(curNode, (const xmlChar*)"version");
metadata.m_version[sizeof(metadata.m_version)-1] = '\0';
xmlFree(version);
} else {
- strcpy(metadata.m_version, (const char*)"");
+ metadata.m_version[0] = '\0';
}
MetaData_Width metadataWidth;
#include "layout_parser_helper.h"
#include "put_record.h"
#include "simple_debug.h"
+#include <dlog.h>
using namespace std;
doc = xmlReadFile(input_file.c_str(), NULL, 0);
if (doc == NULL) {
SCLLOG(SclLog::ERROR, "Could not load file: %s.", input_file.c_str());
- exit(1);
+ LOGE("Could not load file: %s.", input_file.c_str());
+ return;
}
cur_node = xmlDocGetRootElement(doc);
if (cur_node == NULL) {
SCLLOG(SclLog::ERROR, "LayoutParserImpl: empty document.\n");
+ LOGE("LayoutParserImpl: empty document.");
xmlFreeDoc(doc);
- exit(1);
+ return;
}
if (0 != xmlStrcmp(cur_node->name, (const xmlChar*)LAYOUT_TAG))
{
SCLLOG(SclLog::ERROR, "LayoutParserImpl: root name error: %s\n!", (char *)cur_node->name);
+ LOGE("LayoutParserImpl: root name error: %s!", (char *)cur_node->name);
xmlFreeDoc(doc);
- exit(1);
+ return;
}
PSclLayout cur_rec_layout = m_layout_table + layout_id;
/////////////////////////////////////////////////
const string INTTypeHelper::dextoString(const int val) {
char temp[8] = {0};
- sprintf(temp, "0x%x", val);
+ snprintf(temp, sizeof(temp), "0x%x", val);
return string(temp);
}
const string INTTypeHelper::toString(const int val) {
char temp[8] = {0};
- sprintf(temp, "%d", val);
+ snprintf(temp, sizeof(temp), "%d", val);
return string(temp);
}
const int INTTypeHelper::Int(const string str) {