Implementation of the new monitor abstraction.
This commit is contained in:
parent
36bbd62158
commit
e8c89484e8
|
@ -0,0 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Monitor definitions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __WINE_MONITOR_H
|
||||||
|
#define __WINE_MONITOR_H
|
||||||
|
|
||||||
|
struct tagMONITOR_DRIVER;
|
||||||
|
|
||||||
|
typedef struct tagMONITOR
|
||||||
|
{
|
||||||
|
struct tagMONITOR_DRIVER *pDriver;
|
||||||
|
void *pDriverData;
|
||||||
|
} MONITOR;
|
||||||
|
|
||||||
|
typedef struct tagMONITOR_DRIVER {
|
||||||
|
void (*pInitialize)(MONITOR *);
|
||||||
|
void (*pFinalize)(MONITOR *);
|
||||||
|
int (*pGetWidth)(MONITOR *);
|
||||||
|
int (*pGetHeight)(MONITOR *);
|
||||||
|
int (*pGetDepth)(MONITOR *);
|
||||||
|
} MONITOR_DRIVER;
|
||||||
|
|
||||||
|
extern MONITOR MONITOR_PrimaryMonitor;
|
||||||
|
|
||||||
|
extern void MONITOR_Initialize(MONITOR *pMonitor);
|
||||||
|
extern void MONITOR_Finalize(MONITOR *pMonitor);
|
||||||
|
extern int MONITOR_GetWidth(MONITOR *pMonitor);
|
||||||
|
extern int MONITOR_GetHeight(MONITOR *pMonitor);
|
||||||
|
extern int MONITOR_GetDepth(MONITOR *pMonitor);
|
||||||
|
|
||||||
|
#endif /* __WINE_MONITOR_H */
|
|
@ -4,10 +4,57 @@
|
||||||
* Copyright 1998 Turchanov Sergey
|
* Copyright 1998 Turchanov Sergey
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "monitor.h"
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
|
|
||||||
|
/**********************************************************************/
|
||||||
|
|
||||||
#define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
|
#define xPRIMARY_MONITOR ((HMONITOR)0x12340042)
|
||||||
|
|
||||||
|
MONITOR MONITOR_PrimaryMonitor;
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MONITOR_Initialize
|
||||||
|
*/
|
||||||
|
void MONITOR_Initialize(MONITOR *pMonitor)
|
||||||
|
{
|
||||||
|
pMonitor->pDriver->pInitialize(pMonitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MONITOR_Finalize
|
||||||
|
*/
|
||||||
|
void MONITOR_Finalize(MONITOR *pMonitor)
|
||||||
|
{
|
||||||
|
pMonitor->pDriver->pFinalize(pMonitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MONITOR_GetWidth
|
||||||
|
*/
|
||||||
|
int MONITOR_GetWidth(MONITOR *pMonitor)
|
||||||
|
{
|
||||||
|
return pMonitor->pDriver->pGetWidth(pMonitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MONITOR_GetHeight
|
||||||
|
*/
|
||||||
|
int MONITOR_GetHeight(MONITOR *pMonitor)
|
||||||
|
{
|
||||||
|
return pMonitor->pDriver->pGetHeight(pMonitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* MONITOR_GetDepth
|
||||||
|
*/
|
||||||
|
int MONITOR_GetDepth(MONITOR *pMonitor)
|
||||||
|
{
|
||||||
|
return pMonitor->pDriver->pGetDepth(pMonitor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**********************************************************************/
|
||||||
|
|
||||||
HMONITOR WINAPI MonitorFromPoint(POINT32 ptScreenCoords, DWORD dwFlags)
|
HMONITOR WINAPI MonitorFromPoint(POINT32 ptScreenCoords, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
|
if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
|
||||||
|
|
Loading…
Reference in New Issue