1 /* 2 * This is a plug-in for GIMP. 3 * 4 * Generates clickable image maps. 5 * 6 * Copyright (C) 1998-2005 Maurits Rijk m.rijk@chello.nl 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <https://www.gnu.org/licenses/>. 20 * 21 */ 22 23 #ifndef _IMAP_MAIN_H 24 #define _IMAP_MAIN_H 25 26 #include "imap_mru.h" 27 #include "imap_object.h" 28 #include "imap_preferences.h" 29 #include "imap_preview.h" 30 31 #define PLUG_IN_PROC "plug-in-imagemap" 32 #define PLUG_IN_BINARY "imagemap" 33 #define PLUG_IN_ROLE "gimp-imagemap" 34 35 typedef enum {NCSA, CERN, CSIM} MapFormat_t; 36 37 typedef struct { 38 MapFormat_t map_format; 39 gchar *image_name; 40 gchar *title; 41 gchar *author; 42 gchar *default_url; 43 gchar *description; 44 gint old_image_width; 45 gint old_image_height; 46 gboolean color; /* Color (TRUE) or Gray (FALSE) */ 47 gboolean show_gray; 48 } MapInfo_t; 49 50 void main_set_dimension(gint width, gint height); 51 void main_clear_dimension(void); 52 void load(const gchar *filename); 53 void save_as(const gchar *filename); 54 void dump_output(gpointer param, OutputFunc_t output); 55 GtkWidget *get_dialog(void); 56 MRU_t *get_mru(void); 57 MapInfo_t *get_map_info(void); 58 PreferencesData_t *get_preferences(void); 59 60 gint get_image_width(void); 61 gint get_image_height(void); 62 63 void set_busy_cursor(void); 64 void remove_busy_cursor(void); 65 66 void main_toolbar_set_grid(gboolean active); 67 68 void set_zoom(gint zoom_factor); 69 gint get_real_coord(gint coord); 70 void draw_line(cairo_t *cr, gint x1, gint y1, gint x2, 71 gint y2); 72 void draw_rectangle(cairo_t *cr, gboolean filled, gint x, gint y, 73 gint width, gint height); 74 void draw_circle(cairo_t *cr, gint x, gint y, 75 gint r); 76 void draw_polygon(cairo_t *cr, GList *list); 77 78 const char *get_filename(void); 79 80 ObjectList_t *get_shapes(void); 81 void add_shape(Object_t *obj); 82 void update_shape(Object_t *obj); 83 void select_shape(GtkWidget *widget, GdkEventButton *event); 84 void edit_shape(gint x, gint y); 85 86 void do_popup_menu(GdkEventButton *event); 87 void draw_shapes(cairo_t *cr); 88 89 void show_url(void); 90 void hide_url(void); 91 92 void set_preview_color (GtkRadioAction *action, 93 GtkRadioAction *current, 94 gpointer user_data); 95 void set_zoom_factor (GtkRadioAction *action, 96 GtkRadioAction *current, 97 gpointer user_data); 98 void set_func (GtkRadioAction *action, 99 GtkRadioAction *current, 100 gpointer user_data); 101 void do_edit_selected_shape (void); 102 void do_zoom_in (void); 103 void do_zoom_out (void); 104 void do_close (void); 105 void do_quit (void); 106 void do_undo (void); 107 void do_redo (void); 108 void do_cut (void); 109 void do_copy (void); 110 void do_paste (void); 111 void do_select_all (void); 112 void do_deselect_all (void); 113 void do_clear (void); 114 void do_move_up (void); 115 void do_move_down (void); 116 void do_move_to_front (void); 117 void do_send_to_back (void); 118 void do_use_gimp_guides_dialog (void); 119 void do_create_guides_dialog (void); 120 void save (void); 121 void imap_help (void); 122 void toggle_area_list (void); 123 const gchar * get_image_name (void); 124 125 #endif /* _IMAP_MAIN_H */ 126