mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Move keyPressed out of GSDMediaKeys::Private
This commit is contained in:
parent
b1c95d719a
commit
56a5363eb9
1 changed files with 15 additions and 23 deletions
|
@ -27,28 +27,7 @@ constexpr auto kMATEObjectPath = "/org/mate/SettingsDaemon/MediaKeys"_cs;
|
||||||
constexpr auto kInterface = kService;
|
constexpr auto kInterface = kService;
|
||||||
constexpr auto kMATEInterface = "org.mate.SettingsDaemon.MediaKeys"_cs;
|
constexpr auto kMATEInterface = "org.mate.SettingsDaemon.MediaKeys"_cs;
|
||||||
|
|
||||||
} // namespace
|
void KeyPressed(
|
||||||
|
|
||||||
class GSDMediaKeys::Private : public sigc::trackable {
|
|
||||||
public:
|
|
||||||
Glib::RefPtr<Gio::DBus::Connection> dbusConnection;
|
|
||||||
|
|
||||||
Glib::ustring service;
|
|
||||||
Glib::ustring objectPath;
|
|
||||||
Glib::ustring interface;
|
|
||||||
uint signalId = 0;
|
|
||||||
bool grabbed = false;
|
|
||||||
|
|
||||||
void keyPressed(
|
|
||||||
const Glib::RefPtr<Gio::DBus::Connection> &connection,
|
|
||||||
const Glib::ustring &sender_name,
|
|
||||||
const Glib::ustring &object_path,
|
|
||||||
const Glib::ustring &interface_name,
|
|
||||||
const Glib::ustring &signal_name,
|
|
||||||
const Glib::VariantContainerBase ¶meters);
|
|
||||||
};
|
|
||||||
|
|
||||||
void GSDMediaKeys::Private::keyPressed(
|
|
||||||
const Glib::RefPtr<Gio::DBus::Connection> &connection,
|
const Glib::RefPtr<Gio::DBus::Connection> &connection,
|
||||||
const Glib::ustring &sender_name,
|
const Glib::ustring &sender_name,
|
||||||
const Glib::ustring &object_path,
|
const Glib::ustring &object_path,
|
||||||
|
@ -83,6 +62,19 @@ void GSDMediaKeys::Private::keyPressed(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
class GSDMediaKeys::Private {
|
||||||
|
public:
|
||||||
|
Glib::RefPtr<Gio::DBus::Connection> dbusConnection;
|
||||||
|
|
||||||
|
Glib::ustring service;
|
||||||
|
Glib::ustring objectPath;
|
||||||
|
Glib::ustring interface;
|
||||||
|
uint signalId = 0;
|
||||||
|
bool grabbed = false;
|
||||||
|
};
|
||||||
|
|
||||||
GSDMediaKeys::GSDMediaKeys()
|
GSDMediaKeys::GSDMediaKeys()
|
||||||
: _private(std::make_unique<Private>()) {
|
: _private(std::make_unique<Private>()) {
|
||||||
try {
|
try {
|
||||||
|
@ -126,7 +118,7 @@ GSDMediaKeys::GSDMediaKeys()
|
||||||
_private->grabbed = true;
|
_private->grabbed = true;
|
||||||
|
|
||||||
_private->signalId = _private->dbusConnection->signal_subscribe(
|
_private->signalId = _private->dbusConnection->signal_subscribe(
|
||||||
sigc::mem_fun(_private.get(), &Private::keyPressed),
|
sigc::ptr_fun(KeyPressed),
|
||||||
_private->service,
|
_private->service,
|
||||||
_private->interface,
|
_private->interface,
|
||||||
"MediaPlayerKeyPressed",
|
"MediaPlayerKeyPressed",
|
||||||
|
|
Loading…
Add table
Reference in a new issue