Eliminate use of Xmu.

This causes the following change:
In script.c and term.c XA_CLIPBOARD(Xdisplay) used to expand to
XA_PRIMARY, i.e. the identifier of the "PRIMARY" atom, now it will
be the identifier of the "CLIPBOARD" atom.

SVN revision: 50969
This commit is contained in:
Kim Woelders 2010-08-10 18:08:44 +00:00
parent 8f2dd859a6
commit c81f5795de
7 changed files with 20 additions and 27 deletions

View File

@ -205,8 +205,7 @@ sys/ioctl.h sys/select.h sys/time.h \
sys/sockio.h sys/byteorder.h malloc.h \
utmpx.h unistd.h bsd/signal.h regex.h \
regexp.h stdarg.h X11/X.h X11/Xlib.h \
X11/Xmu/Atoms.h X11/Sunkeysym.h \
X11/Xlocale.h \
X11/Sunkeysym.h X11/Xlocale.h \
)
AC_HEADER_TIME
@ -872,11 +871,6 @@ AC_ARG_ENABLE(xim,
XIM="TRUE"
])
# For multibyte selection handling
#if test "$MULTICHAR_ENCODING" != "none"; then
AC_CHECK_LIB(Xmu, XmuInternAtom)
#fi
# check X11R6 for XIM
if test "$XIM" = "TRUE"; then
AC_CHECK_LIB(X11, XRegisterIMInstantiateCallback, AC_DEFINE(USE_X11R6_XIM, , [Define if we have X11R6 XIM.]))

View File

