5 #include "ecore_wl_private.h"
7 /* local function prototypes */
8 static void _ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output __UNUSED__, int x, int y, int w, int h, int subpixel __UNUSED__, const char *make __UNUSED__, const char *model __UNUSED__, int transform __UNUSED__);
9 static void _ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output __UNUSED__, unsigned int flags, int w, int h, int refresh __UNUSED__);
11 /* wayland listeners */
12 static const struct wl_output_listener _ecore_wl_output_listener =
14 _ecore_wl_output_cb_geometry,
15 _ecore_wl_output_cb_mode
20 ecore_wl_outputs_get(void)
22 return _ecore_wl_disp->outputs;
26 _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id)
28 Ecore_Wl_Output *output;
30 LOGFN(__FILE__, __LINE__, __FUNCTION__);
32 if (!(output = malloc(sizeof(Ecore_Wl_Output)))) return;
34 memset(output, 0, sizeof(Ecore_Wl_Output));
36 output->display = ewd;
38 output->output = wl_display_bind(ewd->wl.display, id, &wl_output_interface);
39 wl_list_insert(ewd->outputs.prev, &output->link);
40 wl_output_add_listener(output->output, &_ecore_wl_output_listener, output);
44 _ecore_wl_output_del(Ecore_Wl_Output *output)
47 if (output->destroy) (*output->destroy)(output, output->data);
48 if (output->output) wl_output_destroy(output->output);
49 wl_list_remove(&output->link);
55 _ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output __UNUSED__, int x, int y, int w, int h, int subpixel __UNUSED__, const char *make __UNUSED__, const char *model __UNUSED__, int transform __UNUSED__)
57 Ecore_Wl_Output *output;
59 LOGFN(__FILE__, __LINE__, __FUNCTION__);
62 output->allocation.x = x;
63 output->allocation.y = y;
69 _ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output __UNUSED__, unsigned int flags, int w, int h, int refresh __UNUSED__)
71 Ecore_Wl_Output *output;
72 Ecore_Wl_Display *ewd;
74 LOGFN(__FILE__, __LINE__, __FUNCTION__);
77 ewd = output->display;
78 if (flags & WL_OUTPUT_MODE_CURRENT)
80 output->allocation.w = w;
81 output->allocation.h = h;
82 _ecore_wl_disp->output = output;
83 if (ewd->output_configure) (*ewd->output_configure)(output, ewd->data);