Compilation: fix up tools includes.
[gnumeric.git] / src / wbc-gtk-impl.h
blob149fa5bbf950c7c9c48d2c1355ff5386169491b9
1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_WBC_GTK_IMPL_H_
3 # define _GNM_WBC_GTK_IMPL_H_
5 #include "gnumeric.h"
6 #include "wbc-gtk.h"
7 #include "workbook-control-priv.h"
8 #include "style.h"
9 #include "widgets/gnumeric-expr-entry.h"
10 #include "widgets/gnm-notebook.h"
12 #include <goffice/goffice.h>
13 #include <gtk/gtk.h>
15 G_BEGIN_DECLS
17 struct _WBCGtk {
18 WorkbookControl base;
20 GtkWidget *toplevel;
22 GtkBuilder *gui;
24 /* The area that contains the sheet and the sheet tabs. */
25 GtkWidget *notebook_area;
27 /* The notebook that contains the sheets. */
28 GtkNotebook *snotebook;
30 /* The notebook that contains the sheet tabs. */
31 GnmNotebook *bnotebook;
33 /* The GtkPaned that contains the sheet tabs and the status area. */
34 GtkPaned *tabs_paned;
36 GtkWidget *progress_bar;
38 struct {
39 GnmExprEntry *entry; /* The real edit line */
40 GnmExprEntry *temp_entry; /* A tmp overlay eg from a guru */
41 GtkWidget *guru;
42 gulong signal_changed, signal_insert, signal_delete;
43 gulong signal_cursor_pos, signal_selection_bound;
44 PangoAttrList *cell_attrs; /* Attrs from cell format. */
45 PangoAttrList *markup; /* just the markup */
46 PangoAttrList *full_content; /* cell_attrs+markup */
47 PangoAttrList *cur_fmt; /* attrs for new text (depends on position) */
48 } edit_line;
50 /* While editing these should be visible */
51 GtkWidget *ok_button, *cancel_button;
53 /* While not editing these should be visible */
54 GtkWidget *func_button;
56 gboolean updating_ui;
57 gboolean inside_editing;
59 /* Auto completion */
60 GnmComplete *auto_complete;
61 gboolean auto_completing;
62 char *auto_complete_text;
64 /* Used to detect if the user has backspaced, so we turn off auto-complete */
65 int auto_max_size;
67 /* Keep track of whether the last key pressed was END, so end-mode works */
68 gboolean last_key_was_end;
70 SheetControlGUI *rangesel;
72 GtkWidget *table;
73 GtkWidget *auto_expr_label;
74 GtkWidget *status_text;
76 /* Widgets whose visibility should be copied. */
77 GHashTable *visibility_widgets;
79 gboolean is_fullscreen;
80 GOUndo *undo_for_fullscreen;
81 GSList *hide_for_fullscreen;
83 /* Edit area */
84 GtkWidget *selection_descriptor; /* A GtkEntry */
86 /* Autosave */
87 gboolean autosave_prompt;
88 gint autosave_time;
89 guint autosave_timer;
91 PangoFontDescription *font_desc;
93 SheetControlGUI *active_scg;
94 gulong sig_view_changed;
95 gulong sig_auto_expr_text, sig_auto_expr_attrs;
96 gulong sig_show_horizontal_scrollbar, sig_show_vertical_scrollbar;
97 gulong sig_show_notebook_tabs;
98 gulong sig_sheet_order, sig_notify_uri, sig_notify_dirty;
99 gpointer sig_wbv;
101 /**********************************************/
102 GtkWidget *status_area;
103 GtkUIManager *ui;
104 GtkActionGroup *permanent_actions, *actions, *font_actions,
105 *data_only_actions, *semi_permanent_actions;
106 struct {
107 GtkActionGroup *actions;
108 guint merge_id;
109 } file_history, toolbar, windows, templates;
111 guint template_loader_handler;
113 GOActionComboStack *undo_haction, *redo_haction;
114 GtkAction *undo_vaction, *redo_vaction;
115 GOActionComboColor *fore_color, *back_color;
116 GtkAction *font_name_haction, *font_name_vaction;
117 GOActionComboText *zoom_haction;
118 GtkAction *zoom_vaction;
119 GOActionComboPixmaps *borders, *halignment, *valignment;
120 struct {
121 GtkToggleAction *bold, *italic, *underline, *d_underline,
122 *sl_underline, *dl_underline;
123 GtkToggleAction *superscript, *subscript, *strikethrough;
124 } font;
125 struct {
126 GtkToggleAction *left, *center, *right, *center_across_selection;
127 } h_align;
128 struct {
129 GtkToggleAction *top, *center, *bottom;
130 } v_align;
132 GtkWidget *menu_zone, *toolbar_zones[4];
133 GHashTable *custom_uis;
135 guint idle_update_style_feedback;
137 /* When editing a cell: the cell (may be NULL) */
138 GnmCell *editing_cell;
139 Sheet *editing_sheet;
140 gboolean editing;
142 SheetObject *new_object; /* A newly created object that has yet to be realized */
144 char *preferred_geometry;
147 typedef struct {
148 WorkbookControlClass base;
150 /* signals */
151 void (*markup_changed) (WBCGtk const *wbcg);
152 } WBCGtkClass;
154 #define GNM_RESPONSE_SAVE_ALL -1000
155 #define GNM_RESPONSE_DISCARD_ALL -1001
157 /* Protected functions */
158 gboolean wbc_gtk_close (WBCGtk *wbcg);
159 void wbcg_insert_sheet (GtkWidget *ignored, WBCGtk *wbcg);
160 void wbcg_append_sheet (GtkWidget *ignored, WBCGtk *wbcg);
161 void wbcg_clone_sheet (GtkWidget *ignored, WBCGtk *wbcg);
163 void wbc_gtk_init_editline (WBCGtk *wbcg);
164 void wbc_gtk_init_actions (WBCGtk *wbcg);
165 void wbc_gtk_markup_changer (WBCGtk *wbcg);
167 void wbcg_font_action_set_font_desc (GtkAction *act, PangoFontDescription *desc);
169 gboolean wbc_gtk_load_templates (WBCGtk *gtk);
171 GtkAction *wbcg_find_action (WBCGtk *wbcg, const char *name);
173 G_MODULE_EXPORT void set_uifilename (char const *name, GtkActionEntry const *actions, int nb);
175 G_END_DECLS
177 #endif /* _GNM_WBC_GTK_IMPL_H_ */