1999-09-07 08:03:20 +08:00
|
|
|
/*
|
|
|
|
* This is a plug-in for the GIMP.
|
|
|
|
*
|
|
|
|
* Generates clickable image maps.
|
|
|
|
*
|
2005-01-23 19:21:01 +08:00
|
|
|
* Copyright (C) 1998-2005 Maurits Rijk m.rijk@chello.nl
|
1999-09-07 08:03:20 +08:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (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
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2001-12-29 21:26:29 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2003-01-03 04:35:33 +08:00
|
|
|
#include "imap_commands.h"
|
1999-09-07 08:03:20 +08:00
|
|
|
#include "imap_main.h"
|
2005-06-07 03:53:44 +08:00
|
|
|
#include "imap_menu.h"
|
1999-09-07 08:03:20 +08:00
|
|
|
#include "imap_object_popup.h"
|
|
|
|
|
2004-03-10 20:20:14 +08:00
|
|
|
#include "libgimp/stdplugins-intl.h"
|
|
|
|
|
1999-09-07 08:03:20 +08:00
|
|
|
void
|
|
|
|
object_handle_popup(ObjectPopup_t *popup, Object_t *obj, GdkEventButton *event)
|
|
|
|
{
|
2005-04-15 03:41:49 +08:00
|
|
|
/* int position = object_get_position_in_list(obj) + 1; */
|
1999-09-07 08:03:20 +08:00
|
|
|
|
2005-01-02 16:07:03 +08:00
|
|
|
#ifdef _TEMP_
|
1999-09-07 08:03:20 +08:00
|
|
|
gtk_widget_set_sensitive(popup->up, (position > 1) ? TRUE : FALSE);
|
2004-03-10 20:20:14 +08:00
|
|
|
gtk_widget_set_sensitive(popup->down,
|
|
|
|
(position < g_list_length(obj->list->list))
|
1999-09-07 08:03:20 +08:00
|
|
|
? TRUE : FALSE);
|
2005-01-02 16:07:03 +08:00
|
|
|
#endif
|
1999-09-07 08:03:20 +08:00
|
|
|
gtk_menu_popup(GTK_MENU(popup->menu), NULL, NULL, NULL, NULL,
|
|
|
|
event->button, event->time);
|
|
|
|
}
|
|
|
|
|
2004-03-10 20:20:14 +08:00
|
|
|
void
|
1999-09-07 08:03:20 +08:00
|
|
|
object_do_popup(Object_t *obj, GdkEventButton *event)
|
|
|
|
{
|
|
|
|
static ObjectPopup_t *popup;
|
|
|
|
|
|
|
|
if (!popup)
|
2005-06-07 03:53:44 +08:00
|
|
|
{
|
|
|
|
popup = g_new (ObjectPopup_t, 1);
|
|
|
|
popup->menu = menu_get_widget ("/ObjectPopupMenu");
|
|
|
|
}
|
|
|
|
object_handle_popup (popup, obj, event);
|
1999-09-07 08:03:20 +08:00
|
|
|
}
|