From: Mikko Rasa Date: Sun, 12 Oct 2014 13:54:29 +0000 (+0300) Subject: Let platform header determine (part of) the contents of Display::Private X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=d26a3b66814216fa3a29c8a0582614b7349b13f2;p=libs%2Fgui.git Let platform header determine (part of) the contents of Display::Private This simplifies things a bit as there's no need to declare dummy typedefs for MonitorHandle and ModeHandle if they are not used. It also makes the upcoming Android support a lot easier to accomplish. --- diff --git a/source/graphics/cocoa/display_platform.h b/source/graphics/cocoa/display_platform.h index 2c59e06..0925867 100644 --- a/source/graphics/cocoa/display_platform.h +++ b/source/graphics/cocoa/display_platform.h @@ -7,8 +7,10 @@ namespace Msp { namespace Graphics { typedef CocoaDisplay *DisplayHandle; -typedef int MonitorHandle; -typedef int ModeHandle; + +struct PlatformDisplayPrivate +{ +}; } // namespace Graphics } // namespace Msp diff --git a/source/graphics/display_private.h b/source/graphics/display_private.h index 4a88ced..d5f0bf0 100644 --- a/source/graphics/display_private.h +++ b/source/graphics/display_private.h @@ -10,12 +10,10 @@ namespace Msp { namespace Graphics { -struct Display::Private +struct Display::Private: PlatformDisplayPrivate { DisplayHandle display; std::map windows; - std::vector monitors; - std::vector modes; }; } // namespace Graphics diff --git a/source/graphics/windows/display_platform.h b/source/graphics/windows/display_platform.h index 4abaee7..99329ae 100644 --- a/source/graphics/windows/display_platform.h +++ b/source/graphics/windows/display_platform.h @@ -5,8 +5,11 @@ namespace Msp { namespace Graphics { typedef void *DisplayHandle; -typedef std::string MonitorHandle; -typedef int ModeHandle; + +struct PlatformDisplayPrivate +{ + std::vector monitors; +}; } // namespace Graphics } // namespace Msp diff --git a/source/graphics/x11/display_platform.h b/source/graphics/x11/display_platform.h index 3a213c0..4335f1c 100644 --- a/source/graphics/x11/display_platform.h +++ b/source/graphics/x11/display_platform.h @@ -10,13 +10,14 @@ namespace Msp { namespace Graphics { typedef ::Display *DisplayHandle; + +struct PlatformDisplayPrivate +{ #ifdef WITH_XRANDR -typedef RROutput MonitorHandle; -typedef RRMode ModeHandle; -#else -typedef int MonitorHandle; -typedef int ModeHandle; + std::vector monitors; + std::vector modes; #endif +}; } // namespace Graphics } // namespace Msp