diff --git a/pw3270.cbp b/pw3270.cbp
index 8892889..c3937b0 100644
--- a/pw3270.cbp
+++ b/pw3270.cbp
@@ -121,6 +121,7 @@
+
@@ -240,6 +241,9 @@
+
+
+
diff --git a/src/gtk/v3270/draw.c b/src/gtk/v3270/draw.c
index 818405a..899976f 100644
--- a/src/gtk/v3270/draw.c
+++ b/src/gtk/v3270/draw.c
@@ -94,13 +94,23 @@ gboolean v3270_expose(GtkWidget *widget, GdkEventExpose *event)
void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, const struct v3270_metrics *metrics, GdkRectangle *rect, GdkColor *color)
{
- GdkColor *fg = color+((attr & 0x00F0) >> 4);
+ GdkColor *fg;
GdkColor *bg;
- if(attr & LIB3270_ATTR_FIELD)
- bg = color+(attr & 0x0003)+V3270_COLOR_FIELD;
+ if(attr & LIB3270_ATTR_SELECTED)
+ {
+ fg = color+V3270_COLOR_SELECTED_FG;
+ bg = color+V3270_COLOR_SELECTED_BG;
+ }
else
- bg = color+(attr & 0x000F);
+ {
+ fg = color+((attr & 0x00F0) >> 4);
+
+ if(attr & LIB3270_ATTR_FIELD)
+ bg = color+(attr & 0x0003)+V3270_COLOR_FIELD;
+ else
+ bg = color+(attr & 0x000F);
+ }
v3270_draw_char(cr,chr,attr,metrics,rect,fg,bg);
}
diff --git a/src/gtk/v3270/mouse.c b/src/gtk/v3270/mouse.c
index 861743c..aae0191 100644
--- a/src/gtk/v3270/mouse.c
+++ b/src/gtk/v3270/mouse.c
@@ -32,28 +32,29 @@
#include
#include "v3270.h"
#include "private.h"
+ #include
/*--[ Implement ]------------------------------------------------------------------------------------*/
-static int decode_position(v3270 *widget, GdkPoint *point, gdouble x, gdouble y)
+static int decode_position(v3270 *widget, gdouble x, gdouble y)
{
+ GdkPoint point;
int r,c;
- point->x = ((x-widget->metrics.left)/widget->metrics.width);
- point->y = ((y-widget->metrics.top)/widget->metrics.spacing);
+ point.x = ((x-widget->metrics.left)/widget->metrics.width);
+ point.y = ((y-widget->metrics.top)/widget->metrics.spacing);
lib3270_get_screen_size(widget->host,&r,&c);
- if(point->x >= 0 && point->y >= 0 && point->x < c && point->y < r)
- return (point->y * c) + point->x;
+ if(point.x >= 0 && point.y >= 0 && point.x < c && point.y < r)
+ return (point.y * c) + point.x;
return -1;
}
gboolean v3270_button_press_event(GtkWidget *widget, GdkEventButton *event)
{
- GdkPoint point;
- int baddr = decode_position(GTK_V3270(widget),&point,event->x,event->y);
+ int baddr = decode_position(GTK_V3270(widget),event->x,event->y);
if(baddr < 0)
return FALSE;
@@ -64,6 +65,8 @@ gboolean v3270_button_press_event(GtkWidget *widget, GdkEventButton *event)
{
case 1:
lib3270_set_cursor_address(GTK_V3270(widget)->host,baddr);
+ GTK_V3270(widget)->selecting = 1;
+ lib3270_clear_selection(GTK_V3270(widget)->host);
break;
default:
@@ -75,7 +78,15 @@ gboolean v3270_button_press_event(GtkWidget *widget, GdkEventButton *event)
gboolean v3270_button_release_event(GtkWidget *widget, GdkEventButton*event)
{
-// trace("%s button=%d",__FUNCTION__,event->button);
+ switch(event->button)
+ {
+ case 1:
+ GTK_V3270(widget)->selecting = 0;
+ break;
+
+ default:
+ trace("%s button=%d type=%d",__FUNCTION__,event->button,event->type);
+ }
return FALSE;
@@ -84,8 +95,13 @@ gboolean v3270_button_release_event(GtkWidget *widget, GdkEventButton*event)
gboolean v3270_motion_notify_event(GtkWidget *widget, GdkEventMotion *event)
{
-// trace("%s",__FUNCTION__);
+ int baddr = decode_position(GTK_V3270(widget),event->x,event->y);
+
+ if(baddr < 0)
+ return FALSE;
+ if(GTK_V3270(widget)->selecting)
+ lib3270_select_to(GTK_V3270(widget)->host,baddr);
return FALSE;
}
diff --git a/src/gtk/v3270/oia.c b/src/gtk/v3270/oia.c
index ecd77e3..41f9666 100644
--- a/src/gtk/v3270/oia.c
+++ b/src/gtk/v3270/oia.c
@@ -627,8 +627,6 @@ void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col,
GdkRectangle saved;
char buffer[10];
- trace("%s",__FUNCTION__);
-
if(!terminal->surface)
return;
diff --git a/src/gtk/v3270/v3270.h b/src/gtk/v3270/v3270.h
index ee17e26..7925c9c 100644
--- a/src/gtk/v3270/v3270.h
+++ b/src/gtk/v3270/v3270.h
@@ -143,6 +143,7 @@
GtkWidget parent;
/* private */
+ int selecting : 1;
#if GTK_CHECK_VERSION(3,0,0)
#else
diff --git a/src/include/lib3270.h b/src/include/lib3270.h
index c261e5e..a4e7e33 100644
--- a/src/include/lib3270.h
+++ b/src/include/lib3270.h
@@ -67,6 +67,7 @@
LIB3270_ATTR_CG = 0x1000,
LIB3270_ATTR_MARKER = 0x2000,
LIB3270_ATTR_BACKGROUND_INTENSITY = 0x4000,
+ LIB3270_ATTR_SELECTED = 0x8000
} LIB3270_ATTR;
diff --git a/src/include/lib3270/log.h b/src/include/lib3270/log.h
new file mode 100644
index 0000000..9af6fb0
--- /dev/null
+++ b/src/include/lib3270/log.h
@@ -0,0 +1,45 @@
+/*
+ * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
+ * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
+ * aplicativos mainframe. Registro no INPI sob o nome G3270.
+ *
+ * Copyright (C) <2008>
+ *
+ * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
+ * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
+ * Free Software Foundation.
+ *
+ * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
+ * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
+ * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
+ * obter mais detalhes.
+ *
+ * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
+ * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA, 02111-1307, USA
+ *
+ * Este programa está nomeado como session.h e possui - linhas de código.
+ *
+ * Contatos:
+ *
+ * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
+ * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
+ * licinio@bb.com.br (Licínio Luis Branco)
+ * kraucer@bb.com.br (Kraucer Fernandes Mazuco)
+ *
+ */
+
+ #ifndef LIB3270_LOG_H_INCLUDED
+
+ #include
+
+ #define LIB3270_LOG_H_INCLUDED 1
+
+ LIB3270_EXPORT void lib3270_set_log_handler(void (*loghandler)(H3270 *, const char *, int, const char *, va_list));
+ LIB3270_EXPORT int lib3270_write_log(H3270 *session, const char *module, const char *fmt, ...);
+ LIB3270_EXPORT int lib3270_write_rc(H3270 *session, const char *module, int rc, const char *fmt, ...);
+ LIB3270_EXPORT void lib3270_write_va_log(H3270 *session, const char *module, const char *fmt, va_list arg);
+
+ #endif // LIB3270_LOG_H_INCLUDED
+
+
diff --git a/src/include/lib3270/selection.h b/src/include/lib3270/selection.h
new file mode 100644
index 0000000..570263e
--- /dev/null
+++ b/src/include/lib3270/selection.h
@@ -0,0 +1,40 @@
+/*
+ * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
+ * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
+ * aplicativos mainframe. Registro no INPI sob o nome G3270.
+ *
+ * Copyright (C) <2008>
+ *
+ * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
+ * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
+ * Free Software Foundation.
+ *
+ * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
+ * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
+ * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
+ * obter mais detalhes.
+ *
+ * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
+ * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA, 02111-1307, USA
+ *
+ * Este programa está nomeado como selection.h e possui - linhas de código.
+ *
+ * Contatos:
+ *
+ * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
+ * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
+ * licinio@bb.com.br (Licínio Luis Branco)
+ * kraucer@bb.com.br (Kraucer Fernandes Mazuco)
+ *
+ */
+
+ #ifndef LIB3270_SELECTION_H_INCLUDED
+
+ #define LIB3270_SELECTION_H_INCLUDED 1
+
+ LIB3270_EXPORT void lib3270_clear_selection(H3270 *session);
+ LIB3270_EXPORT void lib3270_select_to(H3270 *session, int baddr);
+
+
+ #endif // LIB3270_SELECTION_H_INCLUDED
diff --git a/src/include/lib3270/session.h b/src/include/lib3270/session.h
index 2ca33cf..6097f50 100644
--- a/src/include/lib3270/session.h
+++ b/src/include/lib3270/session.h
@@ -99,6 +99,13 @@
// Widget info
void * widget;
+ // selection
+ struct
+ {
+ int begin;
+ int end;
+ } selected;
+
// xio
unsigned long ns_read_id;
unsigned long ns_exception_id;
diff --git a/src/lib3270/Makefile.in b/src/lib3270/Makefile.in
index e56e2cd..941c606 100644
--- a/src/lib3270/Makefile.in
+++ b/src/lib3270/Makefile.in
@@ -74,7 +74,8 @@ SOURCES = XtGlue.c actions.c ansi.c charset.c ctlr.c \
ft.c ft_cut.c ft_dft.c glue.c host.c kybd.c \
print.c printer.c proxy.c resources.c rpq.c screen.c see.c \
sf.c tables.c telnet.c toggles.c trace_ds.c utf8.c util.c \
- xio.c resolver.c log.c paste.c macros.c fallbacks.c version.c
+ xio.c resolver.c log.c paste.c macros.c fallbacks.c version.c \
+ selection.c
#---[ Misc targets ]-----------------------------------------------------------
diff --git a/src/lib3270/glue.c b/src/lib3270/glue.c
index 2928946..73895f3 100644
--- a/src/lib3270/glue.c
+++ b/src/lib3270/glue.c
@@ -175,11 +175,12 @@ static void lib3270_session_init(H3270 *hSession, const char *model)
hSession->sz = sizeof(H3270);
hSession->sock = -1;
hSession->model_num = -1;
-// hSession->first_changed = -1;
-// hSession->last_changed = -1;
hSession->cstate = NOT_CONNECTED;
hSession->oia_status = -1;
+ hSession->selected.begin = -1;
+ hSession->selected.end = -1;
+
strncpy(hSession->full_model_name,"IBM-",LIB3270_FULL_MODEL_NAME_LENGTH);
hSession->model_name = &hSession->full_model_name[4];
diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c
index 2a69554..afc317d 100644
--- a/src/lib3270/kybd.c
+++ b/src/lib3270/kybd.c
@@ -2945,301 +2945,6 @@ LIB3270_ACTION( fieldend )
return 0;
}
-/*
- * MoveCursor action. Depending on arguments, this is either a move to the
- * mouse cursor position, or to an absolute location.
- */ /*
-void
-MoveCursor_action(Widget w, XEvent *event, String *params, Cardinal *num_params)
-{
- register int baddr;
- int row, col;
-
-// reset_idle_timer();
- if (kybdlock) {
- if (*num_params == 2)
- enq_ta(MoveCursor_action, params[0], params[1]);
- return;
- }
-
- switch (*num_params) {
-#if defined(X3270_DISPLAY
- case 0: // mouse click, presumably
- if (w != *screen)
- return;
- cursor_move(mouse_baddr(w, event));
- break;
-#endif
- case 2: // probably a macro call
- row = atoi(params[0]);
- col = atoi(params[1]);
- if (!IN_3270) {
- row--;
- col--;
- }
- if (row < 0)
- row = 0;
- if (col < 0)
- col = 0;
- baddr = ((row * COLS) + col) % (ROWS * COLS);
- cursor_move(baddr);
- break;
- default: // couln't say
- popup_an_error("%s requires 0 or 2 arguments",
- action_name(MoveCursor_action));
-// cancel_if_idle_command();
- break;
- }
-}
-
-*/
-#if defined(X3270_DBCS) && defined(X3270_DISPLAY) /*[*/
-/*
- * Run a KeyPress through XIM.
- * Returns True if there is further processing to do, False otherwise.
- */ /*
-static Boolean
-xim_lookup(XKeyEvent *event)
-{
- static char *buf = NULL;
- static UChar *Ubuf = NULL;
- static int buf_len = 0, rlen;
- KeySym k;
- Status status;
- extern XIC ic;
- int i;
- Boolean rv = False;
- int wlen;
-#define BASE_BUFSIZE 50
-
- if (ic == NULL)
- return True;
-
- if (buf == NULL) {
- buf_len = BASE_BUFSIZE;
- buf = Malloc(buf_len);
- Ubuf = (UChar *)Malloc(buf_len * sizeof(UChar));
- }
-
- for (;;) {
- memset(buf, '\0', buf_len);
- rlen = XmbLookupString(ic, event, buf, buf_len - 1, &k,
- &status);
- if (status != XBufferOverflow)
- break;
- buf_len += BASE_BUFSIZE;
- buf = Realloc(buf, buf_len);
- Ubuf = (UChar *)Realloc(Ubuf, buf_len * sizeof(UChar));
- }
-
- switch (status) {
- case XLookupNone:
- rv = False;
- break;
- case XLookupKeySym:
- rv = True;
- break;
- case XLookupChars:
- trace_event("%d XIM char%s:", rlen, (rlen != 1)? "s": "");
- for (i = 0; i < rlen; i++) {
- trace_event(" %02x", buf[i] & 0xff);
- }
- trace_event("\n");
- wlen = mb_to_unicode(buf, rlen, Ubuf, buf_len, NULL);
- if (wlen < 0)
- trace_event(" conversion failed\n");
- for (i = 0; i < wlen; i++) {
- unsigned char asc;
- unsigned char ebc[2];
-
- if (dbcs_map8(Ubuf[i], &asc)) {
- trace_event(" U+%04x -> "
- "EBCDIC SBCS X'%02x'\n",
- Ubuf[i] & 0xffff, asc2ebc[asc]);
- key_ACharacter(asc, KT_STD, ia_cause, NULL);
- } else if (dbcs_map16(Ubuf[i], ebc)) {
- trace_event(" U+%04x -> "
- "EBCDIC DBCS X'%02x%02x'\n",
- Ubuf[i] & 0xffff, ebc[0], ebc[1]);
- (void) key_WCharacter(ebc, NULL);
- } else
- trace_event(" Cannot convert U+%04x to "
- "EBCDIC\n", Ubuf[i] & 0xffff);
- }
- rv = False;
- break;
- case XLookupBoth:
- rv = True;
- break;
- }
- return rv;
-}
-*/
-#endif
-
-/*
- * Key action by string
- */ /*
-void Input_String(const unsigned char *str)
-{
-// reset_idle_timer();
-
- // FIXME (perry#3#): It works but, is it right?
- while(*str)
- {
- key_ACharacter((unsigned char)((*str) & 0xff), KT_STD, IA_KEY, NULL);
- str++;
- }
- screen_disp(&h3270);
-} */
-
-/*
- * Key action.
- */ /*
-void
-Key_action(Widget w unused, XEvent *event, String *params, Cardinal *num_params)
-{
- Cardinal i;
- KeySym k;
- enum keytype keytype;
-
-// reset_idle_timer();
-
- for (i = 0; i < *num_params; i++) {
- char *s = params[i];
-
- k = MyStringToKeysym(s, &keytype);
- if (k == NoSymbol) {
- popup_an_error("%s: Nonexistent or invalid KeySym: %s",
- action_name(Key_action), s);
-// cancel_if_idle_command();
- continue;
- }
- if (k & ~0xff) {
- popup_an_error("%s: Invalid KeySym: %s",
- action_name(Key_action), s);
-// cancel_if_idle_command();
- continue;
- }
- key_ACharacter((unsigned char)(k & 0xff), keytype, IA_KEY,
- NULL);
- }
-}
-*/
-/*
- * String action.
- */ /*
-void
-String_action(Widget w unused, XEvent *event, String *params, Cardinal *num_params)
-{
- Cardinal i;
- int len = 0;
- char *s0, *s;
-
-// reset_idle_timer();
-
- // Determine the total length of the strings.
- for (i = 0; i < *num_params; i++)
- len += strlen(params[i]);
- if (!len)
- return;
-
- // Allocate a block of memory and copy them in.
- s0 = s = Malloc(len + 1);
- *s = '\0';
- for (i = 0; i < *num_params; i++) {
- char *t = params[i];
- unsigned char c;
-
- while ((c = (unsigned char)*t) != '\0') {
- if (c & 0x80) {
- unsigned char xc;
- enum ulfail fail;
- int consumed;
-
- xc = utf8_lookup(t, &fail, &consumed);
- if (xc == 0) {
- switch (fail) {
- case ULFAIL_NOUTF8:
- *s++ = (char)c;
- break;
- case ULFAIL_INCOMPLETE:
- case ULFAIL_INVALID:
- *s++ = ' ';
- break;
- }
- } else {
- *s++ = (char)xc;
- t += (consumed - 1);
- }
- } else
- *s++ = (char)c;
- t++;
- }
- }
- *s = '\0';
-
- // Set a pending string.
-// ps_set(s0, False);
-}
-*/
-
-/*
- * HexString action.
- */ /*
-void HexString_action(Widget w unused, XEvent *event, String *params, Cardinal *num_params)
-{
- Cardinal i;
- int len = 0;
- char *s;
- char *t;
-
-// reset_idle_timer();
-
- // Determine the total length of the strings.
- for (i = 0; i < *num_params; i++) {
- t = params[i];
- if (!strncmp(t, "0x", 2) || !strncmp(t, "0X", 2))
- t += 2;
- len += strlen(t);
- }
- if (!len)
- return;
-
- // Allocate a block of memory and copy them in.
- s = Malloc(len + 1);
- *s = '\0';
- for (i = 0; i < *num_params; i++) {
- t = params[i];
- if (!strncmp(t, "0x", 2) || !strncmp(t, "0X", 2))
- t += 2;
- (void) strcat(s, t);
- }
-
- // Set a pending string.
-// ps_set(s, True);
-}
-*/
-
-/*
- * Dual-mode action for the "asciicircum" ("^") key:
- * If in ANSI mode, pass through untranslated.
- * If in 3270 mode, translate to "notsign".
- * This action is obsoleted by the use of 3270-mode and NVT-mode keymaps, but
- * is still defined here for backwards compatibility with old keymaps.
- */ /*
-void
-CircumNot_action(Widget w unused, XEvent *event, String *params, Cardinal *num_params)
-{
-// reset_idle_timer();
-
- if (IN_3270 && composing == NONE)
- key_ACharacter(0xac, KT_STD, IA_KEY, NULL);
- else
- key_ACharacter('^', KT_STD, IA_KEY, NULL);
-}
-*/
-
/* PA key action for String actions */
static void
do_pa(unsigned n)
diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c
index 4c95544..e63281f 100644
--- a/src/lib3270/screen.c
+++ b/src/lib3270/screen.c
@@ -740,9 +740,9 @@ void popup_system_error(H3270 *session, const char *title, const char *message,
va_end(args);
}
+/*
LIB3270_EXPORT void update_toggle_actions(void)
{
-/*
int f;
if(callbacks && callbacks->toggle_changed)
@@ -750,8 +750,8 @@ LIB3270_EXPORT void update_toggle_actions(void)
for(f=0;f< N_TOGGLES;f++)
callbacks->toggle_changed(&h3270,f,appres.toggle[f].value,TT_UPDATE,toggle_names[f]);
}
-*/
}
+*/
void mcursor_set(H3270 *session,LIB3270_CURSOR m)
{
diff --git a/src/lib3270/selection.c b/src/lib3270/selection.c
new file mode 100644
index 0000000..589966e
--- /dev/null
+++ b/src/lib3270/selection.c
@@ -0,0 +1,93 @@
+/*
+ * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
+ * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
+ * aplicativos mainframe. Registro no INPI sob o nome G3270.
+ *
+ * Copyright (C) <2008>
+ *
+ * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
+ * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
+ * Free Software Foundation.
+ *
+ * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
+ * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
+ * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
+ * obter mais detalhes.
+ *
+ * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
+ * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA, 02111-1307, USA
+ *
+ * Este programa está nomeado como selection.c e possui - linhas de código.
+ *
+ * Contatos:
+ *
+ * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
+ * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
+ *
+ */
+
+ #include "globals.h"
+ #include "ctlr.h"
+ #include
+ #include
+ #include
+
+/*--[ Implement ]------------------------------------------------------------------------------------*/
+
+LIB3270_EXPORT void lib3270_clear_selection(H3270 *session)
+{
+ int a;
+
+ session->selected.begin = -1;
+ session->selected.end = -1;
+
+ for(a = 0; a < session->rows*session->cols; a++)
+ {
+ unsigned short attr = ea_buf[a].attr;
+
+ if(ea_buf[a].attr & LIB3270_ATTR_SELECTED)
+ {
+ ea_buf[a].attr &= ~LIB3270_ATTR_SELECTED;
+ if(session->update)
+ session->update(session,a,ea_buf[a].chr,ea_buf[a].attr,a == session->cursor_addr);
+ }
+ }
+}
+
+LIB3270_EXPORT void lib3270_select_to(H3270 *session, int baddr)
+{
+ CHECK_SESSION_HANDLE(session);
+
+ if(session->selected.begin < 0)
+ session->selected.begin = session->selected.end = session->cursor_addr;
+
+ if(baddr > session->cursor_addr)
+ {
+ session->selected.begin = session->cursor_addr;
+ session->selected.end = baddr;
+ }
+ else
+ {
+ session->selected.begin = baddr;
+ session->selected.end = session->cursor_addr;
+ }
+
+ // Update screen contents
+ for(baddr = 0; baddr < session->rows*session->cols; baddr++)
+ {
+ unsigned short attr = ea_buf[baddr].attr;
+
+ if(baddr >= session->selected.begin && baddr <= session->selected.end)
+ attr |= LIB3270_ATTR_SELECTED;
+ else
+ attr &= ~LIB3270_ATTR_SELECTED;
+
+ if(attr != ea_buf[baddr].attr && session->update)
+ {
+ ea_buf[baddr].attr = attr;
+ session->update(session,baddr,ea_buf[baddr].chr,attr,baddr == session->cursor_addr);
+ }
+ }
+}
+
--
libgit2 0.21.2