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_
7 #include "workbook-control-priv.h"
9 #include "widgets/gnumeric-expr-entry.h"
10 #include "widgets/gnm-notebook.h"
12 #include <goffice/goffice.h>
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. */
36 GtkWidget
*progress_bar
;
39 GnmExprEntry
*entry
; /* The real edit line */
40 GnmExprEntry
*temp_entry
; /* A tmp overlay eg from a 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) */
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
;
57 gboolean inside_editing
;
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 */
67 /* Keep track of whether the last key pressed was END, so end-mode works */
68 gboolean last_key_was_end
;
70 SheetControlGUI
*rangesel
;
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
;
84 GtkWidget
*selection_descriptor
; /* A GtkEntry */
87 gboolean autosave_prompt
;
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
;
101 /**********************************************/
102 GtkWidget
*status_area
;
104 GtkActionGroup
*permanent_actions
, *actions
, *font_actions
,
105 *data_only_actions
, *semi_permanent_actions
;
107 GtkActionGroup
*actions
;
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
;
121 GtkToggleAction
*bold
, *italic
, *underline
, *d_underline
,
122 *sl_underline
, *dl_underline
;
123 GtkToggleAction
*superscript
, *subscript
, *strikethrough
;
126 GtkToggleAction
*left
, *center
, *right
, *center_across_selection
;
129 GtkToggleAction
*top
, *center
, *bottom
;
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
;
142 SheetObject
*new_object
; /* A newly created object that has yet to be realized */
144 char *preferred_geometry
;
148 WorkbookControlClass base
;
151 void (*markup_changed
) (WBCGtk
const *wbcg
);
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
);
177 #endif /* _GNM_WBC_GTK_IMPL_H_ */