2005-10-07 01:33:10 -07:00
|
|
|
/*
|
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
|
|
|
*/
|
2009-01-31 10:33:39 -08:00
|
|
|
|
2005-01-10 05:11:50 -08:00
|
|
|
/*
|
|
|
|
* Xinerama code
|
|
|
|
*/
|
2009-01-31 10:33:39 -08:00
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-01-10 05:11:50 -08:00
|
|
|
#include "Ecore.h"
|
|
|
|
#include "ecore_x_private.h"
|
|
|
|
#include "Ecore_X.h"
|
|
|
|
#include "Ecore_X_Atoms.h"
|
|
|
|
|
2005-02-05 04:59:35 -08:00
|
|
|
#ifdef ECORE_XINERAMA
|
2005-01-10 05:11:50 -08:00
|
|
|
static XineramaScreenInfo *_xin_info = NULL;
|
|
|
|
static int _xin_scr_num = 0;
|
2005-02-05 04:59:35 -08:00
|
|
|
#endif
|
2005-01-10 05:11:50 -08:00
|
|
|
|
2006-01-06 12:22:09 -08:00
|
|
|
EAPI int
|
2005-01-10 05:11:50 -08:00
|
|
|
ecore_x_xinerama_screen_count_get(void)
|
|
|
|
{
|
|
|
|
#ifdef ECORE_XINERAMA
|
2005-10-07 01:33:10 -07:00
|
|
|
int event_base, error_base;
|
|
|
|
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2005-01-10 05:11:50 -08:00
|
|
|
if (_xin_info) XFree(_xin_info);
|
|
|
|
_xin_info = NULL;
|
2005-10-07 01:33:10 -07:00
|
|
|
if (XineramaQueryExtension(_ecore_x_disp, &event_base, &error_base))
|
|
|
|
{
|
|
|
|
_xin_info = XineramaQueryScreens(_ecore_x_disp, &_xin_scr_num);
|
|
|
|
if (_xin_info) return _xin_scr_num;
|
|
|
|
}
|
2005-01-10 05:11:50 -08:00
|
|
|
#endif
|
2005-10-07 01:33:10 -07:00
|
|
|
return 0;
|
2005-01-10 05:11:50 -08:00
|
|
|
}
|
|
|
|
|
2006-01-06 12:22:09 -08:00
|
|
|
EAPI int
|
2005-01-10 05:11:50 -08:00
|
|
|
ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h)
|
|
|
|
{
|
2010-02-25 04:19:02 -08:00
|
|
|
LOGFN(__FILE__, __LINE__, __FUNCTION__);
|
2005-01-10 05:11:50 -08:00
|
|
|
#ifdef ECORE_XINERAMA
|
|
|
|
if (_xin_info)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < _xin_scr_num; i++)
|
|
|
|
{
|
|
|
|
if (_xin_info[i].screen_number == screen)
|
|
|
|
{
|
|
|
|
if (x) *x = _xin_info[i].x_org;
|
|
|
|
if (y) *y = _xin_info[i].y_org;
|
|
|
|
if (w) *w = _xin_info[i].width;
|
|
|
|
if (h) *h = _xin_info[i].height;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (x) *x = 0;
|
|
|
|
if (y) *y = 0;
|
|
|
|
if (w) *w = DisplayWidth(_ecore_x_disp, 0);
|
|
|
|
if (h) *h = DisplayHeight(_ecore_x_disp, 0);
|
|
|
|
return 0;
|
|
|
|
}
|