Plugin API

The API documentation of buzzay-plugin.h.

Structures

struct bz_plugin

The plugin wrapper structure that contains important metadata like plugin name, path, and the buzzay server.

Public Members

const char *plugin_name

The name of the plugin.

const char *plugin_path

The version number of the plugin.

void *data

Any data that you can insert into the plugin.

struct bz_keybinding

Buzzay keybinding information.

Public Members

xkb_keysym_t sym

They key to listen to.

bz_modifier_t modifiers

The modifier keys to listen to.

You can listen to multiple modifier keys by using |. For example, BZ_MOD_SHIFT | BZ_MOD_CTRL.

void (*handler)(struct bz_plugin *plugin, void *data)

Function to execute when keybinding is used.

Enums

enum bz_decoration_mode

Decoration modes

Values:

enumerator BZ_DECORATION_CLIENT_SIDE

Let the client draw their own decoration

enumerator BZ_DECORATION_SERVER_SIDE

Does not apply any decoration

API Functions

void bz_quit(struct bz_plugin *plugin)

Quit buzzay.

void bz_set_decoration_mode(struct bz_plugin *plugin, enum bz_decoration_mode mode)

Set window decoration mode.

bz_binding_handle_t bz_register_keybinding(struct bz_plugin *plugin, struct bz_keybinding binding)

Register a keybinding into buzzay.

Example:

void my_handle(struct bz_plugin *plugin, void *data) {
    // Do something...
}

void init_plugin(struct bz_plugin *plugin) {
   struct bz_keybinding binding = {
       .sym = XKB_KEY_Q,
       .modifiers = BZ_MOD_SHIFT | BZ_MOD_SUPER,
       .flags = BZ_BINDING_NONE,
       .handler = my_handle,
       .data = NULL
   };
   bz_register_keybinding(plugin, binding);
}
void bz_unregister_keybinding(bz_binding_handle_t handle)

Unregister a binding you registered into buzzay.

Example:

void init_plugin(struct bz_plugin *plugin) {
   // ...
   bz_binding_handle_t handle = bz_register_keybinding(plugin, binding);

   // Unregister with the handle
   bz_unregister_keybinding(handle);
}