Commit c6335708f56af01c1a0368f9f1abe0e1ffb8d2a9
1 parent
2e847de3
Exists in
master
and in
1 other branch
Moving _fire_copy and _fire_past to static in the action table source.
Showing
3 changed files
with
53 additions
and
149 deletions
Show diff stats
src/terminal/actions/clipboard.c
| ... | ... | @@ -1,78 +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., 51 Franklin | |
| 19 | - * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como properties.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 "private.h" | |
| 31 | - #include <v3270.h> | |
| 32 | - #include <v3270/selection.h> | |
| 33 | - #include <lib3270/trace.h> | |
| 34 | - #include <lib3270/log.h> | |
| 35 | - | |
| 36 | -/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
| 37 | - | |
| 38 | - int fire_copy_accelerator(GtkWidget *widget, const V3270_ACTION * action) { | |
| 39 | - | |
| 40 | - debug("%s",__FUNCTION__); | |
| 41 | - | |
| 42 | - v3270_clipboard_set( | |
| 43 | - widget, | |
| 44 | - (action->flags & 0x0F), | |
| 45 | - (action->flags & V3270_ACTION_FLAG_CUT) != 0 | |
| 46 | - ); | |
| 47 | - | |
| 48 | - return EINVAL; | |
| 49 | - } | |
| 50 | - | |
| 51 | - int fire_paste_accelerator(GtkWidget *widget, const V3270_ACTION * action) { | |
| 52 | - | |
| 53 | - switch((int) action->flags) | |
| 54 | - { | |
| 55 | - case 0: // Default paste. | |
| 56 | - v3270_clipboard_get_from_url(widget,NULL); | |
| 57 | - break; | |
| 58 | - | |
| 59 | - case 1: // Text paste. | |
| 60 | - v3270_clipboard_get_from_url(widget,"text://"); | |
| 61 | - break; | |
| 62 | - | |
| 63 | - case 2: // File paste. | |
| 64 | - v3270_clipboard_get_from_url(widget,"file://"); | |
| 65 | - break; | |
| 66 | - | |
| 67 | - case 3: // screen paste. | |
| 68 | - v3270_clipboard_get_from_url(widget,"screen://"); | |
| 69 | - break; | |
| 70 | - | |
| 71 | - default: | |
| 72 | - g_warning("Unexpected paste flags %u",(unsigned int) action->flags); | |
| 73 | - } | |
| 74 | - | |
| 75 | - return 0; | |
| 76 | - } | |
| 77 | - | |
| 78 | - |
src/terminal/actions/private.h
| 1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | |
| 2 | + | |
| 1 | 3 | /* |
| 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 - e possui - linhas de código. | |
| 4 | + * Copyright (C) 2008 Banco do Brasil S.A. | |
| 22 | 5 | * |
| 23 | - * Contatos: | |
| 6 | + * This program is free software: you can redistribute it and/or modify | |
| 7 | + * it under the terms of the GNU Lesser General Public License as published | |
| 8 | + * by the Free Software Foundation, either version 3 of the License, or | |
| 9 | + * (at your option) any later version. | |
| 24 | 10 | * |
| 25 | - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 26 | - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 11 | + * This program is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | + * GNU General Public License for more details. | |
| 27 | 15 | * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License | |
| 17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| 28 | 18 | */ |
| 29 | 19 | |
| 30 | 20 | #include <config.h> |
| ... | ... | @@ -55,8 +45,6 @@ |
| 55 | 45 | |
| 56 | 46 | |
| 57 | 47 | // Internal methods |
| 58 | - G_GNUC_INTERNAL int fire_copy_accelerator(GtkWidget *widget, const V3270_ACTION *action); | |
| 59 | - G_GNUC_INTERNAL int fire_paste_accelerator(GtkWidget *widget, const V3270_ACTION *action); | |
| 60 | 48 | G_GNUC_INTERNAL int fire_zoom_action(GtkWidget *widget, const V3270_ACTION *action); |
| 61 | 49 | G_GNUC_INTERNAL int fire_save_action(GtkWidget *widget, const V3270_ACTION *action); |
| 62 | 50 | G_GNUC_INTERNAL int fire_print_action(GtkWidget *widget, const V3270_ACTION *action); | ... | ... |
src/terminal/actions/table.c
| ... | ... | @@ -27,6 +27,9 @@ |
| 27 | 27 | static int fire_copy_as_html(GtkWidget *widget, const struct _v3270_action * action); |
| 28 | 28 | static int fire_copy_as_pixbuff(GtkWidget *widget, const struct _v3270_action * action); |
| 29 | 29 | |
| 30 | + static int fire_copy_accelerator(GtkWidget *widget, const V3270_ACTION *action); | |
| 31 | + static int fire_paste_accelerator(GtkWidget *widget, const V3270_ACTION *action); | |
| 32 | + | |
| 30 | 33 | // Dialogs |
| 31 | 34 | static int fire_accelerators_dialog(GtkWidget *widget, const struct _v3270_action * action); |
| 32 | 35 | static int fire_host_dialog(GtkWidget *widget, const struct _v3270_action * action); |
| ... | ... | @@ -402,7 +405,6 @@ |
| 402 | 405 | } |
| 403 | 406 | |
| 404 | 407 | static int fire_host_dialog(GtkWidget *widget, const struct _v3270_action G_GNUC_UNUSED(* action)) { |
| 405 | - | |
| 406 | 408 | gtk_widget_show_all( |
| 407 | 409 | v3270_settings_popup_dialog( |
| 408 | 410 | v3270_host_settings_new(), |
| ... | ... | @@ -410,51 +412,7 @@ |
| 410 | 412 | TRUE |
| 411 | 413 | ) |
| 412 | 414 | ); |
| 413 | - | |
| 414 | 415 | return 0; |
| 415 | - | |
| 416 | - /* | |
| 417 | - GtkWidget * dialog = v3270_settings_dialog_new(); | |
| 418 | - GtkWidget * settings = v3270_host_settings_new(); | |
| 419 | - | |
| 420 | - v3270_settings_dialog_set_has_subtitle(dialog,FALSE); | |
| 421 | - | |
| 422 | - gtk_window_set_title(GTK_WINDOW(dialog), v3270_settings_get_title(settings)); | |
| 423 | - gtk_container_add(GTK_CONTAINER(dialog), settings); | |
| 424 | - | |
| 425 | - gtk_dialog_set_toplevel(dialog,widget); | |
| 426 | - gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); | |
| 427 | - | |
| 428 | - v3270_settings_dialog_set_terminal_widget(dialog, widget); | |
| 429 | - | |
| 430 | - gtk_window_set_default_size(GTK_WINDOW(dialog), 700, 150); | |
| 431 | - gtk_widget_show_all(dialog); | |
| 432 | - | |
| 433 | - gboolean again = TRUE; | |
| 434 | - while(again) | |
| 435 | - { | |
| 436 | - gtk_widget_set_sensitive(dialog,TRUE); | |
| 437 | - gtk_widget_set_visible(dialog,TRUE); | |
| 438 | - | |
| 439 | - switch(gtk_dialog_run(GTK_DIALOG(dialog))) | |
| 440 | - { | |
| 441 | - case GTK_RESPONSE_APPLY: | |
| 442 | - debug("V3270HostSelectWidget::%s=%s",__FUNCTION__,"GTK_RESPONSE_APPLY"); | |
| 443 | - v3270_settings_dialog_apply(dialog); | |
| 444 | - again = lib3270_reconnect(v3270_get_session(widget),0); | |
| 445 | - break; | |
| 446 | - | |
| 447 | - case GTK_RESPONSE_CANCEL: | |
| 448 | - again = FALSE; | |
| 449 | - debug("V3270HostSelectWidget::%s=%s",__FUNCTION__,"GTK_RESPONSE_CANCEL"); | |
| 450 | - v3270_settings_dialog_revert(dialog); | |
| 451 | - break; | |
| 452 | - } | |
| 453 | - } | |
| 454 | - | |
| 455 | - gtk_widget_destroy(dialog); | |
| 456 | - */ | |
| 457 | - | |
| 458 | 416 | } |
| 459 | 417 | |
| 460 | 418 | static int fire_color_dialog(GtkWidget *widget, const struct _v3270_action G_GNUC_UNUSED(* action)) { |
| ... | ... | @@ -487,9 +445,45 @@ |
| 487 | 445 | widget, |
| 488 | 446 | TRUE |
| 489 | 447 | ); |
| 490 | - | |
| 491 | 448 | gtk_window_set_default_size(GTK_WINDOW(dialog),950,400); |
| 492 | 449 | gtk_widget_show_all(dialog); |
| 450 | + return 0; | |
| 451 | + } | |
| 452 | + | |
| 453 | + static int fire_copy_accelerator(GtkWidget *widget, const V3270_ACTION * action) { | |
| 454 | + | |
| 455 | + v3270_clipboard_set( | |
| 456 | + widget, | |
| 457 | + (action->flags & 0x0F), | |
| 458 | + (action->flags & V3270_ACTION_FLAG_CUT) != 0 | |
| 459 | + ); | |
| 460 | + | |
| 461 | + return EINVAL; | |
| 462 | + } | |
| 463 | + | |
| 464 | + static int fire_paste_accelerator(GtkWidget *widget, const V3270_ACTION * action) { | |
| 465 | + | |
| 466 | + switch((int) action->flags) | |
| 467 | + { | |
| 468 | + case 0: // Default paste. | |
| 469 | + v3270_clipboard_get_from_url(widget,NULL); | |
| 470 | + break; | |
| 471 | + | |
| 472 | + case 1: // Text paste. | |
| 473 | + v3270_clipboard_get_from_url(widget,"text://"); | |
| 474 | + break; | |
| 475 | + | |
| 476 | + case 2: // File paste. | |
| 477 | + v3270_clipboard_get_from_url(widget,"file://"); | |
| 478 | + break; | |
| 479 | + | |
| 480 | + case 3: // screen paste. | |
| 481 | + v3270_clipboard_get_from_url(widget,"screen://"); | |
| 482 | + break; | |
| 483 | + | |
| 484 | + default: | |
| 485 | + g_warning("Unexpected paste flags %u",(unsigned int) action->flags); | |
| 486 | + } | |
| 493 | 487 | |
| 494 | 488 | return 0; |
| 495 | 489 | } | ... | ... |