/*
 * What app.c, files.c and charms.c need from the Wayland host.
 */
#ifndef C8UI_WAYLAND_PRIVATE_H
#define C8UI_WAYLAND_PRIVATE_H

#include <gio/gio.h>
#include "c8ui-wayland.h"

/* The session bus connection on which the app owns its id, when
 * c8ui_app_main made it the one copy; NULL otherwise. The charms serve
 * on it instead of queueing for the name. */
GDBusConnection *c8ui_app_unique_bus(struct c8ui_app *app);
void c8ui_app_set_unique_bus(struct c8ui_app *app, GDBusConnection *bus);
/* Has windows, or is held */
bool c8ui_app_has_windows(struct c8ui_app *app);

/* "wayland:HANDLE" naming the window to other clients (xdg-foreign), so
 * a portal dialog opens over it; "" when there is none. Valid while the
 * window lives. */
const char *c8ui_window_export_handle(struct c8ui_window *window);

/* Asks the compositor for a token tied to the last input on the window,
 * to hand to an app being launched; fn gets NULL if there is none */
typedef void (*c8ui_token_fn)(const char *token, void *data);
void c8ui_window_request_token(struct c8ui_window *window, c8ui_token_fn fn,
	void *data);

#endif
