├── libweston ├── git-version.h.meson ├── backend-headless │ └── meson.build ├── linux-sync-file-uapi.h ├── backend-fbdev │ └── meson.build ├── renderer-gl │ └── meson.build ├── backend-wayland │ └── meson.build ├── linux-sync-file.h ├── backend-drm │ ├── vaapi-recorder.h │ ├── meson.build │ └── libbacklight.h ├── backend-x11 │ └── meson.build ├── linux-explicit-synchronization.h ├── weston-launch.h ├── vertex-clipping.h ├── launcher-util.h ├── pixman-renderer.h ├── launcher-impl.h ├── backend-rdp │ ├── hash.h │ └── meson.build ├── spring-tool.c ├── libinput-seat.h ├── linux-sync-file.c └── libinput-device.h ├── data ├── home.png ├── panel.png ├── border.png ├── pattern.png ├── random.png ├── terminal.png ├── tiling.png ├── wayland.png ├── background.png ├── fullscreen.png ├── sidebyside.png ├── sign_close.png ├── icon_editor.png ├── icon_flower.png ├── icon_terminal.png ├── icon_window.png ├── sign_maximize.png ├── sign_minimize.png ├── icon_ivi_flower.png ├── icon_ivi_smoke.png ├── icon_ivi_clickdot.png ├── icon_ivi_simple-egl.png ├── icon_ivi_simple-shm.png ├── meson.build └── COPYING ├── tests ├── internal-screenshot.ini ├── reference │ ├── basic-test-card.png │ ├── subsurface_z_order-00.png │ ├── subsurface_z_order-01.png │ ├── subsurface_z_order-02.png │ ├── subsurface_z_order-03.png │ ├── subsurface_z_order-04.png │ ├── internal-screenshot-bad-00.png │ ├── internal-screenshot-good-00.png │ ├── output_1-180_buffer_2-90-00.png │ ├── output_1-270_buffer_2-90-00.png │ ├── output_1-90_buffer_2-90-00.png │ ├── output_2-180_buffer_2-90-00.png │ ├── output_2-90_buffer_1-180-00.png │ ├── output_2-90_buffer_1-270-00.png │ ├── output_2-90_buffer_1-90-00.png │ ├── output_2-90_buffer_2-180-00.png │ ├── output_2-90_buffer_2-90-00.png │ ├── viewport_upscale_solid-00.png │ ├── output_1-180_buffer_1-NORMAL-00.png │ ├── output_1-270_buffer_1-NORMAL-00.png │ ├── output_1-90_buffer_1-NORMAL-00.png │ ├── output_1-FLIPPED_buffer_2-90-00.png │ ├── output_1-NORMAL_buffer_1-180-00.png │ ├── output_1-NORMAL_buffer_1-270-00.png │ ├── output_1-NORMAL_buffer_1-90-00.png │ ├── output_1-NORMAL_buffer_2-180-00.png │ ├── output_1-NORMAL_buffer_2-90-00.png │ ├── output_2-180_buffer_1-NORMAL-00.png │ ├── output_2-90_buffer_1-FLIPPED-00.png │ ├── output_2-90_buffer_1-NORMAL-00.png │ ├── output_2-90_buffer_2-FLIPPED-00.png │ ├── output_2-90_buffer_2-NORMAL-00.png │ ├── output_2-90_buffer_3-NORMAL-00.png │ ├── output_2-FLIPPED_buffer_2-90-00.png │ ├── output_2-NORMAL_buffer_2-90-00.png │ ├── output_3-NORMAL_buffer_2-90-00.png │ ├── output_1-FLIPPED_90_buffer_2-90-00.png │ ├── output_1-NORMAL_buffer_1-NORMAL-00.png │ ├── output_1-NORMAL_buffer_2-NORMAL-00.png │ ├── output_1-NORMAL_buffer_3-NORMAL-00.png │ ├── output_2-90_buffer_1-FLIPPED_90-00.png │ ├── output_2-90_buffer_3-FLIPPED_90-00.png │ ├── output_2-NORMAL_buffer_1-NORMAL-00.png │ ├── output_3-NORMAL_buffer_1-NORMAL-00.png │ ├── output_1-FLIPPED_180_buffer_2-90-00.png │ ├── output_1-FLIPPED_270_buffer_2-90-00.png │ ├── output_1-FLIPPED_buffer_1-NORMAL-00.png │ ├── output_1-NORMAL_buffer_1-FLIPPED-00.png │ ├── output_1-NORMAL_buffer_2-FLIPPED-00.png │ ├── output_2-90_buffer_1-FLIPPED_180-00.png │ ├── output_2-90_buffer_1-FLIPPED_270-00.png │ ├── output_2-FLIPPED_buffer_1-NORMAL-00.png │ ├── output_3-FLIPPED_270_buffer_2-90-00.png │ ├── output_1-FLIPPED_180_buffer_1-NORMAL-00.png │ ├── output_1-FLIPPED_270_buffer_1-NORMAL-00.png │ ├── output_1-FLIPPED_90_buffer_1-NORMAL-00.png │ ├── output_1-NORMAL_buffer_1-FLIPPED_180-00.png │ ├── output_1-NORMAL_buffer_1-FLIPPED_270-00.png │ ├── output_1-NORMAL_buffer_1-FLIPPED_90-00.png │ ├── output_1-NORMAL_buffer_3-FLIPPED_90-00.png │ └── output_3-FLIPPED_270_buffer_1-NORMAL-00.png ├── ivi-test.h ├── input-timestamps-helper.h ├── drm-smoke-test.c ├── surface-test.c ├── string-test.c ├── weston-testsuite-data.h └── ivi-shell-app-test.c ├── doc ├── wayland-screenshot.jpg ├── sphinx │ ├── run_doxygen_sphinx.sh.in │ ├── toc │ │ ├── libweston │ │ │ ├── images │ │ │ │ ├── create_output.png │ │ │ │ ├── initial-heads.png │ │ │ │ ├── destroy-output.png │ │ │ │ ├── head-destroyed.png │ │ │ │ ├── react-to-heads-changed.png │ │ │ │ ├── meson.build │ │ │ │ ├── react-to-heads-changed.msc │ │ │ │ ├── head-destroyed.msc │ │ │ │ ├── destroy-output.msc │ │ │ │ ├── initial-heads.msc │ │ │ │ └── create_output.msc │ │ │ ├── meson.build │ │ │ ├── compositor.rst │ │ │ ├── output.rst │ │ │ └── head.rst │ │ ├── test-suite-api.rst │ │ ├── meson.build │ │ ├── kiosk-shell.rst │ │ └── libweston.rst │ └── index.rst ├── doxygen │ ├── tools.doxygen.in │ ├── tooldev.doxygen.in │ ├── tools.dox │ ├── devtools.dox │ └── tools_arch_old.gv └── scripts │ └── remoting-client-receive.bash ├── compositor ├── weston.desktop ├── executable.c ├── rdpdisp.h ├── testsuite-util.c └── wslgd-notify.c ├── .gitignore ├── include ├── meson.build └── libweston │ ├── meson.build │ ├── zalloc.h │ ├── backend-x11.h │ ├── backend-wayland.h │ ├── backend-headless.h │ ├── plugin-registry.h │ ├── version.h.in │ ├── backend-fbdev.h │ └── matrix.h ├── .editorconfig ├── protocol ├── text-cursor-position.xml ├── weston-screenshooter.xml ├── weston-rdprail-shell.xml └── meson.build ├── fullscreen-shell └── meson.build ├── wcap ├── meson.build └── wcap-decode.h ├── kiosk-shell ├── meson.build ├── kiosk-shell-grab.h └── util.h ├── desktop-shell └── meson.build ├── .gitlab-ci └── virtme-scripts │ └── run-weston-tests.sh ├── pipewire ├── meson.build └── pipewire-plugin.h ├── libweston-desktop └── meson.build ├── xwayland ├── meson.build └── hash.h ├── remoting ├── README ├── meson.build └── remoting-plugin.h ├── shared ├── image-loader.h ├── file-util.h ├── fd-util.h ├── xalloc.h ├── meson.build ├── os-compatibility.h └── string-helpers.h ├── COPYING ├── DCO-1.1.txt ├── tools └── zunitc │ └── src │ ├── zuc_base_logger.h │ ├── zuc_junit_reporter.h │ ├── zuc_context.h │ ├── main.c │ ├── zuc_types.h │ ├── zuc_collector.h │ └── zuc_event.h ├── man ├── meson.build └── weston-debug.man ├── rdprail-shell └── meson.build ├── ivi-shell ├── meson.build ├── ivi-shell.h ├── weston.ini.in └── ivi-layout-shell.h ├── weston.ini.in └── SECURITY.md /libweston/git-version.h.meson: -------------------------------------------------------------------------------- 1 | #define BUILD_ID "@VCS_TAG@" 2 | -------------------------------------------------------------------------------- /data/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/home.png -------------------------------------------------------------------------------- /data/panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/panel.png -------------------------------------------------------------------------------- /data/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/border.png -------------------------------------------------------------------------------- /data/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/pattern.png -------------------------------------------------------------------------------- /data/random.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/random.png -------------------------------------------------------------------------------- /data/terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/terminal.png -------------------------------------------------------------------------------- /data/tiling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/tiling.png -------------------------------------------------------------------------------- /data/wayland.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/wayland.png -------------------------------------------------------------------------------- /data/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/background.png -------------------------------------------------------------------------------- /data/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/fullscreen.png -------------------------------------------------------------------------------- /data/sidebyside.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/sidebyside.png -------------------------------------------------------------------------------- /data/sign_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/sign_close.png -------------------------------------------------------------------------------- /data/icon_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_editor.png -------------------------------------------------------------------------------- /data/icon_flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_flower.png -------------------------------------------------------------------------------- /data/icon_terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_terminal.png -------------------------------------------------------------------------------- /data/icon_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_window.png -------------------------------------------------------------------------------- /data/sign_maximize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/sign_maximize.png -------------------------------------------------------------------------------- /data/sign_minimize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/sign_minimize.png -------------------------------------------------------------------------------- /tests/internal-screenshot.ini: -------------------------------------------------------------------------------- 1 | [shell] 2 | startup-animation=none 3 | background-color=0xCC336699 4 | -------------------------------------------------------------------------------- /data/icon_ivi_flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_ivi_flower.png -------------------------------------------------------------------------------- /data/icon_ivi_smoke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_ivi_smoke.png -------------------------------------------------------------------------------- /data/icon_ivi_clickdot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_ivi_clickdot.png -------------------------------------------------------------------------------- /doc/wayland-screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/doc/wayland-screenshot.jpg -------------------------------------------------------------------------------- /data/icon_ivi_simple-egl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_ivi_simple-egl.png -------------------------------------------------------------------------------- /data/icon_ivi_simple-shm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/data/icon_ivi_simple-shm.png -------------------------------------------------------------------------------- /doc/sphinx/run_doxygen_sphinx.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | @DOXYGEN_CMD@ @DOXYGEN_CONF@ && @SPHINX_CMD@ -E -W -q -j auto @SRCDIR@ @OUTDIR@ 3 | -------------------------------------------------------------------------------- /tests/reference/basic-test-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/basic-test-card.png -------------------------------------------------------------------------------- /compositor/weston.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Weston 3 | Comment=The reference Wayland server 4 | Exec=weston 5 | Type=Application 6 | -------------------------------------------------------------------------------- /tests/reference/subsurface_z_order-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/subsurface_z_order-00.png -------------------------------------------------------------------------------- /tests/reference/subsurface_z_order-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/subsurface_z_order-01.png -------------------------------------------------------------------------------- /tests/reference/subsurface_z_order-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/subsurface_z_order-02.png -------------------------------------------------------------------------------- /tests/reference/subsurface_z_order-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/subsurface_z_order-03.png -------------------------------------------------------------------------------- /tests/reference/subsurface_z_order-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/subsurface_z_order-04.png -------------------------------------------------------------------------------- /tests/reference/internal-screenshot-bad-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/internal-screenshot-bad-00.png -------------------------------------------------------------------------------- /tests/reference/internal-screenshot-good-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/internal-screenshot-good-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-180_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-180_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-270_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-270_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-90_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-90_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-180_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-180_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-180-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-180-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-270-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-270-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_2-180-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_2-180-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/viewport_upscale_solid-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/viewport_upscale_solid-00.png -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/create_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/doc/sphinx/toc/libweston/images/create_output.png -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/initial-heads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/doc/sphinx/toc/libweston/images/initial-heads.png -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/destroy-output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/doc/sphinx/toc/libweston/images/destroy-output.png -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/head-destroyed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/doc/sphinx/toc/libweston/images/head-destroyed.png -------------------------------------------------------------------------------- /tests/reference/output_1-180_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-180_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-270_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-270_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-90_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-90_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-180-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-180-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-270-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-270-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_2-180-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_2-180-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-180_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-180_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-FLIPPED-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-FLIPPED-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_2-FLIPPED-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_2-FLIPPED-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_2-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_2-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_3-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_3-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-FLIPPED_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-FLIPPED_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-NORMAL_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-NORMAL_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_3-NORMAL_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_3-NORMAL_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_90_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_90_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_2-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_2-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_3-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_3-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-FLIPPED_90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-FLIPPED_90-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_3-FLIPPED_90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_3-FLIPPED_90-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-NORMAL_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-NORMAL_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_3-NORMAL_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_3-NORMAL_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .*.sw? 3 | .sw? 4 | *.sublime-project 5 | *.sublime-workspace 6 | *~ 7 | ctags 8 | cscope.out 9 | TAGS 10 | 11 | 00*.patch 12 | build/* 13 | -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_180_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_180_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_270_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_270_buffer_2-90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-FLIPPED-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-FLIPPED-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_2-FLIPPED-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_2-FLIPPED-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-FLIPPED_180-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-FLIPPED_180-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-90_buffer_1-FLIPPED_270-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-90_buffer_1-FLIPPED_270-00.png -------------------------------------------------------------------------------- /tests/reference/output_2-FLIPPED_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_2-FLIPPED_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_3-FLIPPED_270_buffer_2-90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_3-FLIPPED_270_buffer_2-90-00.png -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/react-to-heads-changed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/doc/sphinx/toc/libweston/images/react-to-heads-changed.png -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_180_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_180_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_270_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_270_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-FLIPPED_90_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-FLIPPED_90_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-FLIPPED_180-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-FLIPPED_180-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-FLIPPED_270-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-FLIPPED_270-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_1-FLIPPED_90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_1-FLIPPED_90-00.png -------------------------------------------------------------------------------- /tests/reference/output_1-NORMAL_buffer_3-FLIPPED_90-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_1-NORMAL_buffer_3-FLIPPED_90-00.png -------------------------------------------------------------------------------- /tests/reference/output_3-FLIPPED_270_buffer_1-NORMAL-00.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/weston-mirror/HEAD/tests/reference/output_3-FLIPPED_270_buffer_1-NORMAL-00.png -------------------------------------------------------------------------------- /include/meson.build: -------------------------------------------------------------------------------- 1 | subdir('libweston') 2 | 3 | install_headers( 4 | 'libweston-desktop/libweston-desktop.h', 5 | subdir: join_paths(dir_include_libweston, 'libweston-desktop') 6 | ) 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = tab 9 | indent_size = 8 10 | max_line_length = 80 11 | 12 | [*.xml] 13 | indent_style = space 14 | indent_size = 2 15 | tab_width = 8 16 | -------------------------------------------------------------------------------- /doc/sphinx/toc/test-suite-api.rst: -------------------------------------------------------------------------------- 1 | Reference manual 2 | ================ 3 | 4 | 5 | Test harness API 6 | ---------------- 7 | 8 | .. doxygengroup:: testharness 9 | :content-only: 10 | 11 | Test harness Internals 12 | ---------------------- 13 | 14 | .. doxygengroup:: testharness_private 15 | :content-only: 16 | -------------------------------------------------------------------------------- /doc/sphinx/toc/meson.build: -------------------------------------------------------------------------------- 1 | # you need to add here any files you add to the toc directory as well 2 | files = [ 3 | 'kiosk-shell.rst', 4 | 'libweston.rst', 5 | 'test-suite.rst', 6 | 'test-suite-api.rst', 7 | ] 8 | 9 | foreach file : files 10 | configure_file(input: file, output: file, copy: true) 11 | endforeach 12 | 13 | subdir('libweston') 14 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/meson.build: -------------------------------------------------------------------------------- 1 | # you need to add here any files you add to the toc directory as well 2 | files = [ 3 | 'compositor.rst', 4 | 'head.rst', 5 | 'log.rst', 6 | 'output.rst', 7 | 'output-management.rst', 8 | ] 9 | 10 | foreach file : files 11 | configure_file(input: file, output: file, copy: true) 12 | endforeach 13 | 14 | subdir('images') 15 | -------------------------------------------------------------------------------- /protocol/text-cursor-position.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /protocol/weston-screenshooter.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/meson.build: -------------------------------------------------------------------------------- 1 | # Sphinx does not know look for these files in the source directory, so 2 | # they must be copied to the build directory. 3 | files = [ 4 | 'create_output.png', 5 | 'destroy-output.png', 6 | 'head-destroyed.png', 7 | 'initial-heads.png', 8 | 'react-to-heads-changed.png', 9 | ] 10 | 11 | foreach file : files 12 | configure_file(input: file, output: file, copy: true) 13 | endforeach 14 | -------------------------------------------------------------------------------- /fullscreen-shell/meson.build: -------------------------------------------------------------------------------- 1 | if get_option('shell-fullscreen') 2 | srcs_shell_fullscreen = [ 3 | 'fullscreen-shell.c', 4 | fullscreen_shell_unstable_v1_server_protocol_h, 5 | fullscreen_shell_unstable_v1_protocol_c, 6 | ] 7 | shared_library( 8 | 'fullscreen-shell', 9 | srcs_shell_fullscreen, 10 | include_directories: common_inc, 11 | dependencies: dep_libweston_public, 12 | name_prefix: '', 13 | install: true, 14 | install_dir: dir_module_weston 15 | ) 16 | endif 17 | -------------------------------------------------------------------------------- /doc/doxygen/tools.doxygen.in: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = "Tools" 2 | OUTPUT_DIRECTORY = @top_builddir@/docs/tools 3 | JAVADOC_AUTOBRIEF = YES 4 | OPTIMIZE_OUTPUT_FOR_C = YES 5 | INPUT = \ 6 | @top_srcdir@/doc/doxygen/tools.dox \ 7 | @top_srcdir@/tools/zunitc/doc/zunitc.dox \ 8 | @top_srcdir@/tools/zunitc/inc/zunitc/zunitc.h 9 | GENERATE_LATEX = NO 10 | DOTFILE_DIRS = @top_srcdir@/doc/doxygen 11 | STRIP_FROM_PATH = @top_srcdir@ 12 | -------------------------------------------------------------------------------- /doc/doxygen/tooldev.doxygen.in: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = "Tool Internals" 2 | OUTPUT_DIRECTORY = @top_builddir@/docs/developer 3 | JAVADOC_AUTOBRIEF = YES 4 | OPTIMIZE_OUTPUT_FOR_C = YES 5 | EXTRACT_ALL = YES 6 | INPUT = \ 7 | @top_srcdir@/doc/doxygen/devtools.dox \ 8 | @top_srcdir@/tools/zunitc 9 | RECURSIVE = YES 10 | GENERATE_LATEX = NO 11 | DOTFILE_DIRS = @top_srcdir@/doc/doxygen 12 | STRIP_FROM_PATH = @top_srcdir@ 13 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/compositor.rst: -------------------------------------------------------------------------------- 1 | Compositor 2 | ========== 3 | 4 | :type:`weston_compositor` represents the core object of the library, which 5 | aggregates all the other objects and maintains their state. You can create it 6 | using :func:`weston_compositor_create`, while for releasing all the resources 7 | associated with it and then destroy it, you should use 8 | :func:`weston_compositor_destroy`. 9 | 10 | Compositor API 11 | -------------- 12 | 13 | .. doxygengroup:: compositor 14 | :content-only: 15 | -------------------------------------------------------------------------------- /wcap/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('wcap-decode') 2 | subdir_done() 3 | endif 4 | 5 | srcs_wcap = [ 6 | 'main.c', 7 | 'wcap-decode.c', 8 | ] 9 | 10 | wcap_dep_cairo = dependency('cairo', required: false) 11 | if not wcap_dep_cairo.found() 12 | error('wcap requires cairo which was not found. Or, you can use \'-Dwcap-decode=false\'.') 13 | endif 14 | 15 | executable( 16 | 'wcap-decode', 17 | srcs_wcap, 18 | include_directories: common_inc, 19 | dependencies: [ dep_libm, wcap_dep_cairo ], 20 | install: true 21 | ) 22 | -------------------------------------------------------------------------------- /doc/sphinx/toc/kiosk-shell.rst: -------------------------------------------------------------------------------- 1 | Weston kiosk-shell 2 | ================== 3 | 4 | Weston's kiosk-shell is a simple shell targeted at single-app/kiosk use cases. 5 | It makes all top-level application windows fullscreen, and supports defining 6 | which applications to place on particular outputs. This is achieved with the 7 | ``app-ids=`` field in the corresponding output section in weston.ini. For 8 | example: 9 | 10 | .. code-block:: ini 11 | 12 | [output] 13 | name=screen0 14 | app-ids=org.domain.app1,com.domain.app2 15 | 16 | To run weston with kiosk-shell set ``shell=kiosk-shell.so`` in weston.ini, or 17 | use the ``--shell=kiosk-shell.so`` command-line option. 18 | -------------------------------------------------------------------------------- /libweston/backend-headless/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('backend-headless') 2 | subdir_done() 3 | endif 4 | 5 | config_h.set('BUILD_HEADLESS_COMPOSITOR', '1') 6 | 7 | srcs_headless = [ 8 | 'headless.c', 9 | presentation_time_server_protocol_h, 10 | ] 11 | plugin_headless = shared_library( 12 | 'headless-backend', 13 | srcs_headless, 14 | include_directories: common_inc, 15 | dependencies: [ dep_libweston_private, dep_libdrm_headers ], 16 | name_prefix: '', 17 | install: true, 18 | install_dir: dir_module_libweston, 19 | ) 20 | env_modmap += 'headless-backend.so=@0@;'.format(plugin_headless.full_path()) 21 | install_headers(backend_headless_h, subdir: dir_include_libweston_install) 22 | -------------------------------------------------------------------------------- /data/meson.build: -------------------------------------------------------------------------------- 1 | install_data( 2 | [ 3 | 'background.png', 4 | 'border.png', 5 | 'fullscreen.png', 6 | 'home.png', 7 | 'icon_editor.png', 8 | 'icon_flower.png', 9 | 'icon_ivi_clickdot.png', 10 | 'icon_ivi_flower.png', 11 | 'icon_ivi_simple-egl.png', 12 | 'icon_ivi_simple-shm.png', 13 | 'icon_ivi_smoke.png', 14 | 'icon_terminal.png', 15 | 'icon_window.png', 16 | 'panel.png', 17 | 'pattern.png', 18 | 'random.png', 19 | 'sidebyside.png', 20 | 'sign_close.png', 21 | 'sign_maximize.png', 22 | 'sign_minimize.png', 23 | 'terminal.png', 24 | 'tiling.png', 25 | 'wayland.png', 26 | 'wayland.svg', 27 | ], 28 | install_dir: join_paths(dir_data, 'weston') 29 | ) 30 | -------------------------------------------------------------------------------- /libweston/linux-sync-file-uapi.h: -------------------------------------------------------------------------------- 1 | /* Sync file Linux kernel UAPI */ 2 | 3 | #ifndef WESTON_LINUX_SYNC_FILE_UAPI_H 4 | #define WESTON_LINUX_SYNC_FILE_UAPI_H 5 | 6 | #include 7 | #include 8 | 9 | struct sync_fence_info { 10 | char obj_name[32]; 11 | char driver_name[32]; 12 | __s32 status; 13 | __u32 flags; 14 | __u64 timestamp_ns; 15 | }; 16 | 17 | struct sync_file_info { 18 | char name[32]; 19 | __s32 status; 20 | __u32 flags; 21 | __u32 num_fences; 22 | __u32 pad; 23 | 24 | __u64 sync_fence_info; 25 | }; 26 | 27 | #define SYNC_IOC_MAGIC '>' 28 | #define SYNC_IOC_FILE_INFO _IOWR(SYNC_IOC_MAGIC, 4, struct sync_file_info) 29 | 30 | #endif /* WESTON_LINUX_SYNC_FILE_UAPI_H */ 31 | -------------------------------------------------------------------------------- /libweston/backend-fbdev/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('backend-fbdev') 2 | subdir_done() 3 | endif 4 | 5 | config_h.set('BUILD_FBDEV_COMPOSITOR', '1') 6 | 7 | srcs_fbdev = [ 8 | 'fbdev.c', 9 | presentation_time_server_protocol_h, 10 | ] 11 | 12 | deps_fbdev = [ 13 | dep_libweston_private, 14 | dep_session_helper, 15 | dep_libinput_backend, 16 | dependency('libudev', version: '>= 136'), 17 | ] 18 | 19 | plugin_fbdev = shared_library( 20 | 'fbdev-backend', 21 | srcs_fbdev, 22 | include_directories: common_inc, 23 | dependencies: deps_fbdev, 24 | name_prefix: '', 25 | install: true, 26 | install_dir: dir_module_libweston 27 | ) 28 | env_modmap += 'fbdev-backend.so=@0@;'.format(plugin_fbdev.full_path()) 29 | 30 | install_headers(backend_fbdev_h, subdir: dir_include_libweston_install) 31 | -------------------------------------------------------------------------------- /kiosk-shell/meson.build: -------------------------------------------------------------------------------- 1 | if get_option('shell-kiosk') 2 | srcs_shell_kiosk = [ 3 | 'kiosk-shell.c', 4 | 'kiosk-shell-grab.c', 5 | 'util.c', 6 | weston_desktop_shell_server_protocol_h, 7 | weston_desktop_shell_protocol_c, 8 | input_method_unstable_v1_server_protocol_h, 9 | input_method_unstable_v1_protocol_c, 10 | ] 11 | deps_shell_kiosk = [ 12 | dep_libm, 13 | dep_libexec_weston, 14 | dep_libshared, 15 | dep_lib_desktop, 16 | dep_libweston_public, 17 | ] 18 | plugin_shell_kiosk = shared_library( 19 | 'kiosk-shell', 20 | srcs_shell_kiosk, 21 | include_directories: common_inc, 22 | dependencies: deps_shell_kiosk, 23 | name_prefix: '', 24 | install: true, 25 | install_dir: dir_module_weston, 26 | install_rpath: '$ORIGIN' 27 | ) 28 | env_modmap += 'kiosk-shell.so=@0@;'.format(plugin_shell_kiosk.full_path()) 29 | endif 30 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/react-to-heads-changed.msc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/mscgen -Tpng 2 | 3 | msc { 4 | hscale="1.5"; 5 | 6 | c [label = "compositor"], w [label = "libweston core"], 7 | b [label = "backend"]; 8 | 9 | |||; 10 | 11 | --- [label = "Compositor reacts to heads_changed"]; 12 | 13 | c <<= w [label = "heads_changed callback"]; 14 | c box c [label = "Iterate with weston_compositor_iterate_heads(), for each head"]; 15 | c => w [label = "weston_head_is_connected()"]; 16 | c << w [label = "bool"]; 17 | c => w [label = "weston_head_is_enabled()"]; 18 | c << w [label = "bool"]; 19 | c => w [label = "weston_head_is_device_changed()"]; 20 | c << w [label = "bool"]; 21 | c abox c [label = "If the head needs enabling, create an output."]; 22 | c abox c [label = "If the head needs disabling, disable the output or destroy the output."]; 23 | c >> w; 24 | } 25 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/head-destroyed.msc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/mscgen -Tpng 2 | 3 | msc { 4 | hscale="1.5"; 5 | 6 | c [label = "compositor"], w [label = "libweston core"], 7 | b [label = "backend"]; 8 | 9 | |||; 10 | 11 | --- [label = "Head is destroyed for an enabled output"]; 12 | 13 | b box b [label = "A head disappears, e.g. MST connector is removed, not just disconnected"]; 14 | 15 | w <= b [label = "weston_head_release()"]; 16 | c x- w [label = "head->destroy_signal"]; 17 | w => w [label = "weston_head_detach()"]; 18 | w :> b [label = "weston_output::detach_head()"]; 19 | w note w [label = "No heads left in the output."]; 20 | w => w [label = "weston_output_disable()"]; 21 | w :> b [label = "weston_output::disable()"]; 22 | w >> b [label = "release return"]; 23 | b box b [label = "free(head)"]; 24 | 25 | --- [label = "The output is left disabled."]; 26 | } 27 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/destroy-output.msc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/mscgen -Tpng 2 | 3 | msc { 4 | hscale="1.5"; 5 | 6 | c [label = "compositor"], w [label = "libweston core"], 7 | b [label = "backend"]; 8 | 9 | |||; 10 | 11 | --- [label = "Compositor destroys an output for a head"]; 12 | 13 | c box c [label = "A head is found disconnected, is being destroyed, or something else needs it disabled."]; 14 | 15 | c => w [label = "weston_head_get_output()"]; 16 | c << w [label = "weston_output"]; 17 | 18 | c box c [label = "decide the output needs to be destroyed"]; 19 | 20 | c => w [label = "weston_output_destroy()"]; 21 | w => b [label = "weston_output::destroy()"]; 22 | w <= b [label = "weston_output_release()"]; 23 | w <= w [label = "weston_head_detach()"]; 24 | w :> b [label = "weston_output::detach_head()"]; 25 | w >> b [label = "release return"]; 26 | b box b [label = "free(output)"]; 27 | w << b; 28 | c << w; 29 | } 30 | -------------------------------------------------------------------------------- /desktop-shell/meson.build: -------------------------------------------------------------------------------- 1 | if get_option('shell-desktop') 2 | config_h.set_quoted('WESTON_SHELL_CLIENT', get_option('desktop-shell-client-default')) 3 | 4 | srcs_shell_desktop = [ 5 | 'shell.c', 6 | 'exposay.c', 7 | 'input-panel.c', 8 | weston_desktop_shell_server_protocol_h, 9 | weston_desktop_shell_protocol_c, 10 | input_method_unstable_v1_server_protocol_h, 11 | input_method_unstable_v1_protocol_c, 12 | ] 13 | deps_shell_desktop = [ 14 | dep_libm, 15 | dep_libexec_weston, 16 | dep_libshared, 17 | dep_lib_desktop, 18 | dep_libweston_public, 19 | ] 20 | plugin_shell_desktop = shared_library( 21 | 'desktop-shell', 22 | srcs_shell_desktop, 23 | include_directories: common_inc, 24 | dependencies: deps_shell_desktop, 25 | name_prefix: '', 26 | install: true, 27 | install_dir: dir_module_weston, 28 | install_rpath: '$ORIGIN' 29 | ) 30 | env_modmap += 'desktop-shell.so=@0@;'.format(plugin_shell_desktop.full_path()) 31 | endif 32 | -------------------------------------------------------------------------------- /libweston/renderer-gl/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('renderer-gl') 2 | subdir_done() 3 | endif 4 | 5 | config_h.set('ENABLE_EGL', '1') 6 | 7 | srcs_renderer_gl = [ 8 | 'egl-glue.c', 9 | 'gl-renderer.c', 10 | linux_dmabuf_unstable_v1_protocol_c, 11 | linux_dmabuf_unstable_v1_server_protocol_h, 12 | ] 13 | 14 | deps_renderer_gl = [ 15 | dep_libm, 16 | dep_pixman, 17 | dep_libweston_private, 18 | dep_libdrm_headers, 19 | dep_vertex_clipping 20 | ] 21 | 22 | foreach name : [ 'egl', 'glesv2' ] 23 | d = dependency(name, required: false) 24 | if not d.found() 25 | error('gl-renderer requires @0@ which was not found. Or, you can use \'-Drenderer-gl=false\'.'.format(name)) 26 | endif 27 | deps_renderer_gl += d 28 | endforeach 29 | 30 | plugin_gl = shared_library( 31 | 'gl-renderer', 32 | srcs_renderer_gl, 33 | include_directories: common_inc, 34 | dependencies: deps_renderer_gl, 35 | name_prefix: '', 36 | install: true, 37 | install_dir: dir_module_libweston 38 | ) 39 | env_modmap += 'gl-renderer.so=@0@;'.format(plugin_gl.full_path()) 40 | -------------------------------------------------------------------------------- /.gitlab-ci/virtme-scripts/run-weston-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # folders that are necessary to run Weston tests 4 | mkdir -p /tmp/tests 5 | mkdir -p /tmp/.X11-unix 6 | chmod -R 0700 /tmp 7 | 8 | # set environment variables to run Weston tests 9 | export XDG_RUNTIME_DIR=/tmp/tests 10 | export WESTON_TEST_SUITE_DRM_DEVICE=card0 11 | 12 | # ninja test depends on meson, and meson itself looks for its modules on folder 13 | # $HOME/.local/lib/pythonX.Y/site-packages (the Python version may differ). 14 | # virtme starts with HOME=/tmp/roothome, but as we installed meson on user root, 15 | # meson can not find its modules. So we change the HOME env var to fix that. 16 | export HOME=/root 17 | 18 | # run the tests and save the exit status 19 | ninja test 20 | TEST_RES=$? 21 | 22 | # create a file to keep the result of this script: 23 | # - 0 means the script succeeded 24 | # - 1 means the tests failed, so the job itself should fail 25 | TESTS_RES_PATH=$(pwd)/tests-res.txt 26 | echo $TEST_RES > $TESTS_RES_PATH 27 | 28 | # shutdown virtme 29 | sync 30 | poweroff -f 31 | -------------------------------------------------------------------------------- /pipewire/meson.build: -------------------------------------------------------------------------------- 1 | if get_option('pipewire') 2 | user_hint = 'If you rather not build this, set "pipewire=false".' 3 | 4 | if not get_option('backend-drm') 5 | error('Attempting to build the pipewire plugin without the required DRM backend. ' + user_hint) 6 | endif 7 | 8 | depnames = [ 9 | 'libpipewire-0.2', 'libspa-0.1' 10 | ] 11 | deps_pipewire = [ dep_libweston_private ] 12 | foreach depname : depnames 13 | dep = dependency(depname, required: false) 14 | if not dep.found() 15 | error('Pipewire plugin requires @0@ which was not found. '.format(depname) + user_hint) 16 | endif 17 | deps_pipewire += dep 18 | endforeach 19 | 20 | plugin_pipewire = shared_library( 21 | 'pipewire-plugin', 22 | 'pipewire-plugin.c', 23 | include_directories: common_inc, 24 | dependencies: deps_pipewire, 25 | name_prefix: '', 26 | install: true, 27 | install_dir: dir_module_libweston 28 | ) 29 | env_modmap += 'pipewire-plugin.so=@0@;'.format(plugin_pipewire.full_path()) 30 | install_headers('pipewire-plugin.h', subdir: dir_include_libweston_install) 31 | endif 32 | -------------------------------------------------------------------------------- /libweston-desktop/meson.build: -------------------------------------------------------------------------------- 1 | srcs_libdesktop = [ 2 | 'libweston-desktop.c', 3 | 'client.c', 4 | 'seat.c', 5 | 'surface.c', 6 | 'xwayland.c', 7 | 'wl-shell.c', 8 | 'xdg-shell.c', 9 | 'xdg-shell-v6.c', 10 | xdg_shell_unstable_v6_server_protocol_h, 11 | xdg_shell_unstable_v6_protocol_c, 12 | xdg_shell_server_protocol_h, 13 | xdg_shell_protocol_c, 14 | ] 15 | lib_desktop = shared_library( 16 | 'weston-desktop-@0@'.format(libweston_major), 17 | srcs_libdesktop, 18 | include_directories: common_inc, 19 | install: true, 20 | version: '0.0.@0@'.format(libweston_revision), 21 | dependencies: dep_libweston_public 22 | ) 23 | dep_lib_desktop = declare_dependency( 24 | link_with: lib_desktop, 25 | dependencies: dep_libweston_public 26 | ) 27 | 28 | pkgconfig.generate( 29 | lib_desktop, 30 | filebase: 'libweston-desktop-@0@'.format(libweston_major), 31 | name: 'libweston-desktop', 32 | version: version_weston, 33 | description: 'Desktop shells abstraction library for libweston compositors', 34 | requires_private: [ lib_weston, dep_wayland_server ], 35 | subdirs: dir_include_libweston 36 | ) 37 | -------------------------------------------------------------------------------- /xwayland/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('xwayland') 2 | subdir_done() 3 | endif 4 | 5 | srcs_xwayland = [ 6 | 'launcher.c', 7 | 'window-manager.c', 8 | 'selection.c', 9 | 'dnd.c', 10 | 'hash.c', 11 | ] 12 | 13 | dep_names_xwayland = [ 14 | 'xcb', 15 | 'xcb-composite', 16 | 'xcb-shape', 17 | 'xcb-xfixes', 18 | 'xcursor', 19 | 'cairo-xcb', 20 | ] 21 | 22 | deps_xwayland = [ dep_libweston_public ] 23 | 24 | foreach name : dep_names_xwayland 25 | d = dependency(name, required: false) 26 | if not d.found() 27 | error('xwayland requires @0@ which was not found. Or, you can use \'-Dxwayland=false\'.'.format(name)) 28 | endif 29 | deps_xwayland += d 30 | endforeach 31 | 32 | plugin_xwayland = shared_library( 33 | 'xwayland', 34 | srcs_xwayland, 35 | link_with: lib_cairo_shared, 36 | include_directories: common_inc, 37 | dependencies: deps_xwayland, 38 | name_prefix: '', 39 | install: true, 40 | install_dir: dir_module_libweston 41 | ) 42 | env_modmap += 'xwayland.so=@0@;'.format(plugin_xwayland.full_path()) 43 | 44 | install_headers(xwayland_api_h, subdir: dir_include_libweston_install) 45 | -------------------------------------------------------------------------------- /protocol/weston-rdprail-shell.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This interface defines RDP-RAIL shell specific methods. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/initial-heads.msc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/mscgen -Tpng 2 | 3 | msc { 4 | hscale="1.5"; 5 | 6 | c [label = "compositor"], w [label = "libweston core"], 7 | b [label = "backend"]; 8 | 9 | |||; 10 | 11 | c => w [label = "weston_compositor_load_backend()"]; 12 | w => b [label = "init"]; 13 | 14 | --- [label = "Create initial heads"]; 15 | b box b [label = "Backend discovers an entity to create a head for."]; 16 | 17 | w <: b [label = "weston_head_init()"]; 18 | b box b [label = "assign hw resource to head"]; 19 | w <: b [label = "weston_head_set_monitor_strings()"]; 20 | w <: b [label = "weston_head_set_physical_size()"]; 21 | w <: b [label = "weston_head_set_subpixel()"]; 22 | w <: b [label = "weston_head_set_connection_status()"]; 23 | w <= b [label = "weston_compositor_add_head()"]; 24 | w <= w [label = "schedule heads_changed"]; 25 | w << b [label = "init success"]; 26 | c << w [label = "load success"]; 27 | 28 | |||; 29 | 30 | --- [label = "Compositor start-up"]; 31 | 32 | c => w [label = "weston_compositor_flush_heads_changed()"]; 33 | c <<= w [label = "heads_changed callback"]; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /include/libweston/meson.build: -------------------------------------------------------------------------------- 1 | install_headers( 2 | 'config-parser.h', 3 | 'libweston.h', 4 | 'matrix.h', 5 | 'plugin-registry.h', 6 | 'windowed-output-api.h', 7 | 'weston-log.h', 8 | 'zalloc.h', 9 | subdir: dir_include_libweston_install 10 | ) 11 | 12 | backend_drm_h = files('backend-drm.h') 13 | backend_fbdev_h = files('backend-fbdev.h') 14 | backend_headless_h = files('backend-headless.h') 15 | backend_rdp_h = files('backend-rdp.h') 16 | backend_wayland_h = files('backend-wayland.h') 17 | backend_x11_h = files('backend-x11.h') 18 | 19 | xwayland_api_h = files('xwayland-api.h') 20 | 21 | libweston_version_h = configuration_data() 22 | libweston_version_h.set('WESTON_VERSION_MAJOR', version_weston_arr[0]) 23 | libweston_version_h.set('WESTON_VERSION_MINOR', version_weston_arr[1]) 24 | libweston_version_h.set('WESTON_VERSION_MICRO', version_weston_arr[2]) 25 | libweston_version_h.set('WESTON_VERSION', version_weston) 26 | version_h = configure_file( 27 | input: 'version.h.in', 28 | output: 'version.h', 29 | configuration: libweston_version_h 30 | ) 31 | install_headers(version_h, subdir: dir_include_libweston_install) 32 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/images/create_output.msc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/mscgen -Tpng 2 | 3 | msc { 4 | hscale="1.5"; 5 | 6 | c [label = "compositor"], w [label = "libweston core"], 7 | b [label = "backend"]; 8 | 9 | |||; 10 | 11 | --- [label = "Compositor creates an output for a head"]; 12 | 13 | c box c [label = "Have an existing head to process."]; 14 | c => w [label = "weston_compositor_create_output_with_head()"]; 15 | w => b [label = "weston_backend::create_output()"]; 16 | w << b [label = "an empty output, no hw resources"]; 17 | w => b [label = "weston_output::attach_head()"]; 18 | w << b [label = "success"]; 19 | c << w [label = "success"]; 20 | 21 | c abox c [label = "optionally more heads with weston_output_attach_head() for hardware clone mode."]; 22 | 23 | c :> w [label = "weston_output_set_scale()"]; 24 | c :> w [label = "weston_output_set_transform()"]; 25 | c :> b [label = "backend specific settings via plugin API"]; 26 | c => w [label = "weston_output_enable()"]; 27 | w => b [label = "weston_output::enable()"]; 28 | b box b [label = "hw resource allocation"]; 29 | w << b [label = "success"]; 30 | c << w [label = "success"]; 31 | } 32 | -------------------------------------------------------------------------------- /doc/sphinx/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Weston documentation! 2 | ================================ 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | toc/libweston.rst 9 | toc/test-suite.rst 10 | toc/kiosk-shell.rst 11 | 12 | Weston 13 | ------ 14 | 15 | Weston is the reference implementation of a Wayland compositor, as well as a 16 | useful environment in and of itself. 17 | 18 | Out of the box, Weston provides a very basic desktop, or a full-featured 19 | environment for non-desktop uses such as automotive, embedded, in-flight, 20 | industrial, kiosks, set-top boxes and TVs. It also provides a library allowing 21 | other projects to build their own full-featured environments on top of Weston's 22 | core. 23 | 24 | The core focus of Weston is correctness and reliability. Weston aims to be lean 25 | and fast, but more importantly, to be predictable. Whilst Weston does have 26 | known bugs and shortcomings, we avoid unknown or variable behaviour as much as 27 | possible, including variable performance such as occasional spikes in frame 28 | display time. 29 | 30 | Indices and tables 31 | ================== 32 | 33 | * :ref:`genindex` 34 | * :ref:`search` 35 | -------------------------------------------------------------------------------- /remoting/README: -------------------------------------------------------------------------------- 1 | Remoting plugin for Weston 2 | 3 | 4 | The Remoting plugin creates a streaming image of a virtual output and transmits 5 | it to a remote host. It is currently only supported on the drm-backend. Virtual 6 | outputs are created and configured by adding a remote-output section to 7 | weston.ini. See man weston-drm(7) for configuration details. This plugin is 8 | loaded automatically if any remote-output sections are present. 9 | 10 | This plugin sends motion jpeg images to a client via RTP using gstreamer, and 11 | so requires gstreamer-1.0. This plugin starts sending images immediately when 12 | weston is run, and keeps sending them until weston shuts down. The image stream 13 | can be received by any appropriately configured RTP client, but a sample 14 | gstreamer RTP client script can be found at doc/scripts/remoting-client-receive.bash. 15 | 16 | Script usage: 17 | remoting-client-receive.bash 18 | 19 | 20 | How to compile 21 | --------------- 22 | Set --enable-remoting=true when configuring weston. The remoting-plugin.so 23 | module is created and installed in the libweston path. 24 | 25 | 26 | How to configure weston.ini 27 | ---------------------------- 28 | See man weston-drm(7). 29 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/output.rst: -------------------------------------------------------------------------------- 1 | .. _libweston-output: 2 | 3 | Outputs 4 | ======= 5 | 6 | A :type:`weston_output` determines what part of the global compositor 7 | coordinate space will be composited into an image and when. That image is 8 | presented on the attached heads (weston_head). 9 | 10 | An output object is resposible for the framebuffer management, damage tracking, 11 | display timings, and the repaint state machine. Video mode, output scale and 12 | output transform are properties of an output. 13 | 14 | In display hardware, a weston_output represents a CRTC, but only if it has been 15 | successfully enabled. The CRTC may be switched to another during an output's 16 | lifetime. 17 | 18 | The lifetime of a weston_output is controlled by the libweston user. 19 | 20 | With at least a :type:`weston_head` attached, you can construct a 21 | :type:`weston_output` object which can be used by the compositor, by enabling 22 | the output using :func:`weston_output_enable`. The output **must not** be 23 | already enabled. 24 | 25 | The reverse operation, :func:`weston_output_disable`, should be used when there's 26 | a need to reconfigure the output or it will be destroyed. 27 | 28 | 29 | .. doxygengroup:: output 30 | :content-only: 31 | -------------------------------------------------------------------------------- /remoting/meson.build: -------------------------------------------------------------------------------- 1 | if get_option('remoting') 2 | user_hint = 'If you rather not build this, set \'-Dremoting=false\'.' 3 | 4 | if not get_option('backend-drm') or not get_option('renderer-gl') 5 | error('Attempting to build the remoting plugin without the required DRM backend and GL renderer. ' + user_hint) 6 | endif 7 | 8 | depnames = [ 9 | 'gstreamer-1.0', 'gstreamer-allocators-1.0', 10 | 'gstreamer-app-1.0', 'gstreamer-video-1.0', 11 | 'gobject-2.0', 'glib-2.0' 12 | ] 13 | deps_remoting = [ dep_libweston_private, dep_libdrm_headers ] 14 | foreach depname : depnames 15 | dep = dependency(depname, required: false) 16 | if not dep.found() 17 | error('Remoting plugin requires @0@ which was not found. '.format(depname) + user_hint) 18 | endif 19 | deps_remoting += dep 20 | endforeach 21 | 22 | plugin_remoting = shared_library( 23 | 'remoting-plugin', 24 | 'remoting-plugin.c', 25 | include_directories: common_inc, 26 | dependencies: deps_remoting, 27 | name_prefix: '', 28 | install: true, 29 | install_dir: dir_module_libweston 30 | ) 31 | env_modmap += 'remoting-plugin.so=@0@;'.format(plugin_remoting.full_path()) 32 | install_headers('remoting-plugin.h', subdir: dir_include_libweston_install) 33 | endif 34 | -------------------------------------------------------------------------------- /libweston/backend-wayland/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('backend-wayland') 2 | subdir_done() 3 | endif 4 | 5 | config_h.set('BUILD_WAYLAND_COMPOSITOR', '1') 6 | 7 | srcs_wlwl = [ 8 | 'wayland.c', 9 | fullscreen_shell_unstable_v1_client_protocol_h, 10 | fullscreen_shell_unstable_v1_protocol_c, 11 | presentation_time_protocol_c, 12 | presentation_time_server_protocol_h, 13 | xdg_shell_server_protocol_h, 14 | xdg_shell_protocol_c, 15 | ] 16 | 17 | deps_wlwl = [ 18 | dependency('wayland-client'), 19 | dependency('wayland-cursor'), 20 | dep_pixman, 21 | dep_libweston_private, 22 | dep_libdrm_headers, 23 | dep_lib_cairo_shared, 24 | ] 25 | 26 | if get_option('renderer-gl') 27 | d = dependency('wayland-egl', required: false) 28 | if not d.found() 29 | error('wayland-backend + gl-renderer requires wayland-egl which was not found. Or, you can use \'-Dbackend-wayland=false\' or \'-Drenderer-gl=false\'.') 30 | endif 31 | deps_wlwl += d 32 | endif 33 | 34 | plugin_wlwl = shared_library( 35 | 'wayland-backend', 36 | srcs_wlwl, 37 | include_directories: common_inc, 38 | dependencies: deps_wlwl, 39 | name_prefix: '', 40 | install: true, 41 | install_dir: dir_module_libweston 42 | ) 43 | env_modmap += 'wayland-backend.so=@0@;'.format(plugin_wlwl.full_path()) 44 | install_headers(backend_wayland_h, subdir: dir_include_libweston_install) 45 | -------------------------------------------------------------------------------- /doc/doxygen/tools.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | /** 27 | @mainpage 28 | 29 | - @ref zunitc - Simple test framework 30 | 31 | */ 32 | -------------------------------------------------------------------------------- /compositor/executable.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2019 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include "weston.h" 29 | 30 | int 31 | main(int argc, char *argv[]) 32 | { 33 | return wet_main(argc, argv); 34 | } 35 | -------------------------------------------------------------------------------- /shared/image-loader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef _IMAGE_LOADER_H 27 | #define _IMAGE_LOADER_H 28 | 29 | #include 30 | 31 | pixman_image_t * 32 | load_image(const char *filename); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright © 2008-2012 Kristian Høgsberg 2 | Copyright © 2010-2012 Intel Corporation 3 | Copyright © 2010-2011 Benjamin Franzke 4 | Copyright © 2011-2012 Collabora, Ltd. 5 | Copyright © 2010 Red Hat 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a 8 | copy of this software and associated documentation files (the "Software"), 9 | to deal in the Software without restriction, including without limitation 10 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 | and/or sell copies of the Software, and to permit persons to whom the 12 | Software is furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice (including the next 15 | paragraph) shall be included in all copies or substantial portions of the 16 | Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 | DEALINGS IN THE SOFTWARE. 25 | 26 | --- 27 | 28 | The above is the version of the MIT "Expat" License used by X.org: 29 | 30 | http://cgit.freedesktop.org/xorg/xserver/tree/COPYING 31 | -------------------------------------------------------------------------------- /DCO-1.1.txt: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /libweston/linux-sync-file.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Collabora, Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_LINUX_SYNC_FILE_H 27 | #define WESTON_LINUX_SYNC_FILE_H 28 | 29 | #include 30 | #include 31 | 32 | bool 33 | linux_sync_file_is_valid(int fd); 34 | 35 | int 36 | weston_linux_sync_file_read_timestamp(int fd, struct timespec *ts); 37 | 38 | #endif /* WESTON_LINUX_SYNC_FILE_H */ 39 | -------------------------------------------------------------------------------- /include/libweston/zalloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Red Hat, Inc. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_ZALLOC_H 27 | #define WESTON_ZALLOC_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | 35 | static inline void * 36 | zalloc(size_t size) 37 | { 38 | return calloc(1, size); 39 | } 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* WESTON_ZALLOC_H */ 46 | -------------------------------------------------------------------------------- /tools/zunitc/src/zuc_base_logger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef ZUC_BASE_LOGGER_H 27 | #define ZUC_BASE_LOGGER_H 28 | 29 | struct zuc_event_listener; 30 | 31 | /** 32 | * Creates a new logger that outputs data to console in the default 33 | * format. 34 | */ 35 | struct zuc_event_listener * 36 | zuc_base_logger_create(void); 37 | 38 | #endif /* ZUC_BASE_LOGGER_H */ 39 | -------------------------------------------------------------------------------- /man/meson.build: -------------------------------------------------------------------------------- 1 | man_conf = configuration_data() 2 | man_conf.set('weston_native_backend', opt_backend_native) 3 | man_conf.set('weston_modules_dir', dir_module_weston) 4 | man_conf.set('libweston_modules_dir', dir_module_libweston) 5 | man_conf.set('weston_shell_client', get_option('desktop-shell-client-default')) 6 | man_conf.set('weston_libexecdir', dir_libexec) 7 | man_conf.set('weston_bindir', dir_bin) 8 | man_conf.set('xserver_path', get_option('xwayland-path')) 9 | man_conf.set('version', version_weston) 10 | 11 | configure_file( 12 | input: 'weston.man', 13 | output: 'weston.1', 14 | install_dir: join_paths(dir_man, 'man1'), 15 | configuration: man_conf 16 | ) 17 | 18 | configure_file( 19 | input: 'weston-bindings.man', 20 | output: 'weston-bindings.7', 21 | install_dir: join_paths(dir_man, 'man7'), 22 | configuration: man_conf 23 | ) 24 | 25 | configure_file( 26 | input: 'weston-debug.man', 27 | output: 'weston-debug.1', 28 | install_dir: join_paths(dir_man, 'man1'), 29 | configuration: man_conf 30 | ) 31 | 32 | configure_file( 33 | input: 'weston.ini.man', 34 | output: 'weston.ini.5', 35 | install_dir: join_paths(dir_man, 'man5'), 36 | configuration: man_conf 37 | ) 38 | 39 | if get_option('backend-drm') 40 | configure_file( 41 | input: 'weston-drm.man', 42 | output: 'weston-drm.7', 43 | install_dir: join_paths(dir_man, 'man7'), 44 | configuration: man_conf 45 | ) 46 | endif 47 | 48 | if get_option('backend-rdp') 49 | configure_file( 50 | input: 'weston-rdp.man', 51 | output: 'weston-rdp.7', 52 | install_dir: join_paths(dir_man, 'man7'), 53 | configuration: man_conf 54 | ) 55 | endif 56 | -------------------------------------------------------------------------------- /tools/zunitc/src/zuc_junit_reporter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef ZUC_JUNIT_REPORTER_H 27 | #define ZUC_JUNIT_REPORTER_H 28 | 29 | struct zuc_event_listener; 30 | 31 | /** 32 | * Creates an instance of a reporter that will write data in the JUnit 33 | * XML format. 34 | */ 35 | struct zuc_event_listener * 36 | zuc_junit_reporter_create(void); 37 | 38 | #endif /* ZUC_JUNIT_REPORTER_H */ 39 | -------------------------------------------------------------------------------- /rdprail-shell/meson.build: -------------------------------------------------------------------------------- 1 | if get_option('shell-rdprail') 2 | dep_winpr = dependency('winpr3', version: '>= 3.0.0', required: false) 3 | if dep_winpr.found() 4 | config_h.set('HAVE_WINPR', '1') 5 | else 6 | dep_winpr = dependency('winpr2', version: '>= 2.0.0', required: false) 7 | if dep_winpr.found() 8 | config_h.set('HAVE_WINPR', '1') 9 | endif 10 | endif 11 | dep_librsvg = dependency('librsvg-2.0', version: '>= 2.36.0', required: false) 12 | if dep_librsvg.found() 13 | config_h.set('HAVE_LIBRSVG2', '1') 14 | endif 15 | dep_glib = dependency('glib-2.0', version : '>= 2.0.0', required: false) 16 | if dep_glib.found() 17 | config_h.set('HAVE_GLIB', 1) 18 | endif 19 | srcs_shell_rdprail = [ 20 | 'shell.c', 21 | 'input-panel.c', 22 | 'app-list.c', 23 | 'img-load.c', 24 | weston_rdprail_shell_server_protocol_h, 25 | weston_rdprail_shell_protocol_c, 26 | input_method_unstable_v1_server_protocol_h, 27 | input_method_unstable_v1_protocol_c, 28 | ] 29 | deps_shell_rdprail = [ 30 | dep_libm, 31 | dep_libexec_weston, 32 | dep_libshared, 33 | dep_lib_desktop, 34 | dep_libweston_public, 35 | dep_librsvg, 36 | dep_winpr, 37 | dep_glib, 38 | dep_frdp_server, 39 | ] 40 | plugin_shell_rdprail = shared_library( 41 | 'rdprail-shell', 42 | srcs_shell_rdprail, 43 | link_with: lib_cairo_shared, 44 | include_directories: common_inc, 45 | dependencies: deps_shell_rdprail, 46 | name_prefix: '', 47 | install: true, 48 | install_dir: dir_module_weston, 49 | install_rpath: '$ORIGIN' 50 | ) 51 | env_modmap += 'rdprail-shell.so=@0@;'.format(plugin_shell_rdprail.full_path()) 52 | endif 53 | -------------------------------------------------------------------------------- /compositor/rdpdisp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Microsoft 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef RDP_DISP_H 27 | #define RDP_DISP_H 28 | 29 | struct wet_rdp_params { 30 | bool enable_hi_dpi_support; 31 | bool enable_fractional_hi_dpi_support; 32 | bool enable_fractional_hi_dpi_roundup; 33 | int debug_desktop_scaling_factor; 34 | int default_width; 35 | int default_height; 36 | }; 37 | 38 | void 39 | disp_monitor_validate_and_compute_layout(struct weston_compositor *ec); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libweston/backend-drm/vaapi-recorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef _VAAPI_RECORDER_H_ 27 | #define _VAAPI_RECORDER_H_ 28 | 29 | struct vaapi_recorder; 30 | 31 | struct vaapi_recorder * 32 | vaapi_recorder_create(int drm_fd, int width, int height, const char *filename); 33 | void 34 | vaapi_recorder_destroy(struct vaapi_recorder *r); 35 | int 36 | vaapi_recorder_frame(struct vaapi_recorder *r, int fd, int stride); 37 | 38 | #endif /* _VAAPI_RECORDER_H_ */ 39 | -------------------------------------------------------------------------------- /shared/file-util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_FILE_UTIL_H 27 | #define WESTON_FILE_UTIL_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | 35 | FILE * 36 | file_create_dated(const char *path, const char *prefix, const char *suffix, 37 | char *name_out, size_t name_len); 38 | 39 | char * 40 | file_name_with_datadir(const char *); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* WESTON_FILE_UTIL_H */ 47 | -------------------------------------------------------------------------------- /libweston/backend-x11/meson.build: -------------------------------------------------------------------------------- 1 | 2 | if not get_option('backend-x11') 3 | subdir_done() 4 | endif 5 | 6 | config_h.set('BUILD_X11_COMPOSITOR', '1') 7 | 8 | srcs_x11 = [ 9 | 'x11.c', 10 | presentation_time_server_protocol_h, 11 | ] 12 | 13 | dep_x11_xcb = dependency('xcb', version: '>= 1.8', required: false) 14 | if not dep_x11_xcb.found() 15 | error('x11-backend requires xcb >= 1.8 which was not found. Or, you can use \'-Dbackend-x11=false\'.') 16 | endif 17 | 18 | deps_x11 = [ 19 | dep_libweston_private, 20 | dep_libdrm_headers, 21 | dep_x11_xcb, 22 | dep_lib_cairo_shared, 23 | dep_pixman, 24 | ] 25 | 26 | foreach name : [ 'xcb-shm', 'x11', 'x11-xcb' ] 27 | d = dependency(name, required: false) 28 | if not d.found() 29 | error('x11-backend requires @0@ which was not found. Or, you can use \'-Dbackend-x11=false\'.'.format(name)) 30 | endif 31 | deps_x11 += d 32 | endforeach 33 | 34 | dep_xcb_xkb = dependency('xcb-xkb', version: '>= 1.9', required: false) 35 | if dep_xcb_xkb.found() 36 | deps_x11 += dep_xcb_xkb 37 | config_h.set('HAVE_XCB_XKB', '1') 38 | endif 39 | 40 | if get_option('renderer-gl') 41 | if not dep_egl.found() 42 | error('x11-backend + gl-renderer requires egl which was not found. Or, you can use \'-Dbackend-x11=false\' or \'-Drenderer-gl=false\'.') 43 | endif 44 | deps_x11 += dep_egl 45 | endif 46 | 47 | plugin_x11 = shared_library( 48 | 'x11-backend', 49 | srcs_x11, 50 | include_directories: common_inc, 51 | dependencies: deps_x11, 52 | name_prefix: '', 53 | install: true, 54 | install_dir: dir_module_libweston 55 | ) 56 | env_modmap += 'x11-backend.so=@0@;'.format(plugin_x11.full_path()) 57 | 58 | install_headers(backend_x11_h, subdir: dir_include_libweston_install) 59 | -------------------------------------------------------------------------------- /libweston/linux-explicit-synchronization.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_LINUX_EXPLICIT_SYNCHRONIZATION_H 27 | #define WESTON_LINUX_EXPLICIT_SYNCHRONIZATION_H 28 | 29 | struct weston_compositor; 30 | struct wl_resource; 31 | 32 | int 33 | linux_explicit_synchronization_setup(struct weston_compositor *compositor); 34 | 35 | void 36 | linux_explicit_synchronization_send_server_error(struct wl_resource *resource, 37 | const char *msg); 38 | 39 | #endif /* WESTON_LINUX_EXPLICIT_SYNCHRONIZATION */ 40 | -------------------------------------------------------------------------------- /shared/fd-util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef FD_UTIL_H 27 | #define FD_UTIL_H 28 | 29 | #include 30 | 31 | static inline void 32 | fd_update(int *fd, int new_fd) 33 | { 34 | if (*fd == new_fd) 35 | return; 36 | if (*fd >= 0) 37 | close(*fd); 38 | *fd = new_fd; 39 | } 40 | 41 | static inline void 42 | fd_move(int *dest, int *src) 43 | { 44 | if (dest == src) 45 | return; 46 | fd_update(dest, *src); 47 | *src = -1; 48 | } 49 | 50 | static inline void 51 | fd_clear(int *fd) 52 | { 53 | fd_update(fd, -1); 54 | } 55 | 56 | #endif /* FD_UTIL_H */ 57 | -------------------------------------------------------------------------------- /libweston/weston-launch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Benjamin Franzke 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef _WESTON_LAUNCH_H_ 27 | #define _WESTON_LAUNCH_H_ 28 | 29 | enum weston_launcher_opcode { 30 | WESTON_LAUNCHER_OPEN, 31 | }; 32 | 33 | enum weston_launcher_event { 34 | WESTON_LAUNCHER_SUCCESS, 35 | WESTON_LAUNCHER_ACTIVATE, 36 | WESTON_LAUNCHER_DEACTIVATE, 37 | WESTON_LAUNCHER_DEACTIVATE_DONE, 38 | }; 39 | 40 | struct weston_launcher_message { 41 | int opcode; 42 | }; 43 | 44 | struct weston_launcher_open { 45 | struct weston_launcher_message header; 46 | int flags; 47 | char path[0]; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /tests/ivi-test.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef IVI_TEST_H 27 | #define IVI_TEST_H 28 | 29 | /* 30 | * IVI_TEST_SURFACE_ID_BASE is an arbitrary number picked for the 31 | * IVI tests. The only requirement is that it does not clash with 32 | * any other ivi-id range used in Weston. 33 | */ 34 | #define IVI_TEST_SURFACE_ID_BASE 0xffc01200 35 | #define IVI_TEST_SURFACE_ID(i) (IVI_TEST_SURFACE_ID_BASE + i) 36 | #define IVI_TEST_LAYER_ID_BASE 0xeef01200 37 | #define IVI_TEST_LAYER_ID(i) (IVI_TEST_LAYER_ID_BASE + i) 38 | 39 | #define IVI_TEST_SURFACE_COUNT (3) 40 | #define IVI_TEST_LAYER_COUNT (3) 41 | 42 | #endif /* IVI_TEST_H */ 43 | -------------------------------------------------------------------------------- /tests/input-timestamps-helper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2017 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef INPUT_TIMESTAMPS_HELPER_H 27 | #define INPUT_TIMESTAMPS_HELPER_H 28 | 29 | #include "config.h" 30 | 31 | struct client; 32 | struct input_timestamps; 33 | 34 | struct input_timestamps * 35 | input_timestamps_create_for_keyboard(struct client *client); 36 | 37 | struct input_timestamps * 38 | input_timestamps_create_for_pointer(struct client *client); 39 | 40 | struct input_timestamps * 41 | input_timestamps_create_for_touch(struct client *client); 42 | 43 | void 44 | input_timestamps_destroy(struct input_timestamps *input_ts); 45 | 46 | #endif /* INPUT_TIMESTAMPS_HELPER_H */ 47 | -------------------------------------------------------------------------------- /ivi-shell/meson.build: -------------------------------------------------------------------------------- 1 | if get_option('shell-ivi') 2 | srcs_shell_ivi = [ 3 | 'ivi-shell.c', 4 | 'ivi-layout.c', 5 | 'ivi-layout-transition.c', 6 | ivi_application_server_protocol_h, 7 | ivi_application_protocol_c, 8 | input_method_unstable_v1_server_protocol_h, 9 | input_method_unstable_v1_protocol_c, 10 | ] 11 | plugin_shell_ivi = shared_library( 12 | 'ivi-shell', 13 | srcs_shell_ivi, 14 | include_directories: common_inc, 15 | dependencies: [ 16 | dep_libm, 17 | dep_libexec_weston, 18 | dep_lib_desktop, 19 | dep_libweston_public 20 | ], 21 | name_prefix: '', 22 | install: true, 23 | install_dir: dir_module_weston, 24 | install_rpath: '$ORIGIN' 25 | ) 26 | env_modmap += 'ivi-shell.so=@0@;'.format(plugin_shell_ivi.full_path()) 27 | 28 | install_headers('ivi-layout-export.h', subdir: 'weston') 29 | 30 | srcs_ivi_hmi = [ 31 | 'hmi-controller.c', 32 | ivi_hmi_controller_server_protocol_h, 33 | ivi_hmi_controller_protocol_c, 34 | ] 35 | plugin_ivi_hmi = shared_library( 36 | 'hmi-controller', 37 | srcs_ivi_hmi, 38 | include_directories: common_inc, 39 | dependencies: [ 40 | dep_libexec_weston, 41 | dep_libweston_public, 42 | dep_libshared 43 | ], 44 | name_prefix: '', 45 | install: true, 46 | install_dir: dir_module_weston, 47 | install_rpath: '$ORIGIN' 48 | ) 49 | env_modmap += 'hmi-controller.so=@0@;'.format(plugin_ivi_hmi.full_path()) 50 | 51 | ivi_test_config = configuration_data() 52 | ivi_test_config.set('bindir', dir_bin) 53 | ivi_test_config.set('libexecdir', dir_libexec) 54 | ivi_test_config.set('plugin_prefix', meson.current_build_dir()) 55 | ivi_test_config.set('westondatadir', join_paths(dir_data, 'weston')) 56 | ivi_test_ini = configure_file( 57 | input: '../ivi-shell/weston.ini.in', 58 | output: 'weston-ivi-test.ini', 59 | configuration: ivi_test_config 60 | ) 61 | endif 62 | -------------------------------------------------------------------------------- /include/libweston/backend-x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2016 Benoit Gschwind 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_COMPOSITOR_X11_H 27 | #define WESTON_COMPOSITOR_X11_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | 35 | #include 36 | 37 | #define WESTON_X11_BACKEND_CONFIG_VERSION 2 38 | 39 | struct weston_x11_backend_config { 40 | struct weston_backend_config base; 41 | 42 | bool fullscreen; 43 | bool no_input; 44 | 45 | /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */ 46 | bool use_pixman; 47 | }; 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* WESTON_COMPOSITOR_X11_H_ */ 54 | -------------------------------------------------------------------------------- /include/libweston/backend-wayland.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2016 Benoit Gschwind 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_COMPOSITOR_WAYLAND_H 27 | #define WESTON_COMPOSITOR_WAYLAND_H 28 | 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | #include 36 | 37 | #define WESTON_WAYLAND_BACKEND_CONFIG_VERSION 2 38 | 39 | struct weston_wayland_backend_config { 40 | struct weston_backend_config base; 41 | bool use_pixman; 42 | bool sprawl; 43 | char *display_name; 44 | bool fullscreen; 45 | char *cursor_theme; 46 | int cursor_size; 47 | }; 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* WESTON_COMPOSITOR_WAYLAND_H */ 54 | -------------------------------------------------------------------------------- /doc/scripts/remoting-client-receive.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright © 2018 Renesas Electronics Corp. 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining 6 | # a copy of this software and associated documentation files (the 7 | # "Software"), to deal in the Software without restriction, including 8 | # without limitation the rights to use, copy, modify, merge, publish, 9 | # distribute, sublicense, and/or sell copies of the Software, and to 10 | # permit persons to whom the Software is furnished to do so, subject to 11 | # the following conditions: 12 | # 13 | # The above copyright notice and this permission notice (including the 14 | # next paragraph) shall be included in all copies or substantial 15 | # portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 21 | # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 22 | # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | # SOFTWARE. 25 | # 26 | # Authors: IGEL Co., Ltd. 27 | 28 | # By using this script, client can receive remoted output via gstreamer. 29 | # Usage: 30 | # remoting-client-receive.bash 31 | 32 | gst-launch-1.0 rtpbin name=rtpbin \ 33 | udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=JPEG,payload=26" port=$1 ! \ 34 | rtpbin.recv_rtp_sink_0 \ 35 | rtpbin. ! rtpjpegdepay ! jpegdec ! autovideosink \ 36 | udpsrc port=$(($1 + 1)) ! rtpbin.recv_rtcp_sink_0 \ 37 | rtpbin.send_rtcp_src_0 ! \ 38 | udpsink port=$(($1 + 2)) sync=false async=false 39 | -------------------------------------------------------------------------------- /kiosk-shell/kiosk-shell-grab.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining a 5 | * copy of this software and associated documentation files (the "Software"), 6 | * to deal in the Software without restriction, including without limitation 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | * and/or sell copies of the Software, and to permit persons to whom the 9 | * Software is furnished to do so, subject to the following conditions: 10 | * 11 | * The above copyright notice and this permission notice (including the next 12 | * paragraph) shall be included in all copies or substantial portions of the 13 | * 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 18 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | * DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | #ifndef WESTON_KIOSK_SHELL_GRAB_H 25 | #define WESTON_KIOSK_SHELL_GRAB_H 26 | 27 | #include "kiosk-shell.h" 28 | 29 | enum kiosk_shell_grab_result { 30 | KIOSK_SHELL_GRAB_RESULT_OK, 31 | KIOSK_SHELL_GRAB_RESULT_IGNORED, 32 | KIOSK_SHELL_GRAB_RESULT_ERROR, 33 | }; 34 | 35 | enum kiosk_shell_grab_result 36 | kiosk_shell_grab_start_for_pointer_move(struct kiosk_shell_surface *shsurf, 37 | struct weston_pointer *pointer); 38 | 39 | enum kiosk_shell_grab_result 40 | kiosk_shell_grab_start_for_touch_move(struct kiosk_shell_surface *shsurf, 41 | struct weston_touch *touch); 42 | 43 | #endif /* WESTON_KIOSK_SHELL_GRAB_H */ 44 | -------------------------------------------------------------------------------- /include/libweston/backend-headless.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2016 Benoit Gschwind 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_COMPOSITOR_HEADLESS_H 27 | #define WESTON_COMPOSITOR_HEADLESS_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | 35 | #include 36 | 37 | #define WESTON_HEADLESS_BACKEND_CONFIG_VERSION 2 38 | 39 | struct weston_headless_backend_config { 40 | struct weston_backend_config base; 41 | 42 | /** Whether to use the pixman renderer, default is no-op */ 43 | bool use_pixman; 44 | 45 | /** Whether to use the GL renderer, conflicts with use_pixman */ 46 | bool use_gl; 47 | }; 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* WESTON_COMPOSITOR_HEADLESS_H */ 54 | -------------------------------------------------------------------------------- /tools/zunitc/src/zuc_context.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef ZUC_CONTEXT_H 27 | #define ZUC_CONTEXT_H 28 | 29 | #include "zuc_types.h" 30 | 31 | struct zuc_slinked; 32 | 33 | /** 34 | * Internal context for processing. 35 | * Collecting data members here minimizes use of globals. 36 | */ 37 | struct zuc_context { 38 | int case_count; 39 | struct zuc_case **cases; 40 | 41 | bool fatal; 42 | int repeat; 43 | int random; 44 | unsigned int seed; 45 | bool spawn; 46 | bool break_on_failure; 47 | bool output_tap; 48 | bool output_junit; 49 | int fds[2]; 50 | char *filter; 51 | 52 | struct zuc_slinked *listeners; 53 | 54 | struct zuc_case *curr_case; 55 | struct zuc_test *curr_test; 56 | }; 57 | 58 | #endif /* ZUC_CONTEXT_H */ 59 | -------------------------------------------------------------------------------- /include/libweston/plugin-registry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 DENSO CORPORATION 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_PLUGIN_REGISTRY_H 27 | #define WESTON_PLUGIN_REGISTRY_H 28 | 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | struct weston_compositor; 36 | 37 | int 38 | weston_plugin_api_register(struct weston_compositor *compositor, 39 | const char *api_name, 40 | const void *vtable, 41 | size_t vtable_size); 42 | 43 | const void * 44 | weston_plugin_api_get(struct weston_compositor *compositor, 45 | const char *api_name, 46 | size_t vtable_size); 47 | 48 | void 49 | weston_plugin_api_destroy_list(struct weston_compositor *compositor); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* WESTON_PLUGIN_REGISTRY_H */ 56 | -------------------------------------------------------------------------------- /libweston/vertex-clipping.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | #ifndef _WESTON_VERTEX_CLIPPING_H 26 | #define _WESTON_VERTEX_CLIPPING_H 27 | 28 | struct polygon8 { 29 | float x[8]; 30 | float y[8]; 31 | int n; 32 | }; 33 | 34 | struct clip_context { 35 | struct { 36 | float x; 37 | float y; 38 | } prev; 39 | 40 | struct { 41 | float x1, y1; 42 | float x2, y2; 43 | } clip; 44 | 45 | struct { 46 | float *x; 47 | float *y; 48 | } vertices; 49 | }; 50 | 51 | float 52 | float_difference(float a, float b); 53 | 54 | int 55 | clip_simple(struct clip_context *ctx, 56 | struct polygon8 *surf, 57 | float *ex, 58 | float *ey); 59 | 60 | int 61 | clip_transformed(struct clip_context *ctx, 62 | struct polygon8 *surf, 63 | float *ex, 64 | float *ey);\ 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /tools/zunitc/src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | /* 29 | * Common main() for test programs. 30 | */ 31 | 32 | #include 33 | #include 34 | 35 | #include "zunitc/zunitc.h" 36 | 37 | int 38 | main(int argc, char* argv[]) 39 | { 40 | bool helped = false; 41 | int rc = zuc_initialize(&argc, argv, &helped); 42 | 43 | if ((rc == EXIT_SUCCESS) && !helped) { 44 | /* Stop if any unrecognized parameters were encountered. */ 45 | if (argc > 1) { 46 | printf("%s: unrecognized option '%s'\n", 47 | argv[0], argv[1]); 48 | printf("Try '%s --help' for more information.\n", 49 | argv[0]); 50 | rc = EXIT_FAILURE; 51 | } else { 52 | rc = ZUC_RUN_TESTS(); 53 | } 54 | } 55 | 56 | zuc_cleanup(); 57 | return rc; 58 | } 59 | -------------------------------------------------------------------------------- /kiosk-shell/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2012 Intel Corporation 3 | * Copyright 2013 Raspberry Pi Foundation 4 | * Copyright 2011-2012,2020 Collabora, Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a 7 | * copy of this software and associated documentation files (the "Software"), 8 | * to deal in the Software without restriction, including without limitation 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | * and/or sell copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice (including the next 14 | * paragraph) shall be included in all copies or substantial portions of the 15 | * Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | * DEALINGS IN THE SOFTWARE. 24 | */ 25 | 26 | /* Helper functions adapted from desktop-shell */ 27 | 28 | #include 29 | 30 | struct weston_compositor; 31 | struct weston_layer; 32 | struct weston_output; 33 | struct weston_surface; 34 | struct weston_view; 35 | 36 | struct weston_output * 37 | get_default_output(struct weston_compositor *compositor); 38 | 39 | struct weston_output * 40 | get_focused_output(struct weston_compositor *compositor); 41 | 42 | void 43 | center_on_output(struct weston_view *view, struct weston_output *output); 44 | 45 | struct weston_view * 46 | create_colored_surface(struct weston_compositor *compositor, 47 | float r, float g, float b, 48 | float x, float y, int w, int h); 49 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston/head.rst: -------------------------------------------------------------------------------- 1 | .. _libweston-head: 2 | 3 | Heads 4 | ===== 5 | 6 | A head is represented by a :type:`weston_head` object. 7 | 8 | A head refers to a monitor when driving hardware, but it can also be a window 9 | in another window system, or a virtual concept. Essentially a head is a place 10 | where you could present an image. The image will be produced by a weston_output 11 | where the head is attached to. 12 | 13 | In display hardware, a head represents a display connector in a computer 14 | system, not the actual monitor connected to the connector. A head carries 15 | monitor information, if present, like make and model, EDID and possible video 16 | modes. Other properties are DPMS mode and backlight control. 17 | 18 | In terms of Wayland protocol, a head corresponds to a wl_output. If one 19 | :type:`weston_output` has several heads, meaning that the heads are cloned, 20 | each head is represented as a separate wl_output global in wl_registry. Only 21 | the heads of an enabled output are exposed as wl_outputs. 22 | 23 | Heads can appear and disappear dynamically, mainly because of DisplayPort 24 | Multi-Stream Transport where connecting a new monitor may expose new 25 | connectors. Window and virtual outputs are often dynamic as well. 26 | 27 | Heads are always owned by libweston which dictates their lifetimes. Some 28 | backends may offer specific API to create and destroy heads, but hardware 29 | backends like DRM-backend create and destroy heads on their own. 30 | 31 | .. note:: 32 | 33 | :func:`weston_head_init` and :func:`weston_head_release` belong to the 34 | private/internal backend API and should be moved accordingly once that 35 | section has been created. There are many other functions as well that are 36 | intended only for backends. 37 | 38 | A :type:`weston_head` must be attached/detached from a :type:`weston_output`. 39 | To that purpose you can use :func:`weston_output_attach_head`, respectively 40 | :func:`weston_head_detach`. 41 | 42 | 43 | .. doxygengroup:: head 44 | :content-only: 45 | -------------------------------------------------------------------------------- /man/weston-debug.man: -------------------------------------------------------------------------------- 1 | .TH WESTON-DEBUG 1 "2018-09-11" "Weston @version@" 2 | .SH NAME 3 | weston-debug \- a tool for getting debug messages from compositor. 4 | .SH SYNOPSIS 5 | .B weston-debug [options] [names] 6 | . 7 | .\" *************************************************************** 8 | .SH DESCRIPTION 9 | 10 | .B weston-debug 11 | is a debugging tool which uses weston_debug_v1 interface to get the 12 | debug messages from the compositor. The debug messages are categorized into different 13 | debug streams by the compositor (example: logs, proto, list, etc.,) and the compositor 14 | requires a file descriptor to stream the messages. 15 | 16 | This tool accepts a file name or a file descriptor (not both) and any desired debug stream 17 | names from the user as command line arguments and subscribes the desired streams from the 18 | compositor by using the weston_debug_v1 interface. After the subscription, the 19 | compositor will start to write the debug messages to the shared file descriptor. 20 | 21 | If no file name or file descriptor argument is given, the tool will use the stdout file 22 | descriptor. 23 | 24 | . 25 | .\" *************************************************************** 26 | .SH OPTIONS 27 | . 28 | .B weston-debug 29 | accepts the following command line options. 30 | .TP 31 | . B \-h, \-\-help 32 | Print the help text and exit with success. 33 | .TP 34 | . B \-l, \-\-list 35 | List the available debug streams supported by the compositor. May be used 36 | together with --all or a list of debug stream names. 37 | .TP 38 | . B \-a, \-\-all 39 | Bind all debug streams offered by the compositor. Mututally exclusive with 40 | explicitly specifying stream names. 41 | .TP 42 | . B \-o FILE, \-\-output FILE 43 | Direct output to file named FILE. Use - for stdout. 44 | Stdout is the default. Mutually exclusive with -f. 45 | .TP 46 | . B \-f FD, \-\-outfd FD 47 | Direct output to the file descriptor FD. 48 | Stdout (1) is the default. Mutually exclusive with -o. 49 | .TP 50 | .B [names] 51 | A list of debug streams to bind to. Mutually exclusive with --all. 52 | -------------------------------------------------------------------------------- /ivi-shell/ivi-shell.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 DENSO CORPORATION 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_IVI_SHELL_H 27 | #define WESTON_IVI_SHELL_H 28 | 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | 35 | struct ivi_shell 36 | { 37 | struct wl_listener destroy_listener; 38 | struct wl_listener wake_listener; 39 | 40 | struct weston_compositor *compositor; 41 | 42 | struct weston_desktop *desktop; 43 | struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */ 44 | }; 45 | 46 | void 47 | shell_surface_send_configure(struct weston_surface *surface, 48 | int32_t width, int32_t height); 49 | 50 | struct ivi_layout_surface; 51 | 52 | struct ivi_layout_surface * 53 | shell_get_ivi_layout_surface(struct weston_surface *surface); 54 | 55 | #endif /* WESTON_IVI_SHELL_H */ 56 | -------------------------------------------------------------------------------- /libweston/launcher-util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Benjamin Franzke 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef _WESTON_LAUNCHER_UTIL_H_ 27 | #define _WESTON_LAUNCHER_UTIL_H_ 28 | 29 | #include "config.h" 30 | 31 | #include 32 | 33 | struct weston_launcher; 34 | 35 | struct weston_launcher * 36 | weston_launcher_connect(struct weston_compositor *compositor, int tty, 37 | const char *seat_id, bool sync_drm); 38 | 39 | void 40 | weston_launcher_destroy(struct weston_launcher *launcher); 41 | 42 | int 43 | weston_launcher_open(struct weston_launcher *launcher, 44 | const char *path, int flags); 45 | 46 | void 47 | weston_launcher_close(struct weston_launcher *launcher, int fd); 48 | 49 | int 50 | weston_launcher_activate_vt(struct weston_launcher *launcher, int vt); 51 | 52 | void 53 | weston_setup_vt_switch_bindings(struct weston_compositor *compositor); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /data/COPYING: -------------------------------------------------------------------------------- 1 | For the DMZ cursors: 2 | 3 | (c) 2007-2010 Novell, Inc. 4 | 5 | This work is licenced under the Creative Commons Attribution-Share Alike 3.0 6 | United States License. To view a copy of this licence, visit 7 | http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative 8 | Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA. 9 | 10 | The terminal icon is taken from the gnome-icon-theme collection which 11 | is also distributed under the Creative Commons BY-SA 3.0 license. 12 | 13 | 14 | (C) 2013 DENSO CORPORATION 15 | 16 | Permission to use, copy, modify, distribute, and sell following listed images 17 | for any purpose is hereby granted without fee, provided 18 | that the above copyright notice appear in all copies and that both that 19 | copyright notice and this permission notice appear in supporting 20 | documentation, and that the name of the copyright holders not be used in 21 | advertising or publicity pertaining to distribution of the images 22 | without specific, written prior permission. The copyright holders make 23 | no representations about the suitability of these images for any 24 | purpose. It is provided "as is" without express or implied warranty. 25 | 26 | background.png 27 | tiling.png 28 | fullscreen.png 29 | panel.png 30 | random.png 31 | sidebyside.png 32 | home.png 33 | icon_ivi_clickdot.png 34 | icon_ivi_flower.png 35 | icon_ivi_simple-egl.png 36 | icon_ivi_simple-shm.png 37 | icon_ivi_smoke.png 38 | 39 | 40 | For the SVG icons: 41 | 42 | © 2016 Samsung Electronics Co., Ltd 43 | 44 | This work is dual-licenced under both the MIT "Expat" License and the 45 | Creative Commons Attribution-Share Alike 3.0 United States License, and 46 | may be redistributed under either (or both) licenses as desired. See 47 | Weston's COPYING for details of the MIT license. To view a copy of the 48 | CC-SA-3.0 licence, visit http://creativecommons.org/licenses/by-sa/3.0/ 49 | or send a letter to Creative Commons, 171 Second Street, Suite 300, San 50 | Francisco, California 94105, USA. 51 | 52 | icons.svg 53 | icon_terminal.png 54 | icon_editor.png 55 | icon_flower.png 56 | -------------------------------------------------------------------------------- /libweston/pixman-renderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Vasily Khoruzhick 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | #include "backend.h" 30 | #include "libweston-internal.h" 31 | 32 | int 33 | pixman_renderer_init(struct weston_compositor *ec); 34 | 35 | struct pixman_renderer_output_options { 36 | /** Composite into a shadow buffer, copying to the hardware buffer */ 37 | bool use_shadow; 38 | }; 39 | 40 | int 41 | pixman_renderer_output_create(struct weston_output *output, 42 | const struct pixman_renderer_output_options *options); 43 | 44 | void 45 | pixman_renderer_output_set_buffer(struct weston_output *output, 46 | pixman_image_t *buffer); 47 | 48 | void 49 | pixman_renderer_output_set_hw_extra_damage(struct weston_output *output, 50 | pixman_region32_t *extra_damage); 51 | 52 | void 53 | pixman_renderer_output_destroy(struct weston_output *output); 54 | -------------------------------------------------------------------------------- /doc/doxygen/devtools.dox: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | /** 27 | @mainpage 28 | 29 | - @ref zunitc - Simple test framework 30 | 31 | @section tools_overview Overview 32 | 33 | The tools area currently consists of one sub-project (@ref zunitc) that is 34 | refined from the prior single weston/tests source folder. 35 | 36 | @subsection tools_overview_old Old Code Organization 37 | 38 | The original 'tests' folder contained basic weston testing with an 39 | integrated test runner framework. Over time things progressed to the 40 | stage where splitting apart into discrete layers was warranted. 41 | 42 | @dotfile tools_arch_old.gv "Original test code organization" 43 | 44 | @subsection tools_overview_new New Code Organization 45 | 46 | The test code that is not weston-specific gets split out to a separate 47 | folder and/or folders. 48 | 49 | @dotfile tools_arch_new.gv "Refactored test code organization" 50 | 51 | */ 52 | -------------------------------------------------------------------------------- /doc/sphinx/toc/libweston.rst: -------------------------------------------------------------------------------- 1 | Libweston 2 | ========= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | libweston/compositor.rst 9 | libweston/output-management.rst 10 | libweston/log.rst 11 | 12 | `Libweston` is an effort to separate the re-usable parts of Weston into a 13 | library. `Libweston` provides most of the boring and tedious bits of correctly 14 | implementing core Wayland protocols and interfacing with input and output 15 | systems, so that people who just want to write a new "Wayland window manager" 16 | (WM) or a small desktop environment (DE) can focus on the WM part. 17 | 18 | Libweston was first introduced in Weston 1.12, and is expected to continue 19 | evolving through many Weston releases before it achieves a stable API and 20 | feature completeness. 21 | 22 | `Libweston`'s primary purpose is exporting an API for creating Wayland 23 | compositors. Libweston's secondary purpose is to export the weston_config API 24 | so that third party plugins and helper programs can read :file:`weston.ini` if 25 | they want to. However, these two scopes are orthogonal and independent. At no 26 | point will the compositor functionality use or depend on the weston_config 27 | functionality. 28 | 29 | Further work 30 | ------------ 31 | 32 | In current form, `libweston` is an amalgam of various APIs mashed together and 33 | currently it needs a large clean-up and re-organization and possibly, a split 34 | into class-specific files. The documentation only provide the public 35 | API and not the private API used inside `libweston` or other functionality 36 | required in the core internals of the library. 37 | 38 | With that in mind we see the following steps needed to achieve that: 39 | 40 | - migrate everything that should not reside in the public API (for instance, 41 | the doxygen **\\internal** command is a clear indication that that symbol 42 | should not be present in the public API) to private headers. 43 | - if needed be, create class-specific files, like **input** and **output** 44 | which should tackle specific functionality, and allows to write the 45 | documentation parts much easier, and provides clarity for `libweston` 46 | users when they'd read it. 47 | -------------------------------------------------------------------------------- /libweston/launcher-impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Jasper St. Pierre 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | 30 | struct weston_launcher; 31 | 32 | struct launcher_interface { 33 | int (* connect) (struct weston_launcher **launcher_out, struct weston_compositor *compositor, 34 | int tty, const char *seat_id, bool sync_drm); 35 | void (* destroy) (struct weston_launcher *launcher); 36 | int (* open) (struct weston_launcher *launcher, const char *path, int flags); 37 | void (* close) (struct weston_launcher *launcher, int fd); 38 | int (* activate_vt) (struct weston_launcher *launcher, int vt); 39 | /* Get the number of the VT weston is running in */ 40 | int (* get_vt) (struct weston_launcher *launcher); 41 | }; 42 | 43 | struct weston_launcher { 44 | const struct launcher_interface *iface; 45 | }; 46 | 47 | extern const struct launcher_interface launcher_logind_iface; 48 | extern const struct launcher_interface launcher_weston_launch_iface; 49 | extern const struct launcher_interface launcher_direct_iface; 50 | -------------------------------------------------------------------------------- /weston.ini.in: -------------------------------------------------------------------------------- 1 | [core] 2 | #modules=cms-colord.so 3 | #xwayland=true 4 | #shell=desktop-shell.so 5 | #gbm-format=xrgb2101010 6 | #require-input=true 7 | 8 | [shell] 9 | background-image=/usr/share/backgrounds/gnome/Aqua.jpg 10 | background-color=0xff002244 11 | background-type=tile 12 | clock-format=minutes 13 | panel-color=0x90ff0000 14 | locking=true 15 | animation=zoom 16 | startup-animation=fade 17 | #binding-modifier=ctrl 18 | #num-workspaces=6 19 | #cursor-theme=whiteglass 20 | #cursor-size=24 21 | 22 | #lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png 23 | #lockscreen=/usr/share/backgrounds/gnome/Garden.jpg 24 | #homescreen=/usr/share/backgrounds/gnome/Blinds.jpg 25 | #animation=fade 26 | 27 | [launcher] 28 | icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png 29 | path=/usr/bin/gnome-terminal 30 | 31 | [launcher] 32 | icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png 33 | path=@bindir@/weston-terminal 34 | 35 | [launcher] 36 | icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png 37 | path=/usr/bin/google-chrome 38 | 39 | [launcher] 40 | icon=/usr/share/icons/gnome/24x24/apps/arts.png 41 | path=@bindir@/weston-flower 42 | 43 | [input-method] 44 | path=@libexecdir@/weston-keyboard 45 | 46 | #[output] 47 | #name=LVDS1 48 | #mode=1680x1050 49 | #transform=90 50 | #icc_profile=/usr/share/color/icc/colord/Bluish.icc 51 | 52 | #[output] 53 | #name=VGA1 54 | #mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync 55 | #transform=flipped 56 | 57 | #[output] 58 | #name=X1 59 | #mode=1024x768@60 60 | #transform=flipped-90 61 | 62 | #[libinput] 63 | #enable-tap=true 64 | #tap-and-drag=true 65 | #tap-and-drag-lock=true 66 | #disable-while-typing=false 67 | #middle-button-emulation=true 68 | #left-handed=true 69 | #rotation=90 70 | #accel-profile=flat 71 | #accel-speed=.9 72 | #natural-scroll=true 73 | #scroll-method=edge 74 | # For button-triggered scrolling: 75 | #scroll-method=button 76 | #scroll-button=BTN_RIGHT 77 | 78 | #[touchpad] 79 | #constant_accel_factor = 50 80 | #min_accel_factor = 0.16 81 | #max_accel_factor = 1.0 82 | 83 | [screen-share] 84 | command=@bindir@/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize 85 | 86 | #[xwayland] 87 | #path=@bindir@/Xwayland 88 | -------------------------------------------------------------------------------- /wcap/wcap-decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef _WCAP_DECODE_ 27 | #define _WCAP_DECODE_ 28 | 29 | #include 30 | 31 | #define WCAP_HEADER_MAGIC 0x57434150 32 | 33 | #define WCAP_FORMAT_XRGB8888 0x34325258 34 | #define WCAP_FORMAT_XBGR8888 0x34324258 35 | #define WCAP_FORMAT_RGBX8888 0x34325852 36 | #define WCAP_FORMAT_BGRX8888 0x34325842 37 | 38 | struct wcap_header { 39 | uint32_t magic; 40 | uint32_t format; 41 | uint32_t width, height; 42 | }; 43 | 44 | struct wcap_frame_header { 45 | uint32_t msecs; 46 | uint32_t nrects; 47 | }; 48 | 49 | struct wcap_rectangle { 50 | int32_t x1, y1, x2, y2; 51 | }; 52 | 53 | struct wcap_decoder { 54 | int fd; 55 | size_t size; 56 | void *map, *p, *end; 57 | uint32_t *frame; 58 | uint32_t format; 59 | uint32_t msecs; 60 | uint32_t count; 61 | int width, height; 62 | }; 63 | 64 | int wcap_decoder_get_frame(struct wcap_decoder *decoder); 65 | struct wcap_decoder *wcap_decoder_create(const char *filename); 66 | void wcap_decoder_destroy(struct wcap_decoder *decoder); 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /xwayland/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Intel Corporation 3 | * Copyright © 1988-2004 Keith Packard and Bart Massey. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the next 13 | * paragraph) shall be included in all copies or substantial portions of the 14 | * Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | * IN THE SOFTWARE. 23 | * 24 | * Except as contained in this notice, the names of the authors 25 | * or their institutions shall not be used in advertising or 26 | * otherwise to promote the sale, use or other dealings in this 27 | * Software without prior written authorization from the 28 | * authors. 29 | * 30 | * Authors: 31 | * Eric Anholt 32 | * Keith Packard 33 | */ 34 | 35 | #ifndef HASH_H 36 | #define HASH_H 37 | 38 | #include 39 | 40 | struct hash_table; 41 | struct hash_table *hash_table_create(void); 42 | typedef void (*hash_table_iterator_func_t)(void *element, void *data); 43 | 44 | void hash_table_destroy(struct hash_table *ht); 45 | void *hash_table_lookup(struct hash_table *ht, uint32_t hash); 46 | int hash_table_insert(struct hash_table *ht, uint32_t hash, void *data); 47 | void hash_table_remove(struct hash_table *ht, uint32_t hash); 48 | void hash_table_for_each(struct hash_table *ht, 49 | hash_table_iterator_func_t func, void *data); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /compositor/testsuite-util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | #include "weston.h" 30 | 31 | static struct wet_testsuite_data *wet_testsuite_data_global; 32 | 33 | /** Set global test suite data 34 | * 35 | * \param data Custom test suite data. 36 | * 37 | * The type struct wet_testsuite_data is free to be defined by any test suite 38 | * in any way they want. This function stores a single pointer to that data 39 | * in a global variable. 40 | * 41 | * The data is expected to be fetched from a test suite specific plugin that 42 | * knows how to interpret it. 43 | * 44 | * \sa wet_testsuite_data_get 45 | */ 46 | WL_EXPORT void 47 | wet_testsuite_data_set(struct wet_testsuite_data *data) 48 | { 49 | wet_testsuite_data_global = data; 50 | } 51 | 52 | /** Get global test suite data 53 | * 54 | * \return Custom test suite data. 55 | * 56 | * Returns the value last set with wet_testsuite_data_set(). 57 | */ 58 | WL_EXPORT struct wet_testsuite_data * 59 | wet_testsuite_data_get(void) 60 | { 61 | return wet_testsuite_data_global; 62 | } 63 | -------------------------------------------------------------------------------- /include/libweston/version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_VERSION_H 27 | #define WESTON_VERSION_H 28 | 29 | #define WESTON_VERSION_MAJOR @WESTON_VERSION_MAJOR@ 30 | #define WESTON_VERSION_MINOR @WESTON_VERSION_MINOR@ 31 | #define WESTON_VERSION_MICRO @WESTON_VERSION_MICRO@ 32 | #define WESTON_VERSION "@WESTON_VERSION@" 33 | 34 | /* This macro may not do what you expect. Weston doesn't guarantee 35 | * a stable API between 1.X and 1.Y, and thus this macro will return 36 | * FALSE on any WESTON_VERSION_AT_LEAST(1,X,0) if the actual version 37 | * is 1.Y.0 and X != Y). In particular, it fails if X < Y, that is, 38 | * 1.3.0 is considered to not be "at least" 1.4.0. 39 | * 40 | * If you want to test for the version number being 1.3.0 or above or 41 | * maybe in a range (eg 1.2.0 to 1.4.0), just use the WESTON_VERSION_* 42 | * defines above directly. 43 | */ 44 | 45 | #define WESTON_VERSION_AT_LEAST(major, minor, micro) \ 46 | (WESTON_VERSION_MAJOR == (major) && \ 47 | WESTON_VERSION_MINOR == (minor) && \ 48 | WESTON_VERSION_MICRO >= (micro)) 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /shared/xalloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008 Kristian Høgsberg 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_XALLOC_H 27 | #define WESTON_XALLOC_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | 41 | static inline void * 42 | fail_on_null(void *p, size_t size, char *file, int32_t line) 43 | { 44 | if (p == NULL) { 45 | fprintf(stderr, "[%s] ", program_invocation_short_name); 46 | if (file) 47 | fprintf(stderr, "%s:%d: ", file, line); 48 | fprintf(stderr, "out of memory"); 49 | if (size) 50 | fprintf(stderr, " (%zd)", size); 51 | fprintf(stderr, "\n"); 52 | exit(EXIT_FAILURE); 53 | } 54 | 55 | return p; 56 | } 57 | 58 | #define xmalloc(s) (fail_on_null(malloc(s), (s), __FILE__, __LINE__)) 59 | #define xzalloc(s) (fail_on_null(zalloc(s), (s), __FILE__, __LINE__)) 60 | #define xstrdup(s) (fail_on_null(strdup(s), 0, __FILE__, __LINE__)) 61 | #define xrealloc(p, s) (fail_on_null(realloc(p, s), (s), __FILE__, __LINE__)) 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* WESTON_XALLOC_H */ 68 | -------------------------------------------------------------------------------- /libweston/backend-rdp/hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Intel Corporation 3 | * Copyright © 1988-2004 Keith Packard and Bart Massey. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the next 13 | * paragraph) shall be included in all copies or substantial portions of the 14 | * Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | * IN THE SOFTWARE. 23 | * 24 | * Except as contained in this notice, the names of the authors 25 | * or their institutions shall not be used in advertising or 26 | * otherwise to promote the sale, use or other dealings in this 27 | * Software without prior written authorization from the 28 | * authors. 29 | * 30 | * Authors: 31 | * Eric Anholt 32 | * Keith Packard 33 | */ 34 | 35 | #ifndef HASH_H 36 | #define HASH_H 37 | 38 | #include 39 | 40 | struct hash_table; 41 | struct hash_table *hash_table_create(void); 42 | typedef void (*hash_table_iterator_func_t)(void *element, void *data); 43 | 44 | void hash_table_destroy(struct hash_table *ht); 45 | void *hash_table_lookup(struct hash_table *ht, uint32_t hash); 46 | int hash_table_insert(struct hash_table *ht, uint32_t hash, void *data); 47 | void hash_table_remove(struct hash_table *ht, uint32_t hash); 48 | void hash_table_for_each(struct hash_table *ht, 49 | hash_table_iterator_func_t func, void *data); 50 | uint32_t hash_table_num_entries(struct hash_table *ht); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /shared/meson.build: -------------------------------------------------------------------------------- 1 | srcs_libshared = [ 2 | 'config-parser.c', 3 | 'option-parser.c', 4 | 'file-util.c', 5 | 'os-compatibility.c', 6 | ] 7 | deps_libshared = dep_wayland_client 8 | 9 | lib_libshared = static_library( 10 | 'shared', 11 | srcs_libshared, 12 | include_directories: common_inc, 13 | dependencies: deps_libshared, 14 | pic: true, 15 | install: false 16 | ) 17 | dep_libshared = declare_dependency( 18 | link_with: lib_libshared, 19 | include_directories: public_inc, 20 | dependencies: deps_libshared 21 | ) 22 | 23 | srcs_cairo_shared = [ 24 | 'image-loader.c', 25 | 'cairo-util.c', 26 | 'frame.c', 27 | ] 28 | 29 | deps_cairo_shared = [ 30 | dep_libshared, 31 | dependency('cairo'), 32 | dependency('libpng'), 33 | dep_pixman, 34 | dep_libm, 35 | ] 36 | 37 | dep_pango = dependency('pango', required: false) 38 | dep_pangocairo = dependency('pangocairo', required: false) 39 | dep_glib = dependency('glib-2.0', version: '>= 2.36', required: false) 40 | 41 | if dep_pango.found() and dep_pangocairo.found() and dep_glib.found() 42 | deps_cairo_shared += [ dep_pango, dep_pangocairo, dep_glib ] 43 | config_h.set('HAVE_PANGO', '1') 44 | endif 45 | 46 | if get_option('image-jpeg') 47 | dep_libjpeg = dependency('libjpeg', required: false) 48 | if not dep_libjpeg.found() 49 | dep_libjpeg = cc.find_library('jpeg', required: false) 50 | endif 51 | if not dep_libjpeg.found() 52 | error('JPEG image loading requires libjpeg or jpeg, neither was found. Or, you can use \'-Dimage-jpeg=false\'.') 53 | endif 54 | deps_cairo_shared += dep_libjpeg 55 | config_h.set('HAVE_JPEG', '1') 56 | endif 57 | 58 | if get_option('image-webp') 59 | dep_webp = dependency('libwebp', required: false) 60 | if not dep_webp.found() 61 | error('WEBP image loading requires libwebp which was not found. Or, you can use \'-Dimage-webp=false\'.') 62 | endif 63 | deps_cairo_shared += dep_webp 64 | config_h.set('HAVE_WEBP', '1') 65 | endif 66 | 67 | lib_cairo_shared = static_library( 68 | 'cairo-shared', 69 | srcs_cairo_shared, 70 | include_directories: common_inc, 71 | dependencies: deps_cairo_shared, 72 | install: false 73 | ) 74 | dep_lib_cairo_shared = declare_dependency( 75 | link_with: lib_cairo_shared, 76 | dependencies: deps_cairo_shared 77 | ) 78 | 79 | dep_matrix_c = declare_dependency( 80 | sources: 'matrix.c', 81 | include_directories: public_inc, 82 | dependencies: dep_libm 83 | ) 84 | -------------------------------------------------------------------------------- /shared/os-compatibility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef OS_COMPATIBILITY_H 27 | #define OS_COMPATIBILITY_H 28 | 29 | #include "config.h" 30 | 31 | #include 32 | 33 | int 34 | os_fd_set_cloexec(int fd); 35 | 36 | int 37 | os_socketpair_cloexec(int domain, int type, int protocol, int *sv); 38 | 39 | int 40 | os_epoll_create_cloexec(void); 41 | 42 | int 43 | os_create_anonymous_file(off_t size); 44 | 45 | #ifndef HAVE_STRCHRNUL 46 | char * 47 | strchrnul(const char *s, int c); 48 | #endif 49 | 50 | struct ro_anonymous_file; 51 | 52 | enum ro_anonymous_file_mapmode { 53 | RO_ANONYMOUS_FILE_MAPMODE_PRIVATE, 54 | RO_ANONYMOUS_FILE_MAPMODE_SHARED, 55 | }; 56 | 57 | struct ro_anonymous_file * 58 | os_ro_anonymous_file_create(size_t size, 59 | const char *data); 60 | 61 | void 62 | os_ro_anonymous_file_destroy(struct ro_anonymous_file *file); 63 | 64 | size_t 65 | os_ro_anonymous_file_size(struct ro_anonymous_file *file); 66 | 67 | int 68 | os_ro_anonymous_file_get_fd(struct ro_anonymous_file *file, 69 | enum ro_anonymous_file_mapmode mapmode); 70 | 71 | int 72 | os_ro_anonymous_file_put_fd(int fd); 73 | 74 | #endif /* OS_COMPATIBILITY_H */ 75 | -------------------------------------------------------------------------------- /ivi-shell/weston.ini.in: -------------------------------------------------------------------------------- 1 | [core] 2 | shell=ivi-shell.so 3 | modules=hmi-controller.so 4 | 5 | [ivi-shell] 6 | ivi-shell-user-interface=weston-ivi-shell-user-interface 7 | 8 | #developermode=true 9 | 10 | cursor-theme=default 11 | cursor-size=32 12 | 13 | base-layer-id=1000 14 | base-layer-id-offset=10000 15 | 16 | workspace-background-layer-id=2000 17 | workspace-layer-id=3000 18 | application-layer-id=4000 19 | 20 | transition-duration=300 21 | 22 | background-image=@westondatadir@/background.png 23 | background-id=1001 24 | panel-image=@westondatadir@/panel.png 25 | panel-id=1002 26 | surface-id-offset=10 27 | tiling-image=@westondatadir@/tiling.png 28 | tiling-id=1003 29 | sidebyside-image=@westondatadir@/sidebyside.png 30 | sidebyside-id=1004 31 | fullscreen-image=@westondatadir@/fullscreen.png 32 | fullscreen-id=1005 33 | random-image=@westondatadir@/random.png 34 | random-id=1006 35 | home-image=@westondatadir@/home.png 36 | home-id=1007 37 | workspace-background-color=0x99000000 38 | workspace-background-id=2001 39 | 40 | [ivi-launcher] 41 | workspace-id=0 42 | icon-id=4001 43 | icon=@westondatadir@/icon_ivi_flower.png 44 | path=@bindir@/weston-flower 45 | 46 | [ivi-launcher] 47 | workspace-id=0 48 | icon-id=4002 49 | icon=@westondatadir@/icon_ivi_clickdot.png 50 | path=@bindir@/weston-clickdot 51 | 52 | [ivi-launcher] 53 | workspace-id=1 54 | icon-id=4003 55 | icon=@westondatadir@/icon_ivi_simple-egl.png 56 | path=@bindir@/weston-simple-egl 57 | 58 | [ivi-launcher] 59 | workspace-id=1 60 | icon-id=4004 61 | icon=@westondatadir@/icon_ivi_simple-shm.png 62 | path=@bindir@/weston-simple-shm 63 | 64 | [ivi-launcher] 65 | workspace-id=2 66 | icon-id=4005 67 | icon=@westondatadir@/icon_ivi_smoke.png 68 | path=@bindir@/weston-smoke 69 | 70 | [ivi-launcher] 71 | workspace-id=3 72 | icon-id=4006 73 | icon=@westondatadir@/icon_ivi_flower.png 74 | path=@bindir@/weston-flower 75 | 76 | [ivi-launcher] 77 | workspace-id=3 78 | icon-id=4007 79 | icon=@westondatadir@/icon_ivi_clickdot.png 80 | path=@bindir@/weston-clickdot 81 | 82 | [ivi-launcher] 83 | workspace-id=3 84 | icon-id=4008 85 | icon=@westondatadir@/icon_ivi_simple-egl.png 86 | path=@bindir@/weston-simple-egl 87 | 88 | [ivi-launcher] 89 | workspace-id=3 90 | icon-id=4009 91 | icon=@westondatadir@/icon_ivi_simple-shm.png 92 | path=@bindir@/weston-simple-shm 93 | 94 | [ivi-launcher] 95 | workspace-id=3 96 | icon-id=4010 97 | icon=@westondatadir@/icon_ivi_smoke.png 98 | path=@bindir@/weston-smoke 99 | -------------------------------------------------------------------------------- /pipewire/pipewire-plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2019 Pengutronix, Michael Olbrich 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef PIPEWIRE_PLUGIN_H 27 | #define PIPEWIRE_PLUGIN_H 28 | 29 | #include 30 | #include 31 | 32 | #define WESTON_PIPEWIRE_API_NAME "weston_pipewire_api_v1" 33 | 34 | struct weston_pipewire_api { 35 | /** Create pipewire outputs 36 | * 37 | * Returns 0 on success, -1 on failure. 38 | */ 39 | struct weston_output *(*create_output)(struct weston_compositor *c, 40 | char *name); 41 | 42 | /** Check if output is pipewire */ 43 | bool (*is_pipewire_output)(struct weston_output *output); 44 | 45 | /** Set mode */ 46 | int (*set_mode)(struct weston_output *output, const char *modeline); 47 | 48 | /** Set seat */ 49 | void (*set_seat)(struct weston_output *output, const char *seat); 50 | }; 51 | 52 | static inline const struct weston_pipewire_api * 53 | weston_pipewire_get_api(struct weston_compositor *compositor) 54 | { 55 | const void *api; 56 | api = weston_plugin_api_get(compositor, WESTON_PIPEWIRE_API_NAME, 57 | sizeof(struct weston_pipewire_api)); 58 | 59 | return (const struct weston_pipewire_api *)api; 60 | } 61 | 62 | #endif /* PIPEWIRE_PLUGIN_H */ 63 | -------------------------------------------------------------------------------- /tools/zunitc/src/zuc_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef ZUC_TYPES_H 27 | #define ZUC_TYPES_H 28 | 29 | #include "zunitc/zunitc_impl.h" 30 | 31 | struct zuc_case; 32 | 33 | /** 34 | * Represents a specific test. 35 | */ 36 | struct zuc_test 37 | { 38 | int order; 39 | struct zuc_case *test_case; 40 | zucimpl_test_fn fn; 41 | zucimpl_test_fn_f fn_f; 42 | char *name; 43 | int disabled; 44 | int skipped; 45 | int failed; 46 | int fatal; 47 | long elapsed; 48 | struct zuc_event *events; 49 | struct zuc_event *deferred; 50 | }; 51 | 52 | /** 53 | * Represents a test case that can hold a collection of tests. 54 | */ 55 | struct zuc_case 56 | { 57 | int order; 58 | char *name; 59 | const struct zuc_fixture* fxt; 60 | int disabled; 61 | int skipped; 62 | int failed; 63 | int fatal; 64 | int passed; 65 | long elapsed; 66 | int test_count; 67 | struct zuc_test **tests; 68 | }; 69 | 70 | /** 71 | * Returns a human-readable version of the comparison opcode. 72 | * 73 | * @param op the opcode to get a string version of. 74 | * @return a human-readable string of the opcode. 75 | * (This value should not be freed) 76 | */ 77 | const char * 78 | zuc_get_opstr(enum zuc_check_op op); 79 | 80 | #endif /* ZUC_TYPES_H */ 81 | -------------------------------------------------------------------------------- /doc/doxygen/tools_arch_old.gv: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | digraph toolarch_old { 27 | rankdir = "TB"; 28 | 29 | node[shape = record] 30 | 31 | subgraph cluster_0 { 32 | label = "./tests"; 33 | 34 | keyboard_test_c [label = "{keyboard-test.c|tests\l}"] 35 | text_test_c [label = "{text-test.c|tests\l}"] 36 | vertex_clip_test_c [label = "{vertex-clip-test.c|tests\l}"] 37 | 38 | weston_test_client_helper [label = "{weston-test-client-helper.h/.c|Wayland tracking structs\lWeston test protocol\lWayland callbacks\lTest run lifecycle\l}"] 39 | 40 | weston_test_c [label = "{weston-test.c|Extension protocol\nimplementation}"] 41 | weston_test_runner [label = "{weston-test-runner.h/.c|Test definition macros\lTest running functions\lTest reporting functions\lTest run lifecycle\l}"] 42 | } 43 | 44 | weston_test_client_helper -> weston_test_runner 45 | keyboard_test_c -> weston_test_client_helper 46 | keyboard_test_c -> weston_test_runner 47 | vertex_clip_test_c -> weston_test_runner 48 | text_test_c -> weston_test_client_helper 49 | text_test_c -> weston_test_runner 50 | 51 | edge [style = dashed, arrowhead = open] 52 | weston_test_client_helper -> weston_test_c 53 | } 54 | -------------------------------------------------------------------------------- /shared/string-helpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2016 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_STRING_HELPERS_H 27 | #define WESTON_STRING_HELPERS_H 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | /* Convert string to integer 36 | * 37 | * Parses a base-10 number from the given string. Checks that the 38 | * string is not blank, contains only numerical characters, and is 39 | * within the range of INT32_MIN to INT32_MAX. If the validation is 40 | * successful the result is stored in *value; otherwise *value is 41 | * unchanged and errno is set appropriately. 42 | * 43 | * \return true if the number parsed successfully, false on error 44 | */ 45 | static inline bool 46 | safe_strtoint(const char *str, int32_t *value) 47 | { 48 | long ret; 49 | char *end; 50 | 51 | assert(str != NULL); 52 | 53 | errno = 0; 54 | ret = strtol(str, &end, 10); 55 | if (errno != 0) { 56 | return false; 57 | } else if (end == str || *end != '\0') { 58 | errno = EINVAL; 59 | return false; 60 | } 61 | 62 | if ((long)((int32_t)ret) != ret) { 63 | errno = ERANGE; 64 | return false; 65 | } 66 | *value = (int32_t)ret; 67 | 68 | return true; 69 | } 70 | 71 | #endif /* WESTON_STRING_HELPERS_H */ 72 | -------------------------------------------------------------------------------- /include/libweston/backend-fbdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2016 Benoit Gschwind 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_COMPOSITOR_FBDEV_H 27 | #define WESTON_COMPOSITOR_FBDEV_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | 35 | #include 36 | 37 | #define WESTON_FBDEV_BACKEND_CONFIG_VERSION 2 38 | 39 | struct libinput_device; 40 | 41 | struct weston_fbdev_backend_config { 42 | struct weston_backend_config base; 43 | 44 | int tty; 45 | char *device; 46 | 47 | /** Callback used to configure input devices. 48 | * 49 | * This function will be called by the backend when a new input device 50 | * needs to be configured. 51 | * If NULL the device will use the default configuration. 52 | */ 53 | void (*configure_device)(struct weston_compositor *compositor, 54 | struct libinput_device *device); 55 | 56 | /** The seat to be used for input and output. 57 | * 58 | * If seat_id is NULL, the seat is taken from XDG_SEAT environment 59 | * variable. If neither is set, "seat0" is used. The backend will 60 | * take ownership of the seat_id pointer and will free it on 61 | * backend destruction. 62 | */ 63 | char *seat_id; 64 | }; 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* WESTON_COMPOSITOR_FBDEV_H */ 71 | -------------------------------------------------------------------------------- /ivi-shell/ivi-layout-shell.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 DENSO CORPORATION 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef IVI_LAYOUT_SHELL_H 27 | #define IVI_LAYOUT_SHELL_H 28 | 29 | #include 30 | 31 | /* 32 | * This is the interface that ivi-layout exposes to ivi-shell. 33 | * It is private to ivi-shell.so plugin. 34 | */ 35 | 36 | struct wl_listener; 37 | struct weston_compositor; 38 | struct weston_view; 39 | struct weston_surface; 40 | struct ivi_layout_surface; 41 | 42 | void 43 | ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf, 44 | int32_t width, int32_t height); 45 | 46 | struct ivi_layout_surface* 47 | ivi_layout_desktop_surface_create(struct weston_surface *wl_surface); 48 | 49 | void 50 | ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, 51 | int32_t width, int32_t height); 52 | 53 | struct ivi_layout_surface* 54 | ivi_layout_surface_create(struct weston_surface *wl_surface, 55 | uint32_t id_surface); 56 | 57 | void 58 | ivi_layout_init_with_compositor(struct weston_compositor *ec); 59 | 60 | void 61 | ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf); 62 | 63 | int 64 | load_controller_modules(struct weston_compositor *compositor, const char *modules, 65 | int *argc, char *argv[]); 66 | 67 | #endif /* IVI_LAYOUT_SHELL_H */ 68 | -------------------------------------------------------------------------------- /libweston/spring-tool.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2011 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include 27 | #include 28 | 29 | #include "config.h" 30 | 31 | #include 32 | #include "shared/timespec-util.h" 33 | 34 | WL_EXPORT void 35 | weston_view_geometry_dirty(struct weston_view *view) 36 | { 37 | } 38 | 39 | WL_EXPORT int 40 | weston_log(const char *fmt, ...) 41 | { 42 | return 0; 43 | } 44 | 45 | WL_EXPORT void 46 | weston_view_schedule_repaint(struct weston_view *view) 47 | { 48 | } 49 | 50 | WL_EXPORT void 51 | weston_compositor_schedule_repaint(struct weston_compositor *compositor) 52 | { 53 | } 54 | 55 | int 56 | main(int argc, char *argv[]) 57 | { 58 | const double k = 300.0; 59 | const double current = 0.5; 60 | const double target = 1.0; 61 | const double friction = 1400; 62 | 63 | struct weston_spring spring; 64 | struct timespec time = { 0 }; 65 | 66 | weston_spring_init(&spring, k, current, target); 67 | spring.friction = friction; 68 | spring.previous = 0.48; 69 | spring.timestamp = (struct timespec) { 0 }; 70 | 71 | while (!weston_spring_done(&spring)) { 72 | printf("\t%" PRId64 "\t%f\n", 73 | timespec_to_msec(&time), spring.current); 74 | weston_spring_update(&spring, &time); 75 | timespec_add_msec(&time, &time, 16); 76 | } 77 | 78 | return 0; 79 | } 80 | -------------------------------------------------------------------------------- /tools/zunitc/src/zuc_collector.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef ZUC_COLLECTOR_H 27 | #define ZUC_COLLECTOR_H 28 | 29 | struct zuc_event_listener; 30 | struct zuc_test; 31 | 32 | /** 33 | * Creates a new instance of an event collector that will attach events 34 | * to the current test directly or via connection from child to parent. 35 | * 36 | * @param pipe_fd pointer to the file descriptor to use for communication if 37 | * needed. If the value is -1 the events will be attached directly to the 38 | * current test. Otherwise events will be passed back via IPC over this 39 | * pipe with the expectation that the payload will be handled in the parent 40 | * process via zuc_process_message(). 41 | * @return a new collector instance. 42 | * @see zuc_process_message() 43 | */ 44 | struct zuc_event_listener * 45 | zuc_collector_create(int *pipe_fd); 46 | 47 | /** 48 | * Reads events from the given pipe and processes them. 49 | * 50 | * @param test the currently active test to attach events for. 51 | * @param pipe_fd the file descriptor of the pipe to read from. 52 | * @return a positive value if a message was received, 0 if the end has 53 | * been reached and -1 if an error has occurred. 54 | */ 55 | int 56 | zuc_process_message(struct zuc_test *test, int pipe_fd); 57 | 58 | #endif /* ZUC_COLLECTOR_H */ 59 | -------------------------------------------------------------------------------- /libweston/libinput-seat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013 Intel Corporation 3 | * Copyright © 2013 Jonas Ådahl 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice (including the 14 | * next paragraph) shall be included in all copies or substantial 15 | * portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | * SOFTWARE. 25 | */ 26 | 27 | #ifndef _LIBINPUT_SEAT_H_ 28 | #define _LIBINPUT_SEAT_H_ 29 | 30 | #include "config.h" 31 | 32 | #include 33 | 34 | #include 35 | 36 | struct libinput_device; 37 | 38 | struct udev_seat { 39 | struct weston_seat base; 40 | struct wl_list devices_list; 41 | struct wl_listener output_create_listener; 42 | struct wl_listener output_heads_listener; 43 | }; 44 | 45 | typedef void (*udev_configure_device_t)(struct weston_compositor *compositor, 46 | struct libinput_device *device); 47 | 48 | struct udev_input { 49 | struct libinput *libinput; 50 | struct wl_event_source *libinput_source; 51 | struct weston_compositor *compositor; 52 | int suspended; 53 | udev_configure_device_t configure_device; 54 | }; 55 | 56 | int 57 | udev_input_enable(struct udev_input *input); 58 | void 59 | udev_input_disable(struct udev_input *input); 60 | int 61 | udev_input_init(struct udev_input *input, 62 | struct weston_compositor *c, 63 | struct udev *udev, 64 | const char *seat_id, 65 | udev_configure_device_t configure_device); 66 | void 67 | udev_input_destroy(struct udev_input *input); 68 | 69 | struct udev_seat * 70 | udev_seat_get_named(struct udev_input *u, 71 | const char *seat_name); 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /tests/drm-smoke-test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2020 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include "weston-test-client-helper.h" 29 | #include "weston-test-fixture-compositor.h" 30 | 31 | static enum test_result_code 32 | fixture_setup(struct weston_test_harness *harness) 33 | { 34 | struct compositor_setup setup; 35 | 36 | compositor_setup_defaults(&setup); 37 | setup.shell = SHELL_TEST_DESKTOP; 38 | setup.backend = WESTON_BACKEND_DRM; 39 | setup.renderer = RENDERER_PIXMAN; 40 | 41 | return weston_test_harness_execute_as_client(harness, &setup); 42 | } 43 | DECLARE_FIXTURE_SETUP(fixture_setup); 44 | 45 | TEST(drm_smoke) { 46 | 47 | struct client *client; 48 | struct buffer *buffer; 49 | struct wl_surface *surface; 50 | pixman_color_t red; 51 | int i, frame; 52 | 53 | color_rgb888(&red, 255, 0, 0); 54 | 55 | client = create_client_and_test_surface(0, 0, 200, 200); 56 | assert(client); 57 | 58 | surface = client->surface->wl_surface; 59 | buffer = create_shm_buffer_a8r8g8b8(client, 200, 200); 60 | 61 | fill_image_with_color(buffer->image, &red); 62 | 63 | for (i = 0; i < 5; i++) { 64 | wl_surface_attach(surface, buffer->proxy, 0, 0); 65 | wl_surface_damage(surface, 0, 0, 200, 200); 66 | frame_callback_set(surface, &frame); 67 | wl_surface_commit(surface); 68 | frame_callback_wait(client, &frame); 69 | } 70 | 71 | client_destroy(client); 72 | } 73 | -------------------------------------------------------------------------------- /tests/surface-test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2012 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | #include 30 | 31 | #include 32 | #include "compositor/weston.h" 33 | #include "weston-test-runner.h" 34 | #include "weston-test-fixture-compositor.h" 35 | 36 | static enum test_result_code 37 | fixture_setup(struct weston_test_harness *harness) 38 | { 39 | struct compositor_setup setup; 40 | 41 | compositor_setup_defaults(&setup); 42 | 43 | return weston_test_harness_execute_as_plugin(harness, &setup); 44 | } 45 | DECLARE_FIXTURE_SETUP(fixture_setup); 46 | 47 | PLUGIN_TEST(surface_transform) 48 | { 49 | /* struct weston_compositor *compositor; */ 50 | struct weston_surface *surface; 51 | struct weston_view *view; 52 | float x, y; 53 | 54 | surface = weston_surface_create(compositor); 55 | assert(surface); 56 | view = weston_view_create(surface); 57 | assert(view); 58 | surface->width = 200; 59 | surface->height = 200; 60 | weston_view_set_position(view, 100, 100); 61 | weston_view_update_transform(view); 62 | weston_view_to_global_float(view, 20, 20, &x, &y); 63 | 64 | fprintf(stderr, "20,20 maps to %f, %f\n", x, y); 65 | assert(x == 120 && y == 120); 66 | 67 | weston_view_set_position(view, 150, 300); 68 | weston_view_update_transform(view); 69 | weston_view_to_global_float(view, 50, 40, &x, &y); 70 | assert(x == 200 && y == 340); 71 | } 72 | -------------------------------------------------------------------------------- /compositor/wslgd-notify.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022 Microsoft. All rights reservied. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #include "shared/helpers.h" 35 | #include "shared/string-helpers.h" 36 | #include 37 | #include 38 | #include "weston.h" 39 | 40 | WL_EXPORT int 41 | wet_module_init(struct weston_compositor *compositor, 42 | int *argc, char *argv[]) 43 | { 44 | struct sockaddr_un addr = {}; 45 | socklen_t size, name_size; 46 | char *socket_path = getenv("WSLGD_NOTIFY_SOCKET"); 47 | if (!socket_path) { 48 | weston_log("%s: socket path is not specified\n", __func__); 49 | return 0; 50 | } 51 | 52 | int socket_fd = socket(PF_LOCAL, SOCK_SEQPACKET, 0); 53 | if (socket_fd < 0) { 54 | weston_log("%s: socket failed\n", __func__); 55 | return -1; 56 | } 57 | 58 | addr.sun_family = AF_LOCAL; 59 | name_size = snprintf(addr.sun_path, sizeof addr.sun_path, 60 | "%s", socket_path) + 1; 61 | size = offsetof(struct sockaddr_un, sun_path) + name_size; 62 | 63 | int fd = connect(socket_fd, &addr, size); 64 | if (fd < 0) { 65 | weston_log("%s: connect(%s) failed %s\n", __func__, addr.sun_path, strerror(errno)); 66 | goto close_socket_fd; 67 | } 68 | 69 | weston_log("%s: socket connected\n", __FILE__); 70 | 71 | close(fd); 72 | 73 | close_socket_fd: 74 | close(socket_fd); 75 | 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /libweston/backend-drm/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('backend-drm') 2 | subdir_done() 3 | endif 4 | 5 | lib_backlight = static_library( 6 | 'backlight', 7 | 'libbacklight.c', 8 | dependencies: [ 9 | dep_libdrm_headers, 10 | dependency('libudev') 11 | ], 12 | include_directories: common_inc, 13 | install: false 14 | ) 15 | dep_backlight = declare_dependency( 16 | link_with: lib_backlight, 17 | include_directories: include_directories('.') 18 | ) 19 | 20 | config_h.set('BUILD_DRM_COMPOSITOR', '1') 21 | 22 | srcs_drm = [ 23 | 'drm.c', 24 | 'fb.c', 25 | 'modes.c', 26 | 'kms.c', 27 | 'state-helpers.c', 28 | 'state-propose.c', 29 | linux_dmabuf_unstable_v1_protocol_c, 30 | linux_dmabuf_unstable_v1_server_protocol_h, 31 | presentation_time_server_protocol_h, 32 | ] 33 | 34 | deps_drm = [ 35 | dep_libdl, 36 | dep_libweston_private, 37 | dep_session_helper, 38 | dep_libdrm, 39 | dep_libinput_backend, 40 | dependency('libudev', version: '>= 136'), 41 | dep_backlight 42 | ] 43 | 44 | if get_option('renderer-gl') 45 | dep_gbm = dependency('gbm', required: false) 46 | if not dep_gbm.found() 47 | error('drm-backend with GL renderer requires gbm which was not found. Or, you can use \'-Drenderer-gl=false\'.') 48 | endif 49 | if dep_gbm.version().version_compare('>= 17.1') 50 | config_h.set('HAVE_GBM_MODIFIERS', '1') 51 | endif 52 | if dep_gbm.version().version_compare('>= 17.2') 53 | config_h.set('HAVE_GBM_FD_IMPORT', '1') 54 | endif 55 | deps_drm += dep_gbm 56 | srcs_drm += 'drm-gbm.c' 57 | config_h.set('BUILD_DRM_GBM', '1') 58 | endif 59 | 60 | if get_option('backend-drm-screencast-vaapi') 61 | foreach name : [ 'libva', 'libva-drm' ] 62 | d = dependency(name, version: '>= 0.34.0', required: false) 63 | if not d.found() 64 | error('VA-API recorder requires @0@ >= 0.34.0 which was not found. Or, you can use \'-Dbackend-drm-screencast-vaapi=false\'.'.format(name)) 65 | endif 66 | deps_drm += d 67 | endforeach 68 | 69 | srcs_drm += 'vaapi-recorder.c' 70 | deps_drm += dependency('threads') 71 | config_h.set('BUILD_VAAPI_RECORDER', '1') 72 | endif 73 | 74 | if get_option('remoting') or get_option('pipewire') 75 | if not get_option('renderer-gl') 76 | error('DRM virtual requires renderer-gl.') 77 | endif 78 | srcs_drm += 'drm-virtual.c' 79 | config_h.set('BUILD_DRM_VIRTUAL', '1') 80 | endif 81 | 82 | plugin_drm = shared_library( 83 | 'drm-backend', 84 | srcs_drm, 85 | include_directories: common_inc, 86 | dependencies: deps_drm, 87 | name_prefix: '', 88 | install: true, 89 | install_dir: dir_module_libweston 90 | ) 91 | env_modmap += 'drm-backend.so=@0@;'.format(plugin_drm.full_path()) 92 | 93 | install_headers(backend_drm_h, subdir: dir_include_libweston_install) 94 | -------------------------------------------------------------------------------- /libweston/backend-rdp/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('backend-rdp') 2 | subdir_done() 3 | endif 4 | 5 | config_h.set('BUILD_RDP_COMPOSITOR', '1') 6 | 7 | dep_frdp = dependency('freerdp3', version: '>= 3.0.0', required: false) 8 | if not dep_frdp.found() 9 | dep_frdp = dependency('freerdp2', version: '>= 2.2.0', required: false) 10 | if not dep_frdp.found() 11 | error('RDP-backend requires freerdp >= 2.2.0 which was not found. Or, you can use \'-Dbackend-rdp=false\'.') 12 | endif 13 | endif 14 | 15 | dep_frdp_server = dependency('freerdp-server3', version: '>= 3.0.0', required: false) 16 | if not dep_frdp_server.found() 17 | dep_frdp_server = dependency('freerdp-server2', version: '>= 2.2.0', required: false) 18 | if not dep_frdp_server.found() 19 | error('RDP-backend requires freerdp-server >= 2.2.0 which was not found. Or, you can use \'-Dbackend-rdp=false\'.') 20 | endif 21 | endif 22 | 23 | dep_wpr = dependency('winpr3', version: '>= 3.0.0', required: false) 24 | if not dep_wpr.found() 25 | dep_wpr = dependency('winpr2', version: '>= 2.2.0', required: false) 26 | if not dep_wpr.found() 27 | error('RDP-backend requires winpr >= 2.2.0 which was not found. Or, you can use \'-Dbackend-rdp=false\'.') 28 | endif 29 | endif 30 | 31 | dep_rdpapplist = dependency('rdpapplist', version: '>= 2.0.0', required: false) 32 | if dep_rdpapplist.found() 33 | config_h.set('HAVE_FREERDP_RDPAPPLIST_H', '1') 34 | endif 35 | 36 | if cc.has_header('freerdp/channels/gfxredir.h', dependencies: dep_frdp) 37 | config_h.set('HAVE_FREERDP_GFXREDIR_H', '1') 38 | endif 39 | 40 | if cc.has_member( 41 | 'rdpsnd_server_context', 'use_dynamic_virtual_channel', 42 | dependencies : dep_frdp, 43 | prefix : '#include ' 44 | ) 45 | config_h.set('HAVE_RDPSND_DYNAMIC_VIRTUAL_CHANNEL', '1') 46 | endif 47 | 48 | deps_rdp = [ 49 | dep_threads, 50 | dep_libdl, 51 | dep_libweston_private, 52 | dep_frdp, 53 | dep_frdp_server, 54 | dep_wpr, 55 | dep_rdpapplist, 56 | ] 57 | 58 | dep_openssl = dependency('openssl', version: '>= 1.1.1', required: false) 59 | if dep_openssl.found() 60 | config_h.set('HAVE_OPENSSL', '1') 61 | deps_rdp += dep_openssl 62 | endif 63 | 64 | srcs_rdp = [ 65 | 'hash.c', 66 | 'rdp.c', 67 | 'rdpdisp.c', 68 | 'rdpclip.c', 69 | 'rdprail.c', 70 | 'rdputil.c', 71 | ] 72 | 73 | plugin_rdp = shared_library( 74 | 'rdp-backend', 75 | srcs_rdp, 76 | include_directories: common_inc, 77 | dependencies: deps_rdp, 78 | name_prefix: '', 79 | install: true, 80 | install_dir: dir_module_libweston 81 | ) 82 | env_modmap += 'rdp-backend.so=@0@;'.format(plugin_rdp.full_path()) 83 | install_headers(backend_rdp_h, subdir: dir_include_libweston_install) 84 | -------------------------------------------------------------------------------- /protocol/meson.build: -------------------------------------------------------------------------------- 1 | dep_scanner = dependency('wayland-scanner', native: true) 2 | prog_scanner = find_program(dep_scanner.get_pkgconfig_variable('wayland_scanner')) 3 | 4 | dep_wp = dependency('wayland-protocols', version: '>= 1.18') 5 | dir_wp_base = dep_wp.get_pkgconfig_variable('pkgdatadir') 6 | 7 | install_data( 8 | [ 9 | 'weston-debug.xml', 10 | 'weston-direct-display.xml', 11 | ], 12 | install_dir: join_paths(dir_data, dir_protocol_libweston) 13 | ) 14 | 15 | generated_protocols = [ 16 | [ 'input-method', 'v1' ], 17 | [ 'input-timestamps', 'v1' ], 18 | [ 'ivi-application', 'internal' ], 19 | [ 'ivi-hmi-controller', 'internal' ], 20 | [ 'fullscreen-shell', 'v1' ], 21 | [ 'linux-dmabuf', 'v1' ], 22 | [ 'linux-explicit-synchronization', 'v1' ], 23 | [ 'presentation-time', 'stable' ], 24 | [ 'pointer-constraints', 'v1' ], 25 | [ 'relative-pointer', 'v1' ], 26 | [ 'tablet', 'v2' ], 27 | [ 'text-cursor-position', 'internal' ], 28 | [ 'text-input', 'v1' ], 29 | [ 'viewporter', 'stable' ], 30 | [ 'weston-debug', 'internal' ], 31 | [ 'weston-desktop-shell', 'internal' ], 32 | [ 'weston-rdprail-shell', 'internal' ], 33 | [ 'weston-screenshooter', 'internal' ], 34 | [ 'weston-content-protection', 'internal' ], 35 | [ 'weston-test', 'internal' ], 36 | [ 'weston-touch-calibration', 'internal' ], 37 | [ 'weston-direct-display', 'internal' ], 38 | [ 'xdg-output', 'v1' ], 39 | [ 'xdg-shell', 'v6' ], 40 | [ 'xdg-shell', 'stable' ], 41 | ] 42 | 43 | foreach proto: generated_protocols 44 | proto_name = proto[0] 45 | if proto[1] == 'internal' 46 | base_file = proto_name 47 | xml_path = '@0@.xml'.format(proto_name) 48 | elif proto[1] == 'stable' 49 | base_file = proto_name 50 | xml_path = '@0@/stable/@1@/@1@.xml'.format(dir_wp_base, base_file) 51 | else 52 | base_file = '@0@-unstable-@1@'.format(proto_name, proto[1]) 53 | xml_path = '@0@/unstable/@1@/@2@.xml'.format(dir_wp_base, proto_name, base_file) 54 | endif 55 | 56 | foreach output_type: [ 'client-header', 'server-header', 'private-code' ] 57 | if output_type == 'client-header' 58 | output_file = '@0@-client-protocol.h'.format(base_file) 59 | elif output_type == 'server-header' 60 | output_file = '@0@-server-protocol.h'.format(base_file) 61 | else 62 | output_file = '@0@-protocol.c'.format(base_file) 63 | if dep_scanner.version().version_compare('< 1.14.91') 64 | output_type = 'code' 65 | endif 66 | endif 67 | 68 | var_name = output_file.underscorify() 69 | target = custom_target( 70 | '@0@ @1@'.format(base_file, output_type), 71 | command: [ prog_scanner, output_type, '@INPUT@', '@OUTPUT@' ], 72 | input: xml_path, 73 | output: output_file, 74 | ) 75 | 76 | set_variable(var_name, target) 77 | endforeach 78 | endforeach 79 | -------------------------------------------------------------------------------- /tests/string-test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2016 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #include "shared/string-helpers.h" 35 | 36 | #include "weston-test-client-helper.h" 37 | 38 | TEST(strtol_conversions) 39 | { 40 | bool ret; 41 | int32_t val = -1; 42 | char *str = NULL; 43 | 44 | str = ""; val = -1; 45 | ret = safe_strtoint(str, &val); 46 | assert(ret == false); 47 | assert(val == -1); 48 | 49 | str = "."; val = -1; 50 | ret = safe_strtoint(str, &val); 51 | assert(ret == false); 52 | assert(val == -1); 53 | 54 | str = "42"; val = -1; 55 | ret = safe_strtoint(str, &val); 56 | assert(ret == true); 57 | assert(val == 42); 58 | 59 | str = "-42"; val = -1; 60 | ret = safe_strtoint(str, &val); 61 | assert(ret == true); 62 | assert(val == -42); 63 | 64 | str = "0042"; val = -1; 65 | ret = safe_strtoint(str, &val); 66 | assert(ret == true); 67 | assert(val == 42); 68 | 69 | str = "x42"; val = -1; 70 | ret = safe_strtoint(str, &val); 71 | assert(ret == false); 72 | assert(val == -1); 73 | 74 | str = "42x"; val = -1; 75 | ret = safe_strtoint(str, &val); 76 | assert(ret == false); 77 | assert(val == -1); 78 | 79 | str = "0x42424242"; val = -1; 80 | ret = safe_strtoint(str, &val); 81 | assert(ret == false); 82 | assert(val == -1); 83 | 84 | str = "424748364789L"; val = -1; 85 | ret = safe_strtoint(str, &val); 86 | assert(ret == false); 87 | assert(val == -1); 88 | } 89 | -------------------------------------------------------------------------------- /tests/weston-testsuite-data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef WESTON_TESTSUITE_DATA_H 27 | #define WESTON_TESTSUITE_DATA_H 28 | 29 | /** Standard return codes 30 | * 31 | * Both Autotools and Meson use these codes as test program exit codes 32 | * to denote the test result for the whole process. 33 | * 34 | * \ingroup testharness 35 | */ 36 | enum test_result_code { 37 | RESULT_OK = 0, 38 | RESULT_SKIP = 77, 39 | RESULT_FAIL = 1, 40 | RESULT_HARD_ERROR = 99, 41 | }; 42 | 43 | struct weston_test; 44 | struct weston_compositor; 45 | 46 | /** Weston test types 47 | * 48 | * \sa weston_test_harness_execute_standalone 49 | * weston_test_harness_execute_as_plugin 50 | * weston_test_harness_execute_as_client 51 | * 52 | * \ingroup testharness_private 53 | */ 54 | enum test_type { 55 | TEST_TYPE_STANDALONE, 56 | TEST_TYPE_PLUGIN, 57 | TEST_TYPE_CLIENT, 58 | }; 59 | 60 | /** Test harness specific data for running tests 61 | * 62 | * \ingroup testharness_private 63 | */ 64 | struct wet_testsuite_data { 65 | void (*run)(struct wet_testsuite_data *); 66 | 67 | /* test definitions */ 68 | const struct weston_test_entry *tests; 69 | unsigned tests_count; 70 | int case_index; 71 | enum test_type type; 72 | struct weston_compositor *compositor; 73 | 74 | /* client thread control */ 75 | int thread_event_pipe; 76 | 77 | /* informational run state */ 78 | int fixture_iteration; 79 | 80 | /* test counts */ 81 | unsigned counter; 82 | unsigned passed; 83 | unsigned skipped; 84 | unsigned failed; 85 | unsigned total; 86 | }; 87 | 88 | #endif /* WESTON_TESTSUITE_DATA_H */ 89 | -------------------------------------------------------------------------------- /tools/zunitc/src/zuc_event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Samsung Electronics Co., Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef ZUC_EVENT_H 27 | #define ZUC_EVENT_H 28 | 29 | #include 30 | 31 | #include "zunitc/zunitc_impl.h" 32 | 33 | /** 34 | * 35 | */ 36 | enum zuc_event_type 37 | { 38 | ZUC_EVENT_IMMEDIATE, 39 | ZUC_EVENT_DEFERRED 40 | }; 41 | 42 | /** 43 | * Status enum for posted events. 44 | */ 45 | enum zuc_fail_state 46 | { 47 | ZUC_CHECK_OK, /**< no problem. */ 48 | ZUC_CHECK_SKIP, /**< runtime skip directive encountered. */ 49 | ZUC_CHECK_FAIL, /**< non-fatal check fails. */ 50 | ZUC_CHECK_FATAL, /**< fatal assertion/check fails. */ 51 | ZUC_CHECK_ERROR /**< internal level problem. */ 52 | }; 53 | 54 | /** 55 | * Record of an event that occurs during testing such as assert macro 56 | * failures. 57 | */ 58 | struct zuc_event 59 | { 60 | char *file; 61 | int32_t line; 62 | enum zuc_fail_state state; 63 | enum zuc_check_op op; 64 | enum zuc_check_valtype valtype; 65 | intptr_t val1; 66 | intptr_t val2; 67 | char *expr1; 68 | char *expr2; 69 | 70 | struct zuc_event *next; 71 | }; 72 | 73 | /** 74 | * Attaches an event to the specified test. 75 | * 76 | * @param test the test to attach to. 77 | * @param event the event to attach. 78 | * @param event_type of event (immediate or deferred) to attach. 79 | * @param transferred true if the event has been processed elsewhere and 80 | * is being transferred for storage, false otherwise. 81 | */ 82 | void 83 | zuc_attach_event(struct zuc_test *test, struct zuc_event *event, 84 | enum zuc_event_type event_type, bool transferred); 85 | 86 | #endif /* ZUC_EVENT_H */ 87 | -------------------------------------------------------------------------------- /libweston/linux-sync-file.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Collabora, Ltd 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #ifdef HAVE_LINUX_SYNC_FILE_H 36 | #include 37 | #else 38 | #include "linux-sync-file-uapi.h" 39 | #endif 40 | 41 | #include "linux-sync-file.h" 42 | #include "shared/timespec-util.h" 43 | 44 | /* Check that a file descriptor represents a valid sync file 45 | * 46 | * \param fd[in] a file descriptor 47 | * \return true if fd is a valid sync file, false otherwise 48 | */ 49 | bool 50 | linux_sync_file_is_valid(int fd) 51 | { 52 | struct sync_file_info file_info = { { 0 } }; 53 | 54 | if (ioctl(fd, SYNC_IOC_FILE_INFO, &file_info) < 0) 55 | return false; 56 | 57 | return file_info.num_fences > 0; 58 | } 59 | 60 | /* Read the timestamp stored in a sync file 61 | * 62 | * \param fd[in] fd a file descriptor for a sync file 63 | * \param ts[out] the timespec struct to fill with the timestamp 64 | * \return 0 if a timestamp was read, -1 on error 65 | */ 66 | WL_EXPORT int 67 | weston_linux_sync_file_read_timestamp(int fd, struct timespec *ts) 68 | { 69 | struct sync_file_info file_info = { { 0 } }; 70 | struct sync_fence_info fence_info = { { 0 } }; 71 | 72 | assert(ts != NULL); 73 | 74 | file_info.sync_fence_info = (uint64_t)(uintptr_t)&fence_info; 75 | file_info.num_fences = 1; 76 | 77 | if (ioctl(fd, SYNC_IOC_FILE_INFO, &file_info) < 0) 78 | return -1; 79 | 80 | timespec_from_nsec(ts, fence_info.timestamp_ns); 81 | 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /libweston/libinput-device.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2011, 2012 Intel Corporation 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #ifndef _LIBINPUT_DEVICE_H_ 27 | #define _LIBINPUT_DEVICE_H_ 28 | 29 | #include "config.h" 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | enum evdev_device_seat_capability { 39 | EVDEV_SEAT_POINTER = (1 << 0), 40 | EVDEV_SEAT_KEYBOARD = (1 << 1), 41 | EVDEV_SEAT_TOUCH = (1 << 2) 42 | }; 43 | 44 | struct evdev_device { 45 | struct weston_seat *seat; 46 | enum evdev_device_seat_capability seat_caps; 47 | struct libinput_device *device; 48 | struct weston_touch_device *touch_device; 49 | struct wl_list link; 50 | struct weston_output *output; 51 | struct wl_listener output_destroy_listener; 52 | char *output_name; 53 | int fd; 54 | bool override_wl_calibration; 55 | }; 56 | 57 | void 58 | evdev_led_update(struct evdev_device *device, enum weston_led leds); 59 | 60 | struct evdev_device * 61 | evdev_device_create(struct libinput_device *libinput_device, 62 | struct weston_seat *seat); 63 | 64 | int 65 | evdev_device_process_event(struct libinput_event *event); 66 | 67 | void 68 | evdev_device_set_output(struct evdev_device *device, 69 | struct weston_output *output); 70 | void 71 | evdev_device_destroy(struct evdev_device *device); 72 | 73 | void 74 | evdev_notify_keyboard_focus(struct weston_seat *seat, 75 | struct wl_list *evdev_devices); 76 | void 77 | evdev_device_set_calibration(struct evdev_device *device); 78 | 79 | int 80 | dispatch_libinput(struct libinput *libinput); 81 | 82 | #endif /* _LIBINPUT_DEVICE_H_ */ 83 | -------------------------------------------------------------------------------- /libweston/backend-drm/libbacklight.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libbacklight - userspace interface to Linux backlight control 3 | * 4 | * Copyright © 2012 Intel Corporation 5 | * Copyright 2010 Red Hat 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a 8 | * copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation 10 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 | * and/or sell copies of the Software, and to permit persons to whom the 12 | * Software is furnished to do so, subject to the following conditions: 13 | * 14 | * The above copyright notice and this permission notice (including the next 15 | * paragraph) shall be included in all copies or substantial portions of the 16 | * Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | * DEALINGS IN THE SOFTWARE. 26 | * 27 | * Authors: 28 | * Matthew Garrett 29 | * Tiago Vignatti 30 | */ 31 | #ifndef LIBBACKLIGHT_H 32 | #define LIBBACKLIGHT_H 33 | #include 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | enum backlight_type { 41 | BACKLIGHT_RAW, 42 | BACKLIGHT_PLATFORM, 43 | BACKLIGHT_FIRMWARE 44 | }; 45 | 46 | struct backlight { 47 | char *path; 48 | int max_brightness; 49 | int brightness; 50 | enum backlight_type type; 51 | }; 52 | 53 | /* 54 | * Find and set up a backlight for a valid udev connector device, i.e. one 55 | * matching drm subsystem and with status of connected. 56 | */ 57 | struct backlight *backlight_init(struct udev_device *drm_device, 58 | uint32_t connector_type); 59 | 60 | /* Free backlight resources */ 61 | void backlight_destroy(struct backlight *backlight); 62 | 63 | /* Provide the maximum backlight value */ 64 | long backlight_get_max_brightness(struct backlight *backlight); 65 | 66 | /* Provide the cached backlight value */ 67 | long backlight_get_brightness(struct backlight *backlight); 68 | 69 | /* Provide the hardware backlight value */ 70 | long backlight_get_actual_brightness(struct backlight *backlight); 71 | 72 | /* Set the backlight to a value between 0 and max */ 73 | long backlight_set_brightness(struct backlight *backlight, long brightness); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif /* LIBBACKLIGHT_H */ 80 | -------------------------------------------------------------------------------- /include/libweston/matrix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2011 Kristian Høgsberg 3 | * Copyright © 2012 Collabora, Ltd. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining 6 | * a copy of this software and associated documentation files (the 7 | * "Software"), to deal in the Software without restriction, including 8 | * without limitation the rights to use, copy, modify, merge, publish, 9 | * distribute, sublicense, and/or sell copies of the Software, and to 10 | * permit persons to whom the Software is furnished to do so, subject to 11 | * the following conditions: 12 | * 13 | * The above copyright notice and this permission notice (including the 14 | * next paragraph) shall be included in all copies or substantial 15 | * portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | * SOFTWARE. 25 | */ 26 | 27 | #ifndef WESTON_MATRIX_H 28 | #define WESTON_MATRIX_H 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | enum weston_matrix_transform_type { 35 | WESTON_MATRIX_TRANSFORM_TRANSLATE = (1 << 0), 36 | WESTON_MATRIX_TRANSFORM_SCALE = (1 << 1), 37 | WESTON_MATRIX_TRANSFORM_ROTATE = (1 << 2), 38 | WESTON_MATRIX_TRANSFORM_OTHER = (1 << 3), 39 | }; 40 | 41 | struct weston_matrix { 42 | float d[16]; 43 | unsigned int type; 44 | }; 45 | 46 | struct weston_vector { 47 | float f[4]; 48 | }; 49 | 50 | void 51 | weston_matrix_init(struct weston_matrix *matrix); 52 | void 53 | weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n); 54 | void 55 | weston_matrix_scale(struct weston_matrix *matrix, float x, float y, float z); 56 | void 57 | weston_matrix_translate(struct weston_matrix *matrix, 58 | float x, float y, float z); 59 | void 60 | weston_matrix_rotate_xy(struct weston_matrix *matrix, float cos, float sin); 61 | void 62 | weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v); 63 | 64 | int 65 | weston_matrix_invert(struct weston_matrix *inverse, 66 | const struct weston_matrix *matrix); 67 | 68 | #ifdef UNIT_TEST 69 | # define MATRIX_TEST_EXPORT WL_EXPORT 70 | 71 | int 72 | matrix_invert(double *A, unsigned *p, const struct weston_matrix *matrix); 73 | 74 | void 75 | inverse_transform(const double *LU, const unsigned *p, float *v); 76 | 77 | #else 78 | # define MATRIX_TEST_EXPORT static 79 | #endif 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* WESTON_MATRIX_H */ 86 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /remoting/remoting-plugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2018 Renesas Electronics Corp. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | * 25 | * Authors: IGEL Co., Ltd. 26 | */ 27 | 28 | #ifndef REMOTING_PLUGIN_H 29 | #define REMOTING_PLUGIN_H 30 | 31 | #include 32 | #include 33 | 34 | #define WESTON_REMOTING_API_NAME "weston_remoting_api_v1" 35 | 36 | struct weston_remoting_api { 37 | /** Create remoted outputs 38 | * 39 | * Returns 0 on success, -1 on failure. 40 | */ 41 | struct weston_output *(*create_output)(struct weston_compositor *c, 42 | char *name); 43 | 44 | /** Check if output is remoted */ 45 | bool (*is_remoted_output)(struct weston_output *output); 46 | 47 | /** Set mode */ 48 | int (*set_mode)(struct weston_output *output, const char *modeline); 49 | 50 | /** Set gbm format */ 51 | void (*set_gbm_format)(struct weston_output *output, 52 | const char *gbm_format); 53 | 54 | /** Set seat */ 55 | void (*set_seat)(struct weston_output *output, const char *seat); 56 | 57 | /** Set the destination Host(IP Address) */ 58 | void (*set_host)(struct weston_output *output, char *ip); 59 | 60 | /** Set the port number */ 61 | void (*set_port)(struct weston_output *output, int port); 62 | 63 | /** Set the pipeline for gstreamer */ 64 | void (*set_gst_pipeline)(struct weston_output *output, 65 | char *gst_pipeline); 66 | }; 67 | 68 | static inline const struct weston_remoting_api * 69 | weston_remoting_get_api(struct weston_compositor *compositor) 70 | { 71 | const void *api; 72 | api = weston_plugin_api_get(compositor, WESTON_REMOTING_API_NAME, 73 | sizeof(struct weston_remoting_api)); 74 | 75 | return (const struct weston_remoting_api *)api; 76 | } 77 | 78 | #endif /* REMOTING_PLUGIN_H */ 79 | -------------------------------------------------------------------------------- /tests/ivi-shell-app-test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2015 Collabora, Ltd. 3 | * 4 | * Permission is hereby granted, free of charge, to any person obtaining 5 | * a copy of this software and associated documentation files (the 6 | * "Software"), to deal in the Software without restriction, including 7 | * without limitation the rights to use, copy, modify, merge, publish, 8 | * distribute, sublicense, and/or sell copies of the Software, and to 9 | * permit persons to whom the Software is furnished to do so, subject to 10 | * the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the 13 | * next paragraph) shall be included in all copies or substantial 14 | * portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | * SOFTWARE. 24 | */ 25 | 26 | #include "config.h" 27 | 28 | #include 29 | #include 30 | 31 | #include "weston-test-client-helper.h" 32 | #include "ivi-application-client-protocol.h" 33 | #include "weston-test-fixture-compositor.h" 34 | #include "test-config.h" 35 | 36 | static enum test_result_code 37 | fixture_setup(struct weston_test_harness *harness) 38 | { 39 | struct compositor_setup setup; 40 | 41 | compositor_setup_defaults(&setup); 42 | setup.shell = SHELL_IVI; 43 | setup.config_file = TESTSUITE_IVI_CONFIG_PATH; 44 | setup.logging_scopes = "log,test-harness-plugin,proto"; 45 | 46 | return weston_test_harness_execute_as_client(harness, &setup); 47 | } 48 | DECLARE_FIXTURE_SETUP(fixture_setup); 49 | 50 | static struct ivi_application * 51 | get_ivi_application(struct client *client) 52 | { 53 | struct global *g; 54 | struct global *global_iviapp = NULL; 55 | struct ivi_application *iviapp; 56 | 57 | wl_list_for_each(g, &client->global_list, link) { 58 | if (strcmp(g->interface, "ivi_application")) 59 | continue; 60 | 61 | if (global_iviapp) 62 | assert(0 && "multiple ivi_application objects"); 63 | 64 | global_iviapp = g; 65 | } 66 | 67 | assert(global_iviapp && "no ivi_application found"); 68 | 69 | assert(global_iviapp->version == 1); 70 | 71 | iviapp = wl_registry_bind(client->wl_registry, global_iviapp->name, 72 | &ivi_application_interface, 1); 73 | assert(iviapp); 74 | 75 | return iviapp; 76 | } 77 | 78 | TEST(ivi_application_exists) 79 | { 80 | struct client *client; 81 | struct ivi_application *iviapp; 82 | 83 | client = create_client(); 84 | iviapp = get_ivi_application(client); 85 | client_roundtrip(client); 86 | 87 | testlog("Successful bind: %p\n", iviapp); 88 | 89 | client_destroy(client); 90 | } 91 | --------------------------------------------------------------------------------