} else {
LOGW ("wrong format of transaction");
}
+ } else if (cmd == ISM_TRANS_CMD_SET_FLOATING_MODE) {
+ uint32 floating_mode;
+
+ if (m_recv_trans.get_data(floating_mode)) {
+ m_info_manager->set_floating_mode(floating_mode);
+ } else {
+ LOGW ("wrong format of transaction");
+ }
+ } else if (cmd == ISM_TRANS_CMD_SET_FLOATING_DRAG_ENABLED) {
+ uint32 enabled;
+
+ if (m_recv_trans.get_data(enabled)) {
+ m_info_manager->set_floating_drag_enabled(enabled);
+ } else {
+ LOGW ("wrong format of transaction");
+ }
} else {
LOGW ("unknown cmd: %d", cmd);
}
else
LOGW ("Failed to get input method manager interface");
}
+
+ void set_floating_mode (int id, uint32 context_id, uint32 floating_mode)
+ {
+ LOGD ("client id:%d", id);
+ WSCContextISF* ic = find_ic (context_id);
+ if (!ic) return;
+
+ if (ic->im_ctx)
+ wl_input_method_context_set_floating_panel (ic->im_ctx, floating_mode);
+ }
+
+ void set_floating_drag_enabled (int id, uint32 context_id, uint32 enabled)
+ {
+ WSCContextISF* ic = find_ic (context_id);
+ if (!ic) return;
+
+ if (ic->im_ctx)
+ wl_input_method_context_set_floating_drag_enabled (ic->im_ctx, enabled);
+ }
};
extern "C" {
}
}
+ void set_floating_mode (uint32 floating_mode) {
+ int focused_client;
+ uint32 focused_context;
+ get_focused_context (focused_client, focused_context);
+ ClientInfo client_info = socket_get_client_info (focused_client);
+
+ if (client_info.type == FRONTEND_CLIENT) {
+ m_panel_agent_manager.set_floating_mode (focused_client, focused_context, floating_mode);
+ }
+ }
+
+ void set_floating_drag_enabled (uint32 enabled) {
+ int focused_client;
+ uint32 focused_context;
+ get_focused_context (focused_client, focused_context);
+ ClientInfo client_info = socket_get_client_info (focused_client);
+
+ if (client_info.type == FRONTEND_CLIENT) {
+ m_panel_agent_manager.set_floating_drag_enabled (focused_client, focused_context, enabled);
+ }
+ }
+
Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
return m_signal_turn_on.connect (slot);
}
m_impl->request_ise_terminate ();
}
+void InfoManager::set_floating_mode (uint32 floating_mode)
+{
+ m_impl->set_floating_mode (floating_mode);
+}
+
+void InfoManager::set_floating_drag_enabled (uint32 enabled)
+{
+ m_impl->set_floating_drag_enabled (enabled);
+}
+
//////////////////////////////////Message function end/////////////////////////////////////////
Connection
void request_ise_terminate (void);
+ void set_floating_mode (uint32 floating_mode);
+
+ void set_floating_drag_enabled (uint32 enabled);
//////////////////////////////////Message function end/////////////////////////////////////////
void PanelAgentBase::request_ise_reshow (int client, uint32 context)
{
}
+
+void PanelAgentBase::set_floating_mode (int client, uint32 context, uint32 floating_mode)
+{
+}
+
+void PanelAgentBase::set_floating_drag_enabled (int client, uint32 context_id, uint32 enabled)
+{
+}
} /* namespace scim */
/*
* @return none.
*/
virtual void request_ise_reshow (int client, uint32 context);
+
+ /**
+ * @brief set_floating_mode.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void set_floating_mode (int client, uint32 context, uint32 floating_mode);
+
+ /**
+ * @brief set_floating_drag_enabled.
+ *
+ * @param
+ *
+ * @return none.
+ */
+ virtual void set_floating_drag_enabled (int client, uint32 context_id, uint32 enabled);
};
/** @} */
_p->request_ise_reshow (id, context_id);
}
+void PanelAgentManager::set_floating_mode (int id, uint32 context_id, uint32 floating_mode)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
+
+ if (!_p.null ())
+ _p->set_floating_mode (id, context_id, floating_mode);
+}
+
+void PanelAgentManager::set_floating_drag_enabled (int id, uint32 context_id, uint32 enabled)
+{
+ PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
+
+ if (!_p.null ())
+ _p->set_floating_drag_enabled (id, context_id, enabled);
+}
+
} /* namespace scim */
/*
void send_fail_reply (int client);
void update_entry_metadata(int client, uint32 context_id);
void request_ise_reshow(int client, uint32 context_id);
+ void set_floating_mode (int client, uint32 context_id, uint32 floating_mode);
+ void set_floating_drag_enabled (int client, uint32 context_id, uint32 enabled);
};
/** @} */
m_impl->process_key_event_done (key, ret, serial);
}
+void
+HelperAgent::set_floating_mode (bool floating_mode)
+{
+ LOGD ("");
+ if (m_impl->socket_active.is_connected ()) {
+ m_impl->send.clear ();
+ m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
+ m_impl->send.put_data (m_impl->magic_active);
+ m_impl->send.put_command (ISM_TRANS_CMD_SET_FLOATING_MODE);
+ m_impl->send.put_data (floating_mode ? 1 : 0);
+ m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
+ }
+}
+
+void
+HelperAgent::set_floating_drag_enabled (bool enabled)
+{
+ if (m_impl->socket_active.is_connected ()) {
+ m_impl->send.clear ();
+ m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
+ m_impl->send.put_data (m_impl->magic_active);
+ m_impl->send.put_command (ISM_TRANS_CMD_SET_FLOATING_DRAG_ENABLED);
+ m_impl->send.put_data (enabled ? 1 : 0);
+ m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
+ }
+}
+
/**
* @brief Connect a slot to Helper exit signal.
*
uint32 serial,
bool is_success) const;
+ void set_floating_mode (bool floating_mode);
+
+ void set_floating_drag_enabled (bool enabled);
+
public:
/**
* @brief Connect a slot to Helper exit signal.
const int ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE = 1218;
const int ISM_TRANS_CMD_REQUEST_ISE_HIDE = 1219;
const int ISM_TRANS_CMD_RECAPTURE_STRING = 1220;
-
+const int ISM_TRANS_CMD_SET_FLOATING_MODE = 1221;
+const int ISM_TRANS_CMD_SET_FLOATING_DRAG_ENABLED = 1222;
/* Panel to ISE */
const int ISM_TRANS_CMD_CANDIDATE_MORE_WINDOW_SHOW = 1251;