surface.h (1342B)


      1 /*
      2  * Wig --- Widgets in Guile
      3  * Copyright © 2026 Luke Willis <lukejw@monastech.xyz>
      4  *
      5  * This file is part of Wig.
      6  *
      7  * Wig is free software: you can redistribute it and/or modify it under
      8  * the terms of the GNU General Public License as published by the Free
      9  * Software Foundation, either version 3 of the License, or (at your option)
     10  * any later version.
     11  *
     12  * Wig is distributed in the hope that it will be useful, but WITHOUT
     13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
     15  * more details.
     16  *
     17  * You should have received a copy of the GNU General Public License along
     18  * with Wig. If not, see <https://www.gnu.org/licenses/>.
     19  */
     20 
     21 #ifndef WIG_SURFACE
     22 #define WIG_SURFACE
     23 
     24 #include <stdint.h>
     25 #include <wayland-client.h>
     26 
     27 struct wig_surface {
     28 	struct wl_shm *wl_shm;
     29 
     30 	int configured;
     31 	uint32_t width;
     32 	uint32_t height;
     33 	struct wl_surface *wl_surface;
     34 
     35 	int free;
     36 	uint32_t *buffer;
     37 	struct wl_buffer *wl_buffer;
     38 };
     39 
     40 int wig_surface_init(struct wig_surface *surface, struct wl_shm *wl_shm,
     41                      struct wl_compositor *wl_compositor);
     42 int wig_surface_reconfigure(struct wig_surface *surface, uint32_t width,
     43                             uint32_t height);
     44 int wig_surface_commit(struct wig_surface *surface);
     45 
     46 #endif