@ -40,7 +40,7 @@
# include "shared/zalloc.h"
# include "shared/zalloc.h"
# include "xdg-shell-unstable-v5-client-protocol.h"
# include "xdg-shell-unstable-v5-client-protocol.h"
# include "fullscreen-shell-unstable-v1-client-protocol.h"
# include "fullscreen-shell-unstable-v1-client-protocol.h"
# include "scal er-client-protocol.h"
# include "viewport er-client-protocol.h"
int print_debug = 0 ;
int print_debug = 0 ;
@ -49,7 +49,7 @@ struct display {
struct wl_registry * registry ;
struct wl_registry * registry ;
int compositor_version ;
int compositor_version ;
struct wl_compositor * compositor ;
struct wl_compositor * compositor ;
struct wl_scaler * scal er ;
struct wp_viewporter * viewport er ;
struct xdg_shell * shell ;
struct xdg_shell * shell ;
struct zwp_fullscreen_shell_v1 * fshell ;
struct zwp_fullscreen_shell_v1 * fshell ;
struct wl_shm * shm ;
struct wl_shm * shm ;
@ -72,7 +72,7 @@ struct window {
struct display * display ;
struct display * display ;
int width , height , border ;
int width , height , border ;
struct wl_surface * surface ;
struct wl_surface * surface ;
struct wl _viewport * viewport ;
struct wp _viewport * viewport ;
struct xdg_surface * xdg_surface ;
struct xdg_surface * xdg_surface ;
struct wl_callback * callback ;
struct wl_callback * callback ;
struct buffer buffers [ 2 ] ;
struct buffer buffers [ 2 ] ;
@ -258,8 +258,8 @@ create_window(struct display *display, int width, int height,
exit ( 1 ) ;
exit ( 1 ) ;
}
}
if ( display - > scal er = = NULL & & ( flags & WINDOW_FLAG_USE_VIEWPORT ) ) {
if ( display - > viewport er = = NULL & & ( flags & WINDOW_FLAG_USE_VIEWPORT ) ) {
fprintf ( stderr , " Compositor does not support wl _viewport " ) ;
fprintf ( stderr , " Compositor does not support wp _viewport " ) ;
exit ( 1 ) ;
exit ( 1 ) ;
}
}
@ -290,7 +290,7 @@ create_window(struct display *display, int width, int height,
window - > surface = wl_compositor_create_surface ( display - > compositor ) ;
window - > surface = wl_compositor_create_surface ( display - > compositor ) ;
if ( window - > flags & WINDOW_FLAG_USE_VIEWPORT )
if ( window - > flags & WINDOW_FLAG_USE_VIEWPORT )
window - > viewport = wl_scal er_get_viewport ( display - > scal er,
window - > viewport = wp_viewport er_get_viewport ( display - > viewport er,
window - > surface ) ;
window - > surface ) ;
if ( display - > shell ) {
if ( display - > shell ) {
@ -337,7 +337,7 @@ destroy_window(struct window *window)
if ( window - > xdg_surface )
if ( window - > xdg_surface )
xdg_surface_destroy ( window - > xdg_surface ) ;
xdg_surface_destroy ( window - > xdg_surface ) ;
if ( window - > viewport )
if ( window - > viewport )
wl _viewport_destroy ( window - > viewport ) ;
wp _viewport_destroy ( window - > viewport ) ;
wl_surface_destroy ( window - > surface ) ;
wl_surface_destroy ( window - > surface ) ;
free ( window ) ;
free ( window ) ;
}
}
@ -560,7 +560,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
off_x = ty ;
off_x = ty ;
break ;
break ;
}
}
wl _viewport_set_source ( window - > viewport ,
wp _viewport_set_source ( window - > viewport ,
wl_fixed_from_int ( window - > width / 3 ) ,
wl_fixed_from_int ( window - > width / 3 ) ,
wl_fixed_from_int ( window - > height / 5 ) ,
wl_fixed_from_int ( window - > height / 5 ) ,
wl_fixed_from_int ( window - > width / 2 ) ,
wl_fixed_from_int ( window - > width / 2 ) ,
@ -640,7 +640,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
window - > transform ) ;
window - > transform ) ;
if ( window - > viewport )
if ( window - > viewport )
wl _viewport_set_destination ( window - > viewport ,
wp _viewport_set_destination ( window - > viewport ,
window - > width ,
window - > width ,
window - > height ) ;
window - > height ) ;
@ -709,9 +709,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
wl_registry_bind ( registry ,
wl_registry_bind ( registry ,
id , & wl_compositor_interface ,
id , & wl_compositor_interface ,
d - > compositor_version ) ;
d - > compositor_version ) ;
} else if ( strcmp ( interface , " wl_scal er " ) = = 0 & & version > = 2 ) {
} else if ( strcmp ( interface , " wp_viewport er " ) = = 0 ) {
d - > scal er = wl_registry_bind ( registry ,
d - > viewport er = wl_registry_bind ( registry , id ,
id , & wl_scaler_interface , 2 ) ;
& wp_viewporter_interface , 1 ) ;
} else if ( strcmp ( interface , " xdg_shell " ) = = 0 ) {
} else if ( strcmp ( interface , " xdg_shell " ) = = 0 ) {
d - > shell = wl_registry_bind ( registry ,
d - > shell = wl_registry_bind ( registry ,
id , & xdg_shell_interface , 1 ) ;
id , & xdg_shell_interface , 1 ) ;
@ -784,8 +784,8 @@ destroy_display(struct display *display)
if ( display - > fshell )
if ( display - > fshell )
zwp_fullscreen_shell_v1_release ( display - > fshell ) ;
zwp_fullscreen_shell_v1_release ( display - > fshell ) ;
if ( display - > scal er)
if ( display - > viewport er)
wl_scal er_destroy ( display - > scal er) ;
wp_viewport er_destroy ( display - > viewport er) ;
if ( display - > compositor )
if ( display - > compositor )
wl_compositor_destroy ( display - > compositor ) ;
wl_compositor_destroy ( display - > compositor ) ;
@ -816,7 +816,7 @@ print_usage(int retval)
" --scale=SCALE \t \t Scale factor for the surface \n "
" --scale=SCALE \t \t Scale factor for the surface \n "
" --transform=TRANSFORM \t Transform for the surface \n "
" --transform=TRANSFORM \t Transform for the surface \n "
" --rotating-transform \t Use a different buffer_transform for each frame \n "
" --rotating-transform \t Use a different buffer_transform for each frame \n "
" --use-viewport \t Use wl _viewport \n "
" --use-viewport \t Use wp _viewport \n "
" --use-damage-buffer \t Use damage_buffer to post damage \n "
" --use-damage-buffer \t Use damage_buffer to post damage \n "
) ;
) ;