WAYLAND_SERVER_GLOBAL_T(3)

πŸ’… wayland::server::global_t< resource > β€” Wayland++ manual, section 3 πŸ¦‹

okay bestie so this is from the Wayland++ manual pages (section 3), and it's literally the whole wayland::server::global_t< resource > situation. it's a C++ class page, generated by Doxygen, and yes it's giving "template soup" but stick with me β€” it's actually super clean once you see it πŸ’–


✨ NAME ✨

wayland::server::global_t< resource > β€” the global object class, no cap πŸ‘‘


🌸 SYNOPSIS 🌸

#include <wayland-server.hpp>

she inherits wayland::server::global_base_t β€” that's her mother, respect her 🫢

πŸŽ€ Public Member Functions

  • global_t (display_t &display, unsigned int version=resource::max_version) β€” the constructor, aka where the global gets born ✨
  • std::function< void(client_t, resource)> & on_bind () β€” hands you a reference to the bind-signal listener slot, so clients binding to you actually do something πŸ’…
  • template<typename resource> bool has_interface () β€” vibe check: does this global speak a specific interface? πŸ”

πŸ’œ Detailed Description πŸ’œ

template<class resource>
class wayland::server::global_t< resource >

it's a Global object, periodt 🌈

🧚 Template Parameters

  • resource β€” the resource class whose interface shall be used. that's the whole personality of this template, fr fr ⭐
Definition at line 625 of file wayland-server.hpp β€” go look, she's really there 😌

πŸ“ Constructor & Destructor Documentation πŸ“

πŸ’« template<class resource> wayland::server::global_t< resource >::global_t

(display_t & display, unsigned int version = resource::max_version)
[inline]

Create a global object β€” that's the whole job, and she ate πŸ”₯

Parameters

  • display β€” the parent display object, i.e. her home base 🏠
  • version β€” the interface version. defaults to resource::max_version in case you didn't clock it in the signature πŸ‘€
Definition at line 650 of file wayland-server.hpp

πŸ‘‘ Member Function Documentation πŸ‘‘

πŸ” template<typename resource> bool wayland::server::global_base_t::has_interface ()

[inline], [inherited]

Check for specific interface. lowkey the most useful little function ever, inherited so you don't even have to write it yourself 🫢

Template Parameters

  • resource β€” the resource class you're comparing against 🧐

Returns

true if the global has the same interface as the resource class. yes, a real bool, not vibes πŸ’―

Definition at line 614 of file wayland-server.hpp

🎧 template<class resource> std::function< void(client_t, resource)> & wayland::server::global_t< resource >::on_bind ()

[inline]

Adds a listener for the bind signal. this is the main character function honestly πŸ’…

when a client binds to a global object, registered listeners will be notified, carrying the client_t object and the new resource_t object. so you get both the who and the what, iconic 🌟

Definition at line 661 of file wayland-server.hpp

🌈 Author 🌈

Generated automatically by Doxygen for Wayland++ from the source code. not a human, a little documentation robot, and honestly she's doing great πŸ€–πŸ’–


πŸ’€ quick heads up bestie: this page is auto-generated from the source, so if something looks weird in the signature (we've all seen wayland::serv..._t< resource >), that's the truncation talking, not you πŸ™ˆ

and that's the page!! Version 1.0.1, dated Fri Mar 27 2026 β€” mwah, go bind some globals, you're gonna slay πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from