From f17f14a5a35876670320d58b802f80d66d707d8b Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 24 Jan 2019 11:33:33 -0200 Subject: [PATCH] Fixing windows build. --- src/include/v3270.h | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------- src/v3270/colors.c | 2 +- src/v3270/draw.c | 2 +- src/v3270/font.c | 2 +- src/v3270ft/v3270ft.c | 4 ++-- 5 files changed, 67 insertions(+), 78 deletions(-) diff --git a/src/include/v3270.h b/src/include/v3270.h index 9b7a362..1f86264 100644 --- a/src/include/v3270.h +++ b/src/include/v3270.h @@ -164,27 +164,19 @@ #define v3270char void #endif // v3270_char - GtkWidget * v3270_new(void); - - GtkWidget * v3270_new_trace_window(GtkWidget *widget); - - GType v3270_get_type(void); - - void v3270_reload(GtkWidget * widget); - - void v3270_set_font_family(GtkWidget *widget, const gchar *name); - const gchar * v3270_get_font_family(GtkWidget *widget); - - H3270 * v3270_get_session(GtkWidget *widget); - gboolean v3270_is_connected(GtkWidget *widget); - - int v3270_reconnect(GtkWidget *widget); - void v3270_disconnect(GtkWidget *widget); - - int v3270_set_host_charset(GtkWidget *widget, const gchar *name); - - void v3270_set_auto_disconnect(GtkWidget *widget, guint minutes); - guint v3270_get_auto_disconnect(GtkWidget *widget); + LIB3270_EXPORT GtkWidget * v3270_new(void); + LIB3270_EXPORT GtkWidget * v3270_new_trace_window(GtkWidget *widget); + LIB3270_EXPORT GType v3270_get_type(void); + LIB3270_EXPORT void v3270_reload(GtkWidget * widget); + LIB3270_EXPORT void v3270_set_font_family(GtkWidget *widget, const gchar *name); + LIB3270_EXPORT const gchar * v3270_get_font_family(GtkWidget *widget); + LIB3270_EXPORT H3270 * v3270_get_session(GtkWidget *widget); + LIB3270_EXPORT gboolean v3270_is_connected(GtkWidget *widget); + LIB3270_EXPORT int v3270_reconnect(GtkWidget *widget); + LIB3270_EXPORT void v3270_disconnect(GtkWidget *widget); + LIB3270_EXPORT int v3270_set_host_charset(GtkWidget *widget, const gchar *name); + LIB3270_EXPORT void v3270_set_auto_disconnect(GtkWidget *widget, guint minutes); + LIB3270_EXPORT guint v3270_get_auto_disconnect(GtkWidget *widget); // Clipboard @@ -196,80 +188,77 @@ V3270_SELECT_MAX } V3270_SELECT_FORMAT; - void v3270_copy(GtkWidget *widget, V3270_SELECT_FORMAT mode, gboolean cut); - void v3270_copy_append(GtkWidget *widget); - gchar * v3270_get_selected(GtkWidget *widget, gboolean cut); - gchar * v3270_get_copy(GtkWidget *widget); - void v3270_set_copy(GtkWidget *widget, const gchar *text); + LIB3270_EXPORT void v3270_copy(GtkWidget *widget, V3270_SELECT_FORMAT mode, gboolean cut); + LIB3270_EXPORT void v3270_copy_append(GtkWidget *widget); + LIB3270_EXPORT gchar * v3270_get_selected(GtkWidget *widget, gboolean cut); + LIB3270_EXPORT gchar * v3270_get_copy(GtkWidget *widget); + LIB3270_EXPORT void v3270_set_copy(GtkWidget *widget, const gchar *text); -// int v3270_run_script(GtkWidget *widget, const gchar *script); + LIB3270_EXPORT gchar * v3270_get_text(GtkWidget *widget,int offset, int len); + LIB3270_EXPORT gchar * v3270_get_region(GtkWidget *widget, gint start_pos, gint end_pos, gboolean all); - gchar * v3270_get_text(GtkWidget *widget,int offset, int len); - gchar * v3270_get_region(GtkWidget *widget, gint start_pos, gint end_pos, gboolean all); - - void v3270_set_string(GtkWidget *widget, const gchar *str); - void v3270_tab(GtkWidget *widget); - void v3270_backtab(GtkWidget *widget); + LIB3270_EXPORT void v3270_set_string(GtkWidget *widget, const gchar *str); + LIB3270_EXPORT void v3270_tab(GtkWidget *widget); + LIB3270_EXPORT void v3270_backtab(GtkWidget *widget); // Cut & Paste - gboolean v3270_get_selection_bounds(GtkWidget *widget, gint *start, gint *end); - void v3270_unselect(GtkWidget *widget); - void v3270_select_all(GtkWidget *widget); - void v3270_paste(GtkWidget *widget); - void v3270_paste_string(GtkWidget *widget, const gchar *text, const gchar *encoding); - void v3270_select_region(GtkWidget *widget, gint start, gint end); + LIB3270_EXPORT gboolean v3270_get_selection_bounds(GtkWidget *widget, gint *start, gint *end); + LIB3270_EXPORT void v3270_unselect(GtkWidget *widget); + LIB3270_EXPORT void v3270_select_all(GtkWidget *widget); + LIB3270_EXPORT void v3270_paste(GtkWidget *widget); + LIB3270_EXPORT void v3270_paste_string(GtkWidget *widget, const gchar *text, const gchar *encoding); + LIB3270_EXPORT void v3270_select_region(GtkWidget *widget, gint start, gint end); // Colors - void v3270_set_colors(GtkWidget *widget, const gchar *); - void v3270_set_color_table(GdkRGBA *table, const gchar *colors); - const GdkRGBA * v3270_get_color_table(GtkWidget *widget); - void v3270_set_mono_color_table(GdkRGBA *table, const gchar *fg, const gchar *bg); - void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, v3270FontInfo *font, GdkRectangle *rect, GdkRGBA *color); - void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkRGBA *color); - GdkRGBA * v3270_get_color(GtkWidget *widget, enum V3270_COLOR id); + LIB3270_EXPORT void v3270_set_colors(GtkWidget *widget, const gchar *); + LIB3270_EXPORT void v3270_set_color_table(GdkRGBA *table, const gchar *colors); + LIB3270_EXPORT const GdkRGBA * v3270_get_color_table(GtkWidget *widget); + LIB3270_EXPORT void v3270_set_mono_color_table(GdkRGBA *table, const gchar *fg, const gchar *bg); + LIB3270_EXPORT void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, v3270FontInfo *font, GdkRectangle *rect, GdkRGBA *color); + LIB3270_EXPORT void v3270_set_color(GtkWidget *widget, enum V3270_COLOR id, GdkRGBA *color); + LIB3270_EXPORT GdkRGBA * v3270_get_color(GtkWidget *widget, enum V3270_COLOR id); // Misc - GtkIMContext * v3270_get_im_context(GtkWidget *widget); + LIB3270_EXPORT GtkIMContext * v3270_get_im_context(GtkWidget *widget); - gboolean v3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix); - gboolean v3270_set_toggle(GtkWidget *widget, LIB3270_TOGGLE ix, gboolean state); + LIB3270_EXPORT gboolean v3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix); + LIB3270_EXPORT gboolean v3270_set_toggle(GtkWidget *widget, LIB3270_TOGGLE ix, gboolean state); - void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type, const gchar *title, const gchar *message, const gchar *text); - const gchar * v3270_get_session_name(GtkWidget *widget); - void v3270_set_session_name(GtkWidget *widget, const gchar *name); - int v3270_set_script(GtkWidget *widget, const gchar id); - void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on); - int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype); + LIB3270_EXPORT void v3270_popup_message(GtkWidget *widget, LIB3270_NOTIFY type, const gchar *title, const gchar *message, const gchar *text); + LIB3270_EXPORT const gchar * v3270_get_session_name(GtkWidget *widget); + LIB3270_EXPORT void v3270_set_session_name(GtkWidget *widget, const gchar *name); + LIB3270_EXPORT int v3270_set_script(GtkWidget *widget, const gchar id); + LIB3270_EXPORT void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on); + LIB3270_EXPORT int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype); - int v3270_set_host_type(GtkWidget *widget, LIB3270_HOST_TYPE type); - int v3270_set_host_type_by_name(GtkWidget *widget, const char *name); + LIB3270_EXPORT int v3270_set_host_type(GtkWidget *widget, LIB3270_HOST_TYPE type); + LIB3270_EXPORT int v3270_set_host_type_by_name(GtkWidget *widget, const char *name); - void v3270_set_url(GtkWidget *widget, const gchar *uri); - const gchar * v3270_get_hostname(GtkWidget *widget); - const char * v3270_get_luname(GtkWidget *widget); - GtkWidget * v3270_get_default_widget(void); + LIB3270_EXPORT void v3270_set_url(GtkWidget *widget, const gchar *uri); + LIB3270_EXPORT const gchar * v3270_get_hostname(GtkWidget *widget); + LIB3270_EXPORT const char * v3270_get_luname(GtkWidget *widget); + LIB3270_EXPORT GtkWidget * v3270_get_default_widget(void); - void v3270_set_session_host_type(GtkWidget *widget, LIB3270_HOST_TYPE); + LIB3270_EXPORT void v3270_set_session_host_type(GtkWidget *widget, LIB3270_HOST_TYPE); - void v3270_remap_from_xml(GtkWidget *widget, const gchar *path); + LIB3270_EXPORT void v3270_remap_from_xml(GtkWidget *widget, const gchar *path); // Keyboard & Mouse special actions - gboolean v3270_set_keyboard_action(GtkWidget *widget, const gchar *key_name, GtkAction *action); - void v3270_set_scroll_action(GtkWidget *widget, GdkScrollDirection direction, GtkAction *action); + LIB3270_EXPORT gboolean v3270_set_keyboard_action(GtkWidget *widget, const gchar *key_name, GtkAction *action); + LIB3270_EXPORT void v3270_set_scroll_action(GtkWidget *widget, GdkScrollDirection direction, GtkAction *action); // SSL & Security - const gchar * v3270_get_ssl_status_icon(GtkWidget *widget); - const gchar * v3270_get_ssl_status_text(GtkWidget *widget); - const gchar * v3270_get_ssl_status_message(GtkWidget *widget); - void v3270_popup_security_dialog(GtkWidget *widget); - + LIB3270_EXPORT const gchar * v3270_get_ssl_status_icon(GtkWidget *widget); + LIB3270_EXPORT const gchar * v3270_get_ssl_status_text(GtkWidget *widget); + LIB3270_EXPORT const gchar * v3270_get_ssl_status_message(GtkWidget *widget); + LIB3270_EXPORT void v3270_popup_security_dialog(GtkWidget *widget); // File transfer - gint v3270_transfer_file(GtkWidget *widget, LIB3270_FT_OPTION options, const gchar *local, const gchar *remote, int lrecl, int blksize, int primspace, int secspace, int dft); + LIB3270_EXPORT gint v3270_transfer_file(GtkWidget *widget, LIB3270_FT_OPTION options, const gchar *local, const gchar *remote, int lrecl, int blksize, int primspace, int secspace, int dft); // Auxiliary widgets - GtkWidget * v3270_host_select_new(GtkWidget *widget); - void v3270_select_host(GtkWidget *widget); + LIB3270_EXPORT GtkWidget * v3270_host_select_new(GtkWidget *widget); + LIB3270_EXPORT void v3270_select_host(GtkWidget *widget); G_END_DECLS diff --git a/src/v3270/colors.c b/src/v3270/colors.c index 38ea5a5..2bd78e6 100644 --- a/src/v3270/colors.c +++ b/src/v3270/colors.c @@ -132,7 +132,7 @@ LIB3270_EXPORT void v3270_set_mono_color_table(GdkRGBA *clr, const gchar *fg, co } -void v3270_set_color_table(GdkRGBA *table, const gchar *colors) +LIB3270_EXPORT void v3270_set_color_table(GdkRGBA *table, const gchar *colors) { gchar **clr; guint cnt; diff --git a/src/v3270/draw.c b/src/v3270/draw.c index 14f223a..bac7e22 100644 --- a/src/v3270/draw.c +++ b/src/v3270/draw.c @@ -120,7 +120,7 @@ static void get_element_colors(unsigned short attr, GdkRGBA **fg, GdkRGBA **bg, } } -void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, v3270FontInfo *fontInfo, GdkRectangle *rect, GdkRGBA *color) +LIB3270_EXPORT void v3270_draw_element(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, v3270FontInfo *fontInfo, GdkRectangle *rect, GdkRGBA *color) { GdkRGBA *fg; GdkRGBA *bg; diff --git a/src/v3270/font.c b/src/v3270/font.c index 869995e..0daad5b 100644 --- a/src/v3270/font.c +++ b/src/v3270/font.c @@ -183,7 +183,7 @@ LIB3270_EXPORT const gchar * v3270_get_font_family(GtkWidget *widget) return GTK_V3270(widget)->font.family; } -void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on) +LIB3270_EXPORT void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on) { g_return_if_fail(GTK_IS_V3270(widget)); diff --git a/src/v3270ft/v3270ft.c b/src/v3270ft/v3270ft.c index 4c3df79..32a0d2a 100644 --- a/src/v3270ft/v3270ft.c +++ b/src/v3270ft/v3270ft.c @@ -121,7 +121,7 @@ static void local_file_changed(GtkEntry *widget, v3270ft *dialog) { struct v3270ft_entry *entry = v3270ft_get_selected(dialog); if(entry) { - strncpy(entry->local,gtk_entry_get_text(widget),sizeof(entry->local)); + strncpy(entry->local,gtk_entry_get_text(widget),sizeof(entry->local)-1); v3270ft_update_actions(dialog); } @@ -132,7 +132,7 @@ static void remote_file_changed(GtkEntry *widget, v3270ft *dialog) { struct v3270ft_entry *entry = v3270ft_get_selected(dialog); if(entry) { - strncpy(entry->remote,gtk_entry_get_text(widget),sizeof(entry->remote)); + strncpy(entry->remote,gtk_entry_get_text(widget),sizeof(entry->remote)-1); v3270ft_update_actions(dialog); } -- libgit2 0.21.2