Commit 245f6d5a587c058116f46c81f78d42dda63b08ef
1 parent
1280051c
Exists in
master
and in
1 other branch
Moving terminal definitions to separated include file.
Fixing memory leaks detected with valgrind
Showing
21 changed files
with
223 additions
and
203 deletions
Show diff stats
Makefile.in
src/dialogs/print/print.c
| ... | ... | @@ -0,0 +1,183 @@ |
| 1 | +/* | |
| 2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
| 5 | + * | |
| 6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | + * | |
| 8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | + * Free Software Foundation. | |
| 11 | + * | |
| 12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | + * obter mais detalhes. | |
| 16 | + * | |
| 17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - e possui - linhas de código. | |
| 22 | + * | |
| 23 | + * Contatos: | |
| 24 | + * | |
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 27 | + * | |
| 28 | + */ | |
| 29 | + | |
| 30 | +#include <config.h> | |
| 31 | +#include <internals.h> | |
| 32 | + | |
| 33 | +G_BEGIN_DECLS | |
| 34 | + | |
| 35 | + struct _v3270Class | |
| 36 | + { | |
| 37 | + GtkWidgetClass parent_class; | |
| 38 | + | |
| 39 | + // Internal properties. | |
| 40 | + struct { | |
| 41 | + | |
| 42 | + size_t count; // Number of properties. | |
| 43 | + | |
| 44 | + GParamSpec * font_family; | |
| 45 | + GParamSpec * toggle[LIB3270_TOGGLE_COUNT]; // Toggle properties. | |
| 46 | + | |
| 47 | + // Signal related properties | |
| 48 | + GParamSpec * online; | |
| 49 | + GParamSpec * luname; | |
| 50 | + GParamSpec * model; | |
| 51 | + GParamSpec * selection; | |
| 52 | + | |
| 53 | + struct | |
| 54 | + { | |
| 55 | + guint toggle; | |
| 56 | + guint boolean; | |
| 57 | + guint integer; | |
| 58 | + guint str; | |
| 59 | + } type; | |
| 60 | + | |
| 61 | + } properties; | |
| 62 | + | |
| 63 | + // Cursors | |
| 64 | + GdkCursor * cursors[LIB3270_POINTER_COUNT]; | |
| 65 | + | |
| 66 | + // Signals | |
| 67 | + void (*activate)(GtkWidget *widget); | |
| 68 | + void (*toggle_changed)(v3270 *widget,LIB3270_TOGGLE toggle_id,gboolean toggle_state,const gchar *toggle_name); | |
| 69 | + void (*message_changed)(v3270 *widget, LIB3270_MESSAGE id); | |
| 70 | + void (*popup_message)(GtkWidget *widget, LIB3270_NOTIFY id , const gchar *title, const gchar *message, const gchar *text); | |
| 71 | + | |
| 72 | + }; | |
| 73 | + | |
| 74 | +/*--[ Defines]---------------------------------------------------------------------------------------*/ | |
| 75 | + | |
| 76 | + #define OIA_TOP_MARGIN 2 | |
| 77 | + | |
| 78 | + #define KEY_FLAG_SHIFT 0x0001 | |
| 79 | + | |
| 80 | + #ifndef WIN32 | |
| 81 | + #define KEY_FLAG_ALT 0x0002 | |
| 82 | + #endif // !WIN32 | |
| 83 | + | |
| 84 | +/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 85 | + | |
| 86 | + struct v3270_ssl_status_msg | |
| 87 | + { | |
| 88 | + long id; | |
| 89 | + const gchar * icon; | |
| 90 | + const gchar * text; | |
| 91 | + const gchar * message; | |
| 92 | + }; | |
| 93 | + | |
| 94 | +/*--[ Widget data ]----------------------------------------------------------------------------------*/ | |
| 95 | + | |
| 96 | + struct _v3270 | |
| 97 | + { | |
| 98 | + GtkWidget parent; | |
| 99 | + | |
| 100 | + // flags | |
| 101 | + int selecting : 1; /**< Selecting region */ | |
| 102 | + int moving : 1; /**< Moving selected region */ | |
| 103 | + int resizing : 1; /**< Resizing selected region */ | |
| 104 | + int table : 1; /**< Copy mode is table */ | |
| 105 | + int scaled_fonts : 1; /**< Use scaled fonts */ | |
| 106 | + int drawing : 1; /**< Draw widget? */ | |
| 107 | + | |
| 108 | +#if GTK_CHECK_VERSION(3,0,0) | |
| 109 | + | |
| 110 | +#else | |
| 111 | + gint width; | |
| 112 | + gint height; | |
| 113 | +#endif // GTK_CHECK_VERSION(3,0,0) | |
| 114 | + | |
| 115 | + GSource * timer; | |
| 116 | + GtkIMContext * input_method; | |
| 117 | + unsigned short keyflags; | |
| 118 | + | |
| 119 | + struct | |
| 120 | + { | |
| 121 | + char * text; /**< Clipboard contents (lib3270 charset) */ | |
| 122 | + int baddr; /**< Selection addr */ | |
| 123 | + } selection; | |
| 124 | + | |
| 125 | + LIB3270_POINTER pointer_id; | |
| 126 | + unsigned char pointer; /**< Mouse pointer ID */ | |
| 127 | + | |
| 128 | + // Font info | |
| 129 | + cairo_surface_t * surface; | |
| 130 | + v3270FontInfo font; | |
| 131 | + | |
| 132 | + gint minimum_width; | |
| 133 | + gint minimum_height; | |
| 134 | + | |
| 135 | + // Colors | |
| 136 | + GdkRGBA color[V3270_COLOR_COUNT]; /**< Terminal widget colors */ | |
| 137 | + | |
| 138 | + // OIA | |
| 139 | + struct | |
| 140 | + { | |
| 141 | + GdkRectangle rect[V3270_OIA_FIELD_COUNT]; | |
| 142 | + V3270_OIA_FIELD selected; /**< Clicked OIA field */ | |
| 143 | + } oia; | |
| 144 | + | |
| 145 | + struct | |
| 146 | + { | |
| 147 | + unsigned char show; /**< Cursor flag */ | |
| 148 | + unsigned char chr; /**< Char at cursor position */ | |
| 149 | + unsigned short attr; /**< Attribute at cursor position */ | |
| 150 | + GdkRectangle rect; /**< Cursor rectangle */ | |
| 151 | + GSource * timer; /**< Cursor blinking timer */ | |
| 152 | + cairo_surface_t * surface; /**< Cursor image */ | |
| 153 | + } cursor; | |
| 154 | + | |
| 155 | + // Acessibility | |
| 156 | + GtkAccessible * accessible; | |
| 157 | + | |
| 158 | + // Session | |
| 159 | + H3270 * host; /**< Related 3270 session */ | |
| 160 | + gchar * session_name; /**< Session name (for window title) */ | |
| 161 | + | |
| 162 | + // Auto disconnect | |
| 163 | + struct | |
| 164 | + { | |
| 165 | + time_t timestamp; /**< Last action in this widget */ | |
| 166 | + guint disconnect; /**< Time (in minutes) for auto disconnect */ | |
| 167 | + GSource * timer; /**< Auto disconnect timer */ | |
| 168 | + } activity; | |
| 169 | + | |
| 170 | + char script; /**< @brief Script ID */ | |
| 171 | + | |
| 172 | + // Blink | |
| 173 | + struct | |
| 174 | + { | |
| 175 | + int show : 1; /**< @brief Show element? */ | |
| 176 | + GSource * timer; /**< @brief Timer source. */ | |
| 177 | + } blink; | |
| 178 | + | |
| 179 | + }; | |
| 180 | + | |
| 181 | +/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 182 | + | |
| 183 | +G_END_DECLS | ... | ... |
src/terminal/accessible.c
src/terminal/blink.c
src/terminal/callbacks.c
src/terminal/charset.c
src/terminal/colors.c
src/terminal/draw.c
src/terminal/font.c
src/terminal/iocallback.c
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | #include <lib3270.h> |
| 32 | 32 | #include <lib3270/log.h> |
| 33 | 33 | #include <internals.h> |
| 34 | -#include "private.h" | |
| 34 | +#include <terminal.h> | |
| 35 | 35 | |
| 36 | 36 | static void * static_AddSource(H3270 *session, int fd, LIB3270_IO_FLAG flag, void(*proc)(H3270 *, int, LIB3270_IO_FLAG, void *), void *userdata); |
| 37 | 37 | static void static_RemoveSource(H3270 *session, void *id); | ... | ... |
src/terminal/keyboard.c
src/terminal/linux/iosource.c
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | #include <lib3270/log.h> |
| 33 | 33 | #include <poll.h> |
| 34 | 34 | #include <internals.h> |
| 35 | - #include "../private.h" | |
| 35 | + #include <terminal.h> | |
| 36 | 36 | |
| 37 | 37 | /*---[ Structs ]-------------------------------------------------------------------------------------------*/ |
| 38 | 38 | ... | ... |
src/terminal/mouse.c
src/terminal/oia.c
src/terminal/private.h
| ... | ... | @@ -1,183 +0,0 @@ |
| 1 | -/* | |
| 2 | - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | - * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
| 5 | - * | |
| 6 | - * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | - * | |
| 8 | - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | - * Free Software Foundation. | |
| 11 | - * | |
| 12 | - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | - * obter mais detalhes. | |
| 16 | - * | |
| 17 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 19 | - * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como private.h e possui - linhas de código. | |
| 22 | - * | |
| 23 | - * Contatos: | |
| 24 | - * | |
| 25 | - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 26 | - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 27 | - * | |
| 28 | - */ | |
| 29 | - | |
| 30 | -#include <config.h> | |
| 31 | -#include <internals.h> | |
| 32 | - | |
| 33 | -G_BEGIN_DECLS | |
| 34 | - | |
| 35 | - struct _v3270Class | |
| 36 | - { | |
| 37 | - GtkWidgetClass parent_class; | |
| 38 | - | |
| 39 | - // Internal properties. | |
| 40 | - struct { | |
| 41 | - | |
| 42 | - size_t count; // Number of properties. | |
| 43 | - | |
| 44 | - GParamSpec * font_family; | |
| 45 | - GParamSpec * toggle[LIB3270_TOGGLE_COUNT]; // Toggle properties. | |
| 46 | - | |
| 47 | - // Signal related properties | |
| 48 | - GParamSpec * online; | |
| 49 | - GParamSpec * luname; | |
| 50 | - GParamSpec * model; | |
| 51 | - GParamSpec * selection; | |
| 52 | - | |
| 53 | - struct | |
| 54 | - { | |
| 55 | - guint toggle; | |
| 56 | - guint boolean; | |
| 57 | - guint integer; | |
| 58 | - guint str; | |
| 59 | - } type; | |
| 60 | - | |
| 61 | - } properties; | |
| 62 | - | |
| 63 | - // Cursors | |
| 64 | - GdkCursor * cursors[LIB3270_POINTER_COUNT]; | |
| 65 | - | |
| 66 | - // Signals | |
| 67 | - void (*activate)(GtkWidget *widget); | |
| 68 | - void (*toggle_changed)(v3270 *widget,LIB3270_TOGGLE toggle_id,gboolean toggle_state,const gchar *toggle_name); | |
| 69 | - void (*message_changed)(v3270 *widget, LIB3270_MESSAGE id); | |
| 70 | - void (*popup_message)(GtkWidget *widget, LIB3270_NOTIFY id , const gchar *title, const gchar *message, const gchar *text); | |
| 71 | - | |
| 72 | - }; | |
| 73 | - | |
| 74 | -/*--[ Defines]---------------------------------------------------------------------------------------*/ | |
| 75 | - | |
| 76 | - #define OIA_TOP_MARGIN 2 | |
| 77 | - | |
| 78 | - #define KEY_FLAG_SHIFT 0x0001 | |
| 79 | - | |
| 80 | - #ifndef WIN32 | |
| 81 | - #define KEY_FLAG_ALT 0x0002 | |
| 82 | - #endif // !WIN32 | |
| 83 | - | |
| 84 | -/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 85 | - | |
| 86 | - struct v3270_ssl_status_msg | |
| 87 | - { | |
| 88 | - long id; | |
| 89 | - const gchar * icon; | |
| 90 | - const gchar * text; | |
| 91 | - const gchar * message; | |
| 92 | - }; | |
| 93 | - | |
| 94 | -/*--[ Widget data ]----------------------------------------------------------------------------------*/ | |
| 95 | - | |
| 96 | - struct _v3270 | |
| 97 | - { | |
| 98 | - GtkWidget parent; | |
| 99 | - | |
| 100 | - // flags | |
| 101 | - int selecting : 1; /**< Selecting region */ | |
| 102 | - int moving : 1; /**< Moving selected region */ | |
| 103 | - int resizing : 1; /**< Resizing selected region */ | |
| 104 | - int table : 1; /**< Copy mode is table */ | |
| 105 | - int scaled_fonts : 1; /**< Use scaled fonts */ | |
| 106 | - int drawing : 1; /**< Draw widget? */ | |
| 107 | - | |
| 108 | -#if GTK_CHECK_VERSION(3,0,0) | |
| 109 | - | |
| 110 | -#else | |
| 111 | - gint width; | |
| 112 | - gint height; | |
| 113 | -#endif // GTK_CHECK_VERSION(3,0,0) | |
| 114 | - | |
| 115 | - GSource * timer; | |
| 116 | - GtkIMContext * input_method; | |
| 117 | - unsigned short keyflags; | |
| 118 | - | |
| 119 | - struct | |
| 120 | - { | |
| 121 | - char * text; /**< Clipboard contents (lib3270 charset) */ | |
| 122 | - int baddr; /**< Selection addr */ | |
| 123 | - } selection; | |
| 124 | - | |
| 125 | - LIB3270_POINTER pointer_id; | |
| 126 | - unsigned char pointer; /**< Mouse pointer ID */ | |
| 127 | - | |
| 128 | - // Font info | |
| 129 | - cairo_surface_t * surface; | |
| 130 | - v3270FontInfo font; | |
| 131 | - | |
| 132 | - gint minimum_width; | |
| 133 | - gint minimum_height; | |
| 134 | - | |
| 135 | - // Colors | |
| 136 | - GdkRGBA color[V3270_COLOR_COUNT]; /**< Terminal widget colors */ | |
| 137 | - | |
| 138 | - // OIA | |
| 139 | - struct | |
| 140 | - { | |
| 141 | - GdkRectangle rect[V3270_OIA_FIELD_COUNT]; | |
| 142 | - V3270_OIA_FIELD selected; /**< Clicked OIA field */ | |
| 143 | - } oia; | |
| 144 | - | |
| 145 | - struct | |
| 146 | - { | |
| 147 | - unsigned char show; /**< Cursor flag */ | |
| 148 | - unsigned char chr; /**< Char at cursor position */ | |
| 149 | - unsigned short attr; /**< Attribute at cursor position */ | |
| 150 | - GdkRectangle rect; /**< Cursor rectangle */ | |
| 151 | - GSource * timer; /**< Cursor blinking timer */ | |
| 152 | - cairo_surface_t * surface; /**< Cursor image */ | |
| 153 | - } cursor; | |
| 154 | - | |
| 155 | - // Acessibility | |
| 156 | - GtkAccessible * accessible; | |
| 157 | - | |
| 158 | - // Session | |
| 159 | - H3270 * host; /**< Related 3270 session */ | |
| 160 | - gchar * session_name; /**< Session name (for window title) */ | |
| 161 | - | |
| 162 | - // Auto disconnect | |
| 163 | - struct | |
| 164 | - { | |
| 165 | - time_t timestamp; /**< Last action in this widget */ | |
| 166 | - guint disconnect; /**< Time (in minutes) for auto disconnect */ | |
| 167 | - GSource * timer; /**< Auto disconnect timer */ | |
| 168 | - } activity; | |
| 169 | - | |
| 170 | - char script; /**< @brief Script ID */ | |
| 171 | - | |
| 172 | - // Blink | |
| 173 | - struct | |
| 174 | - { | |
| 175 | - int show : 1; /**< @brief Show element? */ | |
| 176 | - GSource * timer; /**< @brief Timer source. */ | |
| 177 | - } blink; | |
| 178 | - | |
| 179 | - }; | |
| 180 | - | |
| 181 | -/*--[ Globals ]--------------------------------------------------------------------------------------*/ | |
| 182 | - | |
| 183 | -G_END_DECLS |
src/terminal/properties.c
src/terminal/security.c
src/terminal/selection.c
src/terminal/widget.c
valgrind.suppression
| 1 | 1 | { |
| 2 | + libcrypto_BIO_read | |
| 3 | + Memcheck:Cond | |
| 4 | + ... | |
| 5 | + fun:BIO_read | |
| 6 | +} | |
| 7 | + | |
| 8 | +{ | |
| 2 | 9 | libcrypt_FIPS_selftest |
| 3 | 10 | Memcheck:Cond |
| 4 | 11 | ... |
| ... | ... | @@ -138,3 +145,18 @@ |
| 138 | 145 | fun:cairo_mask |
| 139 | 146 | } |
| 140 | 147 | |
| 148 | +{ | |
| 149 | + gtk_css_dimension_value_new | |
| 150 | + Memcheck:Leak | |
| 151 | + ... | |
| 152 | + fun:gtk_css_dimension_value_new | |
| 153 | +} | |
| 154 | + | |
| 155 | +{ | |
| 156 | + gtk_style_constructed | |
| 157 | + Memcheck:Leak | |
| 158 | + ... | |
| 159 | + fun:gtk_style_constructed | |
| 160 | +} | |
| 161 | + | |
| 162 | + | ... | ... |