2004-03-03 00:56:51 +01:00
|
|
|
// X Window System-specific code
|
|
|
|
// Copyright (c) 2004 Jan Wassenberg
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// Contact info:
|
|
|
|
// Jan.Wassenberg@stud.uni-karlsruhe.de
|
|
|
|
// http://www.stud.uni-karlsruhe.de/~urkt/
|
|
|
|
|
2004-05-08 03:11:51 +02:00
|
|
|
#include "precompiled.h"
|
|
|
|
|
2004-03-03 00:56:51 +01:00
|
|
|
#ifdef HAVE_X
|
|
|
|
|
|
|
|
#include <Xlib.h>
|
2004-03-04 21:36:31 +01:00
|
|
|
#include "detect.h"
|
2004-03-03 00:56:51 +01:00
|
|
|
|
|
|
|
// useful for choosing a video mode. not called by detect().
|
2004-05-06 19:14:30 +02:00
|
|
|
// if we fail, outputs are unchanged (assumed initialized to defaults)
|
2004-06-01 19:34:12 +02:00
|
|
|
int get_cur_vmode(int* xres, int* yres, int* bpp, int* freq)
|
2004-03-03 00:56:51 +01:00
|
|
|
{
|
2004-03-03 16:16:20 +01:00
|
|
|
Display* disp = XOpenDisplay(0);
|
2004-03-03 00:56:51 +01:00
|
|
|
if(!disp)
|
2004-05-06 19:14:30 +02:00
|
|
|
return -1;
|
2004-03-03 00:56:51 +01:00
|
|
|
|
|
|
|
int screen = XDefaultScreen(disp);
|
2004-06-01 19:34:12 +02:00
|
|
|
if(xres)
|
|
|
|
*xres = XDisplayWidth (disp, screen);
|
|
|
|
if(yres)
|
|
|
|
*yres = XDisplayHeight(disp, screen);
|
|
|
|
if(bpp)
|
|
|
|
*bpp = 0;
|
|
|
|
if(freq)
|
|
|
|
*freq = 0;
|
2004-03-03 00:56:51 +01:00
|
|
|
XCloseDisplay(disp);
|
2004-05-06 19:14:30 +02:00
|
|
|
return 0;
|
2004-03-03 00:56:51 +01:00
|
|
|
}
|
|
|
|
|
2004-05-06 19:14:30 +02:00
|
|
|
|
|
|
|
// useful for determining aspect ratio. not called by detect().
|
|
|
|
// if we fail, outputs are unchanged (assumed initialized to defaults)
|
2004-05-08 03:11:51 +02:00
|
|
|
int get_monitor_size(int& width_mm, int& height_mm)
|
2004-05-06 19:14:30 +02:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-03-04 21:36:31 +01:00
|
|
|
#endif // #ifdef HAVE_X
|