@ -40,7 +40,7 @@
# include "shared/zalloc.h"
# include "xdg-shell-unstable-v5-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 ;
@ -49,7 +49,7 @@ struct display {
struct wl_registry * registry ;
int compositor_version ;
struct wl_compositor * compositor ;
struct wl_scaler * scal er ;
struct wp_viewporter * viewport er ;
struct xdg_shell * shell ;
struct zwp_fullscreen_shell_v1 * fshell ;
struct wl_shm * shm ;
@ -72,7 +72,7 @@ struct window {
struct display * display ;
int width , height , border ;
struct wl_surface * surface ;
struct wl _viewport * viewport ;
struct wp _viewport * viewport ;
struct xdg_surface * xdg_surface ;
struct wl_callback * callback ;
struct buffer buffers [ 2 ] ;
@ -258,8 +258,8 @@ create_window(struct display *display, int width, int height,
exit ( 1 ) ;
}
if ( display - > scal er = = NULL & & ( flags & WINDOW_FLAG_USE_VIEWPORT ) ) {
fprintf ( stderr , " Compositor does not support wl _viewport " ) ;
if ( display - > viewport er = = NULL & & ( flags & WINDOW_FLAG_USE_VIEWPORT ) ) {
fprintf ( stderr , " Compositor does not support wp _viewport " ) ;
exit ( 1 ) ;
}
@ -290,8 +290,8 @@ create_window(struct display *display, int width, int height,
window - > surface = wl_compositor_create_surface ( display - > compositor ) ;
if ( window - > flags & WINDOW_FLAG_USE_VIEWPORT )
window - > viewport = wl_scal er_get_viewport ( display - > scal er,
window - > surface ) ;
window - > viewport = wp_viewport er_get_viewport ( display - > viewport er,
window - > surface ) ;
if ( display - > shell ) {
window - > xdg_surface =
@ -337,7 +337,7 @@ destroy_window(struct window *window)
if ( window - > xdg_surface )
xdg_surface_destroy ( window - > xdg_surface ) ;
if ( window - > viewport )
wl _viewport_destroy ( window - > viewport ) ;
wp _viewport_destroy ( window - > viewport ) ;
wl_surface_destroy ( window - > surface ) ;
free ( window ) ;
}
@ -560,7 +560,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
off_x = ty ;
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 - > height / 5 ) ,
wl_fixed_from_int ( window - > width / 2 ) ,
@ -640,7 +640,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
window - > transform ) ;
if ( window - > viewport )
wl _viewport_set_destination ( window - > viewport ,
wp _viewport_set_destination ( window - > viewport ,
window - > width ,
window - > height ) ;
@ -709,9 +709,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
wl_registry_bind ( registry ,
id , & wl_compositor_interface ,
d - > compositor_version ) ;
} else if ( strcmp ( interface , " wl_scal er " ) = = 0 & & version > = 2 ) {
d - > scal er = wl_registry_bind ( registry ,
id , & wl_scaler_interface , 2 ) ;
} else if ( strcmp ( interface , " wp_viewport er " ) = = 0 ) {
d - > viewport er = wl_registry_bind ( registry , id ,
& wp_viewporter_interface , 1 ) ;
} else if ( strcmp ( interface , " xdg_shell " ) = = 0 ) {
d - > shell = wl_registry_bind ( registry ,
id , & xdg_shell_interface , 1 ) ;
@ -784,8 +784,8 @@ destroy_display(struct display *display)
if ( display - > fshell )
zwp_fullscreen_shell_v1_release ( display - > fshell ) ;
if ( display - > scal er)
wl_scal er_destroy ( display - > scal er) ;
if ( display - > viewport er)
wp_viewport er_destroy ( display - > viewport er) ;
if ( 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 "
" --transform=TRANSFORM \t Transform for the surface \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 "
) ;