[gnome-flashback] export org.gnome.Mutter.DisplayConfig interface
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] export org.gnome.Mutter.DisplayConfig interface
- Date: Sun, 24 Aug 2014 00:22:48 +0000 (UTC)
commit 13cd4cea600c8dad6b3000159db8f764374093c0
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sun Aug 24 02:08:49 2014 +0300
export org.gnome.Mutter.DisplayConfig interface
gnome-flashback/flashback-display-config.c | 83 +++++++++++++++++++++++++++-
1 files changed, 82 insertions(+), 1 deletions(-)
---
diff --git a/gnome-flashback/flashback-display-config.c b/gnome-flashback/flashback-display-config.c
index 40242b6..9339e43 100644
--- a/gnome-flashback/flashback-display-config.c
+++ b/gnome-flashback/flashback-display-config.c
@@ -21,16 +21,90 @@
#include "flashback-display-config.h"
struct _FlashbackDisplayConfigPrivate {
- gint bus_name;
+ gint bus_name;
+ GDBusInterfaceSkeleton *iface;
};
G_DEFINE_TYPE (FlashbackDisplayConfig, flashback_display_config, G_TYPE_OBJECT);
static void
+handle_get_resources (DBusDisplayConfig *object,
+ GDBusMethodInvocation *invocation,
+ gpointer user_data)
+{
+ g_warning ("GetResources is not implemented!");
+}
+
+static void
+handle_apply_configuration (DBusDisplayConfig *object,
+ GDBusMethodInvocation *invocation,
+ guint serial,
+ gboolean persistent,
+ GVariant *crtcs,
+ GVariant *outputs,
+ gpointer user_data)
+{
+ g_warning ("ApplyConfiguration is not implemented!");
+}
+
+static void
+handle_change_backlight (DBusDisplayConfig *object,
+ GDBusMethodInvocation *invocation,
+ guint serial,
+ guint output_index,
+ gint value,
+ gpointer user_data)
+{
+ g_warning ("ChangeBacklight is not implemented!");
+}
+
+static void
+handle_get_crtc_gamma (DBusDisplayConfig *object,
+ GDBusMethodInvocation *invocation,
+ guint serial,
+ guint crtc_id,
+ gpointer user_data)
+{
+ g_warning ("GetCrtcGamma is not implemented!");
+}
+
+static void
+handle_set_crtc_gamma (DBusDisplayConfig *object,
+ GDBusMethodInvocation *invocation,
+ guint serial,
+ guint crtc_id,
+ GVariant *red_v,
+ GVariant *green_v,
+ GVariant *blue_v,
+ gpointer user_data)
+{
+ g_warning ("SetCrtcGamma is not implemented!");
+}
+
+static void
on_bus_acquired (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
+ FlashbackDisplayConfig *config = FLASHBACK_DISPLAY_CONFIG (user_data);
+ GError *error = NULL;
+
+ config->priv->iface = G_DBUS_INTERFACE_SKELETON (dbus_display_config_skeleton_new ());
+
+ g_signal_connect (config->priv->iface, "handle-get-resources", G_CALLBACK (handle_get_resources),
config);
+ g_signal_connect (config->priv->iface, "handle-apply-configuration", G_CALLBACK
(handle_apply_configuration), config);
+ g_signal_connect (config->priv->iface, "handle-change-backlight", G_CALLBACK
(handle_change_backlight), config);
+ g_signal_connect (config->priv->iface, "handle-get-crtc-gamma", G_CALLBACK (handle_get_crtc_gamma),
config);
+ g_signal_connect (config->priv->iface, "handle-set-crtc-gamma", G_CALLBACK (handle_set_crtc_gamma),
config);
+
+ if (!g_dbus_interface_skeleton_export (config->priv->iface,
+ connection,
+ "/org/gnome/Mutter/DisplayConfig",
+ &error)) {
+ g_warning ("Failed to export interface: %s", error->message);
+ g_error_free (error);
+ return;
+ }
}
static void
@@ -52,6 +126,13 @@ flashback_display_config_finalize (GObject *object)
{
FlashbackDisplayConfig *config = FLASHBACK_DISPLAY_CONFIG (object);
+ if (config->priv->iface) {
+ g_dbus_interface_skeleton_unexport (config->priv->iface);
+
+ g_object_unref (config->priv->iface);
+ config->priv->iface = NULL;
+ }
+
if (config->priv->bus_name) {
g_bus_unown_name (config->priv->bus_name);
config->priv->bus_name = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]