Commit c411a5a5657d9669a4987878eccb666955ba6b3b

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

Organizando diretorios para a versao 5

src/gtk/Makefile
... ... @@ -1,104 +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., 59 Temple
19   -# Place, Suite 330, Boston, MA, 02111-1307, USA
20   -#
21   -# Contatos:
22   -#
23   -# perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
24   -# erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça)
25   -# licinio@bb.com.br (Licínio Luis Branco)
26   -# kraucer@bb.com.br (Kraucer Fernandes Mazuco)
27   -#
28   -
29   -PACKAGE_NAME=pw3270
30   -
31   -#---[ Paths ]------------------------------------------------------------------
32   -
33   -prefix=/usr/local
34   -exec_prefix=${prefix}
35   -bindir=${exec_prefix}/bin
36   -sbindir=${exec_prefix}/sbin
37   -libdir=${exec_prefix}/lib
38   -includedir=${prefix}/include
39   -datarootdir=${prefix}/share
40   -localedir=${datarootdir}/locale
41   -docdir=${datarootdir}/doc/${PACKAGE_TARNAME}
42   -sysconfdir=${prefix}/etc
43   -
44   -#---[ Sources ]----------------------------------------------------------------
45   -
46   -include common/sources.mak
47   -include v3270/sources.mak
48   -include uiparser/sources.mak
49   -
50   -#---[ Targets ]----------------------------------------------------------------
51   -
52   -SOURCES=main.c mainwindow.c actions.c fonts.c \
53   - $(foreach SRC, $(V3270_SRC), v3270/$(SRC)) \
54   - $(foreach SRC, $(COMMON_SRC), common/$(SRC)) \
55   - $(foreach SRC, $(UI_PARSER_SRC), uiparser/$(SRC))
56   -
57   -DEPENDS=*.h common/*.h uiparser/*.h v3270/*.h Makefile
58   -
59   -VALGRIND=/usr/bin/valgrind
60   -
61   -CFLAGS=-g -O2 -fvisibility=hidden -DGSEAL_ENABLE -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -DAPPDATA=\"$(datarootdir)/$(PACKAGE_NAME)\" -I../../src/include
62   -LIBS=-lm -pthread -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
63   -
64   -include ../include/rules.mak
65   -
66   -#---[ Debug targets ]----------------------------------------------------------
67   -
68   -Debug: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
69   -
70   -$(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT): $(foreach SRC, $(basename $(SOURCES)), $(OBJDIR)/Debug/$(SRC)$(OBJEXT))
71   -
72   - @echo $@ ...
73   - @$(MKDIR) `dirname $@`
74   - @$(LD) -Wl,--rpath,.bin/Debug -o $@ $^ $(LIBS) $(LIB3270_LIBS)
75   -
76   -run: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
77   - @cd "$(ROOTDIR)" ; .bin/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
78   -
79   -memchk: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
80   -ifeq ($(VALGRIND),no)
81   - @cd "$(ROOTDIR)" ; .bin/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
82   -else
83   - @cd "$(ROOTDIR)" ; G_DEBUG=gc-friendly G_SLICE=always-malloc \$(VALGRIND) --leak-check=full --suppressions=valgrind.suppression --gen-suppressions=all .bin/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
84   -# @cd "$(ROOTDIR)" ; G_DEBUG=gc-friendly G_SLICE=always-malloc \$(VALGRIND) --leak-check=full --suppressions=valgrind.suppression .bin/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
85   -endif
86   -
87   -#---[ Misc targets ]-----------------------------------------------------------
88   -
89   -v3270/marshal.h: v3270/genmarshal
90   - @mkdir -p `dirname $@`
91   - @glib-genmarshal --prefix=$(PACKAGE_NAME) --header v3270/genmarshal > $@
92   -
93   -v3270/marshal.c: v3270/genmarshal v3270/marshal.h
94   - @mkdir -p `dirname $@`
95   - @glib-genmarshal --prefix=$(PACKAGE_NAME) --body v3270/genmarshal > $@
96   -
97   -clean: clean-common
98   - @rm -f v3270/marshal.c
99   - @rm -f v3270/marshal.h
100   - @rm -fr uiparser/.bin
101   - @rm -fr uiparser/.obj
102   - @rm -fr v3270/.bin
103   - @rm -fr v3270/.obj
104   -
src/include/lib3270.h
... ... @@ -469,6 +469,34 @@
469 469 */
470 470 LIB3270_EXPORT int lib3270_get_ssl_state(H3270 *h);
471 471  
  472 + /** I/O callback table
  473 + *
  474 + * Structure with GUI unblocking I/O calls, used to replace the lib3270´s internal ones.
  475 + *
  476 + */
  477 + struct lib3270_io_callbacks
  478 + {
  479 + unsigned short sz;
  480 +
  481 + unsigned long (*AddTimeOut)(unsigned long interval_ms, H3270 *session, void (*proc)(H3270 *session));
  482 + void (*RemoveTimeOut)(unsigned long timer);
  483 +
  484 + unsigned long (*AddInput)(int source, H3270 *session, void (*fn)(H3270 *session));
  485 + void (*RemoveInput)(unsigned long id);
  486 +
  487 + unsigned long (*AddExcept)(int source, H3270 *session, void (*fn)(H3270 *session));
  488 +
  489 + #if !defined(_WIN32) /*[*/
  490 + unsigned long (*AddOutput)(int source, H3270 *session, void (*fn)(H3270 *session));
  491 + #endif /*]*/
  492 +
  493 + int (*callthread)(int(*callback)(H3270 *, void *), H3270 *session, void *parm);
  494 +
  495 + int (*Wait)(int seconds);
  496 + int (*RunPendingEvents)(int wait);
  497 +
  498 + };
  499 +
