Documentation fixes in preparation for release

This commit is contained in:
Victor Berger 2021-07-25 10:47:30 +02:00 committed by Victor Berger
parent 3387957065
commit 07deba4c1b
8 changed files with 34 additions and 23 deletions

View File

@ -33,7 +33,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --features "test_all_features" -p smithay -p calloop:0.9.0 -p dbus -p drm -p gbm -p input -p nix:0.20.0 -p udev -p slog -p wayland-server -p wayland-commons -p wayland-protocols -p winit
args: --no-deps --features "test_all_features" -p smithay -p calloop:0.9.0 -p dbus -p drm -p gbm -p input -p nix:0.20.0 -p udev -p slog -p wayland-server -p wayland-commons:0.29.0 -p wayland-protocols:0.29.0 -p winit
- name: Setup index
run: cp ./doc_index.html ./target/doc/index.html

View File

@ -6,6 +6,13 @@ license = "MIT"
description = "Smithay is a library for writing wayland compositors."
repository = "https://github.com/Smithay/smithay"
edition = "2018"
readme = "README.md"
homepage = "https://smithay.github.io/"
keywords = ["wayland", "compositor", "graphics", "server"]
categories = ["gui"]
[package.metadata.docs.rs]
features = ["test_all_features"]
[workspace]
members = [ "anvil", "wlcs_anvil" ]
@ -64,7 +71,7 @@ renderer_gl = ["gl_generator", "backend_egl"]
use_system_lib = ["wayland_frontend", "wayland-sys", "wayland-server/use_system_lib"]
wayland_frontend = ["wayland-server", "wayland-commons", "wayland-protocols", "tempfile"]
xwayland = ["wayland_frontend"]
test_all_features = ["default"]
test_all_features = ["default", "use_system_lib", "wayland-server/dlopen"]
[[example]]
name = "raw_drm"

View File

