[mutter] Add meta_screen_get_n_monitors() and meta_screen_get_monitor_geometry()
- From: Dan Winship <danw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [mutter] Add meta_screen_get_n_monitors() and meta_screen_get_monitor_geometry()
- Date: Mon, 31 Aug 2009 22:57:41 +0000 (UTC)
commit c10467d22ef9cbc8419f8392f7eb9ac2aa1b3cac
Author: Dan Winship <danw gnome org>
Date: Mon Aug 31 10:06:17 2009 -0400
Add meta_screen_get_n_monitors() and meta_screen_get_monitor_geometry()
http://bugzilla.gnome.org/show_bug.cgi?id=593686
src/core/screen.c | 36 ++++++++++++++++++++++++++++++++++++
src/include/screen.h | 5 +++++
2 files changed, 41 insertions(+), 0 deletions(-)
---
diff --git a/src/core/screen.c b/src/core/screen.c
index aac8230..efe9853 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1923,6 +1923,42 @@ meta_screen_get_current_monitor (MetaScreen *screen)
return &screen->monitor_infos[screen->last_monitor_index];
}
+/**
+ * meta_screen_get_n_monitors:
+ * @screen: a #MetaScreen
+ *
+ * Gets the number of monitors that are joined together to form @screen.
+ *
+ * Return value: the number of monitors
+ */
+int
+meta_screen_get_n_monitors (MetaScreen *screen)
+{
+ g_return_val_if_fail (META_IS_SCREEN (screen), 0);
+
+ return screen->n_monitor_infos;
+}
+
+/**
+ * meta_screen_get_monitor_geometry:
+ * @screen: a #MetaScreen
+ * @monitor: the monitor number
+ * @geometry: (out): location to store the monitor geometry
+ *
+ * Stores the location and size of the indicated monitor in @geometry.
+ */
+void
+meta_screen_get_monitor_geometry (MetaScreen *screen,
+ int monitor,
+ MetaRectangle *geometry)
+{
+ g_return_if_fail (META_IS_SCREEN (screen));
+ g_return_if_fail (monitor >= 0 && monitor < screen->n_monitor_infos);
+ g_return_if_fail (geometry != NULL);
+
+ *geometry = screen->monitor_infos[monitor].rect;
+}
+
#define _NET_WM_ORIENTATION_HORZ 0
#define _NET_WM_ORIENTATION_VERT 1
diff --git a/src/include/screen.h b/src/include/screen.h
index a985ed0..e16fe4d 100644
--- a/src/include/screen.h
+++ b/src/include/screen.h
@@ -75,4 +75,9 @@ int meta_screen_get_active_workspace_index (MetaScreen *screen);
MetaWorkspace * meta_screen_get_active_workspace (MetaScreen *screen);
+int meta_screen_get_n_monitors (MetaScreen *screen);
+void meta_screen_get_monitor_geometry (MetaScreen *screen,
+ int monitor,
+ MetaRectangle *geometry);
+
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]