Lines Matching refs:xwl_output
40 static void xwl_output_get_xdg_output(struct xwl_output *xwl_output);
91 struct xwl_output *xwl_output = data; in output_handle_geometry() local
93 RROutputSetPhysicalSize(xwl_output->randr_output, in output_handle_geometry()
95 RROutputSetSubpixelOrder(xwl_output->randr_output, in output_handle_geometry()
99 if (!xwl_output->xdg_output) { in output_handle_geometry()
100 xwl_output->x = x; in output_handle_geometry()
101 xwl_output->y = y; in output_handle_geometry()
103 xwl_output->rotation = wl_transform_to_xrandr(transform); in output_handle_geometry()
110 struct xwl_output *xwl_output = data; in output_handle_mode() local
116 if (!xwl_output->xdg_output) { in output_handle_mode()
117 xwl_output->width = width; in output_handle_mode()
118 xwl_output->height = height; in output_handle_mode()
120 xwl_output->refresh = refresh; in output_handle_mode()
124 output_get_new_size(struct xwl_output *xwl_output, in output_get_new_size() argument
130 if (!need_rotate || (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180))) { in output_get_new_size()
131 output_width = xwl_output->width; in output_get_new_size()
132 output_height = xwl_output->height; in output_get_new_size()
134 output_width = xwl_output->height; in output_get_new_size()
135 output_height = xwl_output->width; in output_get_new_size()
138 if (*width < xwl_output->x + output_width) in output_get_new_size()
139 *width = xwl_output->x + output_width; in output_get_new_size()
141 if (*height < xwl_output->y + output_height) in output_get_new_size()
142 *height = xwl_output->y + output_height; in output_get_new_size()
180 update_screen_size(struct xwl_output *xwl_output, int width, int height) in update_screen_size() argument
182 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in update_screen_size()
212 apply_output_change(struct xwl_output *xwl_output) in apply_output_change() argument
214 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in apply_output_change()
215 struct xwl_output *it; in apply_output_change()
222 xwl_output->wl_output_done = FALSE; in apply_output_change()
223 xwl_output->xdg_output_done = FALSE; in apply_output_change()
226 need_rotate = (xwl_output->xdg_output == NULL); in apply_output_change()
229 if (need_rotate || xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) { in apply_output_change()
230 mode_width = xwl_output->width; in apply_output_change()
231 mode_height = xwl_output->height; in apply_output_change()
233 mode_width = xwl_output->height; in apply_output_change()
234 mode_height = xwl_output->width; in apply_output_change()
238 xwl_output->refresh / 1000.0, 0, 0); in apply_output_change()
239 RROutputSetModes(xwl_output->randr_output, &randr_mode, 1, 1); in apply_output_change()
240 RRCrtcNotify(xwl_output->randr_crtc, randr_mode, in apply_output_change()
241 xwl_output->x, xwl_output->y, in apply_output_change()
242 xwl_output->rotation, NULL, 1, &xwl_output->randr_output); in apply_output_change()
249 if (it == xwl_output) in apply_output_change()
256 xorg_list_append(&xwl_output->link, &xwl_screen->output_list); in apply_output_change()
259 output_get_new_size(xwl_output, need_rotate, &height, &width); in apply_output_change()
264 update_screen_size(xwl_output, width, height); in apply_output_change()
270 struct xwl_output *xwl_output = data; in output_handle_done() local
272 xwl_output->wl_output_done = TRUE; in output_handle_done()
276 if (xwl_output->xdg_output_done || !xwl_output->xdg_output) in output_handle_done()
277 apply_output_change(xwl_output); in output_handle_done()
296 struct xwl_output *xwl_output = data; in xdg_output_handle_logical_position() local
298 xwl_output->x = x; in xdg_output_handle_logical_position()
299 xwl_output->y = y; in xdg_output_handle_logical_position()
306 struct xwl_output *xwl_output = data; in xdg_output_handle_logical_size() local
308 xwl_output->width = width; in xdg_output_handle_logical_size()
309 xwl_output->height = height; in xdg_output_handle_logical_size()
315 struct xwl_output *xwl_output = data; in xdg_output_handle_done() local
317 xwl_output->xdg_output_done = TRUE; in xdg_output_handle_done()
318 if (xwl_output->wl_output_done) in xdg_output_handle_done()
319 apply_output_change(xwl_output); in xdg_output_handle_done()
328 struct xwl_output *
331 struct xwl_output *xwl_output; in xwl_output_create() local
335 xwl_output = calloc(1, sizeof *xwl_output); in xwl_output_create()
336 if (xwl_output == NULL) { in xwl_output_create()
341 xwl_output->output = wl_registry_bind(xwl_screen->registry, id, in xwl_output_create()
343 if (!xwl_output->output) { in xwl_output_create()
348 xwl_output->server_output_id = id; in xwl_output_create()
349 wl_output_add_listener(xwl_output->output, &output_listener, xwl_output); in xwl_output_create()
353 xwl_output->xwl_screen = xwl_screen; in xwl_output_create()
354 xwl_output->randr_crtc = RRCrtcCreate(xwl_screen->screen, xwl_output); in xwl_output_create()
355 if (!xwl_output->randr_crtc) { in xwl_output_create()
359 RRCrtcSetRotations (xwl_output->randr_crtc, ALL_ROTATIONS); in xwl_output_create()
361 xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name, in xwl_output_create()
362 strlen(name), xwl_output); in xwl_output_create()
363 if (!xwl_output->randr_output) { in xwl_output_create()
368 RRCrtcGammaSetSize(xwl_output->randr_crtc, 256); in xwl_output_create()
369 RROutputSetCrtcs(xwl_output->randr_output, &xwl_output->randr_crtc, 1); in xwl_output_create()
370 RROutputSetConnection(xwl_output->randr_output, RR_Connected); in xwl_output_create()
375 xorg_list_append(&xwl_output->link, &xwl_screen->output_list); in xwl_output_create()
379 xwl_output_get_xdg_output(xwl_output); in xwl_output_create()
381 return xwl_output; in xwl_output_create()
384 if (xwl_output->randr_crtc) in xwl_output_create()
385 RRCrtcDestroy(xwl_output->randr_crtc); in xwl_output_create()
386 if (xwl_output->output) in xwl_output_create()
387 wl_output_destroy(xwl_output->output); in xwl_output_create()
388 free(xwl_output); in xwl_output_create()
393 xwl_output_destroy(struct xwl_output *xwl_output) in xwl_output_destroy() argument
395 wl_output_destroy(xwl_output->output); in xwl_output_destroy()
396 free(xwl_output); in xwl_output_destroy()
400 xwl_output_remove(struct xwl_output *xwl_output) in xwl_output_remove() argument
402 struct xwl_output *it; in xwl_output_remove()
403 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in xwl_output_remove()
405 Bool need_rotate = (xwl_output->xdg_output == NULL); in xwl_output_remove()
407 xorg_list_del(&xwl_output->link); in xwl_output_remove()
411 update_screen_size(xwl_output, width, height); in xwl_output_remove()
413 RRCrtcDestroy(xwl_output->randr_crtc); in xwl_output_remove()
414 RROutputDestroy(xwl_output->randr_output); in xwl_output_remove()
416 xwl_output_destroy(xwl_output); in xwl_output_remove()
452 xwl_output_get_xdg_output(struct xwl_output *xwl_output) in xwl_output_get_xdg_output() argument
454 struct xwl_screen *xwl_screen = xwl_output->xwl_screen; in xwl_output_get_xdg_output()
456 xwl_output->xdg_output = in xwl_output_get_xdg_output()
458 xwl_output->output); in xwl_output_get_xdg_output()
460 zxdg_output_v1_add_listener(xwl_output->xdg_output, in xwl_output_get_xdg_output()
462 xwl_output); in xwl_output_get_xdg_output()
468 struct xwl_output *it; in xwl_screen_init_xdg_output()