@ -26,9 +26,6 @@ static const char cvs_ident[] = "$Id$";
#include <errno.h>
#include <X11/Xatom.h>
#include <X11/Xmd.h> /* CARD32 */
#ifdef HAVE_X11_XMU_ATOMS_H
# include <X11/Xmu/Atoms.h>
#endif
#include "buttons.h"
#include "command.h"
@ -2596,9 +2593,9 @@ selection_paste(Atom sel)
form (usually XA_STRING) and save it for us in the VT_SELECTION
property. We'll then get a SelectionNotify. */
D_SELECT(("Requesting current selection (%d) -> VT_SELECTION (%d)\n", sel, props[PROP_SELECTION_DEST]));
#if defined(MULTI_CHARSET) && defined(HAVE_X11_XMU_ATOMS_H)
#if defined(MULTI_CHARSET)
if (encoding_method != LATIN1) {
XConvertSelection(Xdisplay, sel, XA_COMPOUND_TEXT(Xdisplay), props[PROP_SELECTION_DEST], TermWin.vt, CurrentTime);
XConvertSelection(Xdisplay, sel, props[PROP_COMPOUND_TEXT], props[PROP_SELECTION_DEST], TermWin.vt, CurrentTime);
} else {
XConvertSelection(Xdisplay, sel, XA_STRING, props[PROP_SELECTION_DEST], TermWin.vt, CurrentTime);
}
@ -3346,7 +3343,7 @@ selection_send(XSelectionRequestEvent * rq)
ev.xselection.property = rq->property;
#ifdef MULTI_CHARSET
# ifdef X_HAVE_UTF8_STRING
} else if (rq->target == XA_UTF8_STRING(Xdisplay)) {
} else if (rq->target == props[PROP_UTF8_STRING]) {
XTextProperty xtextp;
char *l[1];
@ -3362,8 +3359,7 @@ selection_send(XSelectionRequestEvent * rq)
}
}
# endif /* X_HAVE_UTF8_STRING */
# ifdef HAVE_X11_XMU_ATOMS_H
} else if (rq->target == XA_TEXT(Xdisplay) || rq->target == XA_COMPOUND_TEXT(Xdisplay)) {
} else if (rq->target == props[PROP_TEXT] || rq->target == props[PROP_COMPOUND_TEXT]) {
XTextProperty xtextp;
char *l[1];
@ -3372,13 +3368,12 @@ selection_send(XSelectionRequestEvent * rq)
xtextp.nitems = 0;
if (XmbTextListToTextProperty(Xdisplay, l, 1, XCompoundTextStyle, &xtextp) == Success) {
if (xtextp.nitems > 0 && xtextp.value != NULL) {
XChangeProperty(Xdisplay, rq->requestor, rq->property, XA_COMPOUND_TEXT(Xdisplay),
XChangeProperty(Xdisplay, rq->requestor, rq->property, props[PROP_COMPOUND_TEXT],
8, PropModeReplace, xtextp.value, xtextp.nitems);
ev.xselection.property = rq->property;
XFree(xtextp.value);
}
}
# endif /* HAVE_X11_XMU_ATOMS_H */
#endif /* MULTI_CHARSET */
} else {
XChangeProperty(Xdisplay, rq->requestor, rq->property, XA_STRING, 8, PropModeReplace, selection.text, selection.len);

View File

@ -16,16 +16,12 @@
#include <X11/Xfuncproto.h>
#include "startup.h"
#ifndef XA_CLIPBOARD
# define XA_CLIPBOARD(d) XA_PRIMARY
#endif
/************ Macros and Definitions ************/
#define WRAP_CHAR (0xff)
#define PROP_SIZE 4096
#define TABSIZE 8 /* default tab size */
#define IS_SELECTION(a) (((a) == XA_PRIMARY) || ((a) == XA_SECONDARY) || ((a) == XA_CLIPBOARD(Xdisplay)))
#define IS_SELECTION(a) (((a) == XA_PRIMARY) || ((a) == XA_SECONDARY) || ((a) == props[PROP_CLIPBOARD]))
#define IS_CUT_BUFFER(a) (((a) >= XA_CUT_BUFFER0) && ((a) <= XA_CUT_BUFFER7))
#define ZERO_SCROLLBACK do { \

View File

@ -165,7 +165,7 @@ script_handler_copy(spif_charptr_t *params)
if (*buffer_id >= '0' && *buffer_id <= '7') {
sel = (Atom) ((int) XA_CUT_BUFFER0 + (int) (*buffer_id - '0'));
} else if (!BEG_STRCASECMP(buffer_id, "clipboard")) {
sel = XA_CLIPBOARD(Xdisplay);
sel = props[PROP_CLIPBOARD];
} else if (!BEG_STRCASECMP(buffer_id, "primary")) {
sel = XA_PRIMARY;
} else if (!BEG_STRCASECMP(buffer_id, "secondary")) {
@ -266,7 +266,7 @@ script_handler_paste(spif_charptr_t *params)
if (*buffer_id >= '0' && *buffer_id <= '7') {
sel = (Atom) ((int) XA_CUT_BUFFER0 + (int) (*buffer_id - '0'));
} else if (!BEG_STRCASECMP(buffer_id, "clipboard")) {
sel = XA_CLIPBOARD(Xdisplay);
sel = props[PROP_CLIPBOARD];
} else if (!BEG_STRCASECMP(buffer_id, "primary")) {
sel = XA_PRIMARY;
} else if (!BEG_STRCASECMP(buffer_id, "secondary")) {

View File

@ -138,6 +138,10 @@ eterm_bootstrap(int argc, char *argv[])
/* Get all our properties set up. */
MEMSET(props, 0, sizeof(props));
props[PROP_TEXT] = XInternAtom(Xdisplay, "TEXT", False);
props[PROP_COMPOUND_TEXT] = XInternAtom(Xdisplay, "COMPOUND_TEXT", False);
props[PROP_UTF8_STRING] = XInternAtom(Xdisplay, "UTF8_STRING", False);
props[PROP_CLIPBOARD] = XInternAtom(Xdisplay, "CLIPBOARD", False);
props[PROP_DESKTOP] = XInternAtom(Xdisplay, "_NET_WM_DESKTOP", False);
props[PROP_TRANS_PIXMAP] = XInternAtom(Xdisplay, "_XROOTPMAP_ID", False);
props[PROP_TRANS_COLOR] = XInternAtom(Xdisplay, "_XROOTCOLOR_PIXEL", False);

View File

@ -91,6 +91,10 @@
#endif
enum {
PROP_TEXT,
PROP_COMPOUND_TEXT,
PROP_UTF8_STRING,
PROP_CLIPBOARD,
PROP_DESKTOP,
PROP_TRANS_PIXMAP,
PROP_TRANS_COLOR,

View File

@ -561,15 +561,15 @@ lookup_key(XEvent * ev)
}
#endif
#if defined(HAVE_X11_SUNKEYSYM_H) && defined(HAVE_X11_XMU_ATOMS_H)
#if defined(HAVE_X11_SUNKEYSYM_H)
switch (keysym) {
case SunXK_Copy:
case SunXK_Cut:
selection_copy(XA_CLIPBOARD(Xdisplay));
selection_copy(props[PROP_CLIPBOARD]);
LK_RET();
break;
case SunXK_Paste:
selection_paste(XA_CLIPBOARD(Xdisplay));
selection_paste(props[PROP_CLIPBOARD]);
LK_RET();
break;
case SunXK_Front: