Support for aligning the floating IME 44/310844/1
authorInhong Han <inhong1.han@samsung.com>
Thu, 9 May 2024 02:30:26 +0000 (11:30 +0900)
committerInhong Han <inhong1.han@samsung.com>
Thu, 9 May 2024 02:30:26 +0000 (11:30 +0900)
Change-Id: Ifa57f147a916f1863c8c27ea36cc5f602e92c54c

src/sclconnection-isf.cpp
src/sclconnection-isf.h
src/sclconnection.cpp
src/sclconnection.h
src/sclcore.cpp
src/sclcore.h
src/sclcorecallback.h
src/sclcoreimpl.cpp
src/sclcoreimpl.h

index 2e62e2891cd29082a9ecf63aaf0a6d460a2c7531..0308d5703cf96b977fe3416ae6059322118481da 100644 (file)
@@ -775,6 +775,16 @@ static void slot_set_input_hint(const scim::HelperAgent *agent, scim::uint32 &in
     }
 }
 
+static void slot_set_position_align(const scim::HelperAgent *agent, scim::uint32 &x, scim::uint32 &y, scim::uint32 &align) {
+    CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
+    if (impl) {
+        ISCLCoreEventCallback *callback = impl->get_core_event_callback();
+        if (callback) {
+            callback->on_set_position_align(x, y, align);
+        }
+    }
+}
+
 /* Internal input handler function */
 Eina_Bool input_handler(void *data, Ecore_Fd_Handler *fd_handler)
 {
@@ -878,6 +888,7 @@ sclboolean CSCLConnectionISF::init()
         m_helper_agent.signal_connect_set_autocapital_type(scim::slot(slot_set_autocapital_type));
         m_helper_agent.signal_connect_set_prediction_allow(scim::slot(slot_set_prediction_allow));
         m_helper_agent.signal_connect_set_input_hint(scim::slot(slot_set_input_hint));
+        m_helper_agent.signal_connect_set_position_align(scim::slot(slot_set_position_align));
 
         m_initialized = TRUE;
     }
@@ -1492,6 +1503,13 @@ void CSCLConnectionISF::set_floating_drag_enabled(sclboolean enabled)
     }
 }
 
+void CSCLConnectionISF::move_resize_floating_window(sclint x, sclint y, sclint w, sclint h)
+{
+    if (m_initialized) {
+        m_helper_agent.move_resize_floating_window(x, y, w, h);
+    }
+}
+
 extern "C"
 {
     EXAPI void scim_module_init(void) {
index 1d1f84703bf91786fc426ba39b4751eed3cb4bc5..61e4742b36ca48b4864ce83e09cea0163de9165c 100644 (file)
@@ -101,6 +101,7 @@ public:
     void send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success);
     void set_floating_mode(sclboolean floating_mode);
     void set_floating_drag_enabled(sclboolean enabled);
+    void move_resize_floating_window(sclint x, sclint y, sclint w, sclint h);
 private:
     sclboolean m_initialized;
 
index 7e8be62af8b2bdb592b03528a502c3aaee14c98a..25cb0245bec9dc6b07ff5955923b61e0e02c850d 100644 (file)
@@ -455,4 +455,11 @@ void CSCLConnection::set_floating_drag_enabled(sclboolean enabled)
     if (m_impl) {
         m_impl->set_floating_drag_enabled(enabled);
     }
+}
+
+void CSCLConnection::move_resize_floating_window(sclint x, sclint y, sclint w, sclint h)
+{
+    if (m_impl) {
+        m_impl->move_resize_floating_window(x, y, w, h);
+    }
 }
\ No newline at end of file
index 80a57226225c92baacc7d8c7f1109f2cb10ee406..f5585f6ca061731fbd33c054aa06e8fe505afff9 100644 (file)
@@ -107,6 +107,7 @@ public:
     virtual void send_key_event_processing_result(scim::KeyEvent &key, sclu32 serial, sclboolean is_success);
     virtual void set_floating_mode(sclboolean floating_mode);
     virtual void set_floating_drag_enabled(sclboolean enabled);
+    virtual void move_resize_floating_window(sclint x, sclint y, sclint w, sclint h);
 protected:
     std::string m_backend_identifier;
 
index 781ad8a2b12a910faf1dbba2627fd92dd56e42d2..6dcabcd50d54854ef1b526693bb954e8ff63170a 100644 (file)
@@ -465,6 +465,13 @@ void CSCLCore::set_floating_drag_enabled(sclboolean enabled)
     }
 }
 
+void CSCLCore::move_resize_floating_window(sclint x, sclint y, sclint w, sclint h)
+{
+    if (m_impl) {
+        m_impl->move_resize_floating_window(x, y, w, h);
+    }
+}
+
 void CSCLCore::set_window_creation_defer_flag(sclboolean flag)
 {
     if (m_impl) {
index 78d4534fde92569c5bef616a1e5c02f61e0d918d..4b09577c3e95d31d85011aaa4814700ab4a85a88 100644 (file)
@@ -474,6 +474,11 @@ public:
      */
     void set_floating_drag_enabled(sclboolean enabled);
 
+    /**
+     * @brief Request to move and resize the floating ISE.
+     */
+    void move_resize_floating_window(sclint x, sclint y, sclint w, sclint h);
+
     /**
      * @brief Request to defer creating window until the window object gets accessed.
      */
index 08dbe9f72309576809c88a8a819a718c430bc5ff..6af86e6fdb1b447f0580fd3a2a45e3107b5b03e3 100644 (file)
@@ -101,6 +101,7 @@ struct ISCLCoreEventCallback {
     virtual void on_set_autocapital_type(sclu32 type) {}
     virtual void on_set_prediction_allow(sclu32 prediction_allow) {}
     virtual void on_set_input_hint(sclu32 input_hint) {}
+    virtual void on_set_position_align(sclu32 x, sclu32 y, sclu32 align) {}
     virtual void on_trigger_property(const sclchar *property) {}
 
     ISCLCoreEventCallback() {
index a04e18d189d3b7fb06e3c6c688b4c78c17deec0a..9dadd6414c7110ec55ed829f87389d62e16ecf1b 100644 (file)
@@ -426,6 +426,11 @@ void CSCLCoreImpl::set_floating_drag_enabled(sclboolean enabled)
     m_connection.set_floating_drag_enabled(enabled);
 }
 
+void CSCLCoreImpl::move_resize_floating_window(sclint x, sclint y, sclint w, sclint h)
+{
+    m_connection.move_resize_floating_window(x, y, w, h);
+}
+
 void CSCLCoreImpl::set_window_creation_defer_flag(sclboolean flag)
 {
     LOGD("defer_flag %d", flag);
index 65a76c7e39b3eaf3f9ebe2f9863b4ad5138f34a1..65009b16ff54771a8b929378d566c04b2273cea7 100644 (file)
@@ -111,6 +111,7 @@ public:
     void commit_content(const sclchar *content, const sclchar *description, const sclchar *mime_types);
     void set_floating_mode(sclboolean floating_mode);
     void set_floating_drag_enabled(sclboolean enabled);
+    void move_resize_floating_window(sclint x, sclint y, sclint w, sclint h);
 
     void set_window_creation_defer_flag(sclboolean flag);
     void update_preedit_string_with_commit(const sclchar *preedit, const sclchar *commit, const scim::AttributeList &attrs, sclint caret);