{
public :
void on_draw_text(const SclFontInfo& font_info, const SclColor& color, const char *str, int pos_x, int pos_y, int w, int h,
- SCLLabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, void* user_data);
+ SCLLabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, SCLWindowType type, void* user_data);
- void on_draw_image(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, void* user_data);
+ void on_draw_image(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, SCLWindowType type, void* user_data);
void on_draw_rectangle(int pos_x, int pos_y, int width, int height, bool fill, int fill_color_r, int fill_color_g, int fill_color_b, int fill_color_a, void* user_data);
};
MAX_LABEL_ALIGNMENT
} LabelAlignment;
+typedef enum _WindowType {
+ WINDOW_KEYPAD,
+ WINDOW_MAGNIFIER,
+ WINDOW_DIM,
+ WINDOW_POPUP,
+}WindowType;
+
/* graphics backend */
typedef void (*scl_nui_draw_text_cb)(const char *font_name, short font_size, bool is_italic, bool is_bold, int r, int g, int b, int a,
const char *str, int pos_x, int pos_y, int w, int h,
- LabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, void* user_data);
+ LabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, WindowType type, void* user_data);
-typedef void (*scl_nui_draw_image_cb)(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, void* user_data);
+typedef void (*scl_nui_draw_image_cb)(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, WindowType type, void* user_data);
typedef void (*scl_nui_draw_rectangle_cb)(int pos_x, int pos_y, int width, int height, bool fill, int fill_color_r, int fill_color_g, int fill_color_b, int fill_color_a, void* user_data);
/* window backend */
typedef void (*scl_nui_update_window_cb)(int x, int y, int width, int height, void* user_data);
typedef int (*scl_nui_key_click_event_cb)(SclUIEventDesc event_desc);
typedef int (*scl_nui_drag_state_changed_cb)(SclUIEventDesc event_desc);
+typedef void (*scl_nui_update_window_position_cb)(SCLWindowType type, int pos_x, int pos_y, int rot_x, int rot_y, void* user_data);
int scl_nui_init(const char *entry_filepath);
int scl_nui_fini();
int scl_nui_set_key_click_event_cb(scl_nui_key_click_event_cb callback);
int scl_nui_set_drag_state_changed_cb(scl_nui_drag_state_changed_cb callback);
+int scl_nui_set_update_window_position_cb(scl_nui_update_window_position_cb callback, void *user_data);
+
+int scl_nui_enable_magnifier(bool enabled);
#ifdef __cplusplus
}
{
public :
void update_window(int x, int y, int width, int height, void* user_data);
+ void update_window_postion(SCLWindowType type, int pos_x, int pos_y, int rot_x, int rot_y);
};
#endif /* __SCL_WINDOW_BACKEND_H__ */
#endif
#define LOG_TAG "CSCLUINUI"
-#define USE_ELM_WIN 1
+#define USE_ELM_WIN 0
#ifdef USE_ELM_WIN
static Evas_Object *g_win = NULL;
static scl_nui_key_click_event_cb g_key_click_event_cb = NULL;
static scl_nui_drag_state_changed_cb g_drag_state_changed_cb = NULL;
+static scl_nui_update_window_position_cb g_update_window_position_cb = NULL;
+static void *g_update_window_position_cb_data = NULL;
+
void CUIGraphicsBackendCallback::on_draw_text(const SclFontInfo& font_info, const SclColor& color, const char *str, int pos_x, int pos_y, int w, int h,
- SCLLabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, void* user_data)
+ SCLLabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, SCLWindowType type, void* user_data)
//const char *str, int x, int y, int w, int h, int fontsize, void* user_data)
{
LOGD("draw text : %p", g_draw_text_cb);
g_draw_text_cb(font_info.font_name, font_info.font_size, font_info.is_bold, font_info.is_italic,
color.r, color.g, color.b, color.a,
str, pos_x, pos_y, w, h,
- (LabelAlignment)align, padding_x, padding_y, inner_width, inner_height, user_data);
+ (LabelAlignment)align, padding_x, padding_y, inner_width, inner_height, (WindowType)type, user_data);
}
}
-void CUIGraphicsBackendCallback::on_draw_image(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, void* user_data)
+void CUIGraphicsBackendCallback::on_draw_image(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, SCLWindowType type, void* user_data)
{
LOGD("draw image : %p", g_draw_image_cb);
if (g_draw_image_cb) {
- g_draw_image_cb(image_path, dest_x, dest_y, dest_weight, dest_height, src_x, src_y, src_width, src_height, user_data);
+ g_draw_image_cb(image_path, dest_x, dest_y, dest_weight, dest_height, src_x, src_y, src_width, src_height, (WindowType)type, user_data);
}
}
return (SCLEventReturnType)ret;
}
+void CUIWindowBackendCallback::update_window_postion(SCLWindowType type, int pos_x, int pos_y, int rot_x, int rot_y)
+{
+ LOGD("update_window_position : %p", g_update_window_position_cb);
+ if (g_update_window_position_cb) {
+ g_update_window_position_cb(type, pos_x, pos_y, rot_x, rot_y, g_update_window_cb_data);
+ }
+}
+
static CUIGraphicsBackendCallback callback;
static CUIWindowBackendCallback window_callback;
{
g_drag_state_changed_cb = callback;
+ return 0;
+}
+
+EXPORT_API int scl_nui_set_update_window_position_cb(scl_nui_update_window_position_cb callback, void *user_data)
+{
+ g_update_window_position_cb = callback;
+ g_update_window_position_cb_data = user_data;
+
+ return 0;
+}
+
+EXPORT_API int scl_nui_enable_magnifier(bool enabled)
+{
+ if (!g_ui)
+ return 1;
+
+ LOGD("enabled : %d", enabled);
+
+ g_ui->enable_magnifier(enabled);
+
return 0;
}
\ No newline at end of file
virtual void on_draw_rectangle(int pos_x, int pos_y, int width, int height, bool fill, int fill_color_r, int fill_color_g, int fill_color_b, int fill_color_a, void* user_data) { }
virtual void update_window(int x, int w, int width, int height, void* user_data) { }
+
+ virtual void update_window_postion(SCLWindowType type, int pos_x, int pos_y, int rot_x, int rot_y) { }
};
#endif //__SCL_BACKENDCALLBACK_H__
DEBUGMODE_AUTOTEST,
}SCLDebugMode;
+typedef enum _SCLWindowType {
+ WINDOW_KEYPAD,
+ WINDOW_MAGNIFIER,
+ WINDOW_DIM,
+ WINDOW_POPUP,
+}SCLWindowType;
+
}
#endif //__SCL_CONFIG_H__
pos.y += magnifier_configure->padding_y * utils->get_custom_scale_rate_y();
pos.x += coordinate->magnifier_offset_x;
pos.y += coordinate->magnifier_offset_y;
- windows->move_window(windows->get_magnifier_window(), pos.x, pos.y);
+ windows->move_window(windows->get_magnifier_window(), pos.x, pos.y, WINDOW_MAGNIFIER);
//windows->resize_window(windows->get_magnifier_window(), utils->get_scale_x(scl_magnifier_configure.width), utils->get_scale_y(scl_magnifier_configure.height));
/*If we use transient_for them the ISE will occur some crash. It needs to check X11 */
/*windows->set_parent(windows->get_base_window(), windows->get_magnifier_window());*/
}
#else
if (windows) {
- windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height);
+ if (context && context->get_magnifier_enabled())
+ windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height, WINDOW_MAGNIFIER);
+ else
+ windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height, WINDOW_KEYPAD);
}
#endif
}
pos.y += magnifier_configure->padding_y * utils->get_custom_scale_rate_y();
pos.x += coordinate->magnifier_offset_x;
pos.y += coordinate->magnifier_offset_y;
- windows->move_window(windows->get_magnifier_window(), pos.x, pos.y);
+ windows->move_window(windows->get_magnifier_window(), pos.x, pos.y, WINDOW_MAGNIFIER);
windows->update_window(windows->get_magnifier_window());
windows->show_window(windows->get_magnifier_window(), TRUE);
}
pos.y += magnifier_configure->padding_y * utils->get_custom_scale_rate_y();
pos.y += coordinate->magnifier_offset_y;
if (windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP) == windows->get_base_window()) {
- windows->move_window(windows->get_magnifier_window(), pos.x, pos.y);
+ windows->move_window(windows->get_magnifier_window(), pos.x, pos.y, WINDOW_MAGNIFIER);
windows->update_window(windows->get_magnifier_window());
}
}
zoomwinpos.y += magnifier_configure->padding_y * utils->get_custom_scale_rate_y();
zoomwinpos.x += coordinate->magnifier_offset_x;
zoomwinpos.y += coordinate->magnifier_offset_y;
- windows->move_window(windows->get_magnifier_window(), zoomwinpos.x, zoomwinpos.y);
+ windows->move_window(windows->get_magnifier_window(), zoomwinpos.x, zoomwinpos.y, WINDOW_MAGNIFIER);
windows->show_window(windows->get_magnifier_window(), 0);
}
zoomwinpos.x += coordinate->magnifier_offset_x;
zoomwinpos.y += coordinate->magnifier_offset_y;
- windows->move_window(windows->get_magnifier_window(), zoomwinpos.x, zoomwinpos.y);
+ windows->move_window(windows->get_magnifier_window(), zoomwinpos.x, zoomwinpos.y, WINDOW_MAGNIFIER);
windows->show_window(windows->get_magnifier_window(), 0);
}
}
scldrawing
CSCLGraphicsImplNui::draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path, SclImageCachedInfo *cachedinfo,
sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
- sclint src_x, sclint src_y, sclint src_width, sclint src_height, sclboolean extrace_image)
+ sclint src_x, sclint src_y, sclint src_width, sclint src_height, sclboolean extrace_image, SCLWindowType type)
{
SCL_DEBUG();
-
scl_assert_return_null(image_path);
LOGI("image path(%s), x(%d), y(%d), w(%d), h(%d)", image_path, dest_x, dest_y, dest_width, dest_height);
if (m_backend_callback) {
LOGI("call draw image callback");
SCL_DEBUG_ELAPSED_TIME_START();
- m_backend_callback->on_draw_image(image_path, dest_x, dest_y, dest_width, dest_height, src_x, src_y, src_width, src_height, m_backend_callback_data);
+ m_backend_callback->on_draw_image(image_path, dest_x, dest_y, dest_width, dest_height, src_x, src_y, src_width, src_height, type, m_backend_callback_data);
SCL_DEBUG_ELAPSED_TIME_END();
}
else {
CSCLGraphicsImplNui::draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
const sclchar *str, SclTextCachedInfo *cachedinfo, sclint pos_x, sclint pos_y, sclint width, sclint height,
SCLLabelAlignment align, sclint padding_x, sclint padding_y,
- sclint inner_width, sclint inner_height)
+ sclint inner_width, sclint inner_height, SCLWindowType type)
{
SCL_DEBUG();
/*
if (m_backend_callback) {
LOGI("call draw text callback");
SCL_DEBUG_ELAPSED_TIME_START();
- m_backend_callback->on_draw_text(font_info, color, str, pos_x, pos_y, width, height, align, padding_x, padding_y, inner_width, inner_height, m_backend_callback_data); //draw_text_cb_data);
+ m_backend_callback->on_draw_text(font_info, color, str, pos_x, pos_y, width, height, align, padding_x, padding_y, inner_width, inner_height, type, m_backend_callback_data); //draw_text_cb_data);
SCL_DEBUG_ELAPSED_TIME_END();
}
else {
{
SCL_DEBUG();
- LOGI("x(%f), y(%f), w(%f), h(%f)", pos_x, pos_y, width, height);
- LOGI("fill(%d), r(%d), g(%d), b(%d), a(%d)", fill, fill_color.r, fill_color.g, fill_color.b, fill_color.a);
+ LOGE("x(%f), y(%f), w(%f), h(%f)", pos_x, pos_y, width, height);
+ LOGE("fill(%d), r(%d), g(%d), b(%d), a(%d)", fill, fill_color.r, fill_color.g, fill_color.b, fill_color.a);
if (m_backend_callback) {
LOGI("call draw rectangle callback");
scldrawing draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path, SclImageCachedInfo *cachedinfo,
sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
- sclint src_x, sclint src_y, sclint src_width, sclint src_height, sclboolean extrace_image);
+ sclint src_x, sclint src_y, sclint src_width, sclint src_height, sclboolean extrace_image, SCLWindowType type);
sclimage load_image(const sclchar* image_path);
void unload_image(sclimage image_data);
void destroy_font(sclfont font);
scldrawing draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
const sclchar *str, SclTextCachedInfo *cachedinfo, sclint pos_x, sclint pos_y, sclint width, sclint height,
- SCLLabelAlignment align, sclint padding_x, sclint padding_y, sclint inner_width, sclint inner_height);
+ SCLLabelAlignment align, sclint padding_x, sclint padding_y, sclint inner_width, sclint inner_height, SCLWindowType type);
scldrawing draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y,
scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color,
SclImageCachedInfo *cachedinfo,
sclint dest_x, sclint dest_y, sclint dest_width, sclint dest_height,
sclint src_x, sclint src_y, sclint src_width, sclint src_height,
- sclboolean extrace_image) = 0;
+ sclboolean extrace_image, SCLWindowType type) = 0;
virtual scldrawing draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
const sclchar *str, SclTextCachedInfo *cachedinfo, sclint pos_x, sclint pos_y,
sclint width, sclint height, SCLLabelAlignment align,
- sclint padding_x, sclint padding_y, sclint inner_width, sclint inner_height) = 0;
+ sclint padding_x, sclint padding_y, sclint inner_width, sclint inner_height, SCLWindowType type) = 0;
virtual scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE) = 0;
virtual void end_paint(const sclwindow window, scldrawctx draw_ctx) = 0;
virtual sclimage load_image(const sclchar *image_path) = 0;
void fini();
scldrawing draw_image(sclwindow window, const scldrawctx draw_ctx, sclchar* image_path, SclImageCachedInfo *cachedinfo, sclint dest_x, sclint dest_y,
- sclint dest_width = -1, sclint dest_height = -1, sclint src_x = 0, sclint src_y = 0, sclint src_width = -1, sclint src_height = -1, sclboolean extrace_image = FALSE) {
- return get_scl_graphics_impl()->draw_image(window, draw_ctx, image_path, cachedinfo, dest_x, dest_y, dest_width, dest_height, src_x, src_y, src_width, src_height, extrace_image);
+ sclint dest_width = -1, sclint dest_height = -1, sclint src_x = 0, sclint src_y = 0, sclint src_width = -1, sclint src_height = -1, sclboolean extrace_image = FALSE, SCLWindowType type = WINDOW_KEYPAD) {
+ return get_scl_graphics_impl()->draw_image(window, draw_ctx, image_path, cachedinfo, dest_x, dest_y, dest_width, dest_height, src_x, src_y, src_width, src_height, extrace_image, type);
}
scldrawing draw_text(sclwindow window, const scldrawctx draw_ctx, const SclFontInfo& font_info, const SclColor& color,
const sclchar *str, SclTextCachedInfo *cachedinfo, sclint pos_x, sclint pos_y, sclint width = 0, sclint height = 0,
SCLLabelAlignment align = LABEL_ALIGN_LEFT_TOP,
- sclint padding_x = 0, sclint padding_y = 0, sclint inner_width = 0, sclint inner_height = 0) {
+ sclint padding_x = 0, sclint padding_y = 0, sclint inner_width = 0, sclint inner_height = 0, SCLWindowType type = WINDOW_KEYPAD) {
return get_scl_graphics_impl()->draw_text(window, draw_ctx, font_info, color, str, cachedinfo,
- pos_x, pos_y, width, height, align, padding_x, padding_y, inner_width, inner_height);
+ pos_x, pos_y, width, height, align, padding_x, padding_y, inner_width, inner_height, type);
}
scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE) {
struct ISCLUIGraphicsBackendCallback {
//virtual void on_draw_text(const char *str, int x, int y, int w, int h, int fontsize, void* user_data) { }
virtual void on_draw_text(const SclFontInfo& font_info, const SclColor& color, const char *str, int pos_x, int pos_y, int w, int h,
- SCLLabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, void* user_data) { }
+ SCLLabelAlignment align, int padding_x, int padding_y, int inner_width, int inner_height, SCLWindowType type, void* user_data) { }
/*
const SclFontInfo& font_info, const SclColor& color,
sclint inner_width, sclint inner_height)
*/
- virtual void on_draw_image(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, void* user_data) { }
+ virtual void on_draw_image(const char *image_path, int dest_x, int dest_y, int dest_weight, int dest_height, int src_x, int src_y, int src_width, int src_height, SCLWindowType type, void* user_data) { }
virtual void on_draw_rectangle(int pos_x, int pos_y, int width, int height, bool fill, int fill_color_r, int fill_color_g, int fill_color_b, int fill_color_a, void* user_data) { }
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <dlog.h>
#include "scluibuilder.h"
#include "scldebug.h"
#include <assert.h>
#include "sclres_manager.h"
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "LIBSCL_UI"
+
using namespace scl;
//extern sclboolean g_key_spacing_off;
* This function will be called by expose event and invalidate rect
*/
sclboolean
-CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y, const scl16 width, const scl16 height)
+CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y, const scl16 width, const scl16 height, const SCLWindowType type)
{
SCL_DEBUG();
if (sclres_manager) {
default_configure = sclres_manager->get_default_configure();
}
+
if (events && windows && graphics && cache && context && focus_handler && default_configure) {
/* FIXME : The draw_ctx should be acquired from the base window also, if the target window is virtual
However, for ease of development, leave the drawctx to be acquired from the target window for now
SCLDisplayMode display_mode = context->get_display_mode();
events->set_touch_event_offset(default_configure->touch_offset[display_mode]);
- if (window == windows->get_magnifier_window()) {
+ if (type == WINDOW_MAGNIFIER) {
/* For the magnifier window */
ret = show_magnifier(window, draw_ctx);
} else if (window == windows->get_dim_window()) {
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_long_key_image_path);
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
magnifier_configure->width * utils->get_custom_scale_rate_x(),
- magnifier_configure->height * utils->get_custom_scale_rate_y());
+ magnifier_configure->height * utils->get_custom_scale_rate_y(),
+ 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
} else {
if (shift_index == SCL_SHIFT_STATE_LOCK) {
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_shift_lock_image_path);
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
magnifier_configure->width * utils->get_custom_scale_rate_x(),
- magnifier_configure->height * utils->get_custom_scale_rate_y());
+ magnifier_configure->height * utils->get_custom_scale_rate_y(),
+ 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
} else if (shift_index == SCL_SHIFT_STATE_ON) {
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_shift_image_path);
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
magnifier_configure->width * utils->get_custom_scale_rate_x(),
- magnifier_configure->height * utils->get_custom_scale_rate_y());
+ magnifier_configure->height * utils->get_custom_scale_rate_y(),
+ 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
} else {
m_utils->get_composed_path(composed_path, IMG_PATH_PREFIX, magnifier_configure->bg_image_path);
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
magnifier_configure->width * utils->get_custom_scale_rate_x(),
- magnifier_configure->height * utils->get_custom_scale_rate_y());
+ magnifier_configure->height * utils->get_custom_scale_rate_y(),
+ 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
}
}
switch (loop) {
case WND_DECORATOR_TOP_LEFT:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL,
- 0, 0, decoration_size, decoration_size);
+ 0, 0, decoration_size, decoration_size, 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_TOP_CENTER:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, decoration_size, 0,
- magnifier_configure->width * utils->get_custom_scale_rate_x()- (2 * decoration_size), decoration_size);
+ magnifier_configure->width * utils->get_custom_scale_rate_x()- (2 * decoration_size), decoration_size, 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_TOP_RIGHT:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL,
- magnifier_configure->width * utils->get_custom_scale_rate_x() - decoration_size, 0, decoration_size, decoration_size);
+ magnifier_configure->width * utils->get_custom_scale_rate_x() - decoration_size, 0, decoration_size, decoration_size, 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_MIDDLE_LEFT:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0,
- decoration_size, decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - (2 * decoration_size));
+ decoration_size, decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - (2 * decoration_size), 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_MIDDLE_CENTER:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0, 0,
- magnifier_configure->width * utils->get_custom_scale_rate_x(), magnifier_configure->height * utils->get_custom_scale_rate_y());
+ magnifier_configure->width * utils->get_custom_scale_rate_x(), magnifier_configure->height * utils->get_custom_scale_rate_y(), 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_MIDDLE_RIGHT:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL,
magnifier_configure->width * utils->get_custom_scale_rate_x() - decoration_size, decoration_size,
- decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - (2 * decoration_size));
+ decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - (2 * decoration_size), 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_BOTTOM_LEFT:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, 0,
- magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size, decoration_size, decoration_size);
+ magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size, decoration_size, decoration_size, 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_BOTTOM_CENTER:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL,
decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size,
- magnifier_configure->width * utils->get_custom_scale_rate_x() - (2 * decoration_size), decoration_size);
+ magnifier_configure->width * utils->get_custom_scale_rate_x() - (2 * decoration_size), decoration_size, 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
case WND_DECORATOR_BOTTOM_RIGHT:
m_gwes->m_graphics->draw_image(window, draw_ctx, composed_path, NULL, magnifier_configure->width * utils->get_custom_scale_rate_x()
- - decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size, decoration_size, decoration_size);
+ - decoration_size, magnifier_configure->height * utils->get_custom_scale_rate_y() - decoration_size, decoration_size, decoration_size, 0, 0, -1, -1, FALSE, WINDOW_MAGNIFIER);
break;
}
}
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(),
+ WINDOW_MAGNIFIER);
}
}
}
static CSCLUIBuilder* get_instance();
void init(sclwindow parent);
- sclboolean show_layout(const sclwindow window, const scl16 x = 0, const scl16 y = 0, const scl16 width = 0, const scl16 height = 0);
+ sclboolean show_layout(const sclwindow window, const scl16 x = 0, const scl16 y = 0, const scl16 width = 0, const scl16 height = 0, const SCLWindowType type = WINDOW_KEYPAD);
sclboolean draw_button(const sclwindow window, scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean force_draw_bg = FALSE);
sclboolean show_magnifier(const sclwindow window, scldrawctx draw_ctx);
sclboolean show_autopopup(const sclwindow parent, scldrawctx draw_ctx, const scl16 key_index);
struct ISCLUIWindowBackendCallback {
virtual void update_window(int x, int w, int width, int height, void* user_data) { }
-
+ virtual void update_window_postion(SCLWindowType type, int pos_x, int pos_y, int rot_x, int rot_y) { }
};
#endif //__SCL_WINDOW_BACKENDCALLBACK_H__
*/
sclint magnifierx, magnifiery;
void
-CSCLWindowsImplNui::move_window(const sclwindow window, scl16 x, scl16 y)
+CSCLWindowsImplNui::move_window(const sclwindow window, scl16 x, scl16 y, SCLWindowType type)
{
SCL_DEBUG();
CSCLUtils *utils = CSCLUtils::get_instance();
CSCLContext *context = CSCLContext::get_instance();
CSCLWindows *windows = CSCLWindows::get_instance();
- if (utils && context && windows && window) {
+ if (utils && context && windows) {
SclWindowContext *window_context = windows->get_window_context(window);
unsigned short win_width = 0;
unsigned short win_height = 0;
//Evas *evas = evas_object_evas_get(window_object);
//evas_render_idle_flush(evas);
+ if (m_window_backend_callback) {
+ LOGI("call update_window_position. type(%d), x(%d), y(%d), rotatex(%d), rotatey(%d)", type, x, y, rotatex, rotatey);
+ m_window_backend_callback->update_window_postion(type, x, y, rotatex, rotatey);
+ }
+ else {
+ LOGW("### No update window position callback ###");
+ }
+
utils->log("WinNui_movewin %p %d %d %d %d (basewin %p mag %p)\n",
window,
x, y, rotatex, rotatey,
* Update the window to redraw given area
*/
void
-CSCLWindowsImplNui::update_window(const sclwindow window, scl16 x, scl16 y, scl16 width, scl16 height)
+CSCLWindowsImplNui::update_window(const sclwindow window, scl16 x, scl16 y, scl16 width, scl16 height, SCLWindowType type)
{
SCL_DEBUG();
}
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
- builder->show_layout(window, x, y, width, height);
+ builder->show_layout(window, x, y, width, height, type);
}
/**
bool destroy_window(sclwindow window);
void show_window(const sclwindow window, sclboolean queue);
void hide_window(const sclwindow window, sclboolean fForce = FALSE);
- void move_window(const sclwindow window, scl16 x, scl16 y);
+ void move_window(const sclwindow window, scl16 x, scl16 y, SCLWindowType type = WINDOW_KEYPAD);
void resize_window(const sclwindow window, scl16 width, scl16 height);
void move_resize_window(const sclwindow window, scl16 x, scl16 y, scl16 width, scl16 height);
- void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0);
+ void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0, SCLWindowType type = WINDOW_KEYPAD);
void set_window_rotation(const sclwindow window, SCLRotation rotation);
void show_message_box(const sclwindow parent, scl8 msgType, sclchar* title, sclchar* msg);
sclboolean get_window_rect(const sclwindow window, SclRectangle *rect);
}
void
-CSCLWindows::move_window(const sclwindow window, scl16 x, scl16 y)
+CSCLWindows::move_window(const sclwindow window, scl16 x, scl16 y, SCLWindowType type)
{
SCL_DEBUG();
if (!is_virtual) {
CSCLWindowsImpl* impl = get_scl_windows_impl();
if (impl) {
- impl->move_window(window, x, y);
+ impl->move_window(window, x, y, type);
}
}
}
void
CSCLWindows::update_window(const sclwindow window,
- scl16 x /*= 0*/, scl16 y /*= 0*/, scl16 width /*= 0*/, scl16 height /*= 0*/ )
+ scl16 x /*= 0*/, scl16 y /*= 0*/, scl16 width /*= 0*/, scl16 height /*= 0*/, SCLWindowType type)
{
if (!m_pending_update) {
CSCLWindowsImpl* impl = get_scl_windows_impl();
CSCLKeyFocusHandler* focus_handler = CSCLKeyFocusHandler::get_instance();
if (impl) {
- impl->update_window(window, x, y, width, height);
+ impl->update_window(window, x, y, width, height, type);
/* If we are not updating the whole screen */
if (animator && cache && context && focus_handler && (x != 0 || y != 0 || width != 0 || height != 0)) {
virtual void show_window(const sclwindow window, sclboolean queue) = 0;
virtual void set_window_rotation(const sclwindow window, SCLRotation rotation) = 0;
virtual void hide_window(const sclwindow window, sclboolean force = FALSE) = 0;
- virtual void move_window(const sclwindow window, scl16 x, scl16 y) = 0;
+ virtual void move_window(const sclwindow window, scl16 x, scl16 y, SCLWindowType type = WINDOW_KEYPAD) = 0;
virtual void move_resize_window(const sclwindow window, scl16 x, scl16 y, scl16 width, scl16 height) = 0;
virtual void resize_window(const sclwindow window, scl16 width, scl16 height) = 0;
- virtual void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0) = 0;
+ virtual void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0, SCLWindowType type = WINDOW_KEYPAD) = 0;
virtual sclboolean get_window_rect(const sclwindow window, SclRectangle *rect) = 0;
virtual void set_keep_above(const sclwindow window, sclboolean keep_above) = 0;
void set_window_rotation(const sclwindow window, SCLRotation rotation);
- void move_window(const sclwindow window, scl16 x, scl16 y);
+ void move_window(const sclwindow window, scl16 x, scl16 y, SCLWindowType type = WINDOW_KEYPAD);
void resize_window(const sclwindow window, scl16 width, scl16 height);
void move_resize_window(const sclwindow window, scl16 x, scl16 y, scl16 width, scl16 height);
- void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0);
+ void update_window(const sclwindow window, scl16 x = 0, scl16 y = 0, scl16 width = 0, scl16 height = 0, SCLWindowType type = WINDOW_KEYPAD);
sclboolean get_window_rect(const sclwindow window, SclRectangle *rect);
sclwindow get_base_window();
sclboolean is_base_window(sclwindow window);