Commit 467e7df727adfd564ac33e17dfc4a3201e58903b
1 parent
9a000006
Exists in
master
and in
5 other branches
Criando um plugin exemplo que execute direto do projeto codeblocks
Showing
2 changed files
with
115 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,63 @@ |
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 main.c e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * | |
27 | + * | |
28 | + */ | |
29 | + | |
30 | + #include <pw3270.h> | |
31 | + #include <pw3270/plugin.h> | |
32 | + | |
33 | +/*--[ Implement ]---------------------------------------------------------------------------------------------------------*/ | |
34 | + | |
35 | + static void connected(GtkWidget *terminal, const gchar *host, GtkWidget * window) { | |
36 | + | |
37 | + fprintf(stderr,"%s\n",__FUNCTION__); | |
38 | + fflush(stderr); | |
39 | + | |
40 | + } | |
41 | + | |
42 | + static void disconnected(GtkWidget *terminal, GtkWidget * window) { | |
43 | + | |
44 | + fprintf(stderr,"%s\n",__FUNCTION__); | |
45 | + fflush(stderr); | |
46 | + | |
47 | + } | |
48 | + | |
49 | + LIB3270_EXPORT int pw3270_plugin_start(GtkWidget *window) { | |
50 | + | |
51 | + GtkWidget * terminal = pw3270_get_terminal_widget(window); | |
52 | + | |
53 | + fprintf(stderr,"%s\n",__FUNCTION__); | |
54 | + fflush(stderr); | |
55 | + | |
56 | + g_signal_connect(terminal,"disconnected",G_CALLBACK(disconnected),window); | |
57 | + g_signal_connect(terminal,"connected",G_CALLBACK(connected),window); | |
58 | + | |
59 | + return 0; | |
60 | + } | |
61 | + | |
62 | + | |
63 | + | ... | ... |
... | ... | @@ -0,0 +1,52 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |
2 | +<CodeBlocks_project_file> | |
3 | + <FileVersion major="1" minor="6" /> | |
4 | + <Project> | |
5 | + <Option title="PW3270 - Sample plugin" /> | |
6 | + <Option pch_mode="2" /> | |
7 | + <Option default_target="Release" /> | |
8 | + <Option compiler="gcc" /> | |
9 | + <Build> | |
10 | + <Target title="Debug"> | |
11 | + <Option output=".bin/Debug/sample3270" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" /> | |
12 | + <Option object_output=".obj/Debug/" /> | |
13 | + <Option type="3" /> | |
14 | + <Option compiler="gcc" /> | |
15 | + <Option parameters="--pluginpath=${PWD}/.bin/Debug" /> | |
16 | + <Option host_application="pw3270" /> | |
17 | + <Option run_host_application_in_terminal="1" /> | |
18 | + <Compiler> | |
19 | + <Add option="-g" /> | |
20 | + </Compiler> | |
21 | + </Target> | |
22 | + <Target title="Release"> | |
23 | + <Option output=".bin/Release/sample3270" imp_lib="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).a" def_file="$(TARGET_OUTPUT_DIR)$(TARGET_OUTPUT_BASENAME).def" prefix_auto="0" extension_auto="1" /> | |
24 | + <Option object_output=".obj/Release/" /> | |
25 | + <Option type="3" /> | |
26 | + <Option compiler="gcc" /> | |
27 | + <Compiler> | |
28 | + <Add option="-O2" /> | |
29 | + </Compiler> | |
30 | + <Linker> | |
31 | + <Add option="-s" /> | |
32 | + </Linker> | |
33 | + </Target> | |
34 | + </Build> | |
35 | + <Compiler> | |
36 | + <Add option="-Wall" /> | |
37 | + <Add option="`pkg-config gtk+-2.0 --cflags`" /> | |
38 | + <Add option="-fPIC" /> | |
39 | + </Compiler> | |
40 | + <Linker> | |
41 | + <Add option="`pkg-config gtk+-2.0 --libs`" /> | |
42 | + </Linker> | |
43 | + <Unit filename="main.c"> | |
44 | + <Option compilerVar="CC" /> | |
45 | + </Unit> | |
46 | + <Extensions> | |
47 | + <code_completion /> | |
48 | + <envvars /> | |
49 | + <debugger /> | |
50 | + </Extensions> | |
51 | + </Project> | |
52 | +</CodeBlocks_project_file> | ... | ... |