mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 04:22:47 -05:00
Minor refactoring of gtkapp.c -> gtkwin.c menu triggers.
Just to avoid an endless proliferation of functions too small to see, I've arranged an enumeration of action ids and a single app_menu_action function on the receiving end, and in gtkapp.c, a list macro that means I at least don't have to define the tiny callback functions and the GActionEntry records by hand and keep them in sync.
This commit is contained in:
@ -3252,17 +3252,20 @@ void init_clipboard(struct gui_data *inst)
|
||||
|
||||
#endif /* JUST_USE_GTK_CLIPBOARD_UTF8 */
|
||||
|
||||
void copy_menu_action(void *frontend)
|
||||
void app_menu_action(void *frontend, enum MenuAction action)
|
||||
{
|
||||
struct gui_data *inst = (struct gui_data *)frontend;
|
||||
static const int clips[] = { MENU_CLIPBOARD };
|
||||
term_request_copy(inst->term, clips, lenof(clips));
|
||||
}
|
||||
|
||||
void paste_menu_action(void *frontend)
|
||||
{
|
||||
struct gui_data *inst = (struct gui_data *)frontend;
|
||||
term_request_paste(inst->term, MENU_CLIPBOARD);
|
||||
switch (action) {
|
||||
case MA_COPY:
|
||||
{
|
||||
static const int clips[] = { MENU_CLIPBOARD };
|
||||
term_request_copy(inst->term, clips, lenof(clips));
|
||||
}
|
||||
break;
|
||||
case MA_PASTE:
|
||||
term_request_paste(inst->term, MENU_CLIPBOARD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void set_window_titles(struct gui_data *inst)
|
||||
|
Reference in New Issue
Block a user