@ -184,7 +184,7 @@ where
/// Marks the current frame as submitted.
///
/// *Note*: Needs to be called, after the vblank event of the matching [`DrmDevice`](super::DrmDevice)
/// *Note*: Needs to be called, after the vblank event of the matching [`DrmDevice`](super::super::DrmDevice)
/// was received after calling [`GbmBufferedSurface::queue_buffer`] on this surface.
/// Otherwise the underlying swapchain will run out of buffers eventually.
pub fn frame_submitted(&mut self) -> Result<(), Error> {

View File

@ -46,7 +46,7 @@ extern "system" fn egl_debug_log(
}
/// Loads libEGL symbols, if not loaded already.
/// This normally happens automatically during [`EGLDisplay`] initialization.
/// This normally happens automatically during [`EGLDisplay`](super::EGLDisplay) initialization.
pub fn make_sure_egl_is_loaded() -> Result<Vec<String>, Error> {
use std::{
ffi::{CStr, CString},

View File

@ -7,14 +7,16 @@
//! - Import/Export external resources to/from OpenGL
//!
//! To use this module, you first need to create a [`EGLDisplay`] through a supported EGL platform
//! as indicated by an implementation of the `native::EGLNativeDisplay` trait.
//! as indicated by an implementation of the [`native::EGLNativeDisplay`] trait.
//!
//! You may bind the [`EGLDisplay`], that shall be used by clients for rendering (so pick one initialized by a fast platform)
//! to the [`wayland_server::Display`] of your compositor. Note only one backend may be bound to any [`Display`](wayland_server::Display) at any time.
//!
//! You may then use the resulting [`display::EGLBufferReader`] to receive [`EGLBuffer`]
//! of an EGL-based [`WlBuffer`](wayland_server::protocol::wl_buffer::WlBuffer) for rendering.
//! Renderers implementing the [`ImportEGL`](crate::backend::renderer::ImportEGL)-trait can manage the buffer reader for you.
//! Renderers implementing the [`ImportEgl`](crate::backend::renderer::ImportEgl)-trait can manage the buffer reader for you.
//!
//! **Note:** The support for binding the [`EGLDisplay`] for use by clients requires the `use_system_lib` cargo feature on Smithay.
//!
//! To create OpenGL contexts you may create [`EGLContext`]s from the display and if the context is initialized with a config
//! it may also be used to initialize an [`EGLSurface`], which can be [bound](crate::backend::renderer::Bind) to some renderers.

View File

@ -91,7 +91,7 @@ pub trait KeyboardKeyEvent<B: InputBackend>: Event<B> {
fn key_code(&self) -> u32;
/// State of the key
fn state(&self) -> KeyState;
/// Total number of keys pressed on all devices on the associated [`Seat`]
/// Total number of keys pressed on all devices on the associated [`Seat`](crate::wayland::seat::Seat)
fn count(&self) -> u32;
}

View File

@ -98,19 +98,20 @@ impl Transform {
}
}
#[cfg(feature = "wayland-frontend")]
#[cfg(feature = "wayland_frontend")]
impl From<wayland_server::protocol::wl_output::Transform> for Transform {
fn from(transform: wayland_server::protocol::wl_output::Transform) -> Transform {
use wayland_server::protocol::wl_output::Transform::*;
use wayland_server::protocol::wl_output::Transform as WlTransform;
match transform {
Normal => Transform::Normal,
_90 => Transform::_90,
_180 => Transform::_180,
_270 => Transform::_270,
Flipped => Transform::Flipped,
Flipped90 => Transform::Flipped90,
Flipped180 => Transform::Flipped180,
Flipped270 => Transform::Flipped270,
WlTransform::Normal => Transform::Normal,
WlTransform::_90 => Transform::_90,
WlTransform::_180 => Transform::_180,
WlTransform::_270 => Transform::_270,
WlTransform::Flipped => Transform::Flipped,
WlTransform::Flipped90 => Transform::Flipped90,
WlTransform::Flipped180 => Transform::Flipped180,
WlTransform::Flipped270 => Transform::Flipped270,
_ => Transform::Normal,
}
}
}
@ -319,11 +320,12 @@ pub trait ImportEgl: Renderer {
///
/// ## Errors
///
/// This might return [`EglExtensionNotSupported`](Error::EglExtensionNotSupported)
/// This might return [`EglExtensionNotSupported`](super::egl::Error::EglExtensionNotSupported)
/// if binding is not supported by the EGL implementation.
///
/// This might return [`OtherEGLDisplayAlreadyBound`](Error::OtherEGLDisplayAlreadyBound)
/// if called for the same [`Display`] multiple times, as only one egl display may be bound at any given time.
/// This might return [`OtherEGLDisplayAlreadyBound`](super::egl::Error::OtherEGLDisplayAlreadyBound)
/// if called for the same [`Display`](wayland_server::Display) multiple times, as only one egl
/// display may be bound at any given time.
fn bind_wl_display(&mut self, display: &wayland_server::Display) -> Result<(), EglError>;
/// Unbinds a previously bound egl display, if existing.
@ -336,8 +338,8 @@ pub trait ImportEgl: Renderer {
///
/// The primary use for this is calling [`buffer_dimensions`] or [`buffer_type`].
///
/// Returns `None` if no [`Display`] was previously bound to the underlying [`EGLDisplay`]
/// (see [`ImportEgl::bind_wl_display`]).
/// Returns `None` if no [`Display`](wayland_server::Display) was previously bound to the underlying
/// [`EGLDisplay`](super::egl::EGLDisplay) (see [`ImportEgl::bind_wl_display`]).
fn egl_reader(&self) -> Option<&EGLBufferReader>;
/// Import a given wl_drm-based buffer into the renderer (see [`buffer_type`]).

View File

@ -22,7 +22,7 @@ use super::{
};
static ZXDG_TOPLEVEL_ROLE: &str = "zxdg_toplevel";
static ZXDG_POPUP_ROLE: &str = "zxdg_toplevel";
static ZXDG_POPUP_ROLE: &str = "zxdg_popup";
pub(crate) fn implement_shell(
shell: Main<zxdg_shell_v6::ZxdgShellV6>,