From 5d28bb7bf3c817d3624ff02bc3a2b0db74454cc4 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Fri, 7 Dec 2018 15:23:44 -0200 Subject: [PATCH] Adding v3270 support on glade. --- .gitignore | 2 +- Makefile.in | 34 +++++++++++++++++++++++++++++++++- branding/logo.svg | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 75 +++------------------------------------------------------------------------ glade/v3270.xml.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ rpm/libv3270.spec | 27 +++++++++++++++++++++++++++ src/dialogs/hostselect.c | 4 ++-- src/include/config.h.in | 2 -- src/include/hostselect.h | 4 ++-- src/include/v3270.h | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------- src/include/v3270/filetransfer.h | 46 +++++++++++++++++++++++----------------------- src/testprogram/testprogram.c | 9 +-------- src/v3270/oia.c | 2 +- src/v3270/private.h | 64 ++++++++++++++++++++++++++++++++-------------------------------- src/v3270/properties.c | 4 ++-- src/v3270/security.c | 6 +++--- 16 files changed, 391 insertions(+), 210 deletions(-) create mode 100644 branding/logo.svg create mode 100644 glade/v3270.xml.in diff --git a/.gitignore b/.gitignore index bc2db2d..18e0ae1 100644 --- a/.gitignore +++ b/.gitignore @@ -49,4 +49,4 @@ makeruntime.sh scripts vgcore.* doxygen/doxyfile - +glade/v3270.xml diff --git a/Makefile.in b/Makefile.in index 344a34c..156cc4d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,6 +53,8 @@ WINDRES=@WINDRES@ AR=@AR@ VALGRIND=@VALGRIND@ GENMARSHAL=@GENMARSHAL@ +CONVERT=@CONVERT@ +OPTIPNG=@OPTIPNG@ #---[ Paths ]---------------------------------------------------------------------------- @@ -172,6 +174,7 @@ $(POTDIR)/$(LIBNAME)/%.pot: \ @$(MKDIR) `dirname $@` @touch $@ + #---[ Marshal Targets ]------------------------------------------------------------------ src/v3270/marshal.h: \ @@ -228,6 +231,11 @@ all: \ $(BINRLS)/static/$(LIBNAME).a \ $(POTDIR)/$(LIBNAME).pot +x: \ + $(BINDIR)/icons/16x16/logo.png \ + $(BINDIR)/icons/22x22/logo.png + + Release: \ $(BINRLS)/$(LIBNAME)@DLLEXT@ \ @@ -279,7 +287,8 @@ $(BINRLS)/static/$(LIBNAME).a: \ install: \ $(BINRLS)/$(LIBNAME)@DLLEXT@ \ - $(BINRLS)/static/$(LIBNAME).a + $(BINRLS)/static/$(LIBNAME).a \ + install-glade # Install library @mkdir -p $(DESTDIR)$(libdir) @@ -320,6 +329,23 @@ install: \ libv3270.pc \ $(DESTDIR)$(libdir)/pkgconfig/v3270.pc +install-glade: + + @mkdir -p $(DESTDIR)$(datarootdir)/glade/catalogs + @mkdir -p $(DESTDIR)$(datarootdir)/glade/pixmaps/hicolor/16x16/actions + @mkdir -p $(DESTDIR)$(datarootdir)/glade/pixmaps/hicolor/22x22/actions + + @$(INSTALL_DATA) \ + glade/v3270.xml + $(DESTDIR)$(datarootdir)/glade/catalogs/v3270.xml + + @$(INSTALL_DATA) \ + branding/icon-16x16.png \ + $(DESTDIR)$(datarootdir)/glade/pixmaps/hicolor/16x16/actions/widget-v3270-terminal.png + + @$(INSTALL_DATA) \ + branding/icon-22x22.png \ + $(DESTDIR)$(datarootdir)/glade/pixmaps/hicolor/22x22/actions/widget-v3270-terminal.png #---[ Misc Targets ]--------------------------------------------------------------------- @@ -357,6 +383,12 @@ $(BINDBG)/$(LIBNAME)@EXEEXT@: \ run: \ $(BINDBG)/$(LIBNAME)@EXEEXT@ + @LD_LIBRARY_PATH=$(BINDBG) \ + $(BINDBG)/$(LIBNAME)@EXEEXT@ + +mem-check: \ + $(BINDBG)/$(LIBNAME)@EXEEXT@ + ifeq ($(VALGRIND),no) @LD_LIBRARY_PATH=$(BINDBG) \ diff --git a/branding/logo.svg b/branding/logo.svg new file mode 100644 index 0000000..e18f0c8 --- /dev/null +++ b/branding/logo.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/configure.ac b/configure.ac index eb9f09b..27d14f1 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,8 @@ AC_PROG_CC AC_PROG_SED AC_PROG_LN_S AC_PATH_TOOL([AR], [ar], [ar]) +AC_PATH_TOOL([CONVERT], [convert], [no]) +AC_PATH_TOOL([OPTIPNG],[optipng],[no]) AC_LANG([C]) @@ -258,78 +260,6 @@ if test "x$DOXYGEN" != "x"; then fi dnl --------------------------------------------------------------------------- -dnl Check for ELF symbol visibility support -dnl --------------------------------------------------------------------------- -m4_define([GLIB_CHECK_COMPILE_WARNINGS], -[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl -rm -f conftest.$ac_objext -glib_ac_compile_save="$ac_compile" -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext' -AS_IF([_AC_EVAL_STDERR($ac_compile) && - AC_TRY_COMMAND([(if test -s conftest.err; then false ; else true; fi)])], - [$2], - [echo "$as_me: failed program was:" >&AS_MESSAGE_LOG_FD -cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD -m4_ifvaln([$3],[$3])dnl]) -ac_compile="$glib_ac_compile_save" -rm -f conftest.$ac_objext conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl -])# GLIB_CHECK_COMPILE_WARNINGS - -AC_MSG_CHECKING(for GNUC visibility attribute) -GLIB_CHECK_COMPILE_WARNINGS([ -void -__attribute__ ((visibility ("hidden"))) - f_hidden (void) -{ -} -void -__attribute__ ((visibility ("internal"))) - f_internal (void) -{ -} -void -__attribute__ ((visibility ("protected"))) - f_protected (void) -{ -} -void -__attribute__ ((visibility ("default"))) - f_default (void) -{ -} -int main (int argc, char **argv) -{ - f_hidden(); - f_internal(); - f_protected(); - f_default(); - return 0; -} -],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no) -AC_MSG_RESULT($g_have_gnuc_visibility) -if test x$g_have_gnuc_visibility = xyes; then - AC_DEFINE(HAVE_GNUC_VISIBILITY, 1, [supports GCC visibility attributes]) -fi - -dnl --------------------------------------------------------------------------- -dnl Check for compiler visibility flag -dnl --------------------------------------------------------------------------- -AC_MSG_CHECKING(whether $CC accepts -fvisibility=hidden) -AC_CACHE_VAL(app_cv_fvisibility_ok, -[ac_save_cc="$CC" -CC="$CC -fvisibility=hidden" -AC_TRY_RUN([int main() { return 0; }], - app_cv_fvisibility_ok=yes, - app_cv_fvisibility_ok=no, - app_cv_fvisibility_ok=no) -CC="$ac_save_cc"]) -AC_MSG_RESULT($app_cv_fvisibility_ok) -if test $app_cv_fvisibility_ok = yes; then - CFLAGS="$CFLAGS -fvisibility=hidden" - CXXFLAGS="$CXXFLAGS -fvisibility=hidden" -fi - -dnl --------------------------------------------------------------------------- dnl Check for pic dnl --------------------------------------------------------------------------- AC_ARG_ENABLE([pic], @@ -415,6 +345,7 @@ dnl --------------------------------------------------------------------------- AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(libv3270.pc) +AC_CONFIG_FILES(glade/v3270.xml) dnl --------------------------------------------------------------------------- dnl Output the generated config.status script. diff --git a/glade/v3270.xml.in b/glade/v3270.xml.in new file mode 100644 index 0000000..10a93de --- /dev/null +++ b/glade/v3270.xml.in @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rpm/libv3270.spec b/rpm/libv3270.spec index 45c4f24..7c44e50 100644 --- a/rpm/libv3270.spec +++ b/rpm/libv3270.spec @@ -61,6 +61,7 @@ BuildRequires: coreutils BuildRequires: gcc-c++ BuildRequires: gettext-devel BuildRequires: m4 +BuildRequires: libgladeui %description @@ -89,6 +90,26 @@ Originally designed as part of the pw3270 application. See more details at https://softwarepublico.gov.br/social/pw3270/ +%package -n glade-catalog-v3270 + +Summary: Glade catalog for the TN3270 terminal emulator library +Group: Development/Libraries/C and C++ + +Requires: libv3270-devel = %{version} +Requires: libgladeui + +%description -n glade-catalog-v3270 + +3270 Virtual Terminal for GTK development files. + +Originally designed as part of the pw3270 application. + +This package provides a catalog for Glade, to allow the use of V3270 +widgets in Glade. + +See more details at https://softwarepublico.gov.br/social/pw3270/ + + #---[ Build & Install ]----------------------------------------------------------------------------------------------- %prep @@ -126,6 +147,12 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libv3270.a +%files -n glade-catalog-v3270 +%defattr(-,root,root) +/usr/share/glade/catalogs/v3270.xml +/usr/share/glade/pixmaps/hicolor/16x16/actions/widget-v3270-terminal.png +/usr/share/glade/pixmaps/hicolor/22x22/actions/widget-v3270-terminal.png + %pre /sbin/ldconfig exit 0 diff --git a/src/dialogs/hostselect.c b/src/dialogs/hostselect.c index 4648974..e5d31bf 100644 --- a/src/dialogs/hostselect.c +++ b/src/dialogs/hostselect.c @@ -376,7 +376,7 @@ void v3270_host_select_set_session(V3270HostSelectWidget *widget, GtkWidget *ses widget->options = opt; } -LIB3270_EXPORT void v3270_select_host(GtkWidget *widget) +void v3270_select_host(GtkWidget *widget) { g_return_if_fail(GTK_IS_V3270(widget)); @@ -426,7 +426,7 @@ LIB3270_EXPORT void v3270_select_host(GtkWidget *widget) } -LIB3270_EXPORT int v3270_host_select_apply(V3270HostSelectWidget *widget) +int v3270_host_select_apply(V3270HostSelectWidget *widget) { g_return_val_if_fail(GTK_IS_V3270HostSelectWidget(widget),0); diff --git a/src/include/config.h.in b/src/include/config.h.in index 2bfd3c2..ca153ed 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -35,8 +35,6 @@ #undef PACKAGE_VERSION #undef PACKAGE_RELEASE - #undef HAVE_GNUC_VISIBILITY - #undef HAVE_GNOME #undef HAVE_GTKMAC diff --git a/src/include/hostselect.h b/src/include/hostselect.h index a4c49b1..3053543 100644 --- a/src/include/hostselect.h +++ b/src/include/hostselect.h @@ -59,8 +59,8 @@ /*--[ Prototipes ]-----------------------------------------------------------------------------------*/ - LIB3270_EXPORT void v3270_host_select_set_session(V3270HostSelectWidget *widget, GtkWidget *session); - LIB3270_EXPORT int v3270_host_select_apply(V3270HostSelectWidget *widget); + void v3270_host_select_set_session(V3270HostSelectWidget *widget, GtkWidget *session); + int v3270_host_select_apply(V3270HostSelectWidget *widget); G_END_DECLS diff --git a/src/include/v3270.h b/src/include/v3270.h index 4f63ae8..9b15cce 100644 --- a/src/include/v3270.h +++ b/src/include/v3270.h @@ -168,24 +168,24 @@ #define v3270char void #endif // v3270_char - LIB3270_EXPORT GtkWidget * v3270_new(void); - LIB3270_EXPORT GType v3270_get_type(void); + GtkWidget * v3270_new(void); + GType v3270_get_type(void); - LIB3270_EXPORT void v3270_reload(GtkWidget * widget); + 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); + void v3270_set_font_family(GtkWidget *widget, const gchar *name); + const gchar * v3270_get_font_family(GtkWidget *widget); - LIB3270_EXPORT H3270 * v3270_get_session(GtkWidget *widget); - LIB3270_EXPORT gboolean v3270_is_connected(GtkWidget *widget); + H3270 * v3270_get_session(GtkWidget *widget); + gboolean v3270_is_connected(GtkWidget *widget); - LIB3270_EXPORT int v3270_connect(GtkWidget *widget); - LIB3270_EXPORT void v3270_disconnect(GtkWidget *widget); + int v3270_connect(GtkWidget *widget); + void v3270_disconnect(GtkWidget *widget); - LIB3270_EXPORT int v3270_set_host_charset(GtkWidget *widget, const gchar *name); + 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); + void v3270_set_auto_disconnect(GtkWidget *widget, guint minutes); + guint v3270_get_auto_disconnect(GtkWidget *widget); // Clipboard @@ -197,73 +197,73 @@ V3270_SELECT_MAX } V3270_SELECT_FORMAT; - 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); + 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 int v3270_run_script(GtkWidget *widget, const gchar *script); + 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); - 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); + void v3270_set_string(GtkWidget *widget, const gchar *str); + void v3270_tab(GtkWidget *widget); + void v3270_backtab(GtkWidget *widget); // Cut & Paste - 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); + 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); // Colors - 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); + 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); // Misc - LIB3270_EXPORT GtkIMContext * v3270_get_im_context(GtkWidget *widget); - LIB3270_EXPORT gboolean v3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix); - 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, gboolean on); - LIB3270_EXPORT void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on); - LIB3270_EXPORT void v3270_set_session_options(GtkWidget *widget, LIB3270_OPTION options); - LIB3270_EXPORT int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype); - LIB3270_EXPORT int v3270_set_host_type(GtkWidget *widget, const char *name); - LIB3270_EXPORT const gchar * 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); - - LIB3270_EXPORT void v3270_remap_from_xml(GtkWidget *widget, const gchar *path); + GtkIMContext * v3270_get_im_context(GtkWidget *widget); + gboolean v3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix); + 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, gboolean on); + void v3270_set_scaled_fonts(GtkWidget *widget, gboolean on); + void v3270_set_session_options(GtkWidget *widget, LIB3270_OPTION options); + int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype); + int v3270_set_host_type(GtkWidget *widget, const char *name); + const gchar * 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); + + void v3270_remap_from_xml(GtkWidget *widget, const gchar *path); // Keyboard & Mouse special actions - 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); + gboolean v3270_set_keyboard_action(GtkWidget *widget, const gchar *key_name, GtkAction *action); + void v3270_set_scroll_action(GtkWidget *widget, GdkScrollDirection direction, GtkAction *action); // SSL & Security - 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); + 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); // File transfer - 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); + 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 - LIB3270_EXPORT GtkWidget * v3270_host_select_new(GtkWidget *widget); - LIB3270_EXPORT void v3270_select_host(GtkWidget *widget); + GtkWidget * v3270_host_select_new(GtkWidget *widget); + void v3270_select_host(GtkWidget *widget); G_END_DECLS diff --git a/src/include/v3270/filetransfer.h b/src/include/v3270/filetransfer.h index 95ac8ee..932a116 100644 --- a/src/include/v3270/filetransfer.h +++ b/src/include/v3270/filetransfer.h @@ -50,34 +50,34 @@ typedef struct _v3270ftClass v3270ftClass; - LIB3270_EXPORT GtkWidget * v3270ft_new(void); - LIB3270_EXPORT GType v3270ft_get_type(void); - LIB3270_EXPORT void v3270ft_set_options(GtkWidget *widget, LIB3270_FT_OPTION opt); - LIB3270_EXPORT LIB3270_FT_OPTION v3270ft_get_options(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_reset(GtkWidget *widget); - LIB3270_EXPORT gboolean v3270ft_is_valid(GtkWidget *widget); - LIB3270_EXPORT guint v3270ft_get_length(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_select_first(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_select_last(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_select_previous(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_select_next(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_remove_selected(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_remove_all(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_save(GtkWidget *widget,const gchar *filename); - LIB3270_EXPORT void v3270ft_load(GtkWidget *widget,const gchar *filename); + GtkWidget * v3270ft_new(void); + GType v3270ft_get_type(void); + void v3270ft_set_options(GtkWidget *widget, LIB3270_FT_OPTION opt); + LIB3270_FT_OPTION v3270ft_get_options(GtkWidget *widget); + void v3270ft_reset(GtkWidget *widget); + gboolean v3270ft_is_valid(GtkWidget *widget); + guint v3270ft_get_length(GtkWidget *widget); + void v3270ft_select_first(GtkWidget *widget); + void v3270ft_select_last(GtkWidget *widget); + void v3270ft_select_previous(GtkWidget *widget); + void v3270ft_select_next(GtkWidget *widget); + void v3270ft_remove_selected(GtkWidget *widget); + void v3270ft_remove_all(GtkWidget *widget); + void v3270ft_save(GtkWidget *widget,const gchar *filename); + void v3270ft_load(GtkWidget *widget,const gchar *filename); - LIB3270_EXPORT gboolean v3270ft_has_selected(GtkWidget *widget); - LIB3270_EXPORT gboolean v3270ft_has_next(GtkWidget *widget); + gboolean v3270ft_has_selected(GtkWidget *widget); + gboolean v3270ft_has_next(GtkWidget *widget); - LIB3270_EXPORT const gchar * v3270ft_get_local_filename(GtkWidget *widget); - LIB3270_EXPORT const gchar * v3270ft_get_remote_filename(GtkWidget *widget); + const gchar * v3270ft_get_local_filename(GtkWidget *widget); + const gchar * v3270ft_get_remote_filename(GtkWidget *widget); - LIB3270_EXPORT void v3270ft_append_file(GtkWidget *widget, const gchar *filename, gboolean text); - LIB3270_EXPORT guint v3270ft_append_selection(GtkWidget *widget, GtkSelectionData *data); + void v3270ft_append_file(GtkWidget *widget, const gchar *filename, gboolean text); + guint v3270ft_append_selection(GtkWidget *widget, GtkSelectionData *data); - LIB3270_EXPORT gchar * v3270ft_select_file(v3270ft *dialog, const gchar *title, const gchar *button, GtkFileChooserAction action, const gchar *filename, const gchar *filter, ... ) G_GNUC_NULL_TERMINATED; + gchar * v3270ft_select_file(v3270ft *dialog, const gchar *title, const gchar *button, GtkFileChooserAction action, const gchar *filename, const gchar *filter, ... ) G_GNUC_NULL_TERMINATED; - LIB3270_EXPORT gint v3270ft_transfer(GtkWidget *dialog, H3270 *session); + gint v3270ft_transfer(GtkWidget *dialog, H3270 *session); G_END_DECLS diff --git a/src/testprogram/testprogram.c b/src/testprogram/testprogram.c index 918e0b1..198b3a7 100644 --- a/src/testprogram/testprogram.c +++ b/src/testprogram/testprogram.c @@ -94,14 +94,7 @@ static void activate(GtkApplication* app, gpointer user_data) { // Setup terminal GKeyFile * conf = g_key_file_new(); - g_key_file_load_from_dirs(conf,"pw3270.conf",(const gchar **) search, &filename,G_KEY_FILE_NONE,NULL); - g_message("Configuration from %s",filename); - - // v3270_set_from_keyfile(terminal,conf); - - g_key_file_unref(conf); - - v3270_connect(terminal); + // v3270_connect(terminal); g_signal_connect(terminal,"popup",G_CALLBACK(popup_menu),NULL); diff --git a/src/v3270/oia.c b/src/v3270/oia.c index 411d422..259460d 100644 --- a/src/v3270/oia.c +++ b/src/v3270/oia.c @@ -1165,7 +1165,7 @@ static void release_script(v3270 *widget) widget->script.id = 0; } -LIB3270_EXPORT int v3270_set_script(GtkWidget *widget, const gchar id, gboolean on) +int v3270_set_script(GtkWidget *widget, const gchar id, gboolean on) { v3270 *terminal; g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); diff --git a/src/v3270/private.h b/src/v3270/private.h index 5573ec4..932ebde 100644 --- a/src/v3270/private.h +++ b/src/v3270/private.h @@ -233,9 +233,9 @@ G_BEGIN_DECLS const GtkWidgetClass * v3270_get_parent_class(void); -gboolean v3270_draw(GtkWidget * widget, cairo_t * cr); -void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, v3270FontInfo *metrics, GdkRGBA *color, GdkRectangle *rect); -void v3270_update_mouse_pointer(GtkWidget *widget); +G_GNUC_INTERNAL gboolean v3270_draw(GtkWidget * widget, cairo_t * cr); +G_GNUC_INTERNAL void v3270_draw_oia(cairo_t *cr, H3270 *host, int row, int cols, v3270FontInfo *metrics, GdkRGBA *color, GdkRectangle *rect); +G_GNUC_INTERNAL void v3270_update_mouse_pointer(GtkWidget *widget); #if ! GTK_CHECK_VERSION(2,18,0) G_GNUC_INTERNAL void gtk_widget_get_allocation(GtkWidget *widget,GtkAllocation *allocation); @@ -259,36 +259,36 @@ void v3270_update_mouse_pointer(GtkWidget *widget); gboolean v3270_expose(GtkWidget * widget, GdkEventExpose *event); #endif // GTK 3 -void v3270_draw_shift_status(v3270 *terminal); -void v3270_draw_alt_status(v3270 *terminal); -void v3270_draw_ins_status(v3270 *terminal); +G_GNUC_INTERNAL void v3270_draw_shift_status(v3270 *terminal); +G_GNUC_INTERNAL void v3270_draw_alt_status(v3270 *terminal); +G_GNUC_INTERNAL void v3270_draw_ins_status(v3270 *terminal); -void v3270_clear_clipboard(v3270 *terminal); +G_GNUC_INTERNAL void v3270_clear_clipboard(v3270 *terminal); -void v3270_update_cursor_surface(v3270 *widget,unsigned char chr,unsigned short attr); +G_GNUC_INTERNAL void v3270_update_cursor_surface(v3270 *widget,unsigned char chr,unsigned short attr); -void v3270_register_io_handlers(v3270Class *cls); +G_GNUC_INTERNAL void v3270_register_io_handlers(v3270Class *cls); -void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, v3270FontInfo *font, GdkRectangle *rect, GdkRGBA *fg, GdkRGBA *bg); -void v3270_draw_text(cairo_t *cr, const GdkRectangle *rect, v3270FontInfo *font, const char *str); -void v3270_draw_text_at(cairo_t *cr, int x, int y, v3270FontInfo *font, const char *str); +G_GNUC_INTERNAL void v3270_draw_char(cairo_t *cr, unsigned char chr, unsigned short attr, H3270 *session, v3270FontInfo *font, GdkRectangle *rect, GdkRGBA *fg, GdkRGBA *bg); +G_GNUC_INTERNAL void v3270_draw_text(cairo_t *cr, const GdkRectangle *rect, v3270FontInfo *font, const char *str); +G_GNUC_INTERNAL void v3270_draw_text_at(cairo_t *cr, int x, int y, v3270FontInfo *font, const char *str); -void v3270_start_timer(GtkWidget *terminal); -void v3270_stop_timer(GtkWidget *terminal); +G_GNUC_INTERNAL void v3270_start_timer(GtkWidget *terminal); +G_GNUC_INTERNAL void v3270_stop_timer(GtkWidget *terminal); -void v3270_draw_connection(cairo_t *cr, H3270 *host, v3270FontInfo *metrics, GdkRGBA *color, const GdkRectangle *rect); -void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, v3270FontInfo *metrics, GdkRGBA *color, GdkRectangle *rect); +G_GNUC_INTERNAL void v3270_draw_connection(cairo_t *cr, H3270 *host, v3270FontInfo *metrics, GdkRGBA *color, const GdkRectangle *rect); +G_GNUC_INTERNAL void v3270_draw_ssl_status(cairo_t *cr, H3270 *host, v3270FontInfo *metrics, GdkRGBA *color, GdkRectangle *rect); -void v3270_update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor); +G_GNUC_INTERNAL void v3270_update_char(H3270 *session, int addr, unsigned char chr, unsigned short attr, unsigned char cursor); -void v3270_update_font_metrics(v3270 *terminal, cairo_t *cr, int width, int height); +G_GNUC_INTERNAL void v3270_update_font_metrics(v3270 *terminal, cairo_t *cr, int width, int height); -void v3270_update_cursor_rect(v3270 *widget, GdkRectangle *rect, unsigned char chr, unsigned short attr); +G_GNUC_INTERNAL void v3270_update_cursor_rect(v3270 *widget, GdkRectangle *rect, unsigned char chr, unsigned short attr); -void v3270_update_message(v3270 *widget, LIB3270_MESSAGE id); -void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, unsigned char c, unsigned short attr); -void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on); -void v3270_update_ssl(H3270 *session, LIB3270_SSL_STATE state); +G_GNUC_INTERNAL void v3270_update_message(v3270 *widget, LIB3270_MESSAGE id); +G_GNUC_INTERNAL void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, unsigned char c, unsigned short attr); +G_GNUC_INTERNAL void v3270_update_oia(H3270 *session, LIB3270_FLAG id, unsigned char on); +G_GNUC_INTERNAL void v3270_update_ssl(H3270 *session, LIB3270_SSL_STATE state); G_GNUC_INTERNAL void v3270_update_luname(GtkWidget *widget,const gchar *name); G_GNUC_INTERNAL void v3270_init_properties(GObjectClass * gobject_class); @@ -298,15 +298,15 @@ G_GNUC_INTERNAL void v3270_disable_updates(GtkWidget *widget); G_GNUC_INTERNAL void v3270_enable_updates(GtkWidget *widget); // Keyboard & Mouse -gboolean v3270_key_press_event(GtkWidget *widget, GdkEventKey *event); -gboolean v3270_key_release_event(GtkWidget *widget, GdkEventKey *event); -void v3270_key_commit(GtkIMContext *imcontext, gchar *str, v3270 *widget); -gboolean v3270_button_press_event(GtkWidget *widget, GdkEventButton *event); -gboolean v3270_button_release_event(GtkWidget *widget, GdkEventButton*event); -gboolean v3270_motion_notify_event(GtkWidget *widget, GdkEventMotion *event); -void v3270_emit_popup(v3270 *widget, int baddr, GdkEventButton *event); -gint v3270_get_offset_at_point(v3270 *widget, gint x, gint y); -gboolean v3270_scroll_event(GtkWidget *widget, GdkEventScroll *event); +G_GNUC_INTERNAL gboolean v3270_key_press_event(GtkWidget *widget, GdkEventKey *event); +G_GNUC_INTERNAL gboolean v3270_key_release_event(GtkWidget *widget, GdkEventKey *event); +G_GNUC_INTERNAL void v3270_key_commit(GtkIMContext *imcontext, gchar *str, v3270 *widget); +G_GNUC_INTERNAL gboolean v3270_button_press_event(GtkWidget *widget, GdkEventButton *event); +G_GNUC_INTERNAL gboolean v3270_button_release_event(GtkWidget *widget, GdkEventButton*event); +G_GNUC_INTERNAL gboolean v3270_motion_notify_event(GtkWidget *widget, GdkEventMotion *event); +G_GNUC_INTERNAL void v3270_emit_popup(v3270 *widget, int baddr, GdkEventButton *event); +G_GNUC_INTERNAL gint v3270_get_offset_at_point(v3270 *widget, gint x, gint y); +G_GNUC_INTERNAL gboolean v3270_scroll_event(GtkWidget *widget, GdkEventScroll *event); G_GNUC_INTERNAL const struct v3270_ssl_status_msg * v3270_get_ssl_status_msg(GtkWidget *widget); diff --git a/src/v3270/properties.c b/src/v3270/properties.c index 7c1bedd..3815beb 100644 --- a/src/v3270/properties.c +++ b/src/v3270/properties.c @@ -164,13 +164,13 @@ debug("%s",__FUNCTION__); } - LIB3270_EXPORT void v3270_set_auto_disconnect(GtkWidget *widget, guint minutes) + void v3270_set_auto_disconnect(GtkWidget *widget, guint minutes) { g_return_if_fail(GTK_IS_V3270(widget)); GTK_V3270(widget)->activity.disconnect = minutes; } - LIB3270_EXPORT guint v3270_get_auto_disconnect(GtkWidget *widget) + guint v3270_get_auto_disconnect(GtkWidget *widget) { g_return_val_if_fail(GTK_IS_V3270(widget),0); return GTK_V3270(widget)->activity.disconnect; diff --git a/src/v3270/security.c b/src/v3270/security.c index a28300a..8714570 100644 --- a/src/v3270/security.c +++ b/src/v3270/security.c @@ -294,7 +294,7 @@ return NULL; } - LIB3270_EXPORT const gchar * v3270_get_ssl_status_icon(GtkWidget *widget) + const gchar * v3270_get_ssl_status_icon(GtkWidget *widget) { g_return_val_if_fail(GTK_IS_V3270(widget),""); @@ -315,7 +315,7 @@ } - LIB3270_EXPORT const gchar * v3270_get_ssl_status_text(GtkWidget *widget) + const gchar * v3270_get_ssl_status_text(GtkWidget *widget) { g_return_val_if_fail(GTK_IS_V3270(widget),""); @@ -333,7 +333,7 @@ return v3270_get_hostname(widget); } - LIB3270_EXPORT const gchar * v3270_get_ssl_status_message(GtkWidget *widget) + const gchar * v3270_get_ssl_status_message(GtkWidget *widget) { g_return_val_if_fail(GTK_IS_V3270(widget),""); -- libgit2 0.21.2