aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Antipov2016-07-04 20:05:06 +0300
committerDmitry Antipov2016-07-04 20:05:06 +0300
commite3ae3c44882085bf52f6bb8b02e98eb7d0b1f81b (patch)
tree46db3a2184d01c10f1d48984d813e847af353814
parentf24fe30cb8118f8e15688eaf61a6fefde87f597e (diff)
downloademacs-e3ae3c44882085bf52f6bb8b02e98eb7d0b1f81b.tar.gz
emacs-e3ae3c44882085bf52f6bb8b02e98eb7d0b1f81b.zip
Cleanup XEditRes hack
* configure.ac [USE_X_TOOLKIT]: Define X_TOOLKIT_EDITRES if _XEditResCheckMessages is declared in X11/Xmu/Editres.h and may be linked with -lXmu. This should work with any non-ancient Xmu library. * xfns.c (toplevel): Remove old cruft. (x_window) [USE_X_TOOLKIT]: Use X_TOOLKIT_EDITRES. * xterm.c (toplevel): Remove old cruft. (handle_one_xevent): Use X_TOOLKIT_EDITRES. * xterm.h (toplevel): Include X11/Xmu/Editres.h if X_TOOLKIT_EDITRES.
-rw-r--r--configure.ac41
-rw-r--r--src/xfns.c7
-rw-r--r--src/xterm.c8
-rw-r--r--src/xterm.h4
4 files changed, 32 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac
index 2674806cadc..aaddfcd7386 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4287,23 +4287,32 @@ else
4287 [Returns true if character is any form of separator.]) 4287 [Returns true if character is any form of separator.])
4288fi 4288fi
4289 4289
4290AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.]) 4290if test "$USE_X_TOOLKIT" != "none"; then
4291 4291 have_editres=yes
4292case $opsys in 4292 case $opsys in
4293 aix4-2) 4293 hpux*)
4294 dnl Unfortunately without libXmu we cannot support EditRes. 4294 dnl Assar Westerlund <assar@sics.se> says this is necessary
4295 if test "x$ac_cv_search_XmuConvertStandardSelection" = xno; then 4295 dnl for HP-UX 10.20, and that it works for HP-UX 0 as well.
4296 AC_DEFINE(NO_EDITRES, 1) 4296 have_editres=no
4297 fi
4298 ;;
4299
4300 hpux*)
4301 dnl Assar Westerlund <assar@sics.se> says this is necessary for
4302 dnl HP-UX 10.20, and that it works for HP-UX 0 as well.
4303 AC_DEFINE(NO_EDITRES, 1)
4304 ;; 4297 ;;
4305esac 4298 esac
4306 4299 if test "$have_editres" != no && test ! -z "$LIBXMU"; then
4300 OLDLIBS="$LIBS"
4301 dnl See libXmu.a check above.
4302 if test x$HAVE_X11XTR6 = xyes; then
4303 LIBS="-lXt -lSM -lICE $LIBXMU"
4304 else
4305 OTHERLIBS="-lXt -$LIBXMU"
4306 fi
4307 AC_TRY_LINK(
4308 [#include <X11/Intrinsic.h>
4309 #include <X11/Xmu/Editres.h>],
4310 [_XEditResCheckMessages (0, 0, 0, 0);],
4311 [AC_DEFINE([X_TOOLKIT_EDITRES], 1,
4312 [Define to 1 if we should use XEditRes.])])
4313 LIBS=$OLDLIBS
4314 fi
4315fi
4307 4316
4308case $opsys in 4317case $opsys in
4309 sol2* | unixware ) 4318 sol2* | unixware )
diff --git a/src/xfns.c b/src/xfns.c
index 265eb6c65ac..798dc49bef5 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -91,11 +91,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
91#include "../lwlib/xlwmenu.h" 91#include "../lwlib/xlwmenu.h"
92#endif 92#endif
93 93
94#if !defined (NO_EDITRES)
95#define HACK_EDITRES
96extern void _XEditResCheckMessages (Widget, XtPointer, XEvent *, Boolean *);
97#endif /* not defined NO_EDITRES */
98
99/* Unique id counter for widgets created by the Lucid Widget Library. */ 94/* Unique id counter for widgets created by the Lucid Widget Library. */
100 95
101extern LWLIB_ID widget_id_tick; 96extern LWLIB_ID widget_id_tick;
@@ -2662,7 +2657,7 @@ x_window (struct frame *f, long window_prompting)
2662 2657
2663 hack_wm_protocols (f, shell_widget); 2658 hack_wm_protocols (f, shell_widget);
2664 2659
2665#ifdef HACK_EDITRES 2660#ifdef X_TOOLKIT_EDITRES
2666 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0); 2661 XtAddEventHandler (shell_widget, 0, True, _XEditResCheckMessages, 0);
2667#endif 2662#endif
2668 2663
diff --git a/src/xterm.c b/src/xterm.c
index 76b92dfb839..cd1d712f39a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -95,10 +95,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
95#endif 95#endif
96 96
97#ifdef USE_X_TOOLKIT 97#ifdef USE_X_TOOLKIT
98#if !defined (NO_EDITRES)
99#define HACK_EDITRES
100extern void _XEditResCheckMessages (Widget, XtPointer, XEvent *, Boolean *);
101#endif /* not NO_EDITRES */
102 98
103/* Include toolkit specific headers for the scroll bar widget. */ 99/* Include toolkit specific headers for the scroll bar widget. */
104 100
@@ -7610,7 +7606,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
7610 goto done; 7606 goto done;
7611 } 7607 }
7612 7608
7613#ifdef HACK_EDITRES 7609#ifdef X_TOOLKIT_EDITRES
7614 if (event->xclient.message_type == dpyinfo->Xatom_editres) 7610 if (event->xclient.message_type == dpyinfo->Xatom_editres)
7615 { 7611 {
7616 f = any; 7612 f = any;
@@ -7619,7 +7615,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
7619 NULL, (XEvent *) event, NULL); 7615 NULL, (XEvent *) event, NULL);
7620 goto done; 7616 goto done;
7621 } 7617 }
7622#endif /* HACK_EDITRES */ 7618#endif /* X_TOOLKIT_EDITRES */
7623 7619
7624 if (event->xclient.message_type == dpyinfo->Xatom_DONE 7620 if (event->xclient.message_type == dpyinfo->Xatom_DONE
7625 || event->xclient.message_type == dpyinfo->Xatom_PAGE) 7621 || event->xclient.message_type == dpyinfo->Xatom_PAGE)
diff --git a/src/xterm.h b/src/xterm.h
index 8e1fc788bc1..675a48443dc 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -38,6 +38,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include <X11/CoreP.h> /* foul, but we need this to use our own 38#include <X11/CoreP.h> /* foul, but we need this to use our own
39 window inside a widget instead of one 39 window inside a widget instead of one
40 that Xt creates... */ 40 that Xt creates... */
41#ifdef X_TOOLKIT_EDITRES
42#include <X11/Xmu/Editres.h>
43#endif
44
41typedef Widget xt_or_gtk_widget; 45typedef Widget xt_or_gtk_widget;
42#endif 46#endif
43 47