array = g_array_append_val(array, v);
g_value_unset(&v);
- if (eom_wl_output->client_info->func)
+ if (eom_wl_output->client_info && eom_wl_output->client_info->func)
eom_wl_output->client_info->func(NULL, array);
if (array)
g_array_free(array, FALSE);
-
}
static EomWaylandOutput *
_eom_wayland_client_find_output_from_wl_output(
- struct wl_list *eom_wl_output_list, struct wl_output *output)
+ struct wl_list *eom_wl_output_list, int output_id)
{
EomWaylandOutput *eom_wl_output = NULL;
EomWaylandOutput *tmp = NULL;
EomWaylandOutput *ret = NULL;
- /* remove all eom_wl_outputs */
if (!wl_list_empty(eom_wl_output_list)) {
wl_list_for_each_safe(eom_wl_output,
tmp, eom_wl_output_list, link) {
- if (eom_wl_output->output == output) {
+ if (eom_wl_output->id == output_id) {
ret = eom_wl_output;
break;
}
EomWaylandOutput *tmp = NULL;
EomWaylandOutput *ret = NULL;
- /* remove all eom_wl_outputs */
if (!wl_list_empty(eom_wl_output_list)) {
wl_list_for_each_safe(eom_wl_output,
tmp, eom_wl_output_list, link) {
static void
_eom_wl_eom_output_type(void *data,
struct wl_eom *wl_eom,
- struct wl_output *output,
+ uint32_t output_id,
uint32_t type,
uint32_t status)
{
EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
EomWaylandOutput *eom_wl_output = NULL;
+ INFO("TYPE");
+
eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
- &eom_client_info->eom_wl_output_list, output);
+ &eom_client_info->eom_wl_output_list, output_id);
RET_IF_FAIL(eom_wl_output != NULL);
/* save the output type */
static void
_eom_wl_eom_output_mode(void *data,
struct wl_eom *wl_eom,
- struct wl_output *output,
+ uint32_t output_id,
uint32_t mode)
{
EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
EomWaylandOutput *eom_wl_output = NULL;
+ INFO("MODE");
+
eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
- &eom_client_info->eom_wl_output_list, output);
+ &eom_client_info->eom_wl_output_list, output_id);
RET_IF_FAIL(eom_wl_output != NULL);
/* check the eom mode and call the notify */
static void
_eom_wl_eom_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)
EomWaylandClientInfo *eom_client_info = (EomWaylandClientInfo *) data;
EomWaylandOutput *eom_wl_output = NULL;
+ INFO("ATTRIBUTE");
+
eom_wl_output = _eom_wayland_client_find_output_from_wl_output(
- &eom_client_info->eom_wl_output_list, output);
+ &eom_client_info->eom_wl_output_list, output_id);
RET_IF_FAIL(eom_wl_output != NULL);
/* check the eom attribute and call the notify */
wl_list_for_each_safe(eom_wl_output, tmp,
&wl_client_info.eom_wl_output_list, link) {
if (eom_wl_output->eom_type == WL_EOM_TYPE_NONE) {
- WARN("[EOM_CLIENT] eom_type is NONE. remove.\n");
+ WARN("[EOM_CLIENT] eom_type is NONE. remove output:%d\n",
+ eom_wl_output->id);
wl_output_destroy(eom_wl_output->output);
wl_list_remove(&eom_wl_output->link);
free(eom_wl_output);
array = g_array_new(FALSE, FALSE, sizeof(GValue));
- /* remove all eom_wl_outputs */
wl_list_for_each_safe(eom_wl_output, tmp,
&wl_client_info.eom_wl_output_list, link) {
if (eom_wl_output->output) {
&wl_client_info.eom_wl_output_list, output_id);
GOTO_IF_FAIL(eom_wl_output != NULL, fail);
- wl_eom_set_attribute(wl_client_info.eom, eom_wl_output->output,
+ wl_eom_set_attribute(wl_client_info.eom, eom_wl_output->id,
_convert_to_wl_eom_attribute(attr));
/* TODO:
#ifndef WL_EOM_CLIENT_PROTOCOL_H
#define WL_EOM_CLIENT_PROTOCOL_H
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
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
+#ifdef __cplusplus
}
#endif
#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 = {
</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"/>