os/boardsupport/emulator/emulatorbsp/inc/monitors.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // wins\inc\monitors.h
    15 // Declare stuff we need for multiple monitor support.
    16 // (Not available in the version of windows.h we use.)
    17 // 
    18 //
    19 
    20 #ifndef __MONITORS_H__
    21 #define __MONITORS_H__
    22 
    23 #ifndef SM_CMONITORS
    24 
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    28 
    29 #define SM_XVIRTUALSCREEN       76
    30 #define SM_YVIRTUALSCREEN       77
    31 #define SM_CXVIRTUALSCREEN      78
    32 #define SM_CYVIRTUALSCREEN      79
    33 #define SM_CMONITORS            80
    34 #define SM_SAMEDISPLAYFORMAT    81
    35 
    36 DECLARE_HANDLE(HMONITOR);
    37 
    38 typedef struct tagMONITORINFO
    39 {
    40     DWORD   cbSize;
    41     RECT    rcMonitor;
    42     RECT    rcWork;
    43     DWORD   dwFlags;
    44 } MONITORINFO, *LPMONITORINFO;
    45 
    46 #ifdef __cplusplus
    47 }
    48 #endif
    49 
    50 #endif		// ifndef SM_CMONITORS
    51 
    52 /* CodeWarrior include files have SM_CMONITORS defined unconditionally,
    53  * but MONITOR_DEFAULTTONULL etc depend upon _WIN32_WINDOWS values.
    54  */
    55 #ifndef MONITOR_DEFAULTTONULL
    56 
    57 #define MONITOR_DEFAULTTONULL       0x00000000
    58 #define MONITOR_DEFAULTTOPRIMARY    0x00000001
    59 #define MONITOR_DEFAULTTONEAREST    0x00000002
    60 
    61 #endif		// ifndef MONITOR_DEFAULTTONULL
    62 
    63 class SystemMonitors
    64 	{
    65 public:
    66 	SystemMonitors(void);
    67 	inline TInt Count(void) { return iCount; };
    68 	TBool RectAllOnOne(RECT& rect);
    69 	HMONITOR MonitorFromRect(const RECT& rect, UINT flags=MONITOR_DEFAULTTONULL);
    70 	TBool GetMonitorInfo(HMONITOR monitor, LPMONITORINFO pMonInfo);
    71 private:
    72 	TBool iHaveMultiMonFunctions;
    73 	TBool iCount;
    74 	HMONITOR (WINAPI *ipMonitorFromRect)(LPCRECT lprcScreenCoords, UINT uFlags);
    75 	BOOL (WINAPI *ipGetMonitorInfo)(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo);
    76 	};
    77 
    78 #endif		// ifndef __MONITORS_H__