internal.h (2608B)
1 /* swc: swc/internal.h 2 * 3 * Copyright (c) 2013-2019 Michael Forney 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a copy 6 * of this software and associated documentation files (the "Software"), to deal 7 * in the Software without restriction, including without limitation the rights 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 * copies of the Software, and to permit persons to whom the Software is 10 * furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in 13 * all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 * SOFTWARE. 22 */ 23 24 #ifndef SWC_INTERNAL_H 25 #define SWC_INTERNAL_H 26 27 #include <stdbool.h> 28 #include <wayland-server.h> 29 30 enum { 31 SWC_EVENT_ACTIVATED, 32 SWC_EVENT_DEACTIVATED, 33 }; 34 35 /* the video backend swc was started with, chosen at run time among those 36 * that were built. a backend that supplies its own screens and target, such 37 * as nested, leaves it unset */ 38 enum swc_video { 39 SWC_VIDEO_NONE, 40 SWC_VIDEO_DRM, 41 SWC_VIDEO_FB, 42 }; 43 44 struct swc { 45 struct wl_display *display; 46 struct wl_event_loop *event_loop; 47 const struct swc_manager *manager; 48 struct wl_signal event_signal; 49 bool active; 50 51 struct swc_seat *seat; 52 const struct swc_bindings *const bindings; 53 struct wl_list screens; 54 struct swc_compositor *const compositor; 55 struct swc_shm *shm; 56 #ifdef ENABLE_DRM 57 struct swc_drm *const drm; 58 #endif 59 struct swc_backend *backend; 60 enum swc_video video; 61 struct wl_global *data_device_manager; 62 struct wl_global *kde_decoration_manager; 63 struct wl_global *layer_shell; 64 struct wl_global *panel_manager; 65 struct wl_global *shell; 66 struct wl_global *snap_manager; 67 struct wl_global *select_manager; 68 struct wl_global *subcompositor; 69 struct wl_global *xdg_decoration_manager; 70 struct wl_global *xdg_dialog_manager; 71 struct wl_global *cursor_shape_manager; 72 struct wl_global *xdg_output_manager; 73 struct wl_global *xdg_shell; 74 75 #ifdef ENABLE_XWAYLAND 76 const struct swc_xserver *const xserver; 77 #endif 78 }; 79 80 extern struct swc swc; 81 82 void 83 swc_activate(void); 84 void 85 swc_deactivate(void); 86 87 #endif