Supports magnifier window 13/262113/1
authorInHong Han <inhong1.han@samsung.com>
Fri, 25 Jun 2021 02:10:20 +0000 (11:10 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 3 Aug 2021 02:54:36 +0000 (11:54 +0900)
Change-Id: I4db920e0f5cd80c7d4dc543da1d5bde5ae3cfb57

18 files changed:
capi/include/cscl-ui-graphics-backend.h
capi/include/cscl-ui-nui.h
capi/include/cscl-ui-window-backend.h
capi/src/cscl-ui-nui.cpp
scl/sclbackendcallback.h
scl/sclconfig.h
scl/sclcontroller.cpp
scl/sclgraphics-nui.cpp
scl/sclgraphics-nui.h
scl/sclgraphics.h
scl/sclgraphicsbackendcallback.h
scl/scluibuilder.cpp
scl/scluibuilder.h
scl/sclwindowbackendcallback.h
scl/sclwindows-nui.cpp
scl/sclwindows-nui.h
scl/sclwindows.cpp
scl/sclwindows.h

index 5da86886325d5bd27f7f2976f841394b44d7a2e5..1270717ddef6a318babc9329b99833f583819948 100644 (file)
@@ -23,9 +23,9 @@ class CUIGraphicsBackendCallback : public ISCLUIGraphicsBackendCallback
 {
 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);
 };
index 6bdbdd14622478baab0f7b3308d712d35a1d0880..dc792b128708e6ec99ca0e4e575bd3344d21a92b 100644 (file)
@@ -39,18 +39,26 @@ typedef enum _LabelAlignment {
     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();
@@ -70,6 +78,9 @@ int scl_nui_set_update_window_cb(scl_nui_update_window_cb callback, void *user_d
 
 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
 }
index 337e4e96e370e193aff5f86934f7c3cadc742b23..e534ec5d40c39b824701485918bc6d0cc9528c80 100644 (file)
@@ -23,6 +23,7 @@ class CUIWindowBackendCallback : public ISCLUIWindowBackendCallback
 {
 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__ */
index e13631badfb6c1ded93e6abc04b89fb694f9b73f..1b9601eacab740b24ca28bf49f9def0dc0b52b5e 100644 (file)
@@ -30,7 +30,7 @@ using namespace scl;
 #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;
@@ -53,8 +53,11 @@ static void *g_update_window_cb_data = 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);
@@ -81,15 +84,15 @@ void CUIGraphicsBackendCallback::on_draw_text(const SclFontInfo& font_info, cons
         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);
     }
 }
 
@@ -138,6 +141,14 @@ SCLEventReturnType CUIEventCallback::on_event_drag_state_changed(SclUIEventDesc
     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;
@@ -301,5 +312,25 @@ EXPORT_API int scl_nui_set_drag_state_changed_cb(scl_nui_drag_state_changed_cb c
 {
     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
index f8c4226e6f6b11029e5d03eecfd8eac92d8fed91..90228df1d2a6bd4b01097a5937f0886e9cfe1bf7 100644 (file)
@@ -34,6 +34,8 @@ struct ISCLUIGraphicsBackendCallback {
     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__
index 2b48208dfe1c747e4c4552ba63cf1066cabaeb68..4f77ea751a0e93959773a766cc761ce63f1f68b2 100644 (file)
@@ -473,6 +473,13 @@ typedef enum _SCLDebugMode {
     DEBUGMODE_AUTOTEST,
 }SCLDebugMode;
 
+typedef enum _SCLWindowType {
+    WINDOW_KEYPAD,
+    WINDOW_MAGNIFIER,
+    WINDOW_DIM,
+    WINDOW_POPUP,
+}SCLWindowType;
+
 }
 
 #endif //__SCL_CONFIG_H__
index 6e08ae31bb5ac47367cab8152bf2e87c3077c4b1..eb4b20ef0a497b94b31863dd3916831f8628c155 100644 (file)
@@ -738,7 +738,7 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
                     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());*/
@@ -784,7 +784,10 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint
             }
 #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
         }
@@ -995,7 +998,7 @@ CSCLController::process_button_long_pressed_event(sclwindow window, sclbyte key_
                                 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);
                             }
@@ -1230,7 +1233,7 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
                             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());
                             }
                         }
@@ -1329,7 +1332,7 @@ CSCLController::process_button_move_event(sclwindow window, sclint x, sclint y,
                                 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);
                             }
 
@@ -3217,7 +3220,7 @@ CSCLController::mouse_move(sclwindow window, sclint x, sclint y, scltouchdevice
 
                     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);
                 }
             }
index acb7ac4bed85a98d06b37c42a7b06c00e922a864..cfb506273befebd4bca50e238570e9a39654b6ef 100644 (file)
@@ -212,10 +212,9 @@ extern sclint magnifierx, magnifiery;
 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);
@@ -223,7 +222,7 @@ CSCLGraphicsImplNui::draw_image(sclwindow window, const scldrawctx draw_ctx, scl
     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 {
@@ -579,7 +578,7 @@ scldrawing
 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();
     /*
@@ -593,7 +592,7 @@ CSCLGraphicsImplNui::draw_text(sclwindow window, const scldrawctx draw_ctx, cons
     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 {
@@ -919,8 +918,8 @@ CSCLGraphicsImplNui::draw_rectangle(sclwindow window, const scldrawctx draw_ctx,
 {
     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");
index faabf40fe7231851f1bf95ae7ea8367dcf0b40d9..bf3ee81d4b60f2b0d4c080b516dd25507e6385f9 100644 (file)
@@ -89,7 +89,7 @@ public :
 
     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);
 
@@ -97,7 +97,7 @@ public :
     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,
index 105dbe2b7ddd1ac584587c26704e832ea31c702a..a010a5d34cc6689fda7ff6dee527e2e4763bb8b3 100644 (file)
@@ -66,11 +66,11 @@ private:
                             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;
@@ -102,16 +102,16 @@ public :
     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) {
index 93a68f200c71af7469406adc962b88a0d11cc545..1bed3ebdc4b0d2f6de0932c83e03877bb2366572 100644 (file)
@@ -30,7 +30,7 @@ using namespace scl;
 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,
@@ -39,7 +39,7 @@ struct ISCLUIGraphicsBackendCallback {
                                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) { }
 
index a71528b71e72cb484417f3b585060085c6e0312a..aaaa90ecb6ee0edd5437477577fa77ed0bb63bc0 100644 (file)
@@ -18,6 +18,7 @@
 #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;
@@ -156,7 +162,7 @@ CSCLUIBuilder::init(sclwindow parent)
  * 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();
 
@@ -174,6 +180,7 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y,
     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
@@ -183,7 +190,7 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y,
         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()) {
@@ -1117,23 +1124,27 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
             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);
             }
         }
 
@@ -1145,41 +1156,41 @@ CSCLUIBuilder::show_magnifier(const sclwindow window, scldrawctx draw_ctx)
                 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;
                 }
             }
@@ -1297,7 +1308,8 @@ CSCLUIBuilder::draw_magnifier_label(const sclwindow window, const scldrawctx dra
                     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);
             }
         }
     }
index 67f43702f84d2bc0b23238eb7aa1b813aafb1c43..2beff8f29d161b75e2e4b5193e97066d2551be94 100644 (file)
@@ -48,7 +48,7 @@ public:
     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);
index a7b7d10101f5994833a4b6830dee8bdb0291c21c..758729d0830b3b9d8850ca3553ace543b1037d69 100644 (file)
@@ -25,7 +25,7 @@ using namespace scl;
 
 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__
index 3f7bcae2bbd9963227e84b8cc7ae007a9479f86c..9bb275406811c7d73c8917e3cbca3445b45d18a6 100644 (file)
@@ -638,14 +638,14 @@ CSCLWindowsImplNui::hide_window(const sclwindow window,  sclboolean fForce)
  */
 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;
@@ -717,6 +717,14 @@ CSCLWindowsImplNui::move_window(const sclwindow window, scl16 x, scl16 y)
         //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,
@@ -826,7 +834,7 @@ CSCLWindowsImplNui::move_resize_window(const sclwindow window, scl16 x, scl16 y,
 * 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();
 
@@ -839,7 +847,7 @@ CSCLWindowsImplNui::update_window(const sclwindow window, scl16 x, scl16 y, scl1
     }
 
     CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
-    builder->show_layout(window, x, y, width, height);
+    builder->show_layout(window, x, y, width, height, type);
 }
 
 /**
index 9b962358e8fd9f3114b0a99137f8f806938735c1..897a7179bafa308f6b3d173d9787f7d484b6a723 100644 (file)
@@ -58,10 +58,10 @@ public :
     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);
index 3c7631b9c541d8767c6f8f706d0c2d305cec0e82..0d60945ecce319082d99f3359e16486e64702e7a 100644 (file)
@@ -691,7 +691,7 @@ CSCLWindows::find_popup_window_index(sclwindow window)
 }
 
 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();
 
@@ -721,7 +721,7 @@ CSCLWindows::move_window(const sclwindow window, scl16 x, scl16 y)
     if (!is_virtual) {
         CSCLWindowsImpl* impl = get_scl_windows_impl();
         if (impl) {
-            impl->move_window(window, x, y);
+            impl->move_window(window, x, y, type);
         }
     }
 }
@@ -1035,7 +1035,7 @@ CSCLWindows::get_update_pending()
 
 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();
@@ -1045,7 +1045,7 @@ CSCLWindows::update_window(const sclwindow window,
         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)) {
index 579b2dddf8fbde6d5ee901b3c8192f3cdb839f48..5ed8880512d6c9ebf0d585961ccb563b1bd8c86e 100644 (file)
@@ -89,10 +89,10 @@ public :
     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;
@@ -127,10 +127,10 @@ public :
 
     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);