Commit 545d52b613ba022bc0b19f02da8573e351cb3d52
1 parent
58ce4959
Exists in
master
and in
5 other branches
Iniciando implementacao das barras laterais e inferior
Showing
6 changed files
with
189 additions
and
1 deletions
Show diff stats
pw3270.cbp
... | ... | @@ -275,6 +275,9 @@ |
275 | 275 | <Unit filename="src\pw3270\uiparser\action.c"> |
276 | 276 | <Option compilerVar="CC" /> |
277 | 277 | </Unit> |
278 | + <Unit filename="src\pw3270\uiparser\keypad.c"> | |
279 | + <Option compilerVar="CC" /> | |
280 | + </Unit> | |
278 | 281 | <Unit filename="src\pw3270\uiparser\menu.c"> |
279 | 282 | <Option compilerVar="CC" /> |
280 | 283 | </Unit> |
... | ... | @@ -344,6 +347,7 @@ |
344 | 347 | </Unit> |
345 | 348 | <Unit filename="src\tools\Makefile.in" /> |
346 | 349 | <Unit filename="ui\00default.xml" /> |
350 | + <Unit filename="ui\10keypad.xml" /> | |
347 | 351 | <Unit filename="ui\99debug.xml" /> |
348 | 352 | <Unit filename="updateChangeLog.sh" /> |
349 | 353 | <Extensions> | ... | ... |
... | ... | @@ -0,0 +1,82 @@ |
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., 51 Franklin | |
19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | + * | |
21 | + * Este programa está nomeado como accelerator.c e possui - 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 Mendonça) | |
27 | + * | |
28 | + */ | |
29 | + | |
30 | + #include <gtk/gtk.h> | |
31 | + #include "private.h" | |
32 | + | |
33 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
34 | + | |
35 | + static void element_start(GMarkupParseContext *context, const gchar *element_name, const gchar **names,const gchar **values, struct parser *info, GError **error) | |
36 | + { | |
37 | + trace("%s: %s",__FUNCTION__,element_name); | |
38 | + } | |
39 | + | |
40 | + static void element_end(GMarkupParseContext *context, const gchar *element_name, struct parser *info, GError **error) | |
41 | + { | |
42 | + trace("%s: %s",__FUNCTION__,element_name); | |
43 | + } | |
44 | + | |
45 | + GObject * ui_create_keypad(GMarkupParseContext *context,GtkAction *action,struct parser *info,const gchar **names, const gchar **values, GError **error) | |
46 | + { | |
47 | + static const GMarkupParser parser = | |
48 | + { | |
49 | + (void (*)(GMarkupParseContext *, const gchar *, const gchar **, const gchar **, gpointer, GError **)) | |
50 | + element_start, | |
51 | + (void (*)(GMarkupParseContext *, const gchar *, gpointer, GError **)) | |
52 | + element_end, | |
53 | + (void (*)(GMarkupParseContext *, const gchar *, gsize, gpointer, GError **)) | |
54 | + NULL, | |
55 | + | |
56 | +// (void (*)(GMarkupParseContext *, GError *, gpointer)) | |
57 | + NULL | |
58 | + | |
59 | + }; | |
60 | + | |
61 | + if(info->element) | |
62 | + { | |
63 | + *error = g_error_new(ERROR_DOMAIN,EINVAL, _( "<%s> should be on toplevel"), "keypad"); | |
64 | + return NULL; | |
65 | + } | |
66 | + | |
67 | + if(action) | |
68 | + { | |
69 | + *error = g_error_new(ERROR_DOMAIN,EINVAL,_( "action attribute is invalid for <%s>"),"keypad"); | |
70 | + return NULL; | |
71 | + } | |
72 | + | |
73 | + g_markup_parse_context_push(context,(GMarkupParser *) &parser,info); | |
74 | + | |
75 | + return NULL; | |
76 | + } | |
77 | + | |
78 | + void ui_end_keypad(GMarkupParseContext *context,GObject *widget,struct parser *info,GError **error) | |
79 | + { | |
80 | + | |
81 | + g_markup_parse_context_pop(context); | |
82 | + } | ... | ... |
src/pw3270/uiparser/parsefile.c
... | ... | @@ -52,6 +52,7 @@ |
52 | 52 | { "popup", UI_ELEMENT_POPUP, ui_create_popup, ui_end_popup }, |
53 | 53 | { "script", UI_ELEMENT_SCRIPT, ui_create_script, ui_end_script }, |
54 | 54 | { "scroll", UI_ELEMENT_SCROLL, ui_create_scroll, ui_end_scroll }, |
55 | + { "keypad", UI_ELEMENT_KEYPAD, ui_create_keypad, ui_end_keypad }, | |
55 | 56 | }; |
56 | 57 | |
57 | 58 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | ... | ... |
src/pw3270/uiparser/private.h
... | ... | @@ -43,6 +43,7 @@ |
43 | 43 | UI_ELEMENT_TOOLBAR, |
44 | 44 | UI_ELEMENT_TOOLITEM, |
45 | 45 | UI_ELEMENT_POPUP, |
46 | + UI_ELEMENT_KEYPAD, | |
46 | 47 | |
47 | 48 | UI_ELEMENT_COUNT |
48 | 49 | }; |
... | ... | @@ -106,6 +107,7 @@ |
106 | 107 | GObject * ui_create_popup(GMarkupParseContext *context,GtkAction *action,struct parser *info,const gchar **names, const gchar **values, GError **error); |
107 | 108 | GObject * ui_create_script(GMarkupParseContext *context,GtkAction *action,struct parser *info,const gchar **names, const gchar **values, GError **error); |
108 | 109 | GObject * ui_create_scroll(GMarkupParseContext *context,GtkAction *action,struct parser *info,const gchar **names, const gchar **values, GError **error); |
110 | + GObject * ui_create_keypad(GMarkupParseContext *context,GtkAction *action,struct parser *info,const gchar **names, const gchar **values, GError **error); | |
109 | 111 | |
110 | 112 | void ui_end_menubar(GMarkupParseContext *context,GObject *widget,struct parser *info,GError **error); |
111 | 113 | void ui_end_menu(GMarkupParseContext *context,GObject *widget,struct parser *info,GError **error); |
... | ... | @@ -117,5 +119,6 @@ |
117 | 119 | void ui_end_popup(GMarkupParseContext *context,GObject *widget,struct parser *info,GError **error); |
118 | 120 | void ui_end_script(GMarkupParseContext *context,GObject *widget,struct parser *info,GError **error); |
119 | 121 | void ui_end_scroll(GMarkupParseContext *context,GObject *widget,struct parser *info,GError **error); |
122 | + void ui_end_keypad(GMarkupParseContext *context,GObject *widget,struct parser *info,GError **error); | |
120 | 123 | |
121 | 124 | #include "parser.h" | ... | ... |
src/pw3270/uiparser/sources.mak
... | ... | @@ -0,0 +1,98 @@ |
1 | +<!----------------------------------------------------------------------------- | |
2 | + | |
3 | + "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
4 | + (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
5 | + aplicativos mainframe. Registro no INPI sob o nome G3270. | |
6 | + | |
7 | + Copyright (C) <2008> <Banco do Brasil S.A.> | |
8 | + | |
9 | + Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
10 | + os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
11 | + Free Software Foundation. | |
12 | + | |
13 | + Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
14 | + GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
15 | + A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
16 | + obter mais detalhes. | |
17 | + | |
18 | + Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
19 | + programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
20 | + Place, Suite 330, Boston, MA, 02111-1307, USA | |
21 | + | |
22 | + Contatos: | |
23 | + | |
24 | + perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
25 | + erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
26 | + licinio@bb.com.br (Licínio Luis Branco) | |
27 | + kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
28 | + | |
29 | +------------------------------------------------------------------------------> | |
30 | + | |
31 | +<ui> | |
32 | + | |
33 | + <keypad name="keypad.right" label="Lateral keypad" position="right" key='<alt>k' > | |
34 | + | |
35 | + <row> | |
36 | + <button action='pfkey' id='1' label='PF1' /> | |
37 | + <button action='pfkey' id='2' label='PF2' /> | |
38 | + <button action='pfkey' id='3' label='PF3' /> | |
39 | + </row> | |
40 | + <row> | |
41 | + <button action='pfkey' id='4' label='PF4' /> | |
42 | + <button action='pfkey' id='5' label='PF5' /> | |
43 | + <button action='pfkey' id='6' label='PF6' /> | |
44 | + </row> | |
45 | + <row> | |
46 | + <button action='pfkey' id='7' label='PF7' /> | |
47 | + <button action='pfkey' id='8' label='PF8' /> | |
48 | + <button action='pfkey' id='9' label='PF9' /> | |
49 | + </row> | |
50 | + <row> | |
51 | + <button action='pfkey' id='10' label='PF10' /> | |
52 | + <button action='pfkey' id='11' label='PF11' /> | |
53 | + <button action='pfkey' id='12' label='PF12' /> | |
54 | + </row> | |
55 | + <row> | |
56 | + <button /> | |
57 | + <button action="CursorUp" icon="go-up" /> | |
58 | + <button /> | |
59 | + </row> | |
60 | + <row> | |
61 | + <button action="CursorLeft" icon="go-back" /> | |
62 | + <button action="Home" icon="goto-top" /> | |
63 | + <button action="CursorRight" icon="go-forward" /> | |
64 | + </row> | |
65 | + <row> | |
66 | + <button /> | |
67 | + <button action="CursorDown" icon="go-down"/> | |
68 | + <button /> | |
69 | + </row> | |
70 | + <row> | |
71 | + <button action='pakey' id='1' label='PA1' /> | |
72 | + <button action='pakey' id='2' label='PA2' /> | |
73 | + <button action='pakey' id='3' label='PA3' /> | |
74 | + </row> | |
75 | + <row> | |
76 | + <button action='PreviousField' icon="goto-first" /> | |
77 | + <button action='NextField' icon="goto-last" /> | |
78 | + </row> | |
79 | + <row> | |
80 | + <button action='Erase' label="Clear" /> | |
81 | + <button action='Reset' label="Reset" /> | |
82 | + </row> | |
83 | + <row> | |
84 | + <button action='EraseEOF' label="Erase\nEOF" /> | |
85 | + <button action='EraseInput' label="Erase\nInput" /> | |
86 | + </row> | |
87 | + <row> | |
88 | + <button action='Attn' label="Attn" /> | |
89 | + <button action='Break' label="Break" /> | |
90 | + </row> | |
91 | + | |
92 | + <row> | |
93 | + <button action='Enter' icon="ok" /> | |
94 | + </row> | |
95 | + | |
96 | + </keypad> | |
97 | + | |
98 | +</ui> | ... | ... |