forked from enlightenment/efl
parent
c7c6f53e78
commit
fb7f6e24c6
|
@ -294,6 +294,38 @@ CFLAGS=$PCFLAGS
|
|||
AC_SUBST(Xcursor_cflags)
|
||||
AC_SUBST(Xcursor_libs)
|
||||
|
||||
Xinerama_libs=""
|
||||
Xinerama_cflags=""
|
||||
use_Xinerama="no"
|
||||
PCFLAGS=$CFLAGS
|
||||
CFLAGS=$x_cflags" "$x_includes
|
||||
AC_CHECK_HEADER(X11/extensions/Xinerama.h, [
|
||||
AC_CHECK_LIB(Xinerama, XineramaQueryScreens, [
|
||||
AC_DEFINE(ECORE_XINERAMA, 1, [Build support for Xinerama])
|
||||
Xinerama_cflags=""
|
||||
Xinerama_libs="-lXinerama"
|
||||
use_Xinerama="yes"
|
||||
], [
|
||||
Xinerama_cflags=""
|
||||
Xinerama_libs=""
|
||||
use_Xinerama="no"
|
||||
], [
|
||||
$x_libs $x_ldflags -lXrender
|
||||
]
|
||||
)
|
||||
], [
|
||||
Xinerama_cflags=""
|
||||
Xinerama_libs=""
|
||||
use_Xinerama="no"
|
||||
], [
|
||||
#include <X11/Xlib.h>
|
||||
]
|
||||
)
|
||||
CFLAGS=$PCFLAGS
|
||||
|
||||
AC_SUBST(Xinerama_cflags)
|
||||
AC_SUBST(Xinerama_libs)
|
||||
|
||||
AC_SUBST(ecore_x_cflags)
|
||||
AC_SUBST(ecore_x_libs)
|
||||
|
||||
|
@ -762,7 +794,7 @@ echo
|
|||
echo " Ecore_Job...............: $have_ecore_job"
|
||||
echo " Ecore_Con...............: $have_ecore_con (OpenSSL: $use_openssl)"
|
||||
echo " Ecore_Txt...............: $have_ecore_txt"
|
||||
echo " Ecore_X.................: $have_ecore_x (Xcursor: $use_Xcursor)"
|
||||
echo " Ecore_X.................: $have_ecore_x (Xcursor: $use_Xcursor) (Xinerama: $use_Xinerama)"
|
||||
echo " Ecore_FB................: $have_ecore_fb"
|
||||
echo " Ecore_Evas..............: $have_ecore_evas"
|
||||
echo " Ecore_Evas GL Support...: $have_ecore_evas_gl"
|
||||
|
|
|
@ -1099,6 +1099,8 @@ EAPI int ecore_x_client_message8_send(Ecore_X_Window win, Ecore_X_A
|
|||
EAPI void ecore_x_netwm_window_state_set(Ecore_X_Window win, Ecore_X_Window_State state, int on);
|
||||
EAPI int ecore_x_netwm_window_state_isset(Ecore_X_Window win, Ecore_X_Window_State state);
|
||||
|
||||
EAPI int ecore_x_xinerama_screen_count_get(void);
|
||||
EAPI int ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h);
|
||||
|
||||
/* FIXME: these funcs need categorising */
|
||||
EAPI void ecore_x_drawable_geometry_get(Ecore_X_Drawable d, int *x, int *y, int *w, int *h);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
INCLUDES = \
|
||||
@Xcursor_cflags@ \
|
||||
@Xinerama_cflags@ \
|
||||
@x_cflags@ \
|
||||
-I$(top_srcdir)/src/lib/ecore \
|
||||
-I$(top_srcdir)/src/lib/ecore_txt \
|
||||
|
@ -37,10 +38,12 @@ ecore_x_window_prop.c \
|
|||
ecore_x_window_shape.c \
|
||||
ecore_x_pixmap.c \
|
||||
ecore_x_gc.c \
|
||||
ecore_x_xinerama.c \
|
||||
ecore_x_private.h
|
||||
|
||||
libecore_x_la_LIBADD = \
|
||||
@Xcursor_libs@ \
|
||||
@Xinerama_libs@ \
|
||||
@x_ldflags@ \
|
||||
@x_libs@ \
|
||||
$(top_builddir)/src/lib/ecore/libecore.la \
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
#ifdef ECORE_XCURSOR
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
#endif
|
||||
#ifdef ECORE_XINERAMA
|
||||
#include <X11/extensions/Xinerama.h>
|
||||
#endif
|
||||
|
||||
#include "Ecore_X.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* Xinerama code
|
||||
*/
|
||||
#include "Ecore.h"
|
||||
#include "ecore_x_private.h"
|
||||
#include "Ecore_X.h"
|
||||
#include "Ecore_X_Atoms.h"
|
||||
|
||||
static XineramaScreenInfo *_xin_info = NULL;
|
||||
static int _xin_scr_num = 0;
|
||||
|
||||
int
|
||||
ecore_x_xinerama_screen_count_get(void)
|
||||
{
|
||||
#ifdef ECORE_XINERAMA
|
||||
if (_xin_info) XFree(_xin_info);
|
||||
_xin_info = NULL;
|
||||
_xin_info = XineramaQueryScreens(_ecore_x_disp, &_xin_scr_num);
|
||||
if (_xin_info) return _xin_scr_num;
|
||||
else return 0;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
ecore_x_xinerama_screen_geometry_get(int screen, int *x, int *y, int *w, int *h)
|
||||
{
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue