From 155e957cc532db480c6cce661d30a9253f329ddc Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 5 Dec 2019 15:46:59 -0300 Subject: [PATCH] Implementing new actions. --- pw3270.cbp | 11 +++++++++++ src/objects/actions/clipboard.c | 6 +++--- src/objects/actions/connect.c | 2 +- src/objects/actions/print.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/objects/actions/private.h | 18 ++++++++++++++---- src/objects/actions/save.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/objects/actions/v3270/copy.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/objects/actions/window.c | 18 ++++++++++++++---- src/objects/toolbar/toolbar.c | 1 + ui/application.xml | 2 +- 10 files changed, 316 insertions(+), 13 deletions(-) create mode 100644 src/objects/actions/print.c create mode 100644 src/objects/actions/save.c create mode 100644 src/objects/actions/v3270/copy.c diff --git a/pw3270.cbp b/pw3270.cbp index 0399f45..fd059ab 100644 --- a/pw3270.cbp +++ b/pw3270.cbp @@ -81,10 +81,19 @@ + + + + + + @@ -142,6 +151,8 @@ + + diff --git a/src/objects/actions/clipboard.c b/src/objects/actions/clipboard.c index 3db76e7..2f6bb07 100644 --- a/src/objects/actions/clipboard.c +++ b/src/objects/actions/clipboard.c @@ -100,7 +100,7 @@ } - GAction * pw3270_copy_action_new(void) { + GAction * pw3270_action_copy_new(void) { pw3270SimpleAction * action = pw3270_simple_action_new(); @@ -117,7 +117,7 @@ } - GAction * pw3270_cut_action_new(void) { + GAction * pw3270_action_cut_new(void) { pw3270SimpleAction * action = pw3270_simple_action_new(); @@ -134,7 +134,7 @@ } - GAction * pw3270_paste_action_new(void) { + GAction * pw3270_action_paste_new(void) { pw3270SimpleAction * action = pw3270_simple_action_new(); diff --git a/src/objects/actions/connect.c b/src/objects/actions/connect.c index e533b87..b83b484 100644 --- a/src/objects/actions/connect.c +++ b/src/objects/actions/connect.c @@ -41,7 +41,7 @@ } - GAction * pw3270_connect_action_new(void) { + GAction * pw3270_action_connect_new(void) { pw3270Action * action = PW3270_ACTION(pw3270_action_new_from_lib3270(lib3270_action_get_by_name("reconnect"))); diff --git a/src/objects/actions/print.c b/src/objects/actions/print.c new file mode 100644 index 0000000..b3f9194 --- /dev/null +++ b/src/objects/actions/print.c @@ -0,0 +1,105 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + /** + * @brief Implement PW3270 print actions. + * + */ + + #include "private.h" + #include + + static void activate_print_screen(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + static void activate_print_selected(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + static void activate_print_copy(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + static void activate_print(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + GAction * pw3270_action_print_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->parent.activate = activate_print; + action->parent.types.parameter = G_VARIANT_TYPE_STRING; + + action->group.id = LIB3270_ACTION_GROUP_ONLINE; + action->parent.name = "print"; + action->label = N_( "Print" ); + action->tooltip = N_( "Print terminal contents." ); + + return G_ACTION(action); + + } + + GAction * pw3270_action_print_screen_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->parent.activate = activate_print_screen; + + action->group.id = LIB3270_ACTION_GROUP_ONLINE; + action->parent.name = "print_screen"; + action->label = N_( "Print screen" ); + + return G_ACTION(action); + + } + + GAction * pw3270_action_print_selected_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->parent.activate = activate_print_selected; + + action->group.id = LIB3270_ACTION_GROUP_SELECTION; + action->parent.name = "print_selected"; + action->label = N_( "Print selected" ); + + return G_ACTION(action); + + } + diff --git a/src/objects/actions/private.h b/src/objects/actions/private.h index e1637c8..bc60f47 100644 --- a/src/objects/actions/private.h +++ b/src/objects/actions/private.h @@ -61,9 +61,19 @@ G_GNUC_INTERNAL void pw3270_action_notify_state(GAction *object); // Internal actions - G_GNUC_INTERNAL GAction * pw3270_connect_action_new(void); - G_GNUC_INTERNAL GAction * pw3270_copy_action_new(void); - G_GNUC_INTERNAL GAction * pw3270_cut_action_new(void); - G_GNUC_INTERNAL GAction * pw3270_paste_action_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_connect_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_copy_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_cut_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_paste_new(void); + + G_GNUC_INTERNAL GAction * pw3270_action_save_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_save_screen_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_save_selected_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_save_copy_new(void); + + G_GNUC_INTERNAL GAction * pw3270_action_print_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_print_screen_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_print_selected_new(void); + G_GNUC_INTERNAL GAction * pw3270_action_print_copy_new(void); #endif // PRIVATE_H_INCLUDED diff --git a/src/objects/actions/save.c b/src/objects/actions/save.c new file mode 100644 index 0000000..16f9e56 --- /dev/null +++ b/src/objects/actions/save.c @@ -0,0 +1,105 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + /** + * @brief Implement PW3270 save actions. + * + */ + + #include "private.h" + #include + + static void activate_save_screen(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + static void activate_save_selected(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + static void activate_save_copy(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + static void activate_save(GAction G_GNUC_UNUSED(*action), GVariant G_GNUC_UNUSED(*parameter), GtkWidget *terminal) { + + debug("%s",__FUNCTION__); + + } + + GAction * pw3270_action_save_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->parent.activate = activate_save; + action->parent.types.parameter = G_VARIANT_TYPE_STRING; + + action->group.id = LIB3270_ACTION_GROUP_ONLINE; + action->parent.name = "save"; + action->label = N_( "_Save" ); + action->tooltip = N_( "Save terminal contents." ); + + return G_ACTION(action); + + } + + GAction * pw3270_action_save_screen_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->parent.activate = activate_save_screen; + + action->group.id = LIB3270_ACTION_GROUP_ONLINE; + action->parent.name = "save_screen"; + action->label = N_( "Save screen" ); + + return G_ACTION(action); + + } + + GAction * pw3270_action_save_selected_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->parent.activate = activate_save_selected; + + action->group.id = LIB3270_ACTION_GROUP_SELECTION; + action->parent.name = "save_selected"; + action->label = N_( "Save selected" ); + + return G_ACTION(action); + + } + diff --git a/src/objects/actions/v3270/copy.c b/src/objects/actions/v3270/copy.c new file mode 100644 index 0000000..5b26856 --- /dev/null +++ b/src/objects/actions/v3270/copy.c @@ -0,0 +1,61 @@ +/* + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como - e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) + * + */ + + /** + * @brief Implement PW3270 save actions. + * + */ + + #include "../private.h" + #include + + + GAction * pw3270_action_print_copy_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->group.id = LIB3270_ACTION_GROUP_ONLINE; + action->parent.name = "print_copy"; + action->label = N_( "Print copy" ); + + return G_ACTION(action); + + } + + GAction * pw3270_action_save_copy_new(void) { + + pw3270SimpleAction * action = pw3270_simple_action_new(); + + action->group.id = LIB3270_ACTION_GROUP_ONLINE; + action->parent.name = "save_copy"; + action->label = N_( "Save copy" ); + + return G_ACTION(action); + + } diff --git a/src/objects/actions/window.c b/src/objects/actions/window.c index 83699db..3fa27c7 100644 --- a/src/objects/actions/window.c +++ b/src/objects/actions/window.c @@ -68,10 +68,20 @@ GAction * actions[] = { pw3270_action_new_pfkey(), pw3270_action_new_pakey(), - pw3270_connect_action_new(), - pw3270_copy_action_new(), - pw3270_cut_action_new(), - pw3270_paste_action_new() + pw3270_action_connect_new(), + pw3270_action_copy_new(), + pw3270_action_cut_new(), + pw3270_action_paste_new(), + pw3270_action_save_new(), + + pw3270_action_save_screen_new(), + pw3270_action_save_selected_new(), + pw3270_action_save_copy_new(), + + pw3270_action_print_screen_new(), + pw3270_action_print_selected_new(), + pw3270_action_print_copy_new() + }; for(ix = 0; ix < G_N_ELEMENTS(actions); ix++) { diff --git a/src/objects/toolbar/toolbar.c b/src/objects/toolbar/toolbar.c index 3bd4b49..ad2e7b5 100644 --- a/src/objects/toolbar/toolbar.c +++ b/src/objects/toolbar/toolbar.c @@ -34,6 +34,7 @@ static gboolean popup_context_menu(GtkToolbar *toolbar, gint x, gint y, gint button_number); static void finalize(GObject *object); + static void pw3270_toolbar_toolbar_set_style(GtkToolbar *toolbar, GtkToolbarStyle style); static const struct icon_size { const gchar * label; diff --git a/ui/application.xml b/ui/application.xml index c3577f6..e0fcc7f 100644 --- a/ui/application.xml +++ b/ui/application.xml @@ -324,7 +324,7 @@ - Select font + Terminal font -- libgit2 0.21.2