logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

wayland::server::shm_t - shared memory support

Author

       Generated automatically by Doxygen for Wayland++ from the source code.

Version 1.0.0                                Wed May 1 2024 17:27:19                   wayland::server::shm_t(3)

Detailed Description

       shared memory support

       A singleton global object that provides support for shared memory.

       Clients can create wl_shm_pool objects using the create_pool request.

       On binding the wl_shm object one or more format events are emitted to inform clients about the valid
       pixel formats that can be used for buffers.

       Definition at line 424 of file wayland-server-protocol.hpp.

Member Data Documentation

constexprstd::uint32_twayland::server::shm_t::format_since_version=1[static],[constexpr]
       Minimum protocol version required for the format function.

       Definition at line 476 of file wayland-server-protocol.hpp.

Member Function Documentation

voidshm_t::format(shm_formatconst&format,boolpost=true)
       pixel format description

       Parametersformat buffer pixel format

       Informs the client about a valid pixel format that can be used for buffers. Known formats include
       argb8888 and xrgb8888.

       Definition at line 1753 of file wayland-server-protocol.cpp.

   std::stringwayland::server::resource_t::get_class()[inherited]
       Retrieve the interface name (class) of a resource object.

       Returns
           Interface name of the resource object.

   client_twayland::server::resource_t::get_client()const[inherited]
       Get the associated client

       Returns
           the client that owns the resource.

   uint32_twayland::server::resource_t::get_id()const[inherited]
       Get the internal ID of the resource

       Returns
           the internal ID of the resource

   unsignedintwayland::server::resource_t::get_version()const[inherited]
       Get interface version

       Returns
           Interface version this resource has been constructed with.

   std::function<void(shm_pool_t,int,int32_t)>&shm_t::on_create_pool()
       create a shm pool

       Parametersid pool to create
           fd file descriptor for the pool
           size pool size, in bytes

       Create a new wl_shm_pool object.

       The pool can be used to create shared memory based buffer objects. The server will mmap size bytes of the
       passed file descriptor, to use as backing memory for the pool.

       Definition at line 1747 of file wayland-server-protocol.cpp.

   voidshm_t::post_invalid_fd(std::stringconst&msg)
       Post error: mmapping the file descriptor failed.

       Definition at line 1768 of file wayland-server-protocol.cpp.

   voidshm_t::post_invalid_format(std::stringconst&msg)
       Post error: buffer format is not known.

       Definition at line 1758 of file wayland-server-protocol.cpp.

   voidshm_t::post_invalid_stride(std::stringconst&msg)
       Post error: invalid size or stride during pool or buffer creation.

       Definition at line 1763 of file wayland-server-protocol.cpp.

   voidwayland::server::resource_t::post_no_memory()const[inherited]
       Post 'not enough memory' error to the client

       If the compositor has not enough memory to fulfill a certail request of the client, this function can be
       called to notify the client of this circumstance.

   boolwayland::server::resource_t::proxy_has_object()const[inherited]
       Check whether this wrapper actually wraps an object.

       Returns
           true if there is an underlying object, false if this wrapper is empty

Name

       wayland::server::shm_t - shared memory support

Synopsis

       #include <wayland-server-protocol.hpp>

       Inherits wayland::server::resource_t.

   PublicMemberFunctions
       std::function< void(shm_pool_t, int, int32_t)> & on_create_pool ()
           create a shm pool
       void format (shm_format const &format, bool post=true)
           pixel format description
       void post_invalid_format (std::string const &msg)
           Post error: buffer format is not known.
       void post_invalid_stride (std::string const &msg)
           Post error: invalid size or stride during pool or buffer creation.
       void post_invalid_fd (std::string const &msg)
           Post error: mmapping the file descriptor failed.
       bool proxy_has_object () const
           Check whether this wrapper actually wraps an object.
       void post_no_memory () const
       uint32_t get_id () const
       client_t get_client () const
       unsigned int get_version () const
       std::string get_class ()

   StaticPublicAttributes
       static constexpr std::uint32_t format_since_version = 1
           Minimum protocol version required for the format function.

See Also