bar can now toggle bluetooth power and discovery

This commit is contained in:
2025-12-22 01:41:01 +01:00
parent 0101ea1ec0
commit 5a429a3b8b
31 changed files with 507 additions and 114 deletions

View File

@@ -0,0 +1,35 @@
#pragma once
#include <gio/gio.h>
#include <gtk/gtk.h>
#include "sigc++/signal.h"
class BluetoothService {
public:
BluetoothService();
sigc::signal<void(bool)> powerStateChangedSignal;
sigc::signal<void(bool)> isDiscoveringChangedSignal;
bool getPowerState();
void setPowerState(bool state);
bool getIsDiscovering();
void setIsDiscovering(bool state);
private:
GDBusProxy *adapter_proxy = nullptr;
bool powerState = false;
bool isDiscovering = false;
void onPropertyChanged(GDBusProxy *proxy,
GVariant *changed_properties,
const gchar *const *invalidated_properties,
gpointer user_data);
static void onPropertyChangedStatic(GDBusProxy *proxy,
GVariant *changed_properties,
const gchar *const *invalidated_properties,
gpointer user_data);
};