1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
/*
* Xinerama code
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif /* ifdef HAVE_CONFIG_H */
#include "Ecore.h"
#include "ecore_x_private.h"
#include "Ecore_X.h"
#include "Ecore_X_Atoms.h"
#ifdef ECORE_XINERAMA
static XineramaScreenInfo *_xin_info = NULL;
static int _xin_scr_num = 0;
#endif /* ifdef ECORE_XINERAMA */
EAPI int
ecore_x_xinerama_screen_count_get(void)
{
#ifdef ECORE_XINERAMA
int event_base, error_base;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (_xin_info)
XFree(_xin_info);
_xin_info = NULL;
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;
}
#endif /* ifdef ECORE_XINERAMA */
return 0;
} /* ecore_x_xinerama_screen_count_get */
EAPI Eina_Bool
ecore_x_xinerama_screen_geometry_get(int screen,
int *x,
int *y,
int *w,
int *h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
#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 EINA_TRUE;
}
}
}
#endif /* ifdef ECORE_XINERAMA */
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 EINA_FALSE;
screen = 0;
} /* ecore_x_xinerama_screen_geometry_get */
|