Added input_panel_position_set interface 41/134041/5
authorInHong Han <inhong1.han@samsung.com>
Mon, 12 Jun 2017 05:26:16 +0000 (14:26 +0900)
committerInHong Han <inhong1.han@samsung.com>
Mon, 19 Jun 2017 11:02:37 +0000 (20:02 +0900)
Change-Id: Id3f05c1a845ac7b6556f1eb372dec744a3028203

src/e_mod_input_panel.c
src/e_mod_main.c
src/e_mod_main.h

index 49772e2..5f30d86 100644 (file)
@@ -39,7 +39,15 @@ struct _E_Input_Panel_Surface
    Eina_Bool need_show;
 };
 
+typedef struct _E_Floating_Position {
+   int portrait_x;
+   int portrait_y;
+   int landscape_x;
+   int landscape_y;
+} E_Floating_Position;
+
 E_Input_Panel *g_input_panel = NULL;
+E_Floating_Position g_floating_position = {-1, -1, -1, -1};
 Eina_List *handlers = NULL;
 static Eina_Bool panel_show_need_rerun = EINA_FALSE;
 
@@ -954,3 +962,25 @@ e_input_panel_show_need_rerun_set(Eina_Bool need_rerun)
 {
    panel_show_need_rerun = need_rerun;
 }
+
+void
+e_input_panel_floating_position_set(E_Client *ec, int x, int y)
+{
+   if (!ec) return;
+
+   switch (ec->e.state.rot.ang.curr)
+     {
+        case 0:
+        case 180:
+           g_floating_position.portrait_x = x;
+           g_floating_position.portrait_y = y;
+           break;
+        case 90:
+        case 270:
+           g_floating_position.landscape_x = x;
+           g_floating_position.landscape_y = y;
+           break;
+        default:
+           break;
+     }
+}
\ No newline at end of file
index 20bd471..fdb1b88 100644 (file)
@@ -1905,6 +1905,21 @@ _e_text_input_cb_mime_type_accept_set(struct wl_client *client EINA_UNUSED, stru
 }
 
 static void
+_e_text_input_cb_input_panel_position_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t x, uint32_t y)
+{
+   E_Text_Input *text_input = wl_resource_get_user_data(resource);
+
+   if (!text_input)
+     {
+        WTI_WARNING(resource,
+                    WL_DISPLAY_ERROR_INVALID_OBJECT,
+                    "No Text Input For Resource");
+        return;
+     }
+   e_input_panel_floating_position_set(client_surface_ec, x, y);
+}
+
+static void
 _e_text_input_cb_resource_destroy(struct wl_resource *resource)
 {
    E_Text_Input *text_input = wl_resource_get_user_data(resource);
@@ -1971,7 +1986,8 @@ static const struct wl_text_input_interface _e_text_input_implementation = {
      _e_text_input_cb_get_hide_permission,
      _e_text_input_cb_set_capital_mode,
      _e_text_input_cb_prediction_hint_set,
-     _e_text_input_cb_mime_type_accept_set
+     _e_text_input_cb_mime_type_accept_set,
+     _e_text_input_cb_input_panel_position_set
 };
 
 static void
index d416665..59960db 100644 (file)
@@ -24,6 +24,7 @@ Eina_Bool   e_input_panel_client_geometry_get(E_Client *ec, int *x, int *y, int
 EINTERN void   e_input_panel_wait_update_set(Eina_Bool wait_update);
 EINTERN void   e_input_panel_transient_for_set(E_Client *parent);
 void        e_input_panel_show_need_rerun_set(Eina_Bool need_rerun);
+void        e_input_panel_floating_position_set(E_Client *ec, int x, int y);
 
 typedef enum {
    TIZEN_PROFILE_UNKNOWN = 0,