* installer/win32/dia.nsi: Save diagrams by default in "My Pictures";
[dia.git] / app / sheets.h
blob1fb9e689a7100fede28f189d7ae743ffc7808bf0
1 /* Dia -- a diagram creation/manipulation program
2 * Copyright (C) 1998 Alexander Larsson
4 * sheets.h : a sheets and objects dialog
5 * Copyright (C) 2002 M.C. Nelson
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #ifndef SHEETS_H
25 #ifdef GNOME
26 #include <gnome.h>
27 #else
28 #include <gtk/gtk.h>
29 #endif
31 #include "../lib/sheet.h"
33 #include "sheets_dialog_callbacks.h"
35 /* The theory behind these structures is simple. Sheets and SheetObjects
36 are wrapped in SheetMod's and SheetObjectMod's respectively. Any changes
37 made by the user to the Sheet or SheetObject is reflected in the *Mod
38 subclass. When the user commits, the information is written back to
39 the datastore and the *Mod lists discarded. */
41 typedef struct _SheetObjectMod SheetObjectMod;
42 typedef struct _SheetMod SheetMod;
44 struct _SheetObjectMod
46 SheetObject sheet_object;
48 enum { OBJECT_TYPE_SVG,
49 OBJECT_TYPE_PROGRAMMED,
50 OBJECT_TYPE_UNASSIGNED } type;
52 enum { SHEET_OBJECT_MOD_NONE,
53 SHEET_OBJECT_MOD_NEW,
54 SHEET_OBJECT_MOD_CHANGED,
55 SHEET_OBJECT_MOD_DELETED } mod;
57 gchar *svg_filename; /* For a new sheet_object */
60 struct _SheetMod
62 Sheet sheet;
64 enum { SHEETMOD_TYPE_NORMAL,
65 SHEETMOD_TYPE_UNASSIGNED } type; /* reserved for future use */
67 enum { SHEETMOD_MOD_NONE,
68 SHEETMOD_MOD_NEW,
69 SHEETMOD_MOD_CHANGED,
70 SHEETMOD_MOD_DELETED } mod;
73 extern GtkWidget *sheets_dialog;
74 extern GtkWidget *sheets_dialog_optionmenu_menu;
75 extern GtkTooltips *sheets_dialog_tooltips;
77 SheetObjectMod *sheets_append_sheet_object_mod(SheetObject *so, SheetMod *sm);
78 SheetMod *sheets_append_sheet_mods(Sheet *sheet);
79 void sheets_optionmenu_create(GtkWidget *option_menu, GtkWidget *wrapbox,
80 gchar *sheet_name);
81 void create_object_pixmap(SheetObject *so, GtkWidget *parent,
82 GdkPixmap **pixmap, GdkBitmap **mask);
84 gchar *sheet_object_mod_get_type_string(SheetObjectMod *som);
86 gboolean sheets_dialog_create(void);
87 void sheets_dialog_show_callback(gpointer data, guint action,
88 GtkWidget *widget);
89 GtkWidget *lookup_widget(GtkWidget *widget,
90 const gchar *widget_name);
91 GtkWidget *create_pixmap(GtkWidget *dialog, gchar *filename, gboolean arg3);
93 #endif /* SHEETS_H */