472 500 /**
473 501 * Register application I/O Handlers.
474 502 *
... ...
src/lib3270/globals.h
... ... @@ -142,12 +142,9 @@ enum iaction {
142 142 IA_IDLE
143 143 };
144 144  
145   -/* Simple global variables - At some point in the future they'll be moved to the session structure */
146   -
147 145 LIB3270_INTERNAL int COLS;
148 146 LIB3270_INTERNAL int ROWS;
149   -
150   -#include "session.h"
  147 +LIB3270_INTERNAL H3270 h3270;
151 148  
152 149 #if defined(X3270_DISPLAY) /*[*/
153 150 LIB3270_INTERNAL Atom a_3270, a_registry, a_encoding;
... ... @@ -347,6 +344,14 @@ enum state_change
347 344 #define PT_ON_THE_SPOT "OnTheSpot"
348 345 #endif /*]*/
349 346  
  347 +/** input key type */
  348 +enum keytype
  349 +{
  350 + KT_STD,
  351 + KT_GE
  352 +};
  353 +
  354 +
350 355 /* Library internal calls */
351 356 void key_ACharacter(unsigned char c, enum keytype keytype, enum iaction cause,Boolean *skipped);
352 357 void lib3270_initialize(void);
... ...
src/lib3270/lib3270.cbp
... ... @@ -7,8 +7,8 @@
7 7 <Option compiler="gcc" />
8 8 <Build>
9 9 <Target title="Debug">
10   - <Option output=".bin/Debug/lib3270" prefix_auto="1" extension_auto="1" />
11   - <Option object_output=".obj/Debug/" />
  10 + <Option output=".bin\Debug\lib3270" prefix_auto="1" extension_auto="1" />
  11 + <Option object_output=".obj\Debug\" />
12 12 <Option type="1" />
13 13 <Option compiler="gcc" />
14 14 <Compiler>
... ... @@ -17,8 +17,8 @@
17 17 </Compiler>
18 18 </Target>
19 19 <Target title="Release">
20   - <Option output=".bin/Release/lib3270" prefix_auto="1" extension_auto="1" />
21   - <Option object_output=".obj/Release/" />
  20 + <Option output=".bin\Release\lib3270" prefix_auto="1" extension_auto="1" />
  21 + <Option object_output=".obj\Release\" />
22 22 <Option type="3" />
23 23 <Option compiler="gcc" />
24 24 <Option createDefFile="1" />
... ... @@ -32,10 +32,14 @@
32 32 </Target>
33 33 </Build>
34 34 <Compiler>
  35 + <Add option="-Wshadow" />
  36 + <Add option="-Wredundant-decls" />
  37 + <Add option="-Wunreachable-code" />
  38 + <Add option="-Wmissing-declarations" />
35 39 <Add option="-Wall" />
36 40 <Add option="-DLIB3270=1" />
37   - <Add directory="../include" />
38   - <Add directory="../include/lib3270" />
  41 + <Add directory="..\include" />
  42 + <Add directory="..\include\lib3270" />
39 43 </Compiler>
40 44 <Unit filename="Makefile.in" />
41 45 <Unit filename="XtGlue.c">
... ...
src/lib3270/session.h
... ... @@ -1,40 +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., 59 Temple
19   - * Place, Suite 330, Boston, MA, 02111-1307, USA
20   - *
21   - * Este programa está nomeado como api.h e possui 444 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 de Mendonça)
27   - * licinio@bb.com.br (Licínio Luis Branco)
28   - * kraucer@bb.com.br (Kraucer Fernandes Mazuco)
29   - * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda)
30   - *
31   - */
32   -
33   -
34   -#ifndef SESSION_H_INCLUDED
35   -
36   - #include <lib3270/api.h>
37   -
38   - LIB3270_INTERNAL H3270 h3270; /**< Handle to static session. At some point in the future it will be managed by GUI */
39   -
40   -#endif // SESSION_H_INCLUDED