}
}
+static void
+_e_info_client_proc_input_output_set(int argc, char **argv)
+{
+ if (argc < 4)
+ {
+ printf("Error Check Args: -input_output_set [input(ex./dev/input/eventX)] [output(ex.HDMIA-1)]\n");
+ return;
+ }
+
+ if (!_e_info_client_eldbus_message_with_args("input_output_set", NULL, "ss",
+ argv[2], argv[3]))
+ {
+ printf("_e_info_client_eldbus_message_with_args error");
+ return;
+ }
+}
+
typedef struct _ProcInfo
{
const char *option;
"Set zone",
_e_info_client_proc_zone_set
},
+ {
+ "input_output_set",
+ "[input(ex./dev/input/eventX) output(ex.HDMIA-1)]",
+ "Set input device's output name",
+ _e_info_client_proc_input_output_set
+ },
};
ProcInfo procs_to_input[] =
return reply;
}
+static Eldbus_Message *
+_e_info_server_cb_input_output_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+ Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+ const char *input_name = NULL, *output_name = NULL;
+ Eina_Bool res = EINA_FALSE;
+
+ if (!eldbus_message_arguments_get(msg, "ss", &input_name, &output_name))
+ {
+ ERR("Error getting arguments.");
+ return reply;
+ }
+
+ res = e_input_device_output_name_set(NULL, input_name, output_name);
+ if (res) INF("Succeeded to set input device(%s)'s output name(%s)", input_name, output_name);
+ else ERR("Failed to set input device(%s)'s output name(%s)", input_name, output_name);
+
+ 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 },
{ "basic_op_gen", ELDBUS_ARGS({"s","window id" }, {"s", "operation"}), NULL, _e_info_server_cb_basic_operation_generate, 0},
{ "process_info", NULL, ELDBUS_ARGS({"s", "process information"}), _e_info_server_cb_process_info, 0 },
{ "zone_set", ELDBUS_ARGS({"si", "zone set"}), NULL, _e_info_server_cb_zone_set, 0 },
+ { "input_output_set", ELDBUS_ARGS({"ss", "set input device's output name"}), NULL, _e_info_server_cb_input_output_set, 0 },
{ NULL, NULL, NULL, NULL, 0 }
};
}
return EINA_TRUE;
+}
+
+EINTERN Eina_Bool
+e_input_device_output_name_set(E_Input_Device *dev, const char *input, const char *output)
+{
+ E_Input_Seat *seat;
+ E_Input_Evdev *edev;
+ Eina_List *l, *ll;
+ Eina_Bool found = EINA_FALSE;
+
+ if (!dev)
+ dev = _e_input_device_default_get();
+
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!dev, EINA_FALSE);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!input, EINA_FALSE);
+ EINA_SAFETY_ON_TRUE_RETURN_VAL(!output, EINA_FALSE);
+ EINA_LIST_FOREACH(dev->seats, l, seat)
+ {
+ EINA_LIST_FOREACH(seat->devices, ll, edev)
+ {
+ if (!e_util_strcmp(edev->path, input))
+ {
+ found = EINA_TRUE;
+ break;
+ }
+ }
+ }
+
+ if (!found || !edev)
+ {
+ ERR("Failed to find input device: %s", input);
+ return EINA_TRUE;
+ }
+
+ if (e_output_find(output))
+ {
+ INF("output device found: %s", output);
+ E_FREE(edev->output_name);
+ edev->output_name = strdup(output);
+ edev->output_configured = EINA_FALSE;
+ return EINA_TRUE;
+ }
+ else
+ ERR("Failed to find output device: %s", output);
+
+ return EINA_FALSE;
}
\ No newline at end of file