GUI: reduce vertical size of the toolbar area
[gnumeric.git] / src / workbook-priv.h
blob0ff9cfd66deec22c8b85a252e5b61c847d1a2255
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_WORKBOOK_PRIV_H_
3 # define _GNM_WORKBOOK_PRIV_H_
5 #include "workbook.h"
6 #include <goffice/goffice.h>
8 G_BEGIN_DECLS
10 struct _Workbook {
11 GODoc doc;
13 GPtrArray *wb_views;
15 GPtrArray *sheets;
16 GHashTable *sheet_hash_private;
17 GHashTable *sheet_order_dependents;
18 GHashTable *sheet_local_functions;
20 gboolean is_placeholder;
22 GOFileFormatLevel file_format_level;
23 GOFileFormatLevel file_export_format_level;
24 GOFileSaver *file_saver;
25 GOFileSaver *file_exporter;
26 char *last_export_uri;
28 /* Undo support */
29 GSList *undo_commands;
30 GSList *redo_commands;
32 GnmNamedExprCollection *names;
34 /* Calculation options */
35 struct {
36 gboolean enabled;
37 int max_number;
38 double tolerance;
39 } iteration;
40 gboolean recalc_auto;
41 GODateConventions const *date_conv;
43 gboolean during_destruction;
44 gboolean being_reordered;
45 gboolean recursive_dirty_enabled;
48 typedef struct {
49 GODocClass base;
51 void (*sheet_order_changed) (Workbook *wb);
52 void (*sheet_added) (Workbook *wb);
53 void (*sheet_deleted) (Workbook *wb);
54 } WorkbookClass;
56 #define WORKBOOK_FOREACH_VIEW(wb, view, code) \
57 do { \
58 int InD; \
59 GPtrArray *wb_views = (wb)->wb_views; \
60 if (wb_views != NULL) /* Reverse is important during destruction */ \
61 for (InD = wb_views->len; InD-- > 0; ) { \
62 WorkbookView *view = g_ptr_array_index (wb_views, InD); \
63 code \
64 } \
65 } while (0)
67 #define WORKBOOK_FOREACH_CONTROL(wb, view, control, code) \
68 WORKBOOK_FOREACH_VIEW((wb), view, \
69 WORKBOOK_VIEW_FOREACH_CONTROL(view, control, code);)
72 * Walk the dependents. WARNING: Note, that it is only valid to muck with
73 * the current dependency in the code.
75 #define WORKBOOK_FOREACH_DEPENDENT(wb, dep, code) \
76 do { \
77 /* Maybe external deps here. */ \
79 WORKBOOK_FOREACH_SHEET(wb, _wfd_sheet, { \
80 SHEET_FOREACH_DEPENDENT (_wfd_sheet, dep, code); \
81 }); \
82 } while (0)
84 G_END_DECLS
86 #endif /* _GNM_WORKBOOK_PRIV_H_ */