printf("Error Check Args: enlightenment_info -effect [1: on, 0: off]\n");
}
+static void
+_e_info_client_quickpanel_control(int argc, char **argv)
+{
+ const char *win;
+ int operation;
+ Eldbus_Message *msg;
+ Eldbus_Message_Iter *itr;
+ Eldbus_Pending *p;
+
+ if (argc < 3)
+ {
+ printf("Error Check Args: winfo -quickpanel [operation] {window}\n");
+ return;
+ }
+
+ operation = atoi(argv[2]);
+ if (argc >= 4)
+ win = argv[3];
+ else
+ win = "default";
+
+ msg = eldbus_proxy_method_call_new(e_info_client.proxy, "quickpanel_control");
+ itr = eldbus_message_iter_get(msg);
+ eldbus_message_iter_basic_append(itr, 'i', operation);
+ eldbus_message_iter_basic_append(itr, 's', win);
+
+ p = eldbus_proxy_send(e_info_client.proxy, msg,
+ _e_info_client_eldbus_message_cb,
+ NULL, -1);
+ if (!p)
+ {
+ printf("\"aux_msg\" proxy_send error");
+ return;
+ }
+}
+
static void
_e_info_client_proc_aux_message(int argc, char **argv)
{
"Window effect [on 1, off 0]",
_e_info_client_proc_effect_control
},
+ {
+ "quickpanel",
+ USAGE_QUICKPANEL_CONTROL,
+ "Control quickpanel state",
+ _e_info_client_quickpanel_control
+ },
{
"aux_msg",
"[window] [key] [value] [options]",
#include "e_info_server_input.h"
#include <mcheck.h>
#include "e_policy_wl.h"
+#include "services/e_service_quickpanel.h"
#define EDJE_EDIT_IS_UNSTABLE_AND_I_KNOW_ABOUT_IT
#include <Edje_Edit.h>
return reply;
}
+static Eldbus_Message *
+e_info_server_cb_quickpanel_control(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ const char *win_str;
+ int operation = 0;
+ unsigned long tmp = 0;
+ uint64_t win_id = 0;
+ E_Client *ec = NULL;
+ Evas_Object *o;
+ Eina_Bool res = EINA_FALSE;
+
+ if (!eldbus_message_arguments_get(msg, "is", &operation, &win_str))
+ {
+ ERR("Error getting arguments.");
+ return reply;
+ }
+
+ if (!e_util_strcmp("default", win_str))
+ ec = NULL;
+ else
+ {
+ res = e_util_string_to_ulong(win_str, &tmp, 16);
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(res, reply);
+
+ win_id = (uint64_t)tmp;
+
+ for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
+ {
+ ec = evas_object_data_get(o, "E_Client");
+ if (!ec) continue;
+
+ Ecore_Window win = e_client_util_win_get(ec);
+
+ if (win == win_id)
+ break;
+ }
+ }
+
+ if ((operation >= 0) && (operation <= 3))
+ e_qp_control_by_command(ec, operation);
+
+ return reply;
+}
+
static Eldbus_Message *
e_info_server_cb_magnifier(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
{ "get_fps_info", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_FPS")", "array of fps"}), _e_info_server_cb_fps_info_get, 0},
{ "get_keymap", NULL, ELDBUS_ARGS({"hi", "keymap fd"}), _e_info_server_cb_keymap_info_get, 0},
{ "effect_control", ELDBUS_ARGS({"i", "effect_control"}), NULL, e_info_server_cb_effect_control, 0},
+ { "quickpanel_control", ELDBUS_ARGS({"i", "operation"}, {"s","window id" }), NULL, e_info_server_cb_quickpanel_control, 0},
{ "get_keygrab_status", ELDBUS_ARGS({"s", "get_keygrab_status"}), NULL, _e_info_server_cb_keygrab_status_get, 0},
{ "get_module_info", ELDBUS_ARGS({"ss", "get_module_info"}), NULL, _e_info_server_cb_module_info_get, 0},
{ "aux_msg", ELDBUS_ARGS({"s","window id" }, {"s", "key"}, {"s", "value"}, {"as", "options"}), NULL, e_info_server_cb_aux_message, 0},
"Example:\n" \
"\twinfo -basic_op_gen basic_op_gen lower\n"
+/* -------------------------------------------------------------------------- */
+/* QUICKPANEL CONTROL */
+/* -------------------------------------------------------------------------- */
+#define USAGE_QUICKPANEL_CONTROL \
+ "-quickpanel (0:hide | 1:show | 2:lock | 3:unlock) {window id}\n" \
+ "\twindow id : This is an optional value. If you want to control specific\n" \
+ "\t quickpanel service, then use this parameter.\n," \
+ "Example:\n" \
+ "\twinfo -quickpanel 0 : hide default quickpanel service\n" \
+ "\twinfo -quickpanel 1 : show default quickpanel service\n" \
+ "\twinfo -quickpanel 2 : set scroll_lock for quickpanel service\n" \
+ "\twinfo -quickpanel 3 : unset scoll_lock for quickpanel service\n" \
+ "\twinfo -quickpanel 1 0x0a710a07 : show the specific quickpanel service\n"
+
#endif /* end of _E_INFO_SHARED_TYPES_ */
eina_iterator_free(it);
}
+static void
+_e_qp_srv_visible_handle(E_Policy_Quickpanel *qp, Eina_Bool vis)
+{
+ Eina_Bool res = EINA_FALSE;
+
+ // If vis is true, show (with effect) the quickpanel service.
+ // Otherwise, hide (with effect) the quickpanel service.
+
+ res = _e_qp_srv_is_effect_running(qp);
+ if (res)
+ _e_qp_srv_effect_finish(qp, vis);
+ else if ((qp->ec) && ((qp->ec->visible) || (vis)))
+ {
+ _e_qp_srv_effect_start(qp);
+ _e_qp_srv_effect_update(qp, qp->effect.x, qp->effect.y);
+ _e_qp_srv_effect_finish(qp, vis);
+ }
+}
+
static void
_e_qp_srv_visible_set(E_Policy_Quickpanel *qp, Eina_Bool vis)
{
return;
}
- res = _e_qp_srv_is_effect_running(qp);
- if (res)
- _e_qp_srv_effect_finish(qp, vis);
- else if ((qp->ec) && ((qp->ec->visible) || (vis)))
+ _e_qp_srv_visible_handle(qp, vis);
+}
+
+EINTERN void
+e_qp_control_by_command(E_Client *ec, int operation)
+{
+ E_Policy_Quickpanel *qp = NULL;
+ Eina_List *l;
+
+ qp = _quickpanel_service_get(ec);
+ if (!qp)
{
- _e_qp_srv_effect_start(qp);
- _e_qp_srv_effect_update(qp, qp->effect.x, qp->effect.y);
- _e_qp_srv_effect_finish(qp, vis);
+ /* look for a first quick panel service */
+ qp = eina_list_nth(qp_services, 0);
+ }
+
+ if (qp)
+ {
+ if (operation == 0)
+ _e_qp_srv_visible_handle(qp, EINA_FALSE);
+ else if (operation == 1)
+ _e_qp_srv_visible_handle(qp, EINA_TRUE);
+ else if (operation == 2)
+ e_service_quickpanel_scroll_lock_set(qp->ec, EINA_TRUE);
+ else
+ e_service_quickpanel_scroll_lock_set(qp->ec, EINA_FALSE);
}
}
EINTERN Eina_Bool e_qp_client_scrollable_state_set(E_Client *ec, E_Quickpanel_Type type, E_Quickpanel_Client_Scroll_State state);
EINTERN E_Quickpanel_Client_Scroll_State e_qp_client_scrollable_state_get(E_Client *ec, E_Quickpanel_Type type);
+EINTERN void e_qp_control_by_command(E_Client *ec, int operation);
#endif