From 5f3db8e0a052b4e40764da264f06f2d8a0828d31 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 25 Jun 2008 16:51:43 +0000 Subject: [PATCH] * clutter/win32/clutter-backend-win32.c (clutter_backend_win32_get_display_size): Implement get_display_size on the Win32 backend. --- ChangeLog | 6 +++++ clutter/win32/clutter-backend-win32.c | 39 ++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a59f4045..0f95c6ea1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-25 Neil Roberts + + * clutter/win32/clutter-backend-win32.c + (clutter_backend_win32_get_display_size): Implement + get_display_size on the Win32 backend. + 2008-06-25 Emmanuele Bassi * clutter/clutter-main.h: Make the priority constants public. diff --git a/clutter/win32/clutter-backend-win32.c b/clutter/win32/clutter-backend-win32.c index 186a987c1..f86e96136 100644 --- a/clutter/win32/clutter-backend-win32.c +++ b/clutter/win32/clutter-backend-win32.c @@ -229,6 +229,30 @@ clutter_backend_win32_get_features (ClutterBackend *backend) return flags; } +static void +clutter_backend_win32_get_display_size (ClutterBackend *backend, + gint *width, + gint *height) +{ + gint display_width, display_height; + + /* Try get the combined size of all of the monitors */ + if ((display_width = GetSystemMetrics (SM_CXVIRTUALSCREEN)) == 0 + || (display_height = GetSystemMetrics (SM_CYVIRTUALSCREEN)) == 0) + { + /* If the multi-monitor API isn't supported then just return the + size of the primary display */ + display_width = GetSystemMetrics (SM_CXSCREEN); + display_height = GetSystemMetrics (SM_CYSCREEN); + } + + if (width) + *width = display_width; + + if (height) + *height = display_height; +} + static void clutter_backend_win32_ensure_context (ClutterBackend *backend, ClutterStage *stage) @@ -336,13 +360,14 @@ clutter_backend_win32_class_init (ClutterBackendWin32Class *klass) gobject_class->dispose = clutter_backend_win32_dispose; gobject_class->finalize = clutter_backend_win32_finalize; - backend_class->pre_parse = clutter_backend_win32_pre_parse; - backend_class->init_events = clutter_backend_win32_init_events; - backend_class->create_stage = clutter_backend_win32_create_stage; - backend_class->add_options = clutter_backend_win32_add_options; - backend_class->get_features = clutter_backend_win32_get_features; - backend_class->redraw = clutter_backend_win32_redraw; - backend_class->ensure_context = clutter_backend_win32_ensure_context; + backend_class->pre_parse = clutter_backend_win32_pre_parse; + backend_class->init_events = clutter_backend_win32_init_events; + backend_class->create_stage = clutter_backend_win32_create_stage; + backend_class->add_options = clutter_backend_win32_add_options; + backend_class->get_features = clutter_backend_win32_get_features; + backend_class->get_display_size = clutter_backend_win32_get_display_size; + backend_class->redraw = clutter_backend_win32_redraw; + backend_class->ensure_context = clutter_backend_win32_ensure_context; } static void