[gnome-settings-daemon] common: Add a GnomeRRScreen singleton
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] common: Add a GnomeRRScreen singleton
- Date: Thu, 22 Sep 2011 08:20:46 +0000 (UTC)
commit bd8c2449d54f5a8bc12591fbd720aa7e22d26b90
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Thu Sep 22 10:19:04 2011 +0200
common: Add a GnomeRRScreen singleton
gnome-settings-daemon/Makefile.am | 4 +++-
gnome-settings-daemon/gnome-settings-session.c | 14 ++++++++++++++
gnome-settings-daemon/gnome-settings-session.h | 5 +++++
3 files changed, 22 insertions(+), 1 deletions(-)
---
diff --git a/gnome-settings-daemon/Makefile.am b/gnome-settings-daemon/Makefile.am
index 2c72233..7e0e092 100644
--- a/gnome-settings-daemon/Makefile.am
+++ b/gnome-settings-daemon/Makefile.am
@@ -8,7 +8,8 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
$(SETTINGS_DAEMON_CFLAGS) \
- $(LIBNOTIFY_CFLAGS) \
+ $(LIBNOTIFY_CFLAGS) \
+ $(GNOME_DESKTOP_CFLAGS) \
$(NULL)
noinst_LTLIBRARIES = \
@@ -74,6 +75,7 @@ gnome_settings_daemon_LDADD = \
libgsd-profile.la \
$(SETTINGS_DAEMON_LIBS) \
$(LIBNOTIFY_LIBS) \
+ $(GNOME_DESKTOP_LIBS) \
$(NULL)
diff --git a/gnome-settings-daemon/gnome-settings-session.c b/gnome-settings-daemon/gnome-settings-session.c
index 2302304..d32490a 100644
--- a/gnome-settings-daemon/gnome-settings-session.c
+++ b/gnome-settings-daemon/gnome-settings-session.c
@@ -308,3 +308,17 @@ gnome_settings_session_new (void)
return GNOME_SETTINGS_SESSION (session);
}
+GnomeRRScreen *
+gnome_settings_session_get_screen (GError **error)
+{
+ static GnomeRRScreen *screen = NULL;
+
+ if (screen != NULL)
+ return g_object_ref (screen);
+
+ screen = gnome_rr_screen_new (gdk_screen_get_default (), error);
+ if (screen != NULL)
+ g_object_add_weak_pointer (G_OBJECT (screen), (gpointer *) &screen);
+
+ return screen;
+}
diff --git a/gnome-settings-daemon/gnome-settings-session.h b/gnome-settings-daemon/gnome-settings-session.h
index 874318b..ba93cf2 100644
--- a/gnome-settings-daemon/gnome-settings-session.h
+++ b/gnome-settings-daemon/gnome-settings-session.h
@@ -24,6 +24,9 @@
#include <glib-object.h>
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnome-desktop/gnome-rr.h>
+
G_BEGIN_DECLS
#define GNOME_TYPE_SETTINGS_SESSION (gnome_settings_session_get_type ())
@@ -58,6 +61,8 @@ GType gnome_settings_session_state_get_type (void);
GnomeSettingsSession *gnome_settings_session_new (void);
GnomeSettingsSessionState gnome_settings_session_get_state (GnomeSettingsSession *session);
+GnomeRRScreen *gnome_settings_session_get_screen (GError **error);
+
G_END_DECLS
#endif /* __GNOME_SETTINGS_SESSION_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]