Skip to content

Commit

Permalink
snapshot of project "xterm", label xterm-342f
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasDickey committed Jan 14, 2019
1 parent b16c906 commit 921500e
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 106 deletions.
2 changes: 1 addition & 1 deletion MANIFEST
@@ -1,4 +1,4 @@
MANIFEST for xterm, version xterm-342e
MANIFEST for xterm, version xterm-342f
--------------------------------------------------------------------------------
MANIFEST this file
256colres.h resource-definitions for 256-color mode
Expand Down
4 changes: 3 additions & 1 deletion THANKS
@@ -1,4 +1,4 @@
-- $XTermId: THANKS,v 1.20 2018/08/10 23:33:05 tom Exp $
-- $XTermId: THANKS,v 1.21 2019/01/13 17:18:41 tom Exp $
-- vile:txtmode fk=utf-8
There's no AUTHORS file in this distribution; it would be redundant since
I (Thomas E. Dickey) have done more than 80% of the work on xterm since 1996.
Expand Down Expand Up @@ -135,6 +135,7 @@ Marco Peereboom
Marius Tolzmann
Mark Waggoner
Markus Kuhn
Martin Hostettler
Martin Pirker
Martin Tournoij
Matthew Green
Expand Down Expand Up @@ -193,6 +194,7 @@ Semen A Ustimenko
Sergei Laskavy
Sergey Vlasov
Slava Semushin
Stefan Assmann
Stefan Dirsch
Stephen P Wall
Stuart Lissaman
Expand Down
42 changes: 26 additions & 16 deletions button.c
@@ -1,4 +1,4 @@
/* $XTermId: button.c,v 1.564 2019/01/04 01:07:36 tom Exp $ */
/* $XTermId: button.c,v 1.567 2019/01/13 16:03:05 tom Exp $ */

/*
* Copyright 1999-2018,2019 by Thomas E. Dickey
Expand Down Expand Up @@ -170,6 +170,7 @@ static void SelectionReceived PROTO_XT_SEL_CB_ARGS;
static void StartSelect(XtermWidget xw, const CELL *cell);
static void TrackDown(XtermWidget xw, XButtonEvent *event);
static void TrackText(XtermWidget xw, const CELL *first, const CELL *last);
static void UnHiliteText(XtermWidget xw);
static void _OwnSelection(XtermWidget xw, String *selections, Cardinal count);
static void do_select_end(XtermWidget xw, XEvent *event, String *params,
Cardinal *num_params, Bool use_cursor_loc);
Expand Down Expand Up @@ -2675,7 +2676,7 @@ EndExtend(XtermWidget xw,
}
}
v_write(screen->respond, line, count);
TrackText(xw, &zeroCELL, &zeroCELL);
UnHiliteText(xw);
}
}
SelectSet(xw, event, params, num_params);
Expand Down Expand Up @@ -3842,6 +3843,12 @@ TrackText(XtermWidget xw,
screen->endHCoord = to;
}

static void
UnHiliteText(XtermWidget xw)
{
TrackText(xw, &zeroCELL, &zeroCELL);
}

/* Guaranteed that (first->row, first->col) <= (last->row, last->col) */
static void
ReHiliteText(XtermWidget xw,
Expand Down Expand Up @@ -4230,7 +4237,7 @@ ConvertSelection(Widget w,

if (keepClipboard(*selection)) {
TRACE(("asked for clipboard\n"));
scp = &(screen->selected_cells[1]);
scp = &(screen->clipboard_data);
} else {
TRACE(("asked for selection\n"));
scp = &(screen->selected_cells[*selection == CLIPBOARD_ATOM]);
Expand Down Expand Up @@ -4416,7 +4423,7 @@ LoseSelection(Widget w, Atom *selection)
}

if (screen->selection_count == 0)
TrackText(xw, &zeroCELL, &zeroCELL);
UnHiliteText(xw);
}

/* ARGSUSED */
Expand Down Expand Up @@ -4481,19 +4488,22 @@ _OwnSelection(XtermWidget xw,
(int) length,
cutbuffer);
}
} else if (keepClipboard(atoms[i])) {
Char *buf;
TRACE(("saving selection to clipboard buffer\n"));
scp = &(screen->selected_cells[1]);
if ((buf = (Char *) malloc((size_t) scp->data_length)) == 0)
SysError(ERROR_BMALLOC2);

free(screen->clipboard_data);
memcpy(buf, scp->data_buffer, scp->data_length);
screen->clipboard_data = buf;
screen->clipboard_size = scp->data_length;
} else {
int which = (atoms[i] == CLIPBOARD_ATOM) ? 1 : 0;
if (keepClipboard(atoms[i])) {
Char *buf;
SelectedCells *tcp = &(screen->clipboard_data);
TRACE(("saving selection to clipboard buffer\n"));
scp = &(screen->selected_cells[1]);
if ((buf = (Char *) malloc((size_t) scp->data_length)) == 0)
SysError(ERROR_BMALLOC2);

free(tcp->data_buffer);
memcpy(buf, scp->data_buffer, scp->data_length);
tcp->data_buffer = buf;
tcp->data_limit = scp->data_length;
tcp->data_length = scp->data_length;
}
scp = &(screen->selected_cells[which]);
if (scp->data_length == 0) {
TRACE(("XtDisownSelection(%s, @%ld)\n",
Expand Down Expand Up @@ -4522,7 +4532,7 @@ _OwnSelection(XtermWidget xw,
if (!screen->replyToEmacs)
screen->selection_count = count;
if (!have_selection)
TrackText(xw, &zeroCELL, &zeroCELL);
UnHiliteText(xw);
}

static void
Expand Down
18 changes: 16 additions & 2 deletions menu.c
@@ -1,7 +1,7 @@
/* $XTermId: menu.c,v 1.354 2018/12/16 22:37:07 tom Exp $ */
/* $XTermId: menu.c,v 1.355 2019/01/12 02:04:19 tom Exp $ */

/*
* Copyright 1999-2017,2018 by Thomas E. Dickey
* Copyright 1999-2018,2019 by Thomas E. Dickey
*
* All Rights Reserved
*
Expand Down Expand Up @@ -371,6 +371,9 @@ MenuEntry vtMenuEntries[] = {
{ "scrollttyoutput",do_scrollttyoutput, NULL },
{ "allow132", do_allow132, NULL },
{ "keepSelection", do_keepSelection, NULL },
#if OPT_MENU_KEEPCLIPBOARD
{ "keepClipboard", do_keepClipboard, NULL },
#endif
{ "selectToClipboard",do_selectClipboard, NULL },
{ "visualbell", do_visualbell, NULL },
{ "bellIsUrgent", do_bellIsUrgent, NULL },
Expand Down Expand Up @@ -1541,6 +1544,17 @@ do_scrollttyoutput(Widget gw GCC_UNUSED,
update_scrollttyoutput();
}

#if OPT_MENU_KEEPCLIPBOARD
void
update_keepClipboard(void)
{
UpdateCheckbox("update_keepClipboard",
vtMenuEntries,
vtMenu_keepClipboard,
TScreenOf(term)->keepClipboard);
}
#endif

static void
do_keepClipboard(Widget gw GCC_UNUSED,
XtPointer closure GCC_UNUSED,
Expand Down
17 changes: 14 additions & 3 deletions menu.h
@@ -1,7 +1,7 @@
/* $XTermId: menu.h,v 1.141 2018/04/29 21:28:37 tom Exp $ */
/* $XTermId: menu.h,v 1.143 2019/01/13 17:21:25 tom Exp $ */

/*
* Copyright 1999-2016,2018 by Thomas E. Dickey
* Copyright 1999-2018,2019 by Thomas E. Dickey
*
* All Rights Reserved
*
Expand Down Expand Up @@ -53,7 +53,6 @@
* not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization
* from the X Consortium.
*
*/

#ifndef included_menu_h
Expand All @@ -62,6 +61,10 @@

#include <xterm.h>

#ifndef OPT_MENU_KEEPCLIPBOARD
#define OPT_MENU_KEEPCLIPBOARD 0 /* useful for debugging */
#endif

typedef struct _MenuEntry {
const char *name;
void (*function) PROTO_XT_CALLBACK_ARGS;
Expand Down Expand Up @@ -245,6 +248,9 @@ typedef enum {
vtMenu_scrollttyoutput,
vtMenu_allow132,
vtMenu_keepSelection,
#if OPT_MENU_KEEPCLIPBOARD
vtMenu_keepClipboard,
#endif
vtMenu_selectToClipboard,
vtMenu_visualbell,
vtMenu_bellIsUrgent,
Expand Down Expand Up @@ -461,7 +467,12 @@ extern void update_visualbell(void);
extern void update_bellIsUrgent(void);
extern void update_poponbell(void);

#if OPT_MENU_KEEPCLIPBOARD
extern void update_keepClipboard(void);
#else
#define update_keepClipboard() /* nothing */
#endif

#define update_marginbell() /* nothing */

#if OPT_LOAD_VTFONTS
Expand Down
4 changes: 2 additions & 2 deletions misc.c
@@ -1,7 +1,7 @@
/* $XTermId: misc.c,v 1.854 2019/01/11 22:25:03 tom Exp $ */
/* $XTermId: misc.c,v 1.855 2019/01/12 00:52:14 tom Exp $ */

/*
* Copyright 1999-2017,2018 by Thomas E. Dickey
* Copyright 1999-2018,2019 by Thomas E. Dickey
*
* All Rights Reserved
*
Expand Down
5 changes: 2 additions & 3 deletions ptyx.h
@@ -1,4 +1,4 @@
/* $XTermId: ptyx.h,v 1.949 2019/01/10 10:26:02 tom Exp $ */
/* $XTermId: ptyx.h,v 1.950 2019/01/12 01:34:39 tom Exp $ */

/*
* Copyright 1999-2018,2019 by Thomas E. Dickey
Expand Down Expand Up @@ -2636,8 +2636,7 @@ typedef struct {
Boolean keepSelection; /* do not lose selection on output */
Boolean replyToEmacs; /* Send emacs escape code when done selecting or extending? */

Char *clipboard_data; /* the current clipboard */
unsigned long clipboard_size; /* size of allocated buffer */
SelectedCells clipboard_data; /* what we sent to the clipboard */

EventMode eventMode;
Time selection_time; /* latest event timestamp */
Expand Down
10 changes: 9 additions & 1 deletion xterm.log.html
Expand Up @@ -30,7 +30,7 @@
* sale, use or other dealings in this Software without prior written *
* authorization. *
*****************************************************************************
$XTermId: xterm.log.html,v 1.1983 2019/01/12 00:48:45 tom Exp $
$XTermId: xterm.log.html,v 1.1984 2019/01/13 18:52:59 tom Exp $
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">

Expand Down Expand Up @@ -974,6 +974,14 @@ <h1>Contents</h1>
<h1><a name="xterm_dev" id="xterm_dev">Development</a></h1>

<ul>
<li>improve manual page discussion of selection ownership
versus highlighting (prompted by discussion with Martin
Hostettler).</li>

<li>restore/repair <code>keepClipboard</code> feature which was
broken by changes in <a href="#xterm_338">patch #338</a>
(report by Martin Hostettler).</li>

<li>improve documentation for <code>deleteIsDEL</code>
resource.</li>

Expand Down

0 comments on commit 921500e

Please sign in to comment.