UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
dbus_portal.cpp File Reference
#include <algorithm>
#include <string>
#include <memory>
#include <cassert>
#include <future>
#include <fstream>
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
#include <glib-object.h>
#include <glib.h>
#include <glib/gtypes.h>
#include <initializer_list>
#include "debug.h"
#include "misc.h"
#include "dbus_portal.hpp"
Include dependency graph for dbus_portal.cpp:

Go to the source code of this file.

Classes

class  ScreenCastPortal_impl
 

Macros

#define MOD_NAME   "[dbus] "
 

Functions

template<auto func>
void CallbackWrapper (GDBusConnection *connection, const gchar *sender_name, const gchar *object_path, const gchar *interface_name, const gchar *signal_name, GVariant *parameters, gpointer user_data)
 
static void on_portal_session_closed (GDBusConnection *connection, const gchar *sender_name, const gchar *object_path, const gchar *interface_name, const gchar *signal_name, GVariant *parameters, gpointer user_data)
 

Detailed Description

Macro Definition Documentation

◆ MOD_NAME

Function Documentation

◆ CallbackWrapper()

template<auto func>
void CallbackWrapper ( GDBusConnection * connection,
const gchar * sender_name,
const gchar * object_path,
const gchar * interface_name,
const gchar * signal_name,
GVariant * parameters,
gpointer user_data )

Definition at line 228 of file dbus_portal.cpp.

235{
236 (void) sender_name;
237 (void) interface_name;
238 (void) signal_name;
239
240 uint32_t response;
241 GVariant_uniq results;
242 g_variant_get(parameters, "(u@a{sv})", &response, out_ptr(results).operator GVariant**());
243
244 func(response, results.get(), static_cast<ScreenCastPortal_impl *>(user_data));
245
246 g_dbus_connection_call(connection, "org.freedesktop.portal.Desktop",
247 object_path, "org.freedesktop.portal.Request", "Close",
248 nullptr, nullptr, G_DBUS_CALL_FLAGS_NONE, -1, nullptr, nullptr, nullptr);
249
250}
Definition misc.h:94
HRESULT __stdcall(* func)()
Definition screen_win.c:325

Referenced by ScreenCastPortal_impl::call_with_request().

◆ on_portal_session_closed()

static void on_portal_session_closed ( GDBusConnection * connection,
const gchar * sender_name,
const gchar * object_path,
const gchar * interface_name,
const gchar * signal_name,
GVariant * parameters,
gpointer user_data )
static

Definition at line 299 of file dbus_portal.cpp.

306{
307 //Doesn't seem to be called by GNOME
308 LOG(LOG_LEVEL_INFO) << MOD_NAME "session closed by compositor\n";
309}
#define MOD_NAME
#define LOG_LEVEL_INFO
normal reporting
Definition debug.h:62
#define LOG(level)
Definition debug.h:313

References LOG, LOG_LEVEL_INFO, and MOD_NAME.

Referenced by ScreenCastPortal_impl::run().