extern "C" {
#endif
-int scl_controller_mouse_press(int x, int y);
+int scl_controller_mouse_press(int window_type, int x, int y);
int scl_controller_mouse_release(int x, int y);
int scl_controller_mouse_move(int x, int y, int touch_id);
WINDOW_MAGNIFIER,
WINDOW_DIM,
WINDOW_POPUP,
+ WINDOW_AUTO_POPUP,
}WindowType;
/* graphics backend */
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 void (*scl_nui_update_window_cb)(SCLWindowType type, 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);
class CUIWindowBackendCallback : public ISCLUIWindowBackendCallback
{
public :
- void update_window(int x, int y, int width, int height, void* user_data);
+ void update_window(SCLWindowType type, 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
#define LOG_TAG "CSCLUINUI"
-EXPORT_API int scl_controller_mouse_press(int x, int y)
+EXPORT_API int scl_controller_mouse_press(int window_type, int x, int y)
{
CSCLController *controller = CSCLController::get_instance();
+ CSCLWindows *windows = CSCLWindows::get_instance();
+ sclwindow popupwin = windows->get_nth_window_in_Z_order_list(SCL_WINDOW_Z_TOP);
+ SclWindowContext *popup_window_context = windows->get_window_context(popupwin);
+
if (controller) {
LOGD("mouse down x:%d, y:%d", x, y);
- controller->mouse_press(get_main_window(), x, y);
+ if ((SCLWindowType)window_type == WINDOW_POPUP)
+ controller->mouse_press(popup_window_context, x, y);
+ else
+ controller->mouse_press(get_main_window(), x, y);
return 0;
}
else {
}
}
-void CUIWindowBackendCallback::update_window(int x, int y, int width, int height, void* user_data)
+void CUIWindowBackendCallback::update_window(SCLWindowType type, int x, int y, int width, int height, void* user_data)
{
LOGD("update_window : %p", g_update_window_cb);
if (g_update_window_cb) {
- g_update_window_cb(x, y, width, height, user_data);
+ g_update_window_cb(type, x, y, width, height, user_data);
}
}
WINDOW_MAGNIFIER,
WINDOW_DIM,
WINDOW_POPUP,
+ WINDOW_AUTO_POPUP,
}SCLWindowType;
}
events->destroy_all_timer();
break;
case SIGACTION_RECOMPUTE_LAYOUT: {
- if (targetWindow != SCLWINDOW_INVALID) {
- if (cache)
- cache->recompute_layout(targetWindow, type);
- }
+ if (cache)
+ cache->recompute_layout(targetWindow, type);
}
break;
case SIGACTION_FREE_IMAGES:
popupindex = windows->find_popup_window_index(window);
/* Check if the popup index is in valid range */
scl_assert_return_false(popupindex >= 0 && popupindex < MAX_POPUP_WINDOW);
-
layout = context->get_popup_layout(window);
+ if (type == WINDOW_AUTO_POPUP)
+ layout = SCL_LAYOUT_AUTOPOPUP;
if (!(sclres_manager->loaded(layout))) {
sclres_manager->load(layout);
}
/* EFL testing */
- if (window) {
- windows->update_window(window, 0, 0, 0, 0, type);
- }
+ windows->update_window(window, 0, 0, 0, 0, type);
}
}
need_endpaint = TRUE;
}
- /* FIXME : There is a case that begin_pain fails. Inspection on the root cause is needed */
- if (draw_ctx) {
- SCLShiftState shift_index = context->get_shift_state();
- if (shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
-
- const SclLayout* layout = cache->get_cur_layout(window);
- const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
-
- /* 1. drawing the background of the button */
- /* check it according to the following check-list */
- /* check it whether uses SW style button */
- if (layout && coordinate) {
- 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, 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, type);
- } else {
- /* case 3 (uses the layout background image) */
- background = draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index, type);
- }
- } else if (force_draw_bg) {
+ SCLShiftState shift_index = context->get_shift_state();
+ if (shift_index >= SCL_SHIFT_STATE_MAX) shift_index = SCL_SHIFT_STATE_OFF;
+
+ const SclLayout* layout = cache->get_cur_layout(window);
+ const SclLayoutKeyCoordinate* coordinate = cache->get_cur_layout_key_coordinate(window, key_index);
+
+ /* 1. drawing the background of the button */
+ /* check it according to the following check-list */
+ /* check it whether uses SW style button */
+ if (layout && coordinate) {
+ 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, 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, type);
+ } else {
+ /* case 3 (uses the layout background image) */
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) */
+ } else if (force_draw_bg) {
+ background = draw_button_bg_by_layoutimg(window, draw_ctx, key_index, state, shift_index, type);
}
-
- /* 2. displaying the label of the button */
- 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);
+ /* 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, 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);
}
/* destroys the cairo surface if the value of the given(parameter) draw_ctx is NULL */
/* FIXME : Need to check the dependency cause by the next include statement */
struct ISCLUIWindowBackendCallback {
- virtual void update_window(int x, int w, int width, int height, void* user_data) { }
+ virtual void update_window(SCLWindowType type, 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) { }
};
{
SCL_DEBUG();
- 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);
- }
- else {
- LOGW("### No update window callback ###");
- }
+ LOGI("call update_window. x(%d), y(%d), w(%d), h(%d)", x, y, width, height);
+ m_window_backend_callback->update_window(type, x, y, width, height, m_window_backend_callback_data);
CSCLUIBuilder *builder = CSCLUIBuilder::get_instance();
- builder->show_layout(window, x, y, width, height, type);
+ if (window == NULL && type == WINDOW_KEYPAD) {
+ CSCLWindows *windows = CSCLWindows::get_instance();
+ builder->show_layout(windows->get_base_window(), x, y, width, height, type);
+ } else {
+ builder->show_layout(window, x, y, width, height, type);
+ }
}
/**
sclwindow CSCLWindows::open_popup(const SclWindowOpener opener, const SclRectangle &geometry, sclshort inputmode, sclshort layout, SCLPopupType popup_type, sclboolean is_virtual, sclboolean use_dim_window, sclint img_offset_x, sclint img_offset_y, sclint timeout)
{
sclwindow window = SCLWINDOW_INVALID;
+ SCLWindowType window_type = (popup_type == POPUP_TYPE_AUTO_POPUP) ? WINDOW_AUTO_POPUP : WINDOW_POPUP;
CSCLEvents *events = CSCLEvents::get_instance();
CSCLActionState *state = CSCLActionState::get_instance();
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, WINDOW_POPUP);
+ controller->handle_engine_signal(SCL_SIG_POPUP_SHOW, window, window_type);
/* Shows the dim window if it uses the dim_window */
if (use_dim_window) {
}*/
if (windows && coordinate)
- windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height, WINDOW_POPUP);
+ windows->update_window(window, coordinate->x, coordinate->y, coordinate->width, coordinate->height, window_type);
}
}
}