1 /* Dia -- an diagram creation/manipulation program -*- c -*-
2 * Copyright (C) 1998 Alexander Larsson
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 typedef struct _Diagram Diagram
;
28 #include "connectionpoint.h"
30 #include "diagramdata.h"
37 int unsaved
; /* True if diagram is created but not saved.*/
39 gboolean autosaved
; /* True if the diagram is autosaved since last mod */
40 char *autosavefilename
; /* Holds the name of the current autosave file
41 * for this diagram, or NULL. */
46 GSList
*displays
; /* List of all displays showing this diagram */
57 typedef struct _object_extent object_extent
;
59 GList
*dia_open_diagrams(void); /* Read only! */
61 Diagram
*diagram_load(const char *filename
, DiaImportFilter
*ifilter
);
62 int diagram_load_into (Diagram
*dest
, const char *filename
, DiaImportFilter
*ifilter
);
63 Diagram
*new_diagram(const char *filename
); /*Note: filename is copied*/
64 void diagram_destroy(Diagram
*dia
);
65 void diagram_modified(Diagram
*dia
);
66 void diagram_set_modified(Diagram
*dia
, int modified
);
67 void diagram_add_ddisplay(Diagram
*dia
, DDisplay
*ddisp
);
68 void diagram_remove_ddisplay(Diagram
*dia
, DDisplay
*ddisp
);
69 void diagram_add_object(Diagram
*dia
, Object
*obj
);
70 void diagram_add_object_list(Diagram
*dia
, GList
*list
);
71 void diagram_selected_break_external(Diagram
*dia
);
72 void diagram_remove_all_selected(Diagram
*diagram
, int delete_empty
);
73 void diagram_unselect_object(Diagram
*diagram
, Object
*obj
);
74 void diagram_unselect_objects(Diagram
*dia
, GList
*obj_list
);
75 void diagram_select(Diagram
*diagram
, Object
*obj
);
76 void diagram_select_list(Diagram
*diagram
, GList
*list
);
77 int diagram_is_selected(Diagram
*diagram
, Object
*obj
);
78 GList
*diagram_get_sorted_selected(Diagram
*dia
);
79 /* Removes selected from objects list, NOT selected list: */
80 GList
*diagram_get_sorted_selected_remove(Diagram
*dia
);
81 void diagram_add_update(Diagram
*dia
, Rectangle
*update
);
82 void diagram_add_update_all(Diagram
*dia
);
83 void diagram_add_update_all_all_and_flush();
84 void diagram_add_update_pixels(Diagram
*dia
, Point
*point
,
85 int pixel_width
, int pixel_height
);
86 void diagram_flush(Diagram
*dia
);
87 Object
*diagram_find_clicked_object(Diagram
*dia
,
90 Object
*diagram_find_clicked_object_except(Diagram
*dia
,
94 real
diagram_find_closest_handle(Diagram
*dia
, Handle
**handle
,
95 Object
**obj
, Point
*pos
);
96 real
diagram_find_closest_connectionpoint(Diagram
*dia
,
100 void diagram_update_extents(Diagram
*dia
);
101 gint
diagram_parent_sort_cb(object_extent
** a
, object_extent
**b
);
103 void diagram_update_menu_sensitivity (Diagram
*dia
, UpdatableMenuItems
*items
);
104 void diagram_update_menubar_sensitivity(Diagram
*dia
, UpdatableMenuItems
*items
);
105 void diagram_update_popupmenu_sensitivity(Diagram
*dia
);
107 void diagram_place_under_selected(Diagram
*dia
);
108 void diagram_place_over_selected(Diagram
*dia
);
109 void diagram_place_down_selected(Diagram
*dia
);
110 void diagram_place_up_selected(Diagram
*dia
);
111 void diagram_group_selected(Diagram
*dia
);
112 void diagram_ungroup_selected(Diagram
*dia
);
113 void diagram_parent_selected(Diagram
*dia
);
114 void diagram_unparent_selected(Diagram
*dia
);
115 void diagram_unparent_children_selected(Diagram
*dia
);
117 void diagram_set_filename(Diagram
*dia
, char *filename
);
118 gchar
*diagram_get_name(Diagram
*dia
);
120 int diagram_modified_exists(void);
122 void diagram_redraw_all(void);
124 void diagram_object_modified(Diagram
*dia
, Object
*object
);
126 #endif /* DIAGRAM_H */