From af9615e4ba8f2f1a45caec88799077b55cc93549 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 9 Feb 2012 12:35:55 +0000 Subject: [PATCH] Incluindo sinal quando o conteudo da tela muda,acertando funcoes de seleção para usar a estrutura de sessão --- latest/src/gtk2/mouse.c | 12 ++++++------ latest/src/include/lib3270/api.h | 1 + latest/src/lib/screen.c | 5 ++++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/latest/src/gtk2/mouse.c b/latest/src/gtk2/mouse.c index c3e2573..15bd750 100644 --- a/latest/src/gtk2/mouse.c +++ b/latest/src/gtk2/mouse.c @@ -924,7 +924,7 @@ SetSelectionMode(Toggled(RECTANGLE_SELECT) ? SELECT_MODE_RECTANGLE : SELECT_MODE_TEXT); } - static void doSelect(int (*call)(void)) + static void doSelect(H3270 *hSession, int (*call)(H3270 *hSession)) { int row; int col; @@ -937,7 +937,7 @@ startCol = endCol = (cursor_position % screen->cols); } - call(); + call(hSession); row = cursor_position / screen->cols; col = cursor_position % screen->cols; @@ -950,22 +950,22 @@ PW3270_ACTION( selectleft ) { - doSelect(lib3270_cursor_left); + doSelect(hSession,lib3270_cursor_left); } PW3270_ACTION( selectright ) { - doSelect(lib3270_cursor_right); + doSelect(hSession,lib3270_cursor_right); } PW3270_ACTION( selectup ) { - doSelect(lib3270_cursor_up); + doSelect(hSession,lib3270_cursor_up); } PW3270_ACTION( selectdown ) { - doSelect(lib3270_cursor_down); + doSelect(hSession,lib3270_cursor_down); } static void MoveSelection(int row, int col) diff --git a/latest/src/include/lib3270/api.h b/latest/src/include/lib3270/api.h index 1bf6d55..1a98bfb 100644 --- a/latest/src/include/lib3270/api.h +++ b/latest/src/include/lib3270/api.h @@ -272,6 +272,7 @@ /* Session based callbacks */ void (*configure)(H3270 *session, unsigned short rows, unsigned short cols); void (*update)(H3270 *session, int baddr, unsigned char c, unsigned short attr); + void (*changed)(H3270 *session, int bstart, int bend); void (*update_cursor)(H3270 *session, unsigned short row, unsigned short col); void (*update_oia)(H3270 *session, OIA_FLAG id, unsigned char on); void (*set_timer)(H3270 *session, unsigned char on); diff --git a/latest/src/lib/screen.c b/latest/src/lib/screen.c index f0019ec..a8d7301 100644 --- a/latest/src/lib/screen.c +++ b/latest/src/lib/screen.c @@ -369,7 +369,6 @@ int screen_read(char *dest, int baddr, int count) /* Display what's in the buffer. */ static void screen_update(H3270 *session, int bstart, int bend) { - int baddr; unsigned short a; int attr = COLOR_GREEN; @@ -434,6 +433,10 @@ static void screen_update(H3270 *session, int bstart, int bend) } } + + if(session->changed) + session->changed(session,bstart,bend); + } void screen_disp(H3270 *session) -- libgit2 0.21.2