Commit e8c89484 authored by Patrik Stridvall's avatar Patrik Stridvall Committed by Alexandre Julliard

Implementation of the new monitor abstraction.

parent 36bbd621
/*
* 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
*/
#include "monitor.h"
#include "windows.h"
/**********************************************************************/
#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)
{
if ((dwFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment