mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 23:42:16 +00:00
Use XInternAtom when XInternAtoms isn't available.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@26962 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1802f35b22
commit
15c3275984
5 changed files with 105 additions and 8 deletions
|
@ -1,3 +1,12 @@
|
|||
2008-10-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Tools/xpbs.m (+initializePasteboard): Use XInternAtom when
|
||||
XInternAtoms isn't available.
|
||||
Patch by Riccardo Mottola <multix@ngi.it>.
|
||||
* configure.ac: Check for XInternAtoms.
|
||||
* configure,
|
||||
* config.h.in: Regenerate.
|
||||
|
||||
2008-10-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/x11/XGServer.m (-visualForScreen:, -depthForScreen:):
|
||||
|
|
13
Tools/xpbs.m
13
Tools/xpbs.m
|
@ -216,8 +216,17 @@ static NSString *xWaitMode = @"XPasteboardWaitMode";
|
|||
/*
|
||||
* Set up atoms for use in X selection mechanism.
|
||||
*/
|
||||
XInternAtoms(xDisplay, atom_names, sizeof(atom_names)/sizeof(char*),
|
||||
False, atoms);
|
||||
#ifdef HAVE_XINTERNATOMS
|
||||
XInternAtoms(xDisplay, atom_names, sizeof(atom_names)/sizeof(char*),
|
||||
False, atoms);
|
||||
#else
|
||||
{
|
||||
int atomCount;
|
||||
|
||||
for (atomCount = 0; atomCount < sizeof(atom_names)/sizeof(char*); atomCount++)
|
||||
atoms[atomCount] = XInternAtom(xDisplay, atom_names[atomCount], False);
|
||||
}
|
||||
#endif
|
||||
|
||||
xRootWin = RootWindow(xDisplay, DefaultScreen(xDisplay));
|
||||
xAppWin = XCreateSimpleWindow(xDisplay, xRootWin,
|
||||
|
|
15
config.h.in
15
config.h.in
|
@ -32,9 +32,6 @@
|
|||
/* Define if you have the glx library */
|
||||
#undef HAVE_GLX
|
||||
|
||||
/* Define if you have the glx library */
|
||||
#undef HAVE_WGL
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
|
@ -47,6 +44,9 @@
|
|||
/* Define to 1 if you have the `Xmu' library (-lXmu). */
|
||||
#undef HAVE_LIBXMU
|
||||
|
||||
/* Define to 1 if you have the `Xt' library (-lXt). */
|
||||
#undef HAVE_LIBXT
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
|
@ -96,6 +96,9 @@
|
|||
*/
|
||||
#undef HAVE_XFT
|
||||
|
||||
/* Define to 1 if you have 'XInternAtoms' function. */
|
||||
#undef HAVE_XINTERNATOMS
|
||||
|
||||
/* Define to 1 if you have the `Xutf8LookupString' function. */
|
||||
#undef HAVE_XUTF8LOOKUPSTRING
|
||||
|
||||
|
@ -123,11 +126,11 @@
|
|||
/* Define to enable XIM support */
|
||||
#undef USE_XIM
|
||||
|
||||
/* Define if you have X11 XRender extension */
|
||||
#undef XRENDER
|
||||
|
||||
/* Define if you have X11 XShm extensions */
|
||||
#undef XSHM
|
||||
|
||||
/* Define if you have X11 Xrender extensions */
|
||||
#undef XRENDER
|
||||
|
||||
/* Define to 1 if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
|
70
configure
vendored
70
configure
vendored
|
@ -6957,6 +6957,76 @@ _ACEOF
|
|||
|
||||
fi
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for XInternAtoms in -lX11" >&5
|
||||
echo $ECHO_N "checking for XInternAtoms in -lX11... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_lib_X11_XInternAtoms+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lX11 $X_LIBS $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char XInternAtoms ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return XInternAtoms ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext &&
|
||||
$as_test_x conftest$ac_exeext; then
|
||||
ac_cv_lib_X11_XInternAtoms=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_lib_X11_XInternAtoms=no
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XInternAtoms" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_X11_XInternAtoms" >&6; }
|
||||
if test $ac_cv_lib_X11_XInternAtoms = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_XINTERNATOMS 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Window's graphics library
|
||||
#--------------------------------------------------------------------
|
||||
|
|
|
@ -298,6 +298,12 @@ if test "$ac_cv_header_X11_extensions_XShm_h" = yes -a "$ac_cv_func_shmctl" = ye
|
|||
AC_DEFINE(XSHM,1,[Define if you have X11 XShm extensions])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(X11, XInternAtoms,
|
||||
AC_DEFINE([HAVE_XINTERNATOMS], 1,
|
||||
[Define to 1 if you have 'XInternAtoms' function.]),
|
||||
,
|
||||
$X_LIBS)
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Window's graphics library
|
||||
#--------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue