1999-09-07 00:03:20 +00:00
|
|
|
/*
|
2007-06-06 08:44:52 +00:00
|
|
|
* This is a plug-in for GIMP.
|
1999-09-07 00:03:20 +00:00
|
|
|
*
|
|
|
|
* Generates clickable image maps.
|
|
|
|
*
|
2005-06-06 19:53:44 +00:00
|
|
|
* Copyright (C) 1998-2005 Maurits Rijk m.rijk@chello.nl
|
1999-09-07 00:03:20 +00:00
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1999-09-07 00:03:20 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1999-09-07 00:03:20 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
1999-09-07 00:03:20 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2001-12-29 13:26:29 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
1999-09-07 00:03:20 +00:00
|
|
|
#include "imap_command.h"
|
|
|
|
#include "imap_menu_funcs.h"
|
|
|
|
|
|
|
|
static GtkAccelGroup *accelerator_group;
|
|
|
|
|
1999-12-18 19:45:00 +00:00
|
|
|
void
|
1999-09-07 00:03:20 +00:00
|
|
|
init_accel_group(GtkWidget *window)
|
|
|
|
{
|
|
|
|
accelerator_group = gtk_accel_group_new();
|
|
|
|
gtk_window_add_accel_group(GTK_WINDOW(window), accelerator_group);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2004-10-25 16:11:40 +00:00
|
|
|
add_accelerator(GtkWidget *widget, guint accelerator_key,
|
2011-02-21 11:51:47 +01:00
|
|
|
guint8 accelerator_mods)
|
1999-09-07 00:03:20 +00:00
|
|
|
{
|
1999-12-18 19:45:00 +00:00
|
|
|
gtk_widget_add_accelerator(widget, "activate", accelerator_group,
|
2011-02-21 11:51:47 +01:00
|
|
|
accelerator_key, accelerator_mods,
|
|
|
|
GTK_ACCEL_VISIBLE);
|
1999-09-07 00:03:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget*
|
2023-02-15 04:29:39 +00:00
|
|
|
insert_item_with_label (GtkWidget *parent,
|
|
|
|
gint position,
|
|
|
|
gchar *label,
|
|
|
|
MenuCallback activate,
|
|
|
|
gpointer data)
|
1999-09-07 00:03:20 +00:00
|
|
|
{
|
2023-02-15 04:29:39 +00:00
|
|
|
GtkWidget *item = gtk_menu_item_new_with_mnemonic (label);
|
|
|
|
gtk_menu_shell_insert (GTK_MENU_SHELL (parent), item, position);
|
|
|
|
g_signal_connect (item, "activate", G_CALLBACK (activate), data);
|
|
|
|
gtk_widget_show (item);
|
1999-09-07 00:03:20 +00:00
|
|
|
|
|
|
|
return item;
|
|
|
|
}
|