struct wl_eom_listener {
/**
* output_type - (none)
- * @output: (none)
+ * @output_id: (none)
* @type: (none)
* @status: (none)
*/
void (*output_type)(void *data,
struct wl_eom *wl_eom,
- struct wl_output *output,
+ uint32_t output_id,
uint32_t type,
uint32_t status);
/**
* output_mode - (none)
- * @output: (none)
+ * @output_id: (none)
* @mode: (none)
*/
void (*output_mode)(void *data,
struct wl_eom *wl_eom,
- struct wl_output *output,
+ uint32_t output_id,
uint32_t mode);
/**
* output_attribute - (none)
- * @output: (none)
+ * @output_id: (none)
* @attribute: (none)
* @attribute_state: (none)
* @error: (none)
*/
void (*output_attribute)(void *data,
struct wl_eom *wl_eom,
- struct wl_output *output,
+ uint32_t output_id,
uint32_t attribute,
uint32_t attribute_state,
uint32_t error);
#define WL_EOM_SET_ATTRIBUTE 0
+#define WL_EOM_SET_ATTRIBUTE_SINCE_VERSION 1
+
static inline void
wl_eom_set_user_data(struct wl_eom *wl_eom, void *user_data)
{
return wl_proxy_get_user_data((struct wl_proxy *) wl_eom);
}
+static inline uint32_t
+wl_eom_get_version(struct wl_eom *wl_eom)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_eom);
+}
+
static inline void
wl_eom_destroy(struct wl_eom *wl_eom)
{
}
static inline void
-wl_eom_set_attribute(struct wl_eom *wl_eom, struct wl_output *output, uint32_t attribute)
+wl_eom_set_attribute(struct wl_eom *wl_eom, uint32_t output_id, uint32_t attribute)
{
wl_proxy_marshal((struct wl_proxy *) wl_eom,
- WL_EOM_SET_ATTRIBUTE, output, attribute);
+ WL_EOM_SET_ATTRIBUTE, output_id, attribute);
}
#ifdef __cplusplus
#include <stdint.h>
#include "wayland-util.h"
-extern const struct wl_interface wl_output_interface;
static const struct wl_interface *types[] = {
- &wl_output_interface,
NULL,
- &wl_output_interface,
- NULL,
- NULL,
- &wl_output_interface,
- NULL,
- &wl_output_interface,
NULL,
NULL,
NULL,
};
static const struct wl_message wl_eom_requests[] = {
- { "set_attribute", "ou", types + 0 },
+ { "set_attribute", "uu", types + 0 },
};
static const struct wl_message wl_eom_events[] = {
- { "output_type", "ouu", types + 2 },
- { "output_mode", "ou", types + 5 },
- { "output_attribute", "ouuu", types + 7 },
+ { "output_type", "uuu", types + 0 },
+ { "output_mode", "uu", types + 0 },
+ { "output_attribute", "uuuu", types + 0 },
};
WL_EXPORT const struct wl_interface wl_eom_interface = {
struct wl_eom_interface {
/**
* set_attribute - (none)
- * @output: (none)
+ * @output_id: (none)
* @attribute: (none)
*/
void (*set_attribute)(struct wl_client *client,
struct wl_resource *resource,
- struct wl_resource *output,
+ uint32_t output_id,
uint32_t attribute);
};
#define WL_EOM_OUTPUT_ATTRIBUTE_SINCE_VERSION 1
static inline void
-wl_eom_send_output_type(struct wl_resource *resource_, struct wl_resource *output, uint32_t type, uint32_t status)
+wl_eom_send_output_type(struct wl_resource *resource_, uint32_t output_id, uint32_t type, uint32_t status)
{
- wl_resource_post_event(resource_, WL_EOM_OUTPUT_TYPE, output, type, status);
+ wl_resource_post_event(resource_, WL_EOM_OUTPUT_TYPE, output_id, type, status);
}
static inline void
-wl_eom_send_output_mode(struct wl_resource *resource_, struct wl_resource *output, uint32_t mode)
+wl_eom_send_output_mode(struct wl_resource *resource_, uint32_t output_id, uint32_t mode)
{
- wl_resource_post_event(resource_, WL_EOM_OUTPUT_MODE, output, mode);
+ wl_resource_post_event(resource_, WL_EOM_OUTPUT_MODE, output_id, mode);
}
static inline void
-wl_eom_send_output_attribute(struct wl_resource *resource_, struct wl_resource *output, uint32_t attribute, uint32_t attribute_state, uint32_t error)
+wl_eom_send_output_attribute(struct wl_resource *resource_, uint32_t output_id, uint32_t attribute, uint32_t attribute_state, uint32_t error)
{
- wl_resource_post_event(resource_, WL_EOM_OUTPUT_ATTRIBUTE, output, attribute, attribute_state, error);
+ wl_resource_post_event(resource_, WL_EOM_OUTPUT_ATTRIBUTE, output_id, attribute, attribute_state, error);
}
#ifdef __cplusplus
</enum>
<request name="set_attribute">
- <arg name="output" type="object" interface="wl_output"/>
+ <arg name="output_id" type="uint"/>
<arg name="attribute" type="uint"/>
</request>
<event name="output_type">
- <arg name="output" type="object" interface="wl_output"/>
+ <arg name="output_id" type="uint"/>
<arg name="type" type="uint"/>
<arg name="status" type="uint"/>
</event>
<event name="output_mode">
- <arg name="output" type="object" interface="wl_output"/>
+ <arg name="output_id" type="uint"/>
<arg name="mode" type="uint"/>
</event>
<event name="output_attribute">
- <arg name="output" type="object" interface="wl_output"/>
+ <arg name="output_id" type="uint"/>
<arg name="attribute" type="uint"/>
<arg name="attribute_state" type="uint"/>
<arg name="error" type="uint"/>
tbm_bufmgr bufmgr;
int fd;
+ /* eom state */
enum wl_eom_mode eom_mode;
enum wl_eom_attribute eom_attribute;
enum wl_eom_attribute_state eom_attribute_state;
/* external output data */
char *ext_output_name;
int is_external_init;
+ int id;
E_EomOutMode src_mode;
E_Comp_Wl_Output *wl_output;
/* internal output data */
- int is_internal_grab;
char *int_output_name;
+ int is_internal_grab;
E_EomOutMode dst_mode;
};
static inline int
_e_eom_set_eom_attribute(enum wl_eom_attribute attribute)
{
- if (attribute == WL_EOM_ATTRIBUTE_NONE)
+ if (attribute == WL_EOM_ATTRIBUTE_NONE || g_eom->eom_attribute == WL_EOM_ATTRIBUTE_NONE)
{
g_eom->eom_attribute = attribute;
return 1;
E_EomDataPtr eom_data = NULL;
tdm_error tdm_err = TDM_ERROR_NONE;
- EOM_DBG("PP EVENT: get\n");
-
if (!user_data)
{
EOM_DBG("ERROR: PP EVENT: user data is NULL\n");
}
g_eom_data.pp_buffer = !g_eom_data.current_buffer;
- EOM_DBG("ERROR: PP EVENT: pp:%d curr:%d\n", g_eom_data.pp_buffer, g_eom_data.current_buffer);
tdm_err = tdm_buffer_add_release_handler(g_eom_data.dst_buffers[g_eom_data.pp_buffer],
_e_eom_pp_cb, &g_eom_data);
EOM_DBG ("ERROR: PP EVENT: pp commit:%d\n", tdm_err );
return;
}
-
- EOM_DBG ("PP EVENT: ok\n");
}
static void
E_EomDataPtr eom_data;
tdm_error err = TDM_ERROR_NONE;
- EOM_DBG("Event 1\n");
-
if (!user_data)
{
EOM_ERR("ERROR: EVENT: user_data is NULL\n");
eom_data = (E_EomDataPtr)user_data;
- EOM_DBG("Event 2\n");
-
- EOM_DBG("EVENT: pp:%d curr:%d\n", eom_data->pp_buffer, eom_data->current_buffer);
-
if (eom_data->current_buffer == 1)
{
eom_data->current_buffer = 0;
EOM_ERR("ERROR: EVENT: set buffer 0\n");
return;
}
-
- EOM_DBG("Event 3\n");
}
else
{
EOM_ERR("ERROR: EVENT: set buffer 1\n");
return;
}
-
- EOM_DBG("Event 4\n");
}
err = tdm_output_commit(eom_data->output, 0, _e_eom_output_commit_cb, eom_data);
EOM_ERR("ERROR: EVENT: commit\n");
return;
}
-
- EOM_DBG("Event 5\n");
}
static E_Comp_Wl_Output *
}
g_eom->is_external_init = 1;
+ g_eom->id = e->id;
_e_eom_set_eom_attribute_state(WL_EOM_ATTRIBUTE_STATE_ACTIVE);
_e_eom_set_eom_status(WL_EOM_STATUS_CONNECTION);
{
g_eom->is_external_init = 0;
g_eom->is_internal_grab = 0;
+ g_eom->id = -1;
_e_eom_set_eom_attribute_state(WL_EOM_ATTRIBUTE_STATE_INACTIVE);
_e_eom_set_eom_status(WL_EOM_STATUS_DISCONNECTION);
/* wl_eom_set_keygrab request handler */
static void
-_e_eom_wl_request_set_attribute_cb(struct wl_client *client, struct wl_resource *resource, struct wl_resource *output, uint32_t attribute)
+_e_eom_wl_request_set_attribute_cb(struct wl_client *client, struct wl_resource *resource, uint32_t output_id, uint32_t attribute)
{
+ int ret = 0;
+ /*
(void) client;
(void) attribute;
+ */
+
+ EOM_DBG("attribute:%d +++ output:%d\n", attribute, output_id);
+
+ /*
+ * TODO: check output_id
+ */
+ ret = _e_eom_set_eom_attribute(attribute);
+ if (ret == 0)
+ {
+ EOM_DBG("set attribute FAILED\n");
- EOM_DBG("attribute:%d\n", attribute);
+ wl_eom_send_output_attribute(resource,
+ g_eom->id,
+ _e_eom_get_eom_attribute(),
+ _e_eom_get_eom_attribute_state(),
+ WL_EOM_ERROR_OUTPUT_OCCUPIED);
+ }
+ else
+ {
+ EOM_DBG("set attribute OK\n");
+
+ wl_eom_send_output_attribute(resource,
+ g_eom->id,
+ _e_eom_get_eom_attribute(),
+ _e_eom_get_eom_attribute_state(),
+ WL_EOM_ERROR_NONE);
+ }
- wl_eom_send_output_attribute(resource,
- output,
- attribute,
- WL_EOM_ATTRIBUTE_STATE_ACTIVE,
- WL_EOM_ERROR_NONE);
}
static const struct wl_eom_interface _e_eom_wl_implementation =
return;
}
- EINA_LIST_FOREACH(wl_output->resources, l, output_resource)
- {
- wl_eom_send_output_type(eom->resource,
- output_resource,
- eom_type,
- _e_eom_get_eom_status());
-
+ wl_eom_send_output_type(eom->resource,
+ eom->id,
+ eom_type,
+ _e_eom_get_eom_status());
- wl_eom_send_output_attribute(eom->resource,
- output_resource,
- _e_eom_get_eom_attribute(),
- _e_eom_get_eom_attribute_state(),
- WL_EOM_ERROR_NONE);
+ wl_eom_send_output_attribute(eom->resource,
+ eom->id,
+ _e_eom_get_eom_attribute(),
+ _e_eom_get_eom_attribute_state(),
+ WL_EOM_ERROR_NONE);
- wl_eom_send_output_mode(eom->resource,
- output_resource,
- _e_eom_get_eom_mode());
- }
+ wl_eom_send_output_mode(eom->resource,
+ eom->id,
+ _e_eom_get_eom_mode());
EOM_DBG("create wl_eom global resource.\n");
}