bumped version number
2005-01-02 Maurits Rijk <m.rijk@chello.nl> * plug-ins/imagemap/imap_about.c: bumped version number * plug-ins/imagemap/AUTHORS * plug-ins/imagemap/NEWS * plug-ins/imagemap/README * plug-ins/imagemap/TODO: removed since they don't contain relevant information anymore. * plug-ins/imagemap/imap_popup.[ch]: removed * plug-ins/imagemap/Makefile.am * po-plug-ins/POTFILES.in: changed accordingly * plug-ins/imagemap/imap_grid.c * plug-ins/imagemap/imap_main.[ch] * plug-ins/imagemap/imap_menu.[ch] * plug-ins/imagemap/imap_object_popup.c * plug-ins/imagemap/imap_preview.c * plug-ins/imagemap/imap_toolbar.[ch] * plug-ins/imagemap/imap_tools.[ch]: first set of changes to fix #138841 (Use action based menus in Imagemap plug-in).
This commit is contained in:

committed by
Maurits Rijk

parent
9dc239a433
commit
f7fa12f7d0
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Generates clickable image maps.
|
||||
*
|
||||
* Copyright (C) 1998-2003 Maurits Rijk lpeek.mrijk@consunet.nl
|
||||
* Copyright (C) 1998-2005 Maurits Rijk m.rijk@chello.nl
|
||||
*
|
||||
* 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
|
||||
@ -46,7 +46,6 @@
|
||||
#include "imap_misc.h"
|
||||
#include "imap_object.h"
|
||||
#include "imap_polygon.h"
|
||||
#include "imap_popup.h"
|
||||
#include "imap_preview.h"
|
||||
#include "imap_rectangle.h"
|
||||
#include "imap_selection.h"
|
||||
@ -284,7 +283,7 @@ zoom_in(void)
|
||||
return _zoom_factor;
|
||||
}
|
||||
|
||||
static gint
|
||||
gint
|
||||
zoom_out(void)
|
||||
{
|
||||
if (_zoom_factor > 1) {
|
||||
@ -299,18 +298,11 @@ set_zoom(gint zoom_factor)
|
||||
{
|
||||
set_busy_cursor();
|
||||
_zoom_factor = zoom_factor;
|
||||
toolbar_set_zoom_sensitivity(_toolbar, zoom_factor);
|
||||
preview_zoom(_preview, zoom_factor);
|
||||
statusbar_set_zoom(_statusbar, zoom_factor);
|
||||
remove_busy_cursor();
|
||||
}
|
||||
|
||||
void
|
||||
main_toolbar_set_grid(gboolean active)
|
||||
{
|
||||
toolbar_set_grid(_toolbar, active);
|
||||
}
|
||||
|
||||
gint
|
||||
get_real_coord(gint coord)
|
||||
{
|
||||
@ -522,21 +514,27 @@ set_object_func(gboolean (*func)(GtkWidget*, GdkEventButton*,
|
||||
}
|
||||
|
||||
void
|
||||
set_rectangle_func(void)
|
||||
set_func(GtkRadioAction *action, GtkRadioAction *current,
|
||||
gpointer user_data)
|
||||
{
|
||||
set_object_func(object_on_button_press, get_rectangle_factory);
|
||||
}
|
||||
|
||||
void
|
||||
set_circle_func(void)
|
||||
{
|
||||
set_object_func(object_on_button_press, get_circle_factory);
|
||||
}
|
||||
|
||||
void
|
||||
set_polygon_func(void)
|
||||
{
|
||||
set_object_func(object_on_button_press, get_polygon_factory);
|
||||
gint value = gtk_radio_action_get_current_value (current);
|
||||
switch (value)
|
||||
{
|
||||
case 0:
|
||||
set_arrow_func();
|
||||
break;
|
||||
case 1:
|
||||
set_object_func(object_on_button_press, get_rectangle_factory);
|
||||
break;
|
||||
case 2:
|
||||
set_object_func(object_on_button_press, get_circle_factory);
|
||||
break;
|
||||
case 3:
|
||||
set_object_func(object_on_button_press, get_polygon_factory);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -581,8 +579,6 @@ set_all_sensitivities(void)
|
||||
{
|
||||
gint count = object_list_nr_selected(_shapes);
|
||||
menu_shapes_selected(count);
|
||||
toolbar_shapes_selected(_toolbar, count);
|
||||
tools_set_sensitive(count);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -688,20 +684,11 @@ edit_shape(gint x, gint y)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
toolbar_grid(void)
|
||||
{
|
||||
gint grid = toggle_grid();
|
||||
popup_check_grid(grid);
|
||||
menu_check_grid(grid);
|
||||
}
|
||||
|
||||
static void
|
||||
menu_zoom_in(void)
|
||||
{
|
||||
gint factor = zoom_in();
|
||||
menu_set_zoom_sensitivity(factor);
|
||||
popup_set_zoom_sensitivity(factor);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -709,7 +696,6 @@ menu_zoom_out(void)
|
||||
{
|
||||
gint factor = zoom_out();
|
||||
menu_set_zoom_sensitivity(factor);
|
||||
popup_set_zoom_sensitivity(factor);
|
||||
}
|
||||
|
||||
void
|
||||
@ -779,7 +765,7 @@ really_close(gpointer data)
|
||||
close_current();
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
do_close(void)
|
||||
{
|
||||
check_if_changed(really_close, NULL);
|
||||
@ -793,7 +779,7 @@ really_quit(gpointer data)
|
||||
gtk_widget_destroy(_dlg);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
do_quit(void)
|
||||
{
|
||||
check_if_changed(really_quit, NULL);
|
||||
@ -819,7 +805,7 @@ do_redo(void)
|
||||
preview_thaw();
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
save(void)
|
||||
{
|
||||
if (_filename)
|
||||
@ -1207,49 +1193,18 @@ data_selected(Object_t *obj, gpointer data)
|
||||
set_all_sensitivities();
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_file_open_dialog(void)
|
||||
{
|
||||
return command_new(do_file_open_dialog);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
imap_help (void)
|
||||
{
|
||||
gimp_standard_help_func ("plug-in-imagemap", NULL);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_save(void)
|
||||
{
|
||||
return command_new(save);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_save_as(void)
|
||||
{
|
||||
return command_new(do_file_save_as_dialog);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_preferences_dialog(void)
|
||||
{
|
||||
return command_new(do_preferences_dialog);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_close(void)
|
||||
{
|
||||
return command_new(do_close);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_quit(void)
|
||||
{
|
||||
return command_new(do_quit);
|
||||
}
|
||||
|
||||
|
||||
static Command_t*
|
||||
factory_undo(void)
|
||||
{
|
||||
@ -1262,40 +1217,40 @@ factory_redo(void)
|
||||
return command_new(do_redo);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_cut(void)
|
||||
void
|
||||
do_cut (void)
|
||||
{
|
||||
return cut_command_new(_shapes);
|
||||
command_execute (cut_command_new (_shapes));
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_copy(void)
|
||||
void
|
||||
do_copy (void)
|
||||
{
|
||||
return copy_command_new(_shapes);
|
||||
command_execute (copy_command_new (_shapes));
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_paste(void)
|
||||
void
|
||||
do_paste (void)
|
||||
{
|
||||
return paste_command_new(_shapes);
|
||||
command_execute (paste_command_new (_shapes));
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_select_all(void)
|
||||
void
|
||||
do_select_all(void)
|
||||
{
|
||||
return select_all_command_new(_shapes);
|
||||
command_execute (select_all_command_new (_shapes));
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_deselect_all(void)
|
||||
void
|
||||
do_deselect_all(void)
|
||||
{
|
||||
return unselect_all_command_new(_shapes, NULL);
|
||||
command_execute (unselect_all_command_new (_shapes, NULL));
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_clear(void)
|
||||
void
|
||||
do_clear(void)
|
||||
{
|
||||
return clear_command_new(_shapes);
|
||||
command_execute (clear_command_new(_shapes));
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
@ -1370,18 +1325,6 @@ factory_send_to_back(void)
|
||||
return send_to_back_command_new(_shapes);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_toolbar_grid(void)
|
||||
{
|
||||
return command_new(toolbar_grid);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_grid_settings_dialog(void)
|
||||
{
|
||||
return command_new(do_grid_settings_dialog);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_create_guides_dialog(void)
|
||||
{
|
||||
@ -1394,18 +1337,6 @@ factory_use_gimp_guides_dialog(void)
|
||||
return gimp_guides_command_new(_shapes, _drawable);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_help(void)
|
||||
{
|
||||
return command_new(imap_help);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_about_dialog(void)
|
||||
{
|
||||
return command_new(do_about_dialog);
|
||||
}
|
||||
|
||||
static Command_t*
|
||||
factory_move_up(void)
|
||||
{
|
||||
@ -1428,7 +1359,6 @@ dialog(GimpDrawable *drawable)
|
||||
GtkWidget *main_vbox;
|
||||
Tools_t *tools;
|
||||
Menu_t *menu;
|
||||
PopupMenu_t *popup;
|
||||
|
||||
gimp_ui_init ("imagemap", TRUE);
|
||||
|
||||
@ -1460,59 +1390,9 @@ dialog(GimpDrawable *drawable)
|
||||
|
||||
/* Create menu */
|
||||
menu = make_menu(main_vbox, dlg);
|
||||
menu_set_open_command(menu, factory_file_open_dialog);
|
||||
menu_set_save_command(menu, factory_save);
|
||||
menu_set_save_as_command(menu, factory_save_as);
|
||||
menu_set_preferences_command(menu, factory_preferences_dialog);
|
||||
menu_set_close_command(menu, factory_close);
|
||||
menu_set_quit_command(menu, factory_quit);
|
||||
menu_set_undo_command(menu, factory_undo);
|
||||
menu_set_redo_command(menu, factory_redo);
|
||||
menu_set_cut_command(menu, factory_cut);
|
||||
menu_set_copy_command(menu, factory_copy);
|
||||
menu_set_paste_command(menu, factory_paste);
|
||||
menu_set_select_all_command(menu, factory_select_all);
|
||||
menu_set_deselect_all_command(menu, factory_deselect_all);
|
||||
menu_set_clear_command(menu, factory_clear);
|
||||
menu_set_edit_erea_info_command(menu, factory_edit);
|
||||
menu_set_area_list_command(menu, factory_toggle_area_list);
|
||||
menu_set_source_command(menu, factory_source_dialog);
|
||||
menu_set_color_command(menu, factory_preview_color);
|
||||
menu_set_gray_command(menu, factory_preview_gray);
|
||||
menu_set_zoom_in_command(menu, factory_menu_zoom_in);
|
||||
menu_set_zoom_out_command(menu, factory_menu_zoom_out);
|
||||
menu_set_edit_map_info_command(menu, factory_settings_dialog);
|
||||
menu_set_grid_settings_command(menu, factory_grid_settings_dialog);
|
||||
menu_set_create_guides_command(menu, factory_create_guides_dialog);
|
||||
menu_set_use_gimp_guides_command(menu, factory_use_gimp_guides_dialog);
|
||||
menu_set_help_command(menu, factory_help);
|
||||
menu_set_about_command(menu, factory_about_dialog);
|
||||
|
||||
/* Create popup */
|
||||
popup = create_main_popup_menu();
|
||||
popup_set_zoom_in_command(popup, factory_zoom_in);
|
||||
popup_set_zoom_out_command(popup, factory_zoom_out);
|
||||
popup_set_edit_map_info_command(popup, factory_settings_dialog);
|
||||
popup_set_grid_settings_command(popup, factory_grid_settings_dialog);
|
||||
popup_set_create_guides_command(popup, factory_create_guides_dialog);
|
||||
popup_set_paste_command(popup, factory_paste);
|
||||
|
||||
/* Create toolbar */
|
||||
_toolbar = make_toolbar(main_vbox, dlg);
|
||||
toolbar_set_open_command(_toolbar, factory_file_open_dialog);
|
||||
toolbar_set_save_command(_toolbar, factory_save);
|
||||
toolbar_set_preferences_command(_toolbar, factory_preferences_dialog);
|
||||
toolbar_set_undo_command(_toolbar, factory_undo);
|
||||
toolbar_set_redo_command(_toolbar, factory_redo);
|
||||
toolbar_set_cut_command(_toolbar, factory_cut);
|
||||
toolbar_set_copy_command(_toolbar, factory_copy);
|
||||
toolbar_set_paste_command(_toolbar, factory_paste);
|
||||
toolbar_set_zoom_in_command(_toolbar, factory_zoom_in);
|
||||
toolbar_set_zoom_out_command(_toolbar, factory_zoom_out);
|
||||
toolbar_set_edit_map_info_command(_toolbar, factory_settings_dialog);
|
||||
toolbar_set_move_to_front_command(_toolbar, factory_move_to_front);
|
||||
toolbar_set_send_to_back_command(_toolbar, factory_send_to_back);
|
||||
toolbar_set_grid_command(_toolbar, factory_toolbar_grid);
|
||||
|
||||
/* Dialog area */
|
||||
hbox = gtk_hbox_new(FALSE, 1);
|
||||
@ -1520,8 +1400,7 @@ dialog(GimpDrawable *drawable)
|
||||
gtk_widget_show(hbox);
|
||||
|
||||
tools = make_tools(dlg);
|
||||
selection_set_delete_command(tools, factory_clear);
|
||||
selection_set_edit_command(tools, factory_edit);
|
||||
// selection_set_edit_command(tools, factory_edit);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), tools->container, FALSE, FALSE, 0);
|
||||
|
||||
_preview = make_preview(drawable);
|
||||
@ -1542,8 +1421,6 @@ dialog(GimpDrawable *drawable)
|
||||
_selection = make_selection(_shapes);
|
||||
selection_set_move_up_command(_selection, factory_move_up);
|
||||
selection_set_move_down_command(_selection, factory_move_down);
|
||||
selection_set_delete_command(_selection, factory_clear);
|
||||
selection_set_edit_command(_selection, factory_edit);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), _selection->container, FALSE, FALSE, 0);
|
||||
|
||||
_statusbar = make_statusbar(main_vbox, dlg);
|
||||
|
Reference in New Issue
Block a user