Merge branch 'example-descriptions' into 'master'

Draft: examples: add descriptions to missing files

See merge request wlroots/wlroots!4931
This commit is contained in:
Simon Ser 2025-03-10 16:25:56 +00:00
commit 9e8177926f
9 changed files with 48 additions and 19 deletions

View file

@ -1,3 +1,7 @@
/* Simple scene-graph example with a custom buffer drawn by Cairo.
*
* Input is unimplemented. Surfaces are unimplemented.
*/
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
@ -13,10 +17,6 @@
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/interfaces/wlr_buffer.h> #include <wlr/interfaces/wlr_buffer.h>
/* Simple scene-graph example with a custom buffer drawn by Cairo.
*
* Input is unimplemented. Surfaces are unimplemented. */
struct cairo_buffer { struct cairo_buffer {
struct wlr_buffer base; struct wlr_buffer base;
cairo_surface_t *surface; cairo_surface_t *surface;

View file

@ -1,3 +1,9 @@
/* Embed a minimal xdg-shell compositor backed by a scene-graph into a
* wl_subsurface displayed inside a parent Wayland compositor.
*
* Input is unimplemented.
*/
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <GLES2/gl2.h> #include <GLES2/gl2.h>

View file

@ -1,3 +1,7 @@
/*
* A minimal fullscreen-shell server. It only supports rendering.
*/
#include <getopt.h> #include <getopt.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
@ -16,10 +20,6 @@
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/util/transform.h> #include <wlr/util/transform.h>
/**
* A minimal fullscreen-shell server. It only supports rendering.
*/
struct fullscreen_server { struct fullscreen_server {
struct wl_display *wl_display; struct wl_display *wl_display;
struct wlr_backend *backend; struct wlr_backend *backend;

View file

@ -1,3 +1,11 @@
/* Simple compositor making use of the output layers API. The compositor will
* attempt to display client surfaces with output layers. Input is
* unimplemented.
*
* New surfaces are stacked on top of the existing ones as they appear.
* Surfaces that don't make it into an output layer are rendered as usual.
*/
#include <getopt.h> #include <getopt.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
@ -16,13 +24,6 @@
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
/* Simple compositor making use of the output layers API. The compositor will
* attempt to display client surfaces with output layers. Input is
* unimplemented.
*
* New surfaces are stacked on top of the existing ones as they appear.
* Surfaces that don't make it into an output layer are rendered as usual. */
struct server { struct server {
struct wl_display *wl_display; struct wl_display *wl_display;
struct wlr_backend *backend; struct wlr_backend *backend;

View file

@ -1,3 +1,8 @@
/* Bounces a cat picture inside an output layout.
*
* Arrow keys nudge the cat in a direction.
*/
#include <drm_fourcc.h> #include <drm_fourcc.h>
#include <limits.h> #include <limits.h>
#include <math.h> #include <math.h>

View file

@ -1,3 +1,10 @@
/* Paints a cursor and moves it based on pointer, touch and tablet events.
*
* Left, middle and right pointer buttons change the background color to blue,
* green and red respectively. Axis pointer events change the brightness of the
* background color.
*/
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>

View file

@ -1,3 +1,10 @@
/* Scrolls across a mosaic of cats.
*
* Arrow keys change the scroll direction.
*
* The -r CLI option sets the output transform.
*/
#include <drm_fourcc.h> #include <drm_fourcc.h>
#include <getopt.h> #include <getopt.h>
#include <math.h> #include <math.h>

View file

@ -1,3 +1,8 @@
/* Simple compositor making use of the scene-graph API. Input is unimplemented.
*
* New surfaces are stacked on top of the existing ones as they appear.
*/
#include <assert.h> #include <assert.h>
#include <getopt.h> #include <getopt.h>
#include <stdbool.h> #include <stdbool.h>
@ -15,10 +20,6 @@
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
/* Simple compositor making use of the scene-graph API. Input is unimplemented.
*
* New surfaces are stacked on top of the existing ones as they appear. */
static const int border_width = 3; static const int border_width = 3;
struct server { struct server {

View file

@ -1,3 +1,5 @@
/* Animates the background color. */
#include <inttypes.h> #include <inttypes.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>