ecore_main_loop_begin();
}
+static void
+_e_info_client_proc_aux_hint(int argc, char **argv)
+{
+ const char *cmd, *win, *id, *hint, *val;
+ Eldbus_Message *msg;
+ Eldbus_Message_Iter *itr;
+ Eldbus_Pending *p;
+ uint32_t hint_id;
+ Eina_Bool res;
+
+ if ((argc != 5) && (argc != 7))
+ {
+ goto usage;
+ return;
+ }
+
+ cmd = argv[2];
+ win = argv[3];
+ id = argv[4];
+
+ res = _util_string_to_uint(id, &hint_id, 10);
+ if (!res)
+ {
+ printf("\"aux_hint\" hint id isn't uint");
+ goto usage;
+ return;
+ }
+
+ if ((argc == 7) && !strncmp(cmd, "add", 3))
+ {
+ hint = argv[5];
+ val = argv[6];
+ msg = eldbus_proxy_method_call_new(e_info_client.proxy, "aux_hint_add");
+ itr = eldbus_message_iter_get(msg);
+ eldbus_message_iter_basic_append(itr, 's', win);
+ eldbus_message_iter_basic_append(itr, 'u', hint_id);
+ eldbus_message_iter_basic_append(itr, 's', hint);
+ eldbus_message_iter_basic_append(itr, 's', val);
+ }
+ else if(!strncmp(cmd, "del", 3))
+ {
+ msg = eldbus_proxy_method_call_new(e_info_client.proxy, "aux_hint_del");
+ itr = eldbus_message_iter_get(msg);
+ eldbus_message_iter_basic_append(itr, 's', win);
+ eldbus_message_iter_basic_append(itr, 'u', hint_id);
+ }
+ else
+ {
+ goto usage;
+ return;
+ }
+
+ p = eldbus_proxy_send(e_info_client.proxy, msg,
+ _e_info_client_eldbus_message_cb,
+ NULL, -1);
+ if (!p)
+ {
+ printf("\"aux_hint\" proxy_send error");
+ return;
+ }
+
+ ecore_main_loop_begin();
+ return;
+
+usage :
+ printf("Error Check Args: enlightenment_info -aux_hint add [window id] [hint id] [hint] [val]\n");
+ printf(" enlightenment_info -aux_hint del [window id] [hint id]\n");
+ return;
+}
+
+
static void
_e_info_client_cb_scrsaver(const Eldbus_Message *msg)
{
"Send aux message to client",
_e_info_client_proc_aux_message
},
+ {
+ "aux_hint",
+ "[window] [hint id] [hint] [value]",
+ "Set aux hint to client",
+ _e_info_client_proc_aux_hint
+ },
{
"scrsaver",
USAGE_SCRSAVER,
return reply;
}
+static Eldbus_Message *
+e_info_server_cb_aux_hint_add(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ const char *win_str, *hint, *val;
+ uint32_t hint_id;
+ unsigned long tmp = 0;
+ uint64_t win_id = 0;
+ E_Client *ec;
+ Evas_Object *o;
+ Eina_Bool res = EINA_FALSE;
+
+ if (!e_policy)
+ {
+ ERR("e_policy is not initialized!");
+ return reply;
+ }
+
+ if (!eldbus_message_arguments_get(msg, "suss", &win_str, &hint_id, &hint, &val))
+ {
+ ERR("Error getting arguments.");
+ return reply;
+ }
+
+ 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;
+
+ if (e_client_util_win_get(ec) == win_id)
+ {
+ res = e_hints_aux_hint_add(ec, hint_id, hint, val);
+ if (res) e_policy_wl_aux_hint_apply(ec);
+ break;
+ }
+ }
+
+ return reply;
+}
+
+static Eldbus_Message *
+e_info_server_cb_aux_hint_del(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ const char *win_str;
+ uint32_t hint_id;
+ unsigned long tmp = 0;
+ uint64_t win_id = 0;
+ E_Client *ec;
+ Evas_Object *o;
+ Eina_Bool res = EINA_FALSE;
+
+ if (!e_policy)
+ {
+ ERR("e_policy is not initialized!");
+ return reply;
+ }
+
+ if (!eldbus_message_arguments_get(msg, "su", &win_str, &hint_id))
+ {
+ ERR("Error getting arguments.");
+ return reply;
+ }
+
+ 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;
+
+ if (e_client_util_win_get(ec) == win_id)
+ {
+ res = e_hints_aux_hint_del(ec, hint_id);
+ if (res) e_policy_wl_aux_hint_apply(ec);
+ break;
+ }
+ }
+
+ return reply;
+}
+
static Eldbus_Message *
_e_info_server_cb_force_render(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
{ "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},
+ { "aux_hint_add", ELDBUS_ARGS({"s","window id" }, {"u", "hint id"}, {"s", "hint"}, {"s", "value"}), NULL, e_info_server_cb_aux_hint_add, 0},
+ { "aux_hint_del", ELDBUS_ARGS({"s","window id" }, {"u", "hint id"}), NULL, e_info_server_cb_aux_hint_del, 0},
{ "scrsaver", ELDBUS_ARGS({SIGNATURE_SCRSAVER_CLIENT, "scrsaver_params"}), ELDBUS_ARGS({SIGNATURE_SCRSAVER_SERVER, "scrsaver_result"}), _e_info_server_cb_scrsaver, 0},
{ "slot_message", ELDBUS_ARGS({"iiiiii", "slot_message"}), ELDBUS_ARGS({"a(ss)", "array of ec"}), e_info_server_cb_slot_message, 0},
{ "desktop_geometry_set", ELDBUS_ARGS({"iiii", "Geometry"}), NULL, _e_info_server_cb_desktop_geometry_set, 0},