From: InHong Han Date: Thu, 8 Jul 2021 05:20:43 +0000 (+0900) Subject: Supports dim and popup windows X-Git-Tag: submit/tizen/20210803.031958~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F262115%2F1;p=platform%2Fcore%2Fuifw%2Flibscl-ui-nui.git Supports dim and popup windows Change-Id: I2fbef3a74cbbac70cb8f6897137432b4ebcf1891 --- diff --git a/capi/include/cscl-ui-graphics-backend.h b/capi/include/cscl-ui-graphics-backend.h index 1270717..772da8c 100644 --- a/capi/include/cscl-ui-graphics-backend.h +++ b/capi/include/cscl-ui-graphics-backend.h @@ -27,7 +27,7 @@ public : 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); + 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, SCLWindowType type, void* user_data); }; #endif /* __SCL_GRAPHICS_BACKEND_H__ */ diff --git a/capi/include/cscl-ui-nui.h b/capi/include/cscl-ui-nui.h index 4f73a71..b02c13e 100644 --- a/capi/include/cscl-ui-nui.h +++ b/capi/include/cscl-ui-nui.h @@ -57,12 +57,13 @@ typedef void (*scl_nui_draw_text_cb)(const char *font_name, short font_size, boo 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, 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); +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, SCLWindowType type, 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 int (*scl_nui_event_notification_cb)(SCLUINotiType noti_type, SclNotiDesc *etc_info); 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); @@ -84,6 +85,7 @@ 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_event_notification_cb(scl_nui_event_notification_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); diff --git a/capi/src/cscl-ui-nui.cpp b/capi/src/cscl-ui-nui.cpp index 603222a..ab5ef78 100644 --- a/capi/src/cscl-ui-nui.cpp +++ b/capi/src/cscl-ui-nui.cpp @@ -52,6 +52,7 @@ 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_event_notification_cb g_event_notification_cb = NULL; static scl_nui_update_window_position_cb g_update_window_position_cb = NULL; static void *g_update_window_position_cb_data = NULL; @@ -96,12 +97,12 @@ void CUIGraphicsBackendCallback::on_draw_image(const char *image_path, int dest_ } } -void CUIGraphicsBackendCallback::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) +void CUIGraphicsBackendCallback::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, SCLWindowType type, void* user_data) { LOGD("draw rectangle : %p", g_draw_rectangle_cb); if (g_draw_rectangle_cb) { g_draw_rectangle_cb(pos_x, pos_y, width, height, - fill, fill_color_r, fill_color_g, fill_color_b, fill_color_a, user_data); + fill, fill_color_r, fill_color_g, fill_color_b, fill_color_a, type, user_data); } } @@ -127,7 +128,12 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d SCLEventReturnType CUIEventCallback::on_event_notification(SCLUINotiType noti_type, SclNotiDesc *etc_info) { LOGI(""); - return SCL_EVENT_PASS_ON; + int ret = 0; + if (g_event_notification_cb) { + ret = g_event_notification_cb(noti_type, etc_info); + } + + return (SCLEventReturnType)ret; } SCLEventReturnType CUIEventCallback::on_event_drag_state_changed(SclUIEventDesc event_desc) @@ -324,6 +330,13 @@ EXPORT_API int scl_nui_set_drag_state_changed_cb(scl_nui_drag_state_changed_cb c return 0; } +EXPORT_API int scl_nui_set_event_notification_cb(scl_nui_event_notification_cb callback) +{ + g_event_notification_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; diff --git a/scl/sclcontroller.cpp b/scl/sclcontroller.cpp index eb4b20e..0ad9805 100644 --- a/scl/sclcontroller.cpp +++ b/scl/sclcontroller.cpp @@ -786,8 +786,8 @@ CSCLController::process_button_pressed_event(sclwindow window, sclint x, sclint if (windows) { 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); + + windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height, WINDOW_KEYPAD); } #endif } @@ -3718,7 +3718,7 @@ CSCLController::timer_event(const scl32 data) } /* 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, SCLWindowType type) { SCL_DEBUG(); @@ -3812,7 +3812,7 @@ void CSCLController::handle_engine_signal(SclInternalSignal signal, sclwindow ta case SIGACTION_RECOMPUTE_LAYOUT: { if (targetWindow != SCLWINDOW_INVALID) { if (cache) - cache->recompute_layout(targetWindow); + cache->recompute_layout(targetWindow, type); } } break; diff --git a/scl/sclcontroller.h b/scl/sclcontroller.h index cbb2eba..cc2d254 100644 --- a/scl/sclcontroller.h +++ b/scl/sclcontroller.h @@ -81,7 +81,7 @@ private: sclboolean check_farthest, scltouchdevice touch_id, sclbyte extra_option); public: - void handle_engine_signal(SclInternalSignal signal, sclwindow skip_window = SCLWINDOW_INVALID); + void handle_engine_signal(SclInternalSignal signal, sclwindow skip_window = SCLWINDOW_INVALID, SCLWindowType type = WINDOW_KEYPAD); sclboolean process_input_mode_change(const sclbyte mode); sclboolean process_rotation_change(const SCLRotation rotation); diff --git a/scl/sclgraphics-nui.cpp b/scl/sclgraphics-nui.cpp index cfb5062..a45c01d 100644 --- a/scl/sclgraphics-nui.cpp +++ b/scl/sclgraphics-nui.cpp @@ -914,7 +914,7 @@ CSCLGraphicsImplNui::draw_text(sclwindow window, const scldrawctx draw_ctx, cons */ scldrawing CSCLGraphicsImplNui::draw_rectangle(sclwindow window, const scldrawctx draw_ctx, scldouble pos_x, scldouble pos_y, - scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color, sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha) + scldouble width, scldouble height, const scldouble line_width, const SclColor& line_color, sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha, SCLWindowType type) { SCL_DEBUG(); @@ -924,7 +924,7 @@ CSCLGraphicsImplNui::draw_rectangle(sclwindow window, const scldrawctx draw_ctx, if (m_backend_callback) { LOGI("call draw rectangle callback"); SCL_DEBUG_ELAPSED_TIME_START(); - m_backend_callback->on_draw_rectangle(pos_x, pos_y, width, height, fill, fill_color.r, fill_color.g, fill_color.b, fill_color.a, m_backend_callback_data); + m_backend_callback->on_draw_rectangle(pos_x, pos_y, width, height, fill, fill_color.r, fill_color.g, fill_color.b, fill_color.a, type, m_backend_callback_data); SCL_DEBUG_ELAPSED_TIME_END(); } else { diff --git a/scl/sclgraphics-nui.h b/scl/sclgraphics-nui.h index bf3ee81..1e8dc0a 100644 --- a/scl/sclgraphics-nui.h +++ b/scl/sclgraphics-nui.h @@ -101,7 +101,7 @@ public : 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, - sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha); + sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha, SCLWindowType type); scldrawctx begin_paint(const sclwindow window, const sclboolean force_draw = FALSE); void end_paint(const sclwindow window, scldrawctx draw_ctx); SclSize get_image_size(sclchar* image_path); diff --git a/scl/sclgraphics.h b/scl/sclgraphics.h index a010a5d..c380450 100644 --- a/scl/sclgraphics.h +++ b/scl/sclgraphics.h @@ -79,7 +79,7 @@ private: virtual void destroy_font(sclfont font) = 0; virtual 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, - sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha) = 0; + sclboolean fill, const SclColor& fill_color, scldouble radius, sclfloat alpha, SCLWindowType type) = 0; virtual SclSize get_image_size(sclchar* image_path) = 0; virtual SclSize get_text_size(const SclFontInfo &fontinfo, const sclchar *str) = 0; virtual void register_atspi_object(sclwindow window, scldrawing drawing, const sclchar* name) = 0; @@ -124,8 +124,8 @@ public : 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, - sclboolean fill, const SclColor& fill_color, scldouble radius = 0, sclfloat alpha = 1.0) { - return get_scl_graphics_impl()->draw_rectangle(window, draw_ctx, pos_x, pos_y, width, height, line_width, line_color, fill, fill_color, radius, alpha); + sclboolean fill, const SclColor& fill_color, scldouble radius = 0, sclfloat alpha = 1.0, SCLWindowType type = WINDOW_KEYPAD) { + return get_scl_graphics_impl()->draw_rectangle(window, draw_ctx, pos_x, pos_y, width, height, line_width, line_color, fill, fill_color, radius, alpha, type); } SclSize get_image_size(sclchar* image_path) { diff --git a/scl/sclgraphicsbackendcallback.h b/scl/sclgraphicsbackendcallback.h index 1bed3eb..8cbf4ca 100644 --- a/scl/sclgraphicsbackendcallback.h +++ b/scl/sclgraphicsbackendcallback.h @@ -41,7 +41,7 @@ struct ISCLUIGraphicsBackendCallback { 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) { } + 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, SCLWindowType type, void* user_data) { } //virtual void update_window(int x, int w, int width, int height, void* user_data) { } diff --git a/scl/sclresourcecache.cpp b/scl/sclresourcecache.cpp index 21b49ea..94d5c65 100644 --- a/scl/sclresourcecache.cpp +++ b/scl/sclresourcecache.cpp @@ -902,7 +902,7 @@ CSCLResourceCache::clear_private_keys() * This func will be called when a newly window is created */ sclboolean -CSCLResourceCache::recompute_layout(sclwindow window) +CSCLResourceCache::recompute_layout(sclwindow window, SCLWindowType type) { SCL_DEBUG(); @@ -1105,7 +1105,7 @@ CSCLResourceCache::recompute_layout(sclwindow window) /* EFL testing */ if (window) { - windows->update_window(window); + windows->update_window(window, 0, 0, 0, 0, type); } } } diff --git a/scl/sclresourcecache.h b/scl/sclresourcecache.h index df1af1a..bbcb3e8 100644 --- a/scl/sclresourcecache.h +++ b/scl/sclresourcecache.h @@ -50,7 +50,7 @@ public: static CSCLResourceCache* get_instance(); sclboolean init(); - sclboolean recompute_layout(sclwindow window); + sclboolean recompute_layout(sclwindow window, SCLWindowType type = WINDOW_KEYPAD); const SclLayout* get_cur_layout(sclwindow window) const; SclLayoutKeyCoordinate* get_cur_layout_key_coordinate(sclwindow window, sclbyte key_index); diff --git a/scl/scluibuilder.cpp b/scl/scluibuilder.cpp index aaaa90e..2a09b87 100644 --- a/scl/scluibuilder.cpp +++ b/scl/scluibuilder.cpp @@ -201,7 +201,7 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y, size.width = dim_window_context->geometry.width; size.height = dim_window_context->geometry.height; color = default_configure->dim_color; - draw_window_bg_by_sw(window, draw_ctx, size, 0.0, color, color); + draw_window_bg_by_sw(window, draw_ctx, size, 0.0, color, color, type); /*sclchar composed_path[_POSIX_PATH_MAX] = {0,}; const SclLayout* layout = cache->get_cur_layout(windows->get_base_window()); m_utils->get_composed_path(composed_path, layout->image_path[BUTTON_STATE_NORMAL]); @@ -222,7 +222,7 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y, SclSize size; size.width = window_context->geometry.width; size.height = window_context->geometry.height; - draw_window_bg_by_sw(window, draw_ctx, size, layout->bg_line_width, layout->bg_line_color, layout->bg_color); + draw_window_bg_by_sw(window, draw_ctx, size, layout->bg_line_width, layout->bg_line_color, layout->bg_color, type); } } else if (layout->image_path[BUTTON_STATE_NORMAL]) { sclint targetx = 0; @@ -261,12 +261,12 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y, graphics->draw_image(targetwin, draw_ctx, composed_path, NULL, targetx, targety, layout->width, layout->height, window_context->layout_image_offset.x, window_context->layout_image_offset.y, - -1, -1, layout->extract_background); + -1, -1, layout->extract_background, type); } } } } - draw_button_all(window, draw_ctx, x, y, width, height); + draw_button_all(window, draw_ctx, x, y, width, height, type); //if (highlight_ui_enabled) if (focus_handler->get_current_focus_window() == window) { @@ -305,7 +305,7 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y, if (coordinate) { // Draw highlight graphics->draw_image(window, draw_ctx, composed_path, NULL, - startx + coordinate->x, starty + coordinate->y, coordinate->width, coordinate->height); + startx + coordinate->x, starty + coordinate->y, coordinate->width, coordinate->height, 0, 0, -1, -1, FALSE, type); } } } @@ -321,7 +321,7 @@ CSCLUIBuilder::show_layout(const sclwindow window, const scl16 x, const scl16 y, * Draws all of buttons */ sclboolean -CSCLUIBuilder::draw_button_all(const sclwindow window, const scldrawctx draw_ctx, const scl16 x /* = 0 */, const scl16 y /* = 0 */, const scl16 width /* = 0 */, const scl16 height /* = 0 */) +CSCLUIBuilder::draw_button_all(const sclwindow window, const scldrawctx draw_ctx, const scl16 x /* = 0 */, const scl16 y /* = 0 */, const scl16 width /* = 0 */, const scl16 height /* = 0 */, const SCLWindowType type) { SCL_DEBUG(); scl_assert_return_false(window); @@ -356,7 +356,7 @@ CSCLUIBuilder::draw_button_all(const sclwindow window, const scldrawctx draw_ctx if (button_context->toggled) { state = BUTTON_STATE_TOGGLED; } - if (!draw_button(window, draw_ctx, idx, state)) { + if (!draw_button(window, draw_ctx, idx, state, FALSE, type)) { break; } } @@ -401,7 +401,7 @@ CSCLUIBuilder::get_button_text_to_read(const sclwindow window, const scl16 key_i * @remark draw_button_all */ sclboolean -CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean force_draw_bg /* = FALSE */) +CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean force_draw_bg /* = FALSE */, const SCLWindowType type) { SCL_DEBUG(); scl_assert_return_false(window); @@ -442,25 +442,25 @@ CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const sc scldrawing background = NULL; if (layout->use_sw_button) { /* case 1 (uses Software button) */ - background = draw_button_bg_by_sw(window, draw_ctx, key_index, state); + background = draw_button_bg_by_sw(window, draw_ctx, key_index, state, type); } else { /* check it whether uses an individual images */ if (coordinate->bg_image_path[shift_index][state]) { if (strcmp(coordinate->bg_image_path[shift_index][state], SCL_BACKGROUND_IMAGE_STRING) != 0) { /* case 2 (uses an individual image) */ - background = draw_button_bg_by_img(window, draw_ctx, key_index, state, shift_index); + background = draw_button_bg_by_img(window, draw_ctx, key_index, state, shift_index, type); } else { /* case 3 (uses the layout background image) */ - background = draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index); + background = draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index, type); } } else if (force_draw_bg) { - background = draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index); + background = draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index, type); } /* case 4 (don't draw anything for button's background if image_path is NULL) */ } /* 2. displaying the label of the button */ - draw_button_label(window, draw_ctx, key_index, state, shift_index); + draw_button_label(window, draw_ctx, key_index, state, shift_index, type); /* 3. register button as atspi object */ const sclchar * text = get_button_text_to_read(window, key_index, shift_index); graphics->register_atspi_object(window, background, text); @@ -483,7 +483,7 @@ CSCLUIBuilder::draw_button(const sclwindow window, scldrawctx draw_ctx, const sc * @remark draw_button */ sclboolean -CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, SCLButtonState state, SCLShiftState shift) +CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, SCLButtonState state, SCLShiftState shift, const SCLWindowType type) { SCL_DEBUG(); @@ -592,7 +592,8 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c pos.x + targetaddx, pos.y + targetaddy, imgSize.width, - imgSize.height); + imgSize.height, + 0, 0, -1, -1, FALSE, type); } } @@ -664,7 +665,8 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c 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(), + type); } graphics->draw_text( targetwin, @@ -681,7 +683,8 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c 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(), + type); } } } @@ -696,7 +699,7 @@ CSCLUIBuilder::draw_button_label(const sclwindow window, const scldrawctx draw_c */ sclboolean CSCLUIBuilder::draw_window_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const SclSize size, - const scldouble line_width, const SclColor line_color, const SclColor fill_color) + const scldouble line_width, const SclColor line_color, const SclColor fill_color, const SCLWindowType type) { SCL_DEBUG(); scl_assert_return_false(window); @@ -719,7 +722,7 @@ CSCLUIBuilder::draw_window_bg_by_sw(const sclwindow window, const scldrawctx dra graphics->draw_rectangle(targetwin, draw_ctx, cache->get_custom_starting_coordinates().x, cache->get_custom_starting_coordinates().y, - size.width, size.height, line_width, line_color, TRUE, fill_color); + size.width, size.height, line_width, line_color, TRUE, fill_color, 0.0, 1.0f, type); } return TRUE; @@ -730,7 +733,7 @@ CSCLUIBuilder::draw_window_bg_by_sw(const sclwindow window, const scldrawctx dra * @remark draw_button */ scldrawing -CSCLUIBuilder::draw_button_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state) +CSCLUIBuilder::draw_button_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const SCLWindowType type) { //SCL_DEBUG(); @@ -784,7 +787,7 @@ CSCLUIBuilder::draw_button_bg_by_sw(const sclwindow window, const scldrawctx dra * @remark draw_button */ scldrawing -CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx, scl16 key_index, SCLButtonState state, SCLShiftState shift) +CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx, scl16 key_index, SCLButtonState state, SCLShiftState shift, const SCLWindowType type) { SCL_DEBUG(); @@ -886,7 +889,8 @@ CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx dr (sclint)targetx, (sclint)targety, (sclint)coordinate->width, - (sclint)coordinate->height); + (sclint)coordinate->height, + 0, 0, -1, -1, FALSE, type); //} } @@ -898,7 +902,7 @@ CSCLUIBuilder::draw_button_bg_by_img(const sclwindow window, const scldrawctx dr * @remark draw_button */ scldrawing -CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean shift) +CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean shift, const SCLWindowType type) { SCL_DEBUG(); @@ -1001,7 +1005,8 @@ CSCLUIBuilder::draw_button_bg_by_layoutimg(const sclwindow window, const scldraw window_context->layout_image_offset.y + (sclint)coordinate->y, (sclint)coordinate->width, (sclint)coordinate->height, - TRUE); + TRUE, + type); //} } return NULL; diff --git a/scl/scluibuilder.h b/scl/scluibuilder.h index 2beff8f..54108ed 100644 --- a/scl/scluibuilder.h +++ b/scl/scluibuilder.h @@ -49,7 +49,7 @@ public: 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, 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 draw_button(const sclwindow window, scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const sclboolean force_draw_bg = FALSE, const SCLWindowType type = WINDOW_KEYPAD); sclboolean show_magnifier(const sclwindow window, scldrawctx draw_ctx); sclboolean show_autopopup(const sclwindow parent, scldrawctx draw_ctx, const scl16 key_index); @@ -57,16 +57,16 @@ public: void set_window_backend_callback(ISCLUIWindowBackendCallback *callback, void *data); private: - sclboolean draw_button_all(const sclwindow window, const scldrawctx draw_ctx, const scl16 x, const scl16 y, const scl16 width, const scl16 height); - scldrawing draw_button_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state); + sclboolean draw_button_all(const sclwindow window, const scldrawctx draw_ctx, const scl16 x, const scl16 y, const scl16 width, const scl16 height, const SCLWindowType type); + scldrawing draw_button_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, const SCLButtonState state, const SCLWindowType type); sclboolean draw_window_bg_by_sw(const sclwindow window, const scldrawctx draw_ctx, const SclSize size, - const scldouble line_width, const SclColor line_color, const SclColor fill_color); + const scldouble line_width, const SclColor line_color, const SclColor fill_color, const SCLWindowType type); scldrawing draw_button_bg_by_img(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, - SCLButtonState state, SCLShiftState shift); + SCLButtonState state, SCLShiftState shift, const SCLWindowType type); scldrawing draw_button_bg_by_layoutimg(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, - const SCLButtonState state, const sclboolean shift); + const SCLButtonState state, const sclboolean shift, const SCLWindowType type); sclboolean draw_button_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 key_index, - SCLButtonState state, SCLShiftState shift); + SCLButtonState state, SCLShiftState shift, const SCLWindowType type); sclboolean draw_magnifier_label(const sclwindow window, const scldrawctx draw_ctx, const scl16 label_index, const sclchar* label); diff --git a/scl/sclwindows-nui.cpp b/scl/sclwindows-nui.cpp index 9bb2754..73b99bd 100644 --- a/scl/sclwindows-nui.cpp +++ b/scl/sclwindows-nui.cpp @@ -143,73 +143,6 @@ CSCLWindowsImplNui::create_window(const sclwindow parent, SclWindowContext *wind Evas_Object *win = NULL; CSCLUtils *utils = CSCLUtils::get_instance(); - win = elm_win_add(static_cast(parent), "SCLPopup", ELM_WIN_UTILITY); - - elm_win_borderless_set(win, EINA_TRUE); - elm_win_alpha_set(win, EINA_TRUE); - elm_win_title_set(win, "ISF Popup"); - - set_window_accepts_focus(win, FALSE); - - int rots[4] = {0, 90, 180, 270}; - elm_win_wm_rotation_available_rotations_set(win, rots, 4); - - scl16 new_width = 0; - scl16 new_height = 0; - CSCLContext *context = CSCLContext::get_instance(); - if (context) { - if (context->get_rotation() == ROTATION_90_CW || context->get_rotation() == ROTATION_90_CCW) { - new_width = height; - new_height = width; - } else { - new_width = width; - new_height = height; - } - } - -#ifndef FULL_SCREEN_TEST - //evas_object_resize(win, width, height); -#endif - -#ifdef WAYLAND - Ecore_Wl2_Window *wl_window = (Ecore_Wl2_Window *)(elm_win_wl_window_get(win)); - ecore_wl2_window_rotation_geometry_set(wl_window, - rotation_values_EFL[ROTATION_0], 0, 0, new_width, new_height); - ecore_wl2_window_rotation_geometry_set(wl_window, - rotation_values_EFL[ROTATION_90_CW], 0, 0, new_width, new_height); - ecore_wl2_window_rotation_geometry_set(wl_window, - rotation_values_EFL[ROTATION_180], 0, 0, new_width, new_height); - ecore_wl2_window_rotation_geometry_set(wl_window, - rotation_values_EFL[ROTATION_90_CCW], 0, 0, new_width, new_height); -#else - /* - ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(win), - rotation_values_EFL[ROTATION_0], 0, 0, new_width, new_height); - ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(win), - rotation_values_EFL[ROTATION_90_CW], 0, 0, new_width, new_height); - ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(win), - rotation_values_EFL[ROTATION_180], 0, 0, new_width, new_height); - ecore_x_e_window_rotation_geometry_set(elm_win_xwindow_get(win), - rotation_values_EFL[ROTATION_90_CCW], 0, 0, new_width, new_height); - */ - ecore_x_icccm_name_class_set(elm_win_xwindow_get(static_cast(win)), "ISF Popup", "ISF"); - - Ecore_X_Atom ATOM_WINDOW_EFFECT_ENABLE = 0; - unsigned int effect_state = 0; // 0 -> disable effect 1-> enable effect - - ATOM_WINDOW_EFFECT_ENABLE = ecore_x_atom_get("_NET_CM_WINDOW_EFFECT_ENABLE"); - if (ATOM_WINDOW_EFFECT_ENABLE) { - ecore_x_window_prop_card32_set(elm_win_xwindow_get(static_cast(win)), ATOM_WINDOW_EFFECT_ENABLE, &effect_state, 1); - } else { - if (utils) { - utils->log("Could not get _NET_CM_WINDOW_EFFECT_ENABLE ATOM \n"); - } - } -#endif - - if (context) - set_window_rotation(win, context->get_rotation()); - //elm_win_override_set(win, EINA_TRUE); if (utils) { utils->log("WinNui_createwin %p, %d %d\n", @@ -316,40 +249,6 @@ CSCLWindowsImplNui::create_dim_window(const sclwindow parent, SclWindowContext * Evas_Object *win = NULL; CSCLUtils *utils = CSCLUtils::get_instance(); - win = elm_win_add(static_cast(parent), "SCLPopup", ELM_WIN_UTILITY); - - elm_win_borderless_set(win, EINA_TRUE); - elm_win_alpha_set(win, EINA_TRUE); - elm_win_title_set(win, "ISF Dim"); - - evas_object_resize(win, width, height); - - int rots[4] = {0, 90, 180, 270}; - elm_win_wm_rotation_available_rotations_set(win, rots, 4); - - set_window_accepts_focus(win, FALSE); - -#ifndef WAYLAND - ecore_x_icccm_name_class_set(elm_win_xwindow_get(static_cast(win)), "ISF Popup", "ISF"); - - Ecore_X_Atom ATOM_WINDOW_EFFECT_ENABLE = 0; - unsigned int effect_state = 0; // 0 -> disable effect 1-> enable effect - - ATOM_WINDOW_EFFECT_ENABLE = ecore_x_atom_get("_NET_CM_WINDOW_EFFECT_ENABLE"); - if (ATOM_WINDOW_EFFECT_ENABLE) { - ecore_x_window_prop_card32_set(elm_win_xwindow_get(static_cast(win)), ATOM_WINDOW_EFFECT_ENABLE, &effect_state, 1); - } else { - if (utils) { - utils->log("Could not get _NET_CM_WINDOW_EFFECT_ENABLE ATOM \n"); - } - } -#endif - - CSCLContext *context = CSCLContext::get_instance(); - if (context) - set_window_rotation(win, context->get_rotation()); - - hide_window(win); if (utils) { utils->log("WinNui_createdimwin %p, %d %d\n", @@ -474,7 +373,7 @@ CSCLWindowsImplNui::destroy_window(sclwindow window) * Shows the given window */ void -CSCLWindowsImplNui::show_window(const sclwindow window, sclboolean queue) +CSCLWindowsImplNui::show_window(const sclwindow window, sclboolean queue, SCLWindowType type) { SCL_DEBUG(); CSCLWindows *windows = CSCLWindows::get_instance(); @@ -489,7 +388,7 @@ CSCLWindowsImplNui::show_window(const sclwindow window, sclboolean queue) } if (!(windows->get_update_pending())) { - update_window(window); + update_window(window, 0, 0, 0, 0, type); } } } @@ -838,7 +737,7 @@ CSCLWindowsImplNui::update_window(const sclwindow window, scl16 x, scl16 y, scl1 { SCL_DEBUG(); - if (m_window_backend_callback) { + if (m_window_backend_callback && type == WINDOW_KEYPAD) { LOGI("call update_window. x(%d), y(%d), w(%d), h(%d)", x, y, width, height); m_window_backend_callback->update_window(x, y, width, height, m_window_backend_callback_data); } diff --git a/scl/sclwindows-nui.h b/scl/sclwindows-nui.h index 897a717..9a38508 100644 --- a/scl/sclwindows-nui.h +++ b/scl/sclwindows-nui.h @@ -56,7 +56,7 @@ public : sclwindow create_magnifier_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height); sclwindow create_dim_window(const sclwindow parent, SclWindowContext *window_context, scl16 width, scl16 height); bool destroy_window(sclwindow window); - void show_window(const sclwindow window, sclboolean queue); + void show_window(const sclwindow window, sclboolean queue, SCLWindowType type = WINDOW_KEYPAD); void hide_window(const sclwindow window, sclboolean fForce = FALSE); void move_window(const sclwindow window, scl16 x, scl16 y, SCLWindowType type = WINDOW_KEYPAD); void resize_window(const sclwindow window, scl16 width, scl16 height); diff --git a/scl/sclwindows.cpp b/scl/sclwindows.cpp index 0d60945..42b112e 100644 --- a/scl/sclwindows.cpp +++ b/scl/sclwindows.cpp @@ -170,7 +170,7 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang window, geometry.x, geometry.y, geometry.width, geometry.height, layout, popup_type); events->connect_window_events(window, SCL_EVENT_MOUSE | SCL_EVENT_EXPOSE); - controller->handle_engine_signal(SCL_SIG_POPUP_SHOW, window); + controller->handle_engine_signal(SCL_SIG_POPUP_SHOW, window, WINDOW_POPUP); /* Shows the dim window if it uses the dim_window */ if (use_dim_window) { @@ -192,12 +192,12 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang set_parent(dim_window, window); } } - show_window(dim_window); + show_window(dim_window, FALSE, WINDOW_DIM); } else { /*If we use transient_for them the ISE will occur some crash. It needs to check X11*/ set_parent(opener.window, window); } - show_window(window); + show_window(window, FALSE, WINDOW_POPUP); push_window_in_Z_order_list(window); @@ -270,7 +270,7 @@ sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectang }*/ if (windows && coordinate) - windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height); + windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height, WINDOW_POPUP); } } } @@ -958,7 +958,7 @@ void CSCLWindows::set_window_rotation(const sclwindow window, SCLRotation rotati void -CSCLWindows::show_window(const sclwindow window, sclboolean queue /*= FALSE*/) +CSCLWindows::show_window(const sclwindow window, sclboolean queue /*= FALSE*/, SCLWindowType type) { SCL_DEBUG(); @@ -979,7 +979,7 @@ CSCLWindows::show_window(const sclwindow window, sclboolean queue /*= FALSE*/) CSCLWindowsImpl* impl = get_scl_windows_impl(); if (impl) { - impl->show_window(window, queue); + impl->show_window(window, queue, type); } } @@ -1084,7 +1084,7 @@ CSCLWindows::update_window(const sclwindow window, LOGD("startx: %d, starty: %d", startx, starty); LOGD("coordinate x(%d), y(%d), w(%d), h(%d)", coordinate->x, coordinate->y, coordinate->width, coordinate->height); - impl->update_window(window, startx + coordinate->x, starty + coordinate->y, coordinate->width, coordinate->height); + impl->update_window(window, startx + coordinate->x, starty + coordinate->y, coordinate->width, coordinate->height, type); } } } diff --git a/scl/sclwindows.h b/scl/sclwindows.h index 5ed8880..37d1f46 100644 --- a/scl/sclwindows.h +++ b/scl/sclwindows.h @@ -86,7 +86,7 @@ public : SclWindowContext *window_context, scl16 width, scl16 height) = 0; virtual bool destroy_window(sclwindow window) = 0; virtual void set_parent(const sclwindow parent, const sclwindow window) = 0; - virtual void show_window(const sclwindow window, sclboolean queue) = 0; + virtual void show_window(const sclwindow window, sclboolean queue, SCLWindowType type = WINDOW_KEYPAD) = 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, SCLWindowType type = WINDOW_KEYPAD) = 0; @@ -120,7 +120,7 @@ public : sclwindow create_base_window(const sclwindow parent, scl16 width, scl16 height); - void show_window(const sclwindow window, sclboolean queue = FALSE); + void show_window(const sclwindow window, sclboolean queue = FALSE, SCLWindowType type = WINDOW_KEYPAD); void hide_window(const sclwindow window, sclboolean force = FALSE); void set_parent(const sclwindow parent, const sclwindow window); void set_keep_above(const sclwindow window, sclboolean keep_above);