virtual output: Add implementation for client and test case for virtual output.
[platform/core/uifw/libtdm.git] / src / tdm_server.c
index 13a7867..d77151c 100644 (file)
@@ -9,7 +9,7 @@
  *          Taeheon Kim <th908.kim@samsung.com>,
  *          YoungJun Cho <yj44.cho@samsung.com>,
  *          SooChan Lim <sc1.lim@samsung.com>,
- *          Boram Park <sc1.lim@samsung.com>
+ *          Boram Park <boram1288.park@samsung.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the
@@ -682,6 +682,27 @@ _tdm_server_cb_create_output(struct wl_client *client, struct wl_resource *resou
        }
 }
 
+static void
+_tdm_server_cb_create_virtual_output(struct wl_client *client, struct wl_resource *resource, const char *name, uint32_t id)
+{
+       struct wl_resource *voutput_resource = NULL;
+
+       voutput_resource =
+               wl_resource_create(client, &wl_tdm_voutput_interface,
+                                                  wl_resource_get_version(resource), id);
+       if (!voutput_resource) {
+               /* LCOV_EXCL_START */
+
+               wl_resource_post_no_memory(resource);
+               TDM_ERR("wl_resource_create failed");
+               return;
+
+               /* LCOV_EXCL_STOP */
+       }
+
+       wl_tdm_voutput_send_ack_message(voutput_resource, WL_TDM_VOUTPUT_MESSAGE_ADDED);
+}
+
 /* LCOV_EXCL_START */
 static void
 _tdm_server_cb_debug(struct wl_client *client, struct wl_resource *resource, const char *options)
@@ -727,6 +748,7 @@ _tdm_server_cb_debug(struct wl_client *client, struct wl_resource *resource, con
 static const struct wl_tdm_interface tdm_implementation = {
        _tdm_server_cb_debug,
        _tdm_server_cb_create_output,
+       _tdm_server_cb_create_virtual_output
 };
 
 static void