Commit 35d8292f6d656945f2f60cf06c3749b3c6b7fbc8

Authored by perry.werneck@gmail.com
1 parent 05292584

Preparando para empacotamento do plugin dbus

@@ -76,6 +76,8 @@ AMTAR=@AMTAR@ @@ -76,6 +76,8 @@ AMTAR=@AMTAR@
76 DBGCMDPREFIX=@DBGCMDPREFIX@ 76 DBGCMDPREFIX=@DBGCMDPREFIX@
77 MAKENSIS=@MAKENSIS@ 77 MAKENSIS=@MAKENSIS@
78 78
  79 +PLUGIN_RELEASE_ARGS=LIB3270_MODE=Release
  80 +
79 #---[ Rules ]------------------------------------------------------------------ 81 #---[ Rules ]------------------------------------------------------------------
80 82
81 %.tar.bz2: %.tar 83 %.tar.bz2: %.tar
@@ -130,7 +132,7 @@ $(BINDIR)/Debug/plugins/%@DLLEXT@: src/plugins/%/* $(BINDIR)/Debug/$(PACKAGE_TAR @@ -130,7 +132,7 @@ $(BINDIR)/Debug/plugins/%@DLLEXT@: src/plugins/%/* $(BINDIR)/Debug/$(PACKAGE_TAR
130 @make BINDIR="../../../$(BINDIR)" PW3270_LIBS="-L../../../$(BINDIR)/Debug@DLLDIR@ -l3270 -lpw3270" PW3270_CFLAGS="-I../../../src/include" -C $(dir $<) Debug 132 @make BINDIR="../../../$(BINDIR)" PW3270_LIBS="-L../../../$(BINDIR)/Debug@DLLDIR@ -l3270 -lpw3270" PW3270_CFLAGS="-I../../../src/include" -C $(dir $<) Debug
131 133
132 $(BINDIR)/Release/plugins/%@DLLEXT@: src/plugins/%/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) 134 $(BINDIR)/Release/plugins/%@DLLEXT@: src/plugins/%/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT)
133 - @make BINDIR="../../../$(BINDIR)" PW3270_LIBS="-L../../../$(BINDIR)/Release@DLLDIR@ -l3270 -lpw3270" PW3270_CFLAGS="-I../../../src/include" -C $(dir $<) Release 135 + @make $(PLUGIN_RELEASE_ARGS) -C $(dir $<) Release
134 136
135 #---[ Release targets ]-------------------------------------------------------- 137 #---[ Release targets ]--------------------------------------------------------
136 138
@@ -262,7 +264,7 @@ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar: clean pixmaps filelist @@ -262,7 +264,7 @@ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar: clean pixmaps filelist
262 @rm -fr $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) 264 @rm -fr $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
263 @echo $@ 265 @echo $@
264 266
265 -install: install-sdk install-lib install-app install-man 267 +install: install-sdk install-lib install-app install-man install-plugins
266 268
267 install-app: $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) install-locale 269 install-app: $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) install-locale
268 @$(MAKE) BINDIR="../../$(BINDIR)" LIB3270_LIBS="$(RLSLIB)" LIB3270_CFLAGS="-I../../src/include" -C src/pw3270 install 270 @$(MAKE) BINDIR="../../$(BINDIR)" LIB3270_LIBS="$(RLSLIB)" LIB3270_CFLAGS="-I../../src/include" -C src/pw3270 install
@@ -270,6 +272,9 @@ install-app: $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) install-locale @@ -270,6 +272,9 @@ install-app: $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) install-locale
270 @$(INSTALL_DATA) colors.conf $(DESTDIR)$(datarootdir)/$(PACKAGE_NAME) 272 @$(INSTALL_DATA) colors.conf $(DESTDIR)$(datarootdir)/$(PACKAGE_NAME)
271 @$(INSTALL_DATA) ui/*.xml $(DESTDIR)$(datarootdir)/$(PACKAGE_NAME)/ui 273 @$(INSTALL_DATA) ui/*.xml $(DESTDIR)$(datarootdir)/$(PACKAGE_NAME)/ui
272 274
  275 +install-plugins: $(foreach PLUGIN, $(PLUGINS), $(BINDIR)/Release/plugins/$(PLUGIN)@DLLEXT@)
  276 + @echo -e $(foreach PLUGIN, $(PLUGINS), $(MAKE) DESTDIR=$(DESTDIR) $(PLUGIN_RELEASE_ARGS) -C src/plugins/$(PLUGIN) install\\n ) | $(SHELL)
  277 +
273 install-lib: $(BINDIR)/Release@DLLDIR@/@DLLPREFIX@3270@DLLEXT@ 278 install-lib: $(BINDIR)/Release@DLLDIR@/@DLLPREFIX@3270@DLLEXT@
274 @$(MAKE) BINRLS="../../.bin/Release@DLLDIR@" -C src/lib3270 install 279 @$(MAKE) BINRLS="../../.bin/Release@DLLDIR@" -C src/lib3270 install
275 280
@@ -278,14 +283,12 @@ locale: $(foreach MO, $(basename $(LANG_FILES)), $(BINDIR)/Release/$(localedir)/ @@ -278,14 +283,12 @@ locale: $(foreach MO, $(basename $(LANG_FILES)), $(BINDIR)/Release/$(localedir)/
278 install-locale: $(foreach MO, $(basename $(LANG_FILES)), $(BINDIR)/Release/$(localedir)/$(notdir $(MO))/LC_MESSAGES/$(PACKAGE_NAME).mo) 283 install-locale: $(foreach MO, $(basename $(LANG_FILES)), $(BINDIR)/Release/$(localedir)/$(notdir $(MO))/LC_MESSAGES/$(PACKAGE_NAME).mo)
279 @echo -e $(foreach MO, $(notdir $(basename $(LANG_FILES))), mkdir -p $(DESTDIR)/$(localedir)/$(MO)/LC_MESSAGES\\n$(INSTALL_DATA) $(BINDIR)/Release/$(localedir)/$(MO)/LC_MESSAGES/$(PACKAGE_NAME).mo $(DESTDIR)/$(localedir)/$(MO)/LC_MESSAGES/$(PACKAGE_NAME).mo \\n ) | $(SHELL) 284 @echo -e $(foreach MO, $(notdir $(basename $(LANG_FILES))), mkdir -p $(DESTDIR)/$(localedir)/$(MO)/LC_MESSAGES\\n$(INSTALL_DATA) $(BINDIR)/Release/$(localedir)/$(MO)/LC_MESSAGES/$(PACKAGE_NAME).mo $(DESTDIR)/$(localedir)/$(MO)/LC_MESSAGES/$(PACKAGE_NAME).mo \\n ) | $(SHELL)
280 285
281 -  
282 install-man: 286 install-man:
283 @$(MKDIR) $(DESTDIR)$(mandir)/man1 287 @$(MKDIR) $(DESTDIR)$(mandir)/man1
284 @$(INSTALL_DATA) man/man1/pw3270.1 $(DESTDIR)/$(mandir)/man1/pw3270.1 288 @$(INSTALL_DATA) man/man1/pw3270.1 $(DESTDIR)/$(mandir)/man1/pw3270.1
285 @$(MKDIR) $(DESTDIR)$(mandir)/man5 289 @$(MKDIR) $(DESTDIR)$(mandir)/man5
286 @$(INSTALL_DATA) man/man5/pw3270.5 $(DESTDIR)/$(mandir)/man5/pw3270.5 290 @$(INSTALL_DATA) man/man5/pw3270.5 $(DESTDIR)/$(mandir)/man5/pw3270.5
287 291
288 -  
289 install-sdk: 292 install-sdk:
290 @$(MKDIR) $(DESTDIR)$(includedir)/lib3270 293 @$(MKDIR) $(DESTDIR)$(includedir)/lib3270
291 @$(INSTALL_DATA) src/include/lib3270.h $(DESTDIR)/$(includedir) 294 @$(INSTALL_DATA) src/include/lib3270.h $(DESTDIR)/$(includedir)
@@ -349,16 +352,16 @@ $(BINDIR)/Debug/plugins/remotectl@DLLEXT@: src/plugins/remotectl/* $(BINDIR)/Deb @@ -349,16 +352,16 @@ $(BINDIR)/Debug/plugins/remotectl@DLLEXT@: src/plugins/remotectl/* $(BINDIR)/Deb
349 @make BINDIR="../../../$(BINDIR)" PW3270_LIBS="-L../../../$(BINDIR)/Debug@DLLDIR@ -l3270 -lpw3270" PW3270_CFLAGS="-I../../../src/include" -C $(dir $<) Debug 352 @make BINDIR="../../../$(BINDIR)" PW3270_LIBS="-L../../../$(BINDIR)/Debug@DLLDIR@ -l3270 -lpw3270" PW3270_CFLAGS="-I../../../src/include" -C $(dir $<) Debug
350 353
351 $(BINDIR)/Release/plugins/remotectl@DLLEXT@: src/plugins/remotectl/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) 354 $(BINDIR)/Release/plugins/remotectl@DLLEXT@: src/plugins/remotectl/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT)
352 - @make BINDIR="../../../$(BINDIR)" PW3270_LIBS="-L../../../$(BINDIR)/Release@DLLDIR@ -l3270 -lpw3270" PW3270_CFLAGS="-I../../../src/include" -C $(dir $<) Release 355 + @make $(PLUGIN_RELEASE_ARGS) -C $(dir $<) Release
353 356
354 $(BINDIR)/Debug/plugins/rx3270@DLLEXT@: src/plugins/rx3270/* $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) 357 $(BINDIR)/Debug/plugins/rx3270@DLLEXT@: src/plugins/rx3270/* $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
355 @make BINDIR="../../../$(BINDIR)" LIB3270_MODE=Debug -C $(dir $<) Debug 358 @make BINDIR="../../../$(BINDIR)" LIB3270_MODE=Debug -C $(dir $<) Debug
356 359
357 $(BINDIR)/Release/plugins/rx3270@DLLEXT@: src/plugins/rx3270/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) 360 $(BINDIR)/Release/plugins/rx3270@DLLEXT@: src/plugins/rx3270/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT)
358 - @make BINDIR="../../../$(BINDIR)" LIB3270_MODE=Release -C $(dir $<) Release 361 + @make $(PLUGIN_RELEASE_ARGS) -C $(dir $<) Release
359 362
360 $(BINDIR)/Debug/plugins/dbus3270@DLLEXT@: src/plugins/dbus3270/* $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) 363 $(BINDIR)/Debug/plugins/dbus3270@DLLEXT@: src/plugins/dbus3270/* $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
361 @make BINDIR="../../../$(BINDIR)" LIB3270_MODE=Debug -C $(dir $<) Debug 364 @make BINDIR="../../../$(BINDIR)" LIB3270_MODE=Debug -C $(dir $<) Debug
362 365
363 $(BINDIR)/Release/plugins/dbus3270@DLLEXT@: src/plugins/dbus3270/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) 366 $(BINDIR)/Release/plugins/dbus3270@DLLEXT@: src/plugins/dbus3270/* $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT)
364 - @make BINDIR="../../../$(BINDIR)" LIB3270_MODE=Release -C $(dir $<) Release 367 + @make $(PLUGIN_RELEASE_ARGS) -C $(dir $<) Release
@@ -353,9 +353,9 @@ PKG_CHECK_MODULES( [DBUS], [dbus-glib-1], app_cv_dbus=yes, AC_MSG_NOTICE([No DBU @@ -353,9 +353,9 @@ PKG_CHECK_MODULES( [DBUS], [dbus-glib-1], app_cv_dbus=yes, AC_MSG_NOTICE([No DBU
353 AC_SUBST(DBUS_LIBS) 353 AC_SUBST(DBUS_LIBS)
354 AC_SUBST(DBUS_CFLAGS) 354 AC_SUBST(DBUS_CFLAGS)
355 355
356 -#if test "$app_cv_dbus" == "yes"; then  
357 -# PLUGINS="$PLUGINS dbus3270"  
358 -#fi 356 +if test "$app_cv_dbus" == "yes"; then
  357 + PLUGINS="$PLUGINS dbus3270"
  358 +fi
359 359
360 #--[ SSL ]---------------------------------------------------------------------------------------------------------------------------------------------------- 360 #--[ SSL ]----------------------------------------------------------------------------------------------------------------------------------------------------
361 361
man/man1/pw3270.1
@@ -7,23 +7,23 @@ pw3270 \- a modern tn3270 emulator @@ -7,23 +7,23 @@ pw3270 \- a modern tn3270 emulator
7 .SH SYNOPSIS 7 .SH SYNOPSIS
8 .B pw3270 [-a 8 .B pw3270 [-a
9 .I application-name 9 .I application-name
10 -.B ] [-h 10 +.B ] [-h
11 .I hostname:port 11 .I hostname:port
12 -.B ] [-s 12 +.B ] [-s
13 .I session name 13 .I session name
14 .B ] 14 .B ]
15 -.B ] [-c 15 +.B ] [-c
16 .I session colors 16 .I session colors
17 -.B ] [-t 17 +.B ] [-t
18 .I system type 18 .I system type
19 -.B ] [-a 19 +.B ] [-a
20 .I application name 20 .I application name
21 .B ] 21 .B ]
22 .SH DESCRIPTION 22 .SH DESCRIPTION
23 -.B pw3270  
24 -is a modern, GTK-based, completely free tn3270 emulator. 23 +.B pw3270
  24 +is a modern, GTK-based, completely free tn3270 emulator.
25 25
26 -Based on the original x3270 code by Paul Mattes, it was created originally for Banco do Brasil. It's now an official Brazilian Government Public Software project, and is used worldwide. 26 +Based on the original x3270 code by Paul Mattes, it was created originally for Banco do Brasil. It's now an official Brazilian Government Public Software project, and is used worldwide.
27 27
28 pw3270 is fully themable, and each element on the screen can be individually customized through the configuration files. It also supports all kinds of monospaced TrueType and bitmap fonts your system already supports. 28 pw3270 is fully themable, and each element on the screen can be individually customized through the configuration files. It also supports all kinds of monospaced TrueType and bitmap fonts your system already supports.
29 29
@@ -34,7 +34,7 @@ File transfers are supported, for uploads and downloads. @@ -34,7 +34,7 @@ File transfers are supported, for uploads and downloads.
34 Printing is implemented using the native GTK print dialogs. 34 Printing is implemented using the native GTK print dialogs.
35 35
36 36
37 -In addition to the modern GUI, a development library 37 +In addition to the modern GUI, a development library
38 .BR lib3270 (3) 38 .BR lib3270 (3)
39 has been created to allow you to create your own programs using the 3270 protocol. 39 has been created to allow you to create your own programs using the 3270 protocol.
40 40
@@ -42,13 +42,13 @@ has been created to allow you to create your own programs using the 3270 protoco @@ -42,13 +42,13 @@ has been created to allow you to create your own programs using the 3270 protoco
42 .IP "--help" 42 .IP "--help"
43 Shows the available options. 43 Shows the available options.
44 .IP "-h hostname:port" 44 .IP "-h hostname:port"
45 -Connects to the host and port specified. Use the form  
46 -.I "s:hostname:port" 45 +Connects to the host and port specified. Use the form
  46 +.I "s:hostname:port"
47 for a secure (SSL) connection. 47 for a secure (SSL) connection.
48 .IP "-a application-name" 48 .IP "-a application-name"
49 -Specifies an alternate window title. This is useful if you want to name each host window differently (with the service name or host address, for example). The default is to always name the window "pw3270". 49 +Specifies an alternate window title. This is useful if you want to name each host window differently (with the service name or host address, for example). The default is to always name the window "pw3270".
50 .IP "-s session-name" 50 .IP "-s session-name"
51 -Specifies an anternate session-name. This affects some plugins who does IPC communications 51 +Specifies an anternate session-name. This affects some plugins who does IPC communications, like the dbus one.
52 .IP "-c Change the reported colors" 52 .IP "-c Change the reported colors"
53 Change the response to a Query(Color); when 8 pw3270 will respond with a list of 8 supported colors; when 16 the response will be a list of the 16 standard colors. 53 Change the response to a Query(Color); when 8 pw3270 will respond with a list of 8 supported colors; when 16 the response will be a list of the 16 standard colors.
54 .IP "-t Change systemtype" 54 .IP "-t Change systemtype"
@@ -70,7 +70,7 @@ Perry Werneck &lt;perry.werneck at gmail dot com&gt; @@ -70,7 +70,7 @@ Perry Werneck &lt;perry.werneck at gmail dot com&gt;
70 70
71 Erico Mendonca <erico.mendonca at gmail dot com> 71 Erico Mendonca <erico.mendonca at gmail dot com>
72 72
73 -The official project page is located at http://www.softwarepublico.gov.br/dotlrn/clubs/pw3270 . 73 +The official project page is located at http://www.softwarepublico.gov.br/dotlrn/clubs/pw3270 .
74 74
75 .SH "SEE ALSO" 75 .SH "SEE ALSO"
76 .BR pw3270 (5) 76 .BR pw3270 (5)
@@ -5,7 +5,7 @@ msgid &quot;&quot; @@ -5,7 +5,7 @@ msgid &quot;&quot;
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2013-02-21 10:43-0300\n" 8 +"POT-Creation-Date: 2013-02-21 17:02-0300\n"
9 "PO-Revision-Date: 2013-01-14 09:49-0200\n" 9 "PO-Revision-Date: 2013-01-14 09:49-0200\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <>\n" 11 "Language-Team: Português <>\n"
@@ -334,7 +334,7 @@ msgstr &quot;Não foi possível conectar ao servidor&quot; @@ -334,7 +334,7 @@ msgstr &quot;Não foi possível conectar ao servidor&quot;
334 msgid "Can't convert line %d from %s to %s" 334 msgid "Can't convert line %d from %s to %s"
335 msgstr "Não foi possível converter a linha %d de %s para %s" 335 msgstr "Não foi possível converter a linha %d de %s para %s"
336 336
337 -#: selection.c:631 337 +#: selection.c:634
338 msgid "Can't cut rectangular regions" 338 msgid "Can't cut rectangular regions"
339 msgstr "Recortar não permitido em seleção retangular" 339 msgstr "Recortar não permitido em seleção retangular"
340 340
@@ -855,7 +855,7 @@ msgstr &quot;Invalid CGCSGID &#39;%s&#39;, ignoring&quot; @@ -855,7 +855,7 @@ msgstr &quot;Invalid CGCSGID &#39;%s&#39;, ignoring&quot;
855 msgid "Invalid charset entry '%s' (#%d)" 855 msgid "Invalid charset entry '%s' (#%d)"
856 msgstr "Invalid charset entry '%s' (#%d)" 856 msgstr "Invalid charset entry '%s' (#%d)"
857 857
858 -#: selection.c:631 858 +#: selection.c:634
859 msgid "Invalid cut action" 859 msgid "Invalid cut action"
860 msgstr "Ação recortar inválida" 860 msgstr "Ação recortar inválida"
861 861
@@ -961,7 +961,7 @@ msgstr &quot;Normal/Protegido&quot; @@ -961,7 +961,7 @@ msgstr &quot;Normal/Protegido&quot;
961 msgid "Normal/Unprotected" 961 msgid "Normal/Unprotected"
962 msgstr "Normal/Desprotegido" 962 msgstr "Normal/Desprotegido"
963 963
964 -#: selection.c:631 964 +#: selection.c:634
965 msgid "Not available" 965 msgid "Not available"
966 msgstr "Não disponível" 966 msgstr "Não disponível"
967 967
@@ -54,6 +54,7 @@ @@ -54,6 +54,7 @@
54 <Unit filename="configure.ac" /> 54 <Unit filename="configure.ac" />
55 <Unit filename="debian.rules" /> 55 <Unit filename="debian.rules" />
56 <Unit filename="makegtkruntime.sh.in" /> 56 <Unit filename="makegtkruntime.sh.in" />
  57 + <Unit filename="man/man1/pw3270.1" />
57 <Unit filename="pw3270.nsi.in" /> 58 <Unit filename="pw3270.nsi.in" />
58 <Unit filename="pw3270.spec.in" /> 59 <Unit filename="pw3270.spec.in" />
59 <Unit filename="src/include/lib3270.h" /> 60 <Unit filename="src/include/lib3270.h" />
src/include/plugin.mak.in
@@ -59,16 +59,17 @@ DLL_NAME=@DLLDIR@/@DLLPREFIX@$(MODULE_NAME)@DLLEXT@ @@ -59,16 +59,17 @@ DLL_NAME=@DLLDIR@/@DLLPREFIX@$(MODULE_NAME)@DLLEXT@
59 PLUGIN_NAME=plugins/$(MODULE_NAME)@DLLEXT@ 59 PLUGIN_NAME=plugins/$(MODULE_NAME)@DLLEXT@
60 60
61 ifeq ($(LIB3270_MODE),Debug) 61 ifeq ($(LIB3270_MODE),Debug)
62 - PW3270_LIBS=-L$(BINDBG)@DLLDIR@ -l3270  
63 - PW3270_CFLAGS=-I../../../src/include  
64 - LIB3270_LIBS=-L$(BINDBG)@DLLDIR@ -l3270 62 + PW3270_LIBS="-L../../../.bin/Debug@DLLDIR@ -lpw3270"
  63 + PW3270_CFLAGS="-I../../../src/include"
  64 + LIB3270_LIBS="-L../../../.bin/Debug@DLLDIR@ -l3270"
65 LIB270_CFLAGS=-I../../../src/include 65 LIB270_CFLAGS=-I../../../src/include
66 endif 66 endif
67 67
68 ifeq ($(LIB3270_MODE),Release) 68 ifeq ($(LIB3270_MODE),Release)
69 - PW3270_LIBS=-L$(BINRLS)@DLLDIR@ -l3270 69 + BINRLS=../../../.bin/Release
  70 + PW3270_LIBS=-L$(BINRLS)@DLLDIR@ -lpw3270
70 PW3270_CFLAGS=-I../../../src/include 71 PW3270_CFLAGS=-I../../../src/include
71 - LIB3270_LIBS=-L$(BINRLS)@DLLDIR@ -l3270 72 + LIB3270_LIBS=-L$(BINRLS)@DLLDIR@ -l3270
72 LIB270_CFLAGS=-I../../../src/include 73 LIB270_CFLAGS=-I../../../src/include
73 endif 74 endif
74 75
src/lib3270/selection.c
@@ -380,7 +380,10 @@ static char * get_text(H3270 *hSession,unsigned char all) @@ -380,7 +380,10 @@ static char * get_text(H3270 *hSession,unsigned char all)
380 size_t sz = 0; 380 size_t sz = 0;
381 381
382 if(!(lib3270_connected(hSession) && hSession->text)) 382 if(!(lib3270_connected(hSession) && hSession->text))
  383 + {
  384 + errno = ENOTCONN;
383 return NULL; 385 return NULL;
  386 + }
384 387
385 ret = lib3270_malloc(buflen); 388 ret = lib3270_malloc(buflen);
386 389
@@ -406,6 +409,7 @@ static char * get_text(H3270 *hSession,unsigned char all) @@ -406,6 +409,7 @@ static char * get_text(H3270 *hSession,unsigned char all)
406 if(!sz) 409 if(!sz)
407 { 410 {
408 lib3270_free(ret); 411 lib3270_free(ret);
  412 + errno = ENOENT;
409 return NULL; 413 return NULL;
410 } 414 }
411 else if(sz > 1 && ret[sz-1] == '\n') // Remove ending \n 415 else if(sz > 1 && ret[sz-1] == '\n') // Remove ending \n
@@ -462,7 +466,10 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len) @@ -462,7 +466,10 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len)
462 CHECK_SESSION_HANDLE(h); 466 CHECK_SESSION_HANDLE(h);
463 467
464 if(!lib3270_connected(h)) 468 if(!lib3270_connected(h))
  469 + {
  470 + errno = ENOTCONN;
465 return NULL; 471 return NULL;
  472 + }
466 473
467 maxlen = (h->rows * (h->cols+1)) - offset; 474 maxlen = (h->rows * (h->cols+1)) - offset;
468 if(maxlen <= 0 || offset < 0) 475 if(maxlen <= 0 || offset < 0)
@@ -505,10 +512,6 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len) @@ -505,10 +512,6 @@ LIB3270_EXPORT char * lib3270_get_text(H3270 *h, int offset, int len)
505 LIB3270_EXPORT char * lib3270_get_text_at(H3270 *h, int row, int col, int len) 512 LIB3270_EXPORT char * lib3270_get_text_at(H3270 *h, int row, int col, int len)
506 { 513 {
507 CHECK_SESSION_HANDLE(h); 514 CHECK_SESSION_HANDLE(h);
508 -  
509 - if(!lib3270_connected(h))  
510 - return NULL;  
511 -  
512 return lib3270_get_text(h, ((row-1) * h->cols) + (col-1), len); 515 return lib3270_get_text(h, ((row-1) * h->cols) + (col-1), len);
513 } 516 }
514 517
src/plugins/dbus3270/Makefile.in
@@ -26,9 +26,18 @@ @@ -26,9 +26,18 @@
26 # kraucer@bb.com.br (Kraucer Fernandes Mazuco) 26 # kraucer@bb.com.br (Kraucer Fernandes Mazuco)
27 # 27 #
28 28
  29 +PACKAGE_NAME=@PACKAGE_NAME@
  30 +MODULE_NAME=dbus3270
  31 +
  32 +prefix=@prefix@
  33 +exec_prefix=@exec_prefix@
  34 +bindir=@bindir@
  35 +libdir=@libdir@
  36 +datarootdir=@datarootdir@
  37 +localedir=@localedir@
  38 +
29 #---[ Sources ]---------------------------------------------------------------- 39 #---[ Sources ]----------------------------------------------------------------
30 40
31 -MODULE_NAME=dbus3270  
32 DEPENDS=Makefile dbus-glue.h 41 DEPENDS=Makefile dbus-glue.h
33 PLUGIN_SRC=main.c gobject.c misc.c 42 PLUGIN_SRC=main.c gobject.c misc.c
34 DAEMON_SRC=daemon.c gobject.c iocallback.c misc.c 43 DAEMON_SRC=daemon.c gobject.c iocallback.c misc.c
@@ -51,6 +60,9 @@ MKDIR=@MKDIR_P@ @@ -51,6 +60,9 @@ MKDIR=@MKDIR_P@
51 CC=@CC@ 60 CC=@CC@
52 LD=@CC@ 61 LD=@CC@
53 DBUSBINDINGTOOL=@DBUSBINDINGTOOL@ 62 DBUSBINDINGTOOL=@DBUSBINDINGTOOL@
  63 +INSTALL=@INSTALL@
  64 +INSTALL_PROGRAM=@INSTALL_PROGRAM@
  65 +INSTALL_DATA=@INSTALL_DATA@
54 66
55 #---[ Flags ]------------------------------------------------------------------ 67 #---[ Flags ]------------------------------------------------------------------
56 68
@@ -69,27 +81,26 @@ GLIB_LIBS=@GLIB_LIBS@ @@ -69,27 +81,26 @@ GLIB_LIBS=@GLIB_LIBS@
69 GTK_LIBS=@GTK_LIBS@ 81 GTK_LIBS=@GTK_LIBS@
70 82
71 ifeq ($(LIB3270_MODE),Debug) 83 ifeq ($(LIB3270_MODE),Debug)
72 - PW3270_LIBS=-L$(BINDBG)@DLLDIR@ -lpw3270  
73 - PW3270_CFLAGS=-I../../../src/include  
74 - LIB3270_LIBS=-L$(BINDBG)@DLLDIR@ -l3270 84 + PW3270_LIBS="-L../../../.bin/Debug@DLLDIR@ -lpw3270"
  85 + PW3270_CFLAGS="-I../../../src/include"
  86 + LIB3270_LIBS="-L../../../.bin/Debug@DLLDIR@ -l3270"
75 LIB270_CFLAGS=-I../../../src/include 87 LIB270_CFLAGS=-I../../../src/include
76 endif 88 endif
77 89
78 ifeq ($(LIB3270_MODE),Release) 90 ifeq ($(LIB3270_MODE),Release)
79 - PW3270_LIBS=-L$(BINRLS)@DLLDIR@ -lṕw3270  
80 - PW3270_CFLAGS=-I../../../src/include  
81 - LIB3270_LIBS=-L$(BINRLS)@DLLDIR@ -l3270 91 + PW3270_LIBS="-L../../../.bin/Release@DLLDIR@ -lpw3270"
  92 + PW3270_CFLAGS="-I../../../src/include"
  93 + LIB3270_LIBS="-L../../../.bin/Release@DLLDIR@ -l3270"
82 LIB270_CFLAGS=-I../../../src/include 94 LIB270_CFLAGS=-I../../../src/include
83 endif 95 endif
84 96
85 ifeq ($(LIB3270_MODE),Default) 97 ifeq ($(LIB3270_MODE),Default)
86 LIB3270_LIBS ?= `pkg-config --libs lib3270` 98 LIB3270_LIBS ?= `pkg-config --libs lib3270`
87 LIB3270_CFLAGS ?= `pkg-config --cflags lib3270` 99 LIB3270_CFLAGS ?= `pkg-config --cflags lib3270`
88 - PW3270_LIBS ?= `pkg-config --libs pw3270`  
89 - PW3270_CFLAGS ?= `pkg-config --cflags pw3270` 100 + PW3270_LIBS ?= `pkg-config --libs pw3270 lib3270`
  101 + PW3270_CFLAGS ?= `pkg-config --cflags pw3270 lib3270`
90 endif 102 endif
91 103
92 -  
93 #---[ Rules ]------------------------------------------------------------------ 104 #---[ Rules ]------------------------------------------------------------------
94 105
95 $(OBJDBG)/%.o: %.c $(DEPENDS) 106 $(OBJDBG)/%.o: %.c $(DEPENDS)
@@ -110,7 +121,7 @@ Release: $(BINRLS)/plugins/$(MODULE_NAME).so @@ -110,7 +121,7 @@ Release: $(BINRLS)/plugins/$(MODULE_NAME).so
110 $(BINRLS)/plugins/$(MODULE_NAME).so: $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJRLS)/$(SRC).o) 121 $(BINRLS)/plugins/$(MODULE_NAME).so: $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJRLS)/$(SRC).o)
111 @echo " CCLD `basename $@`" 122 @echo " CCLD `basename $@`"
112 @$(MKDIR) `dirname $@` 123 @$(MKDIR) `dirname $@`
113 - @$(LD) $(DLL_FLAGS) -Wl,-soname,`basename $@` $(LDFLAGS) -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(PW3270_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(DBUS_LIBS) 124 + $(LD) $(DLL_FLAGS) -Wl,-soname,`basename $@` $(LDFLAGS) -o $@ $^ $(LIBS) $(LIB3270_LIBS) $(PW3270_LIBS) $(GLIB_LIBS) $(GTK_LIBS) $(DBUS_LIBS)
114 125
115 #---[ Debug targets ]---------------------------------------------------------- 126 #---[ Debug targets ]----------------------------------------------------------
116 127
@@ -123,6 +134,10 @@ $(BINDBG)/plugins/$(MODULE_NAME).so: $(foreach SRC, $(basename $(PLUGIN_SRC)), $ @@ -123,6 +134,10 @@ $(BINDBG)/plugins/$(MODULE_NAME).so: $(foreach SRC, $(basename $(PLUGIN_SRC)), $
123 134
124 #---[ Misc targets ]----------------------------------------------------------- 135 #---[ Misc targets ]-----------------------------------------------------------
125 136
  137 +install: $(BINRLS)/plugins/$(MODULE_NAME).so
  138 + @$(MKDIR) $(DESTDIR)$(datarootdir)/$(PACKAGE_NAME)/plugins
  139 + @$(INSTALL_PROGRAM) $(BINRLS)/plugins/$(MODULE_NAME).so $(DESTDIR)$(datarootdir)/$(PACKAGE_NAME)/plugins
  140 +
126 debug-service: $(BINDBG)/@PACKAGE_NAME@d 141 debug-service: $(BINDBG)/@PACKAGE_NAME@d
127 142
128 dbus-glue.h: pw3270dbus.xml 143 dbus-glue.h: pw3270dbus.xml
src/plugins/dbus3270/gobject.c
@@ -214,3 +214,34 @@ void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar * @@ -214,3 +214,34 @@ void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *
214 214
215 g_free(text); 215 g_free(text);
216 } 216 }
  217 +
  218 +void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBusGMethodInvocation *context)
  219 +{
  220 + gchar * text;
  221 + H3270 * hSession = pw3270_dbus_get_session_handle(object);
  222 +
  223 + trace("%s object=%p context=%p",__FUNCTION__,object,context);
  224 + if(pw3270_dbus_check_valid_state(object,context))
  225 + return;
  226 +
  227 + text = lib3270_get_text_at(hSession, row, col, len);
  228 + if(!text)
  229 + {
  230 + GError *error = pw3270_dbus_get_error_from_errno(errno);
  231 + dbus_g_method_return_error(context,error);
  232 + g_error_free(error);
  233 + }
  234 + else
  235 + {
  236 + gchar * utftext = g_convert_with_fallback(text,-1,"UTF-8",lib3270_get_charset(hSession),"?",NULL,NULL,NULL);
  237 +
  238 + lib3270_free(text);
  239 +
  240 + dbus_g_method_return(context,utftext);
  241 +
  242 + g_free(utftext);
  243 + }
  244 +
  245 +
  246 +}
  247 +
src/plugins/dbus3270/pw3270dbus.xml
@@ -36,5 +36,11 @@ @@ -36,5 +36,11 @@
36 <arg type="i" name="col" direction="in" /> 36 <arg type="i" name="col" direction="in" />
37 <arg type="s" name="text" direction="in" /> 37 <arg type="s" name="text" direction="in" />
38 </method> 38 </method>
  39 + <method name="getTextAt">
  40 + <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/>
  41 + <arg type="i" name="row" direction="in" />
  42 + <arg type="i" name="col" direction="in" />
  43 + <arg type="i" name="len" direction="in" />
  44 + </method>
39 </interface> 45 </interface>
40 </node> 46 </node>
src/plugins/dbus3270/service.h
@@ -75,7 +75,7 @@ @@ -75,7 +75,7 @@
75 // Actions 75 // Actions
76 void pw3270_dbus_enter(PW3270Dbus *object, DBusGMethodInvocation *context); 76 void pw3270_dbus_enter(PW3270Dbus *object, DBusGMethodInvocation *context);
77 void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *text, DBusGMethodInvocation *context); 77 void pw3270_dbus_set_text_at(PW3270Dbus *object, int row, int col, const gchar *text, DBusGMethodInvocation *context);
78 - 78 + void pw3270_dbus_get_text_at(PW3270Dbus *object, int row, int col, int len, DBusGMethodInvocation *context);
79 79
80 G_END_DECLS 80 G_END_DECLS
81 81
src/plugins/rx3270/Makefile.in
@@ -60,10 +60,11 @@ $(BINDBG)$(DLL_NAME).$(VERSION): $(foreach SRC, $(basename $(EXTAPI_SRC)), $(OBJ @@ -60,10 +60,11 @@ $(BINDBG)$(DLL_NAME).$(VERSION): $(foreach SRC, $(basename $(EXTAPI_SRC)), $(OBJ
60 $(BINRLS)/$(PLUGIN_NAME): $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJRLS)/$(SRC).o) $(BINRLS)$(DLL_NAME) 60 $(BINRLS)/$(PLUGIN_NAME): $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJRLS)/$(SRC).o) $(BINRLS)$(DLL_NAME)
61 @echo " CCLD `basename $@`" 61 @echo " CCLD `basename $@`"
62 @$(MKDIR) `dirname $@` 62 @$(MKDIR) `dirname $@`
63 - @$(CXX) $(DLL_FLAGS) @LDSOFLAGS@ $(LDFLAGS) -o $@ $^ $(LIBS) $(PW3270_LIBS) $(GTK_LIBS) 63 + $(CXX) $(DLL_FLAGS) @LDSOFLAGS@ $(LDFLAGS) -o $@ $^ $(LIBS) $(PW3270_LIBS) $(GTK_LIBS)
64 64
65 $(BINRLS)$(DLL_NAME).$(VERSION): $(foreach SRC, $(basename $(EXTAPI_SRC)), $(OBJRLS)/$(SRC).o) 65 $(BINRLS)$(DLL_NAME).$(VERSION): $(foreach SRC, $(basename $(EXTAPI_SRC)), $(OBJRLS)/$(SRC).o)
66 @echo " CCLD `basename $@`" 66 @echo " CCLD `basename $@`"
67 @$(MKDIR) `dirname $@` 67 @$(MKDIR) `dirname $@`
68 - @$(CXX) $(DLL_FLAGS) @LDSOFLAGS@ $(LDFLAGS) -o $@ $^ $(LIBS) $(LIB3270_LIBS) 68 + $(CXX) $(DLL_FLAGS) @LDSOFLAGS@ $(LDFLAGS) -o $@ $^ $(LIBS) $(LIB3270_LIBS)
69 69
  70 +install:
src/pw3270/uiparser/keypad.c
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 57
58 for(f = 0; f < G_N_ELEMENTS(cmd); f++) 58 for(f = 0; f < G_N_ELEMENTS(cmd); f++)
59 { 59 {
60 - if(!g_strcasecmp(cmd[f].element_name,element_name)) 60 + if(!g_ascii_strcasecmp(cmd[f].element_name,element_name))
61 { 61 {
62 cmd[f].start(context,names,values,error,keypad); 62 cmd[f].start(context,names,values,error,keypad);
63 return; 63 return;
src/pw3270/uiparser/parsefile.c
@@ -187,7 +187,7 @@ @@ -187,7 +187,7 @@
187 187
188 for(f=0;info->disabled && plat[f];f++) 188 for(f=0;info->disabled && plat[f];f++)
189 { 189 {
190 - if(!g_strcasecmp(plat[f],platname)) 190 + if(!g_ascii_strcasecmp(plat[f],platname))
191 info->disabled = 0; 191 info->disabled = 0;
192 } 192 }
193 193