}
}
+static void
+_e_info_client_property_set(int argc, char **argv)
+{
+ const char *win, *property;
+ int set;
+
+ if (argc < 5)
+ {
+ printf("Error Check Args: winfo -prop_set [window] [property] [value]\n");
+ return;
+ }
+
+ win = argv[2];
+ property = argv[3];
+ set = atoi(argv[4]);
+
+ if (!_e_info_client_eldbus_message_with_args("prop_set", NULL, "ssi", win, property, set))
+ {
+ printf("_e_info_client_eldbus_message_with_args error");
+ return;
+ }
+}
+
typedef struct _ProcInfo
{
const char *option;
"Set resize ppu value",
_e_info_client_proc_resize_ppu_set
},
+ {
+ "prop_set",
+ USAGE_PROPERTY_SET,
+ "Set/Unset specify property",
+ _e_info_client_property_set
+ },
};
ProcInfo procs_to_input[] =
return reply;
}
+static void
+_e_info_server_prop_set(E_Client *ec, const char *property, int set)
+{
+ if (!ec) return;
+ if (!property) return;
+
+ if (!e_util_strcmp("pin", property))
+ {
+ e_client_pinned_set(ec, set);
+ }
+ else
+ {
+ ERR("Not supported operation (%s)", property);
+ }
+}
+
+static Eldbus_Message *
+_e_info_server_cb_prop_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ const char *win_str, *property;
+ int value;
+ unsigned long tmp = 0;
+ uint64_t win_id = 0;
+ E_Client *ec;
+ Evas_Object *o;
+ Eina_Bool res = EINA_FALSE;
+
+ if (!eldbus_message_arguments_get(msg, "ssi", &win_str, &property, &value))
+ {
+ 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;
+
+ Ecore_Window win = e_client_util_win_get(ec);
+
+ if (win == win_id)
+ {
+ _e_info_server_prop_set(ec, property, value);
+ break;
+ }
+ }
+
+ return reply;
+}
+
//{ "method_name", arguments_from_client, return_values_to_client, _method_cb, ELDBUS_METHOD_FLAG },
static const Eldbus_Method methods[] = {
{ "get_window_info", NULL, ELDBUS_ARGS({"iiiiisiiia("VALUE_TYPE_FOR_TOPVWINS")", "array of ec"}), _e_info_server_cb_window_info_get, 0 },
{ "input_output_set", ELDBUS_ARGS({"ss", "set input device's output name"}), NULL, _e_info_server_cb_input_output_set, 0 },
{ "input_seat_set", ELDBUS_ARGS({"ss", "set input device's seat"}), NULL, _e_info_server_cb_input_seat_set, 0 },
{ "resize_ppu_set", ELDBUS_ARGS({"si", "set resize ppu"}), NULL, e_info_server_cb_resize_ppu_set, 0},
+ { "prop_set", ELDBUS_ARGS({"s","window id" }, {"s", "property"}, {"i", "set value"}), NULL, _e_info_server_cb_prop_set, 0},
{ NULL, NULL, NULL, NULL, 0 }
};