Commit 34fa4985 authored by Jody Goldberg's avatar Jody Goldberg

finish merging wbc-gtk and wbcg. Things compile and run now.

still needs testing.

svn path=/trunk/; revision=15740
parent d14bd4fb
......@@ -194,13 +194,12 @@ src/test-pango.c
src/validation.c
src/value.c
src/value-sheet.c
src/wbcg-actions.c
src/wbc-gtk.c
src/wbc-gtk-actions.c
src/wbc-gtk-edit.c
src/workbook.c
src/workbook-cmd-format.c
src/workbook-control.c
src/workbook-control-gui.c
src/workbook-edit.c
src/workbook-view.c
src/xml-io.c
src/xml-sax-read.c
......
......@@ -312,13 +312,12 @@ src/test-pango.c
src/validation.c
src/value.c
src/value-sheet.c
src/wbcg-actions.c
src/wbc-gtk.c
src/wbc-gtk-actions.c
src/wbc-gtk-edit.c
src/workbook.c
src/workbook-cmd-format.c
src/workbook-control.c
src/workbook-control-gui.c
src/workbook-edit.c
src/workbook-view.c
src/xml-io.c
src/xml-sax-read.c
......
......@@ -275,9 +275,8 @@ libspreadsheet_include_HEADERS = \
workbook-view.h \
workbook-control.h \
workbook-control-priv.h \
workbook-edit.h \
workbook-control-gui-priv.h \
wbc-gtk.h \
wbc-gtk-impl.h \
xml-io.h \
xml-io-version.h \
xml-sax.h \
......@@ -285,7 +284,6 @@ libspreadsheet_include_HEADERS = \
print.h \
print-cell.h
gnumeric_SOURCES = \
io-context-gtk.c \
io-context-gtk.h \
......
......@@ -26,9 +26,7 @@
#include "sheet-view.h"
#include "application.h"
#include "workbook-view.h"
#include "workbook-edit.h"
#include "workbook-control-gui.h"
#include "workbook-control-gui-priv.h"
#include "wbc-gtk-impl.h"
#include "workbook.h"
#include "workbook-cmd-format.h"
#include "commands.h"
......@@ -404,7 +402,7 @@ gnm_pane_key_mode_sheet (GnmPane *pane, GdkEventKey *event,
/* Be careful to restore the editing sheet if we are editing */
if (wbcg_is_editing (wbcg))
sheet = wbcg->wb_control.editing_sheet;
sheet = wbcg->editing_sheet;
if (wbcg_edit_finish (wbcg, WBC_EDIT_ACCEPT, NULL)) {
if ((event->state & GDK_MOD1_MASK) &&
......
......@@ -15,7 +15,8 @@
#include "command-context-stderr.h"
#include "selection.h"
#include "application.h"
#include "workbook-control-gui-priv.h"
#include "workbook-control.h"
#include "wbc-gtk.h"
#include "workbook-priv.h"
#include "workbook.h"
#include "workbook-view.h"
......
......@@ -20,7 +20,7 @@
#include "sheet.h"
#include "application.h"
#include "command-context.h"
#include "workbook-control-gui-priv.h"
#include "wbc-gtk-impl.h"
#include "workbook-view.h"
#include "workbook-priv.h"
#include "gnumeric-gconf.h"
......
......@@ -22,6 +22,7 @@
#include "application.h"
#include "workbook.h"
#include "libgnumeric.h"
#include "wbc-gtk.h"
#include "widgets/gnumeric-expr-entry.h"
#include <goffice/app/error-info.h>
......
......@@ -19,7 +19,7 @@
#include "sheet-control-gui-priv.h"
#include "application.h"
#include "selection.h"
#include "workbook-edit.h"
#include "wbc-gtk.h"
#include "gui-util.h"
#include "parse-util.h"
#include "commands.h"
......@@ -108,7 +108,7 @@ item_bar_calc_size (ItemBar *ib)
Sheet const *sheet = scg_sheet (scg);
double const zoom_factor = sheet->last_zoom_factor_used;
PangoContext *context;
const PangoFontDescription *src_desc = wbcg_get_font_desc (scg_wbcg (scg));
PangoFontDescription const *src_desc = wbcg_get_font_desc (scg_wbcg (scg));
PangoFontDescription *desc;
int size = pango_font_description_get_size (src_desc);
PangoLayout *layout;
......
......@@ -23,7 +23,7 @@
#include "sheet-merge.h"
#include "value.h"
#include "workbook.h"
#include "workbook-edit.h"
#include "wbc-gtk.h"
#include "gui-util.h"
#include "cmd-edit.h"
#include "commands.h"
......
......@@ -31,7 +31,7 @@
#include "pattern.h"
#include "parse-util.h"
#include "workbook.h"
#include "workbook-edit.h"
#include "wbc-gtk.h"
#include "gui-util.h"
#include "widgets/gnumeric-expr-entry.h"
#include "item-debug.h"
......
......@@ -15,9 +15,8 @@
#include "item-grid.h"
#include "gnm-pane-impl.h"
#include "workbook-edit.h"
#include "wbc-gtk-impl.h"
#include "workbook-view.h"
#include "workbook-control-gui-priv.h"
#include "sheet-control-gui-priv.h"
#include "sheet.h"
#include "sheet-view.h"
......@@ -365,7 +364,7 @@ item_grid_draw (FooCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expo
GnmPane *pane = GNM_PANE (canvas);
Sheet const *sheet = scg_sheet (pane->simple.scg);
WBCGtk *wbcg = scg_wbcg (pane->simple.scg);
GnmCell const * const edit_cell = wbcg->wb_control.editing_cell;
GnmCell const * const edit_cell = wbcg->editing_cell;
ItemGrid *ig = ITEM_GRID (item);
ColRowInfo const *ri = NULL, *next_ri = NULL;
int const dir = sheet->text_is_rtl ? -1 : 1;
......
......@@ -24,8 +24,7 @@
#include "io-context-gtk.h"
/* TODO: Get rid of this one */
#include "command-context-stderr.h"
#include "workbook-control-gui.h"
#include "workbook-control-gui-priv.h"
#include "wbc-gtk-impl.h"
#include "workbook-view.h"
#include <goffice/app/go-plugin.h>
#include "workbook.h"
......@@ -315,7 +314,8 @@ store_plugin_state (void)
static int
cb_kill_wbcg (WBCGtk *wbcg)
{
wbcg_close_control (wbcg);
gboolean still_open = wbc_gtk_close (wbcg);
g_assert (!still_open);
return FALSE;
}
......
......@@ -29,8 +29,7 @@
#include <workbook.h>
#include <workbook-priv.h>
#include <workbook-view.h>
#include <workbook-edit.h>
#include <workbook-control-gui.h>
#include <wbc-gtk.h>
#include <gui-file.h>
#include <gui-util.h>
#include <goffice/app/go-doc.h>
......
......@@ -30,9 +30,8 @@
#include "sheet-merge.h"
#include "workbook.h"
#include "workbook-view.h"
#include "workbook-edit.h"
#include "workbook-cmd-format.h"
#include "workbook-control-gui-priv.h"
#include "wbc-gtk-impl.h"
#include "cell.h"
#include "selection.h"
#include "style.h"
......@@ -3605,3 +3604,21 @@ scg_drag_data_get (SheetControlGUI *scg, GtkSelectionData *selection_data)
g_free (target_name);
g_slist_free (objects);
}
void
scg_delete_sheet_if_possible (SheetControlGUI *scg)
{
SheetControl *sc = (SheetControl *) scg;
Sheet *sheet = sc->sheet;
Workbook *wb = sheet->workbook;
/* If this is the last sheet left, ignore the request */
if (workbook_sheet_count (wb) != 1) {
WorkbookSheetState *old_state = workbook_sheet_state_new (wb);
WorkbookControl *wbc = sc->wbc;
workbook_sheet_delete (sheet);
/* Careful: sc just ceased to be valid. */
cmd_reorganize_sheets (wbc, old_state, sheet);
}
}
......@@ -103,6 +103,8 @@ void scg_drag_data_received (SheetControlGUI *scg, GtkWidget *source_widget,
void scg_drag_data_get (SheetControlGUI *scg,
GtkSelectionData *selection_data);
void scg_delete_sheet_if_possible (SheetControlGUI *scg);
/* Convenience wrappers. */
SheetView *scg_view (SheetControlGUI const *scg);
Sheet *scg_sheet (SheetControlGUI const *scg);
......
......@@ -32,7 +32,7 @@
#include "gnm-graph-window.h"
#include "style-color.h"
#include "sheet-object-impl.h"
#include "workbook-edit.h"
#include "wbc-gtk.h"
#include "commands.h"
#include "application.h"
#include "xml-io.h"
......
......@@ -12,6 +12,7 @@
#include "sheet-object-image.h"
#include "gnm-pane.h"
#include "wbc-gtk.h"
#include "sheet-object-impl.h"
#include "sheet-control-gui.h"
#include "gui-file.h"
......
......@@ -36,7 +36,7 @@
#include "value.h"
#include "ranges.h"
#include "selection.h"
#include "workbook-edit.h"
#include "wbc-gtk.h"
#include "workbook.h"
#include "sheet.h"
#include "cell.h"
......
......@@ -20,7 +20,6 @@
#include "sheet-private.h"
#include "dialogs.h"
#include "sheet-object-impl.h"
#include "workbook-edit.h"
#include "expr.h"
#include "ranges.h"
#include "commands.h"
......
......@@ -31,7 +31,6 @@
#include "workbook-priv.h"
#include "workbook-control.h"
#include "workbook-view.h"
#include "workbook-edit.h"
#include "parse-util.h"
#include "dependent.h"
#include "value.h"
......
......@@ -35,7 +35,7 @@
#include <goffice/app/io-context-priv.h>
#include <goffice/utils/go-glib-extras.h>
#include "command-context.h"
#include "workbook-control-gui.h"
#include "wbc-gtk.h"
#include "workbook-view.h"
#include "workbook.h"
#include "dialog-stf.h"
......
......@@ -47,8 +47,7 @@
#include "cmd-edit.h"
#include "workbook-priv.h"
#include "workbook-view.h"
#include "workbook-edit.h"
#include "workbook-control-gui-priv.h"
#include "wbc-gtk-impl.h"
#include "workbook-cmd-format.h"
#include "dialogs/dialogs.h"
#include "sheet-object-image.h"
......@@ -147,18 +146,20 @@ static GNM_ACTION_DEF (cb_file_print_area_show)
static GNM_ACTION_DEF (cb_file_print)
{
gnm_print_sheet (wbcg, wbcg_cur_sheet (wbcg), FALSE, PRINT_ACTIVE_SHEET, NULL);
gnm_print_sheet (WORKBOOK_CONTROL (wbcg),
wbcg_cur_sheet (wbcg), FALSE, PRINT_ACTIVE_SHEET, NULL);
}
static GNM_ACTION_DEF (cb_file_print_preview)
{
gnm_print_sheet (wbcg, wbcg_cur_sheet (wbcg), TRUE, PRINT_ACTIVE_SHEET, NULL);
gnm_print_sheet (WORKBOOK_CONTROL (wbcg),
wbcg_cur_sheet (wbcg), TRUE, PRINT_ACTIVE_SHEET, NULL);
}
static GNM_ACTION_DEF (cb_doc_meta_data) { dialog_doc_metadata_new (wbcg); }
static GNM_ACTION_DEF (cb_file_preferences) { dialog_preferences (wbcg, 0); }
static GNM_ACTION_DEF (cb_file_history_full) { dialog_recent_used (wbcg); }
static GNM_ACTION_DEF (cb_file_close) { wbcg_close_control (wbcg); }
static GNM_ACTION_DEF (cb_file_close) { wbc_gtk_close (wbcg); }
static GNM_ACTION_DEF (cb_file_quit)
{
......@@ -297,7 +298,7 @@ static GNM_ACTION_DEF (cb_sheet_remove)
{
SheetControlGUI *scg = wbcg_cur_scg (wbcg);
if (scg)
scg_delete_sheet_if_possible (NULL, scg);
scg_delete_sheet_if_possible (scg);
}
static GNM_ACTION_DEF (cb_edit_undo_last) { command_undo (WORKBOOK_CONTROL (wbcg)); }
......@@ -1059,7 +1060,8 @@ static GNM_ACTION_DEF (cmd_create_rectangle)
static GNM_ACTION_DEF (cmd_create_ellipse)
{ create_object (wbcg, GNM_SO_FILLED_TYPE, "is-oval", TRUE, NULL); }
void
/*****************************************************************************/
static void
wbcg_set_selection_halign (WBCGtk *wbcg, GnmHAlign halign)
{
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
......@@ -1079,7 +1081,6 @@ wbcg_set_selection_halign (WBCGtk *wbcg, GnmHAlign halign)
gnm_style_set_align_h (style, halign);
cmd_selection_format (wbc, style, NULL, _("Set Horizontal Alignment"));
}
static GNM_ACTION_DEF (cb_align_left)
{ wbcg_set_selection_halign (wbcg, HALIGN_LEFT); }
static GNM_ACTION_DEF (cb_align_right)
......@@ -1089,7 +1090,9 @@ static GNM_ACTION_DEF (cb_align_center)
static GNM_ACTION_DEF (cb_center_across_selection)
{ wbcg_set_selection_halign (wbcg, HALIGN_CENTER_ACROSS_SELECTION); }
void
/*****************************************************************************/
static void
wbcg_set_selection_valign (WBCGtk *wbcg, GnmVAlign valign)
{
WorkbookControl *wbc = WORKBOOK_CONTROL (wbcg);
......@@ -1112,7 +1115,6 @@ wbcg_set_selection_valign (WBCGtk *wbcg, GnmVAlign valign)
gnm_style_set_align_v (style, valign);
cmd_selection_format (wbc, style, NULL, _("Set Vertical Alignment"));
}
static GNM_ACTION_DEF (cb_align_top)
{ wbcg_set_selection_valign (wbcg, VALIGN_TOP); }
static GNM_ACTION_DEF (cb_align_vcenter)
......@@ -1120,10 +1122,7 @@ static GNM_ACTION_DEF (cb_align_vcenter)
static GNM_ACTION_DEF (cb_align_bottom)
{ wbcg_set_selection_valign (wbcg, VALIGN_BOTTOM); }
static GNM_ACTION_DEF (cb_view_statusbar)
{
wbcg_toggle_visibility (wbcg, GTK_TOGGLE_ACTION (a));
}
/*****************************************************************************/
static GNM_ACTION_DEF (cb_merge_and_center)
{
......@@ -1152,6 +1151,13 @@ static GNM_ACTION_DEF (cb_unmerge_cells)
range_fragment_free (range_list);
}
static GNM_ACTION_DEF (cb_view_statusbar)
{
wbcg_toggle_visibility (wbcg, GTK_TOGGLE_ACTION (a));
}
/*****************************************************************************/
static void
toggle_font_attr (WBCGtk *wbcg, GtkToggleAction *act,
GnmStyleElement t, unsigned true_val, unsigned false_val)
......@@ -2158,22 +2164,94 @@ static GtkToggleActionEntry const font_toggle_actions[] = {
N_("Subscript"), G_CALLBACK (cb_font_subscript), FALSE }
};
void wbcg_register_actions (WBCGtk *wbcg,
GtkActionGroup *menu_group,
GtkActionGroup *group,
GtkActionGroup *font_group);
/****************************************************************************/
static GOActionComboPixmapsElement const halignment_combo_info[] = {
{ N_("Align left"), GTK_STOCK_JUSTIFY_LEFT, HALIGN_LEFT },
{ N_("Center horizontally"), GTK_STOCK_JUSTIFY_CENTER, HALIGN_CENTER },
{ N_("Align right"), GTK_STOCK_JUSTIFY_RIGHT, HALIGN_RIGHT },
{ N_("Fill Horizontally"), "Gnumeric_HAlignFill", HALIGN_FILL },
{ N_("Justify Horizontally"), GTK_STOCK_JUSTIFY_FILL, HALIGN_JUSTIFY },
{ N_("Center horizontally across the selection"),
"Gnumeric_CenterAcrossSelection", HALIGN_CENTER_ACROSS_SELECTION },
{ N_("Align numbers right, and text left"),
"Gnumeric_HAlignGeneral", HALIGN_GENERAL },
{ NULL, NULL }
};
static GOActionComboPixmapsElement const valignment_combo_info[] = {
{ N_("Align Top"), "stock_alignment-top", VALIGN_TOP },
{ N_("Center Vertically"), "stock_alignment-centered-vertically", VALIGN_CENTER },
{ N_("Align Bottom"), "stock_alignment-bottom", VALIGN_BOTTOM },
{ NULL, NULL}
};
static void
cb_halignment_activated (GOActionComboPixmaps *a, WBCGtk *wbcg)
{
wbcg_set_selection_halign (wbcg,
go_action_combo_pixmaps_get_selected (a, NULL));
}
static void
cb_valignment_activated (GOActionComboPixmaps *a, WBCGtk *wbcg)
{
wbcg_set_selection_valign (wbcg,
go_action_combo_pixmaps_get_selected (a, NULL));
}
static void
wbc_gtk_init_alignments (WBCGtk *wbcg)
{
wbcg->halignment = go_action_combo_pixmaps_new ("HAlignmentSelector",
halignment_combo_info, 3, 1);
g_object_set (G_OBJECT (wbcg->halignment),
"label", _("Horizontal Alignment"),
"tooltip", _("Horizontal Alignment"),
NULL);
#if 0
gnm_combo_box_set_title (GO_COMBO_BOX (fore_combo), _("Horizontal Alignment"));
go_combo_pixmaps_select (wbcg->halignment, 1); /* default to none */
#endif
g_signal_connect (G_OBJECT (wbcg->halignment),
"activate",
G_CALLBACK (cb_halignment_activated), wbcg);
gtk_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->halignment));
wbcg->valignment = go_action_combo_pixmaps_new ("VAlignmentSelector",
valignment_combo_info, 1, 3);
g_object_set (G_OBJECT (wbcg->valignment),
"label", _("Vertical Alignment"),
"tooltip", _("Vertical Alignment"),
NULL);
#if 0
gnm_combo_box_set_title (GO_COMBO_BOX (fore_combo), _("Horizontal Alignment"));
go_combo_pixmaps_select (wbcg->valignment, 1); /* default to none */
#endif
g_signal_connect (G_OBJECT (wbcg->valignment),
"activate",
G_CALLBACK (cb_valignment_activated), wbcg);
gtk_action_group_add_action (wbcg->actions, GTK_ACTION (wbcg->valignment));
}
/****************************************************************************/
void
wbcg_register_actions (WBCGtk *wbcg,
GtkActionGroup *menu_group,
GtkActionGroup *group,
GtkActionGroup *font_group)
wbc_gtk_init_actions (WBCGtk *wbcg)
{
gtk_action_group_add_actions (menu_group,
wbcg->permanent_actions = gtk_action_group_new ("PermanentActions");
gtk_action_group_set_translation_domain (wbcg->permanent_actions, GETTEXT_PACKAGE);
wbcg->actions = gtk_action_group_new ("Actions");
gtk_action_group_set_translation_domain (wbcg->actions, GETTEXT_PACKAGE);
wbcg->font_actions = gtk_action_group_new ("FontActions");
gtk_action_group_set_translation_domain (wbcg->font_actions, GETTEXT_PACKAGE);
gtk_action_group_add_actions (wbcg->permanent_actions,
permanent_actions, G_N_ELEMENTS (permanent_actions), wbcg);
gtk_action_group_add_actions (group,
gtk_action_group_add_actions (wbcg->actions,
actions, G_N_ELEMENTS (actions), wbcg);
gtk_action_group_add_toggle_actions (group,
gtk_action_group_add_toggle_actions (wbcg->actions,
toggle_actions, G_N_ELEMENTS (toggle_actions), wbcg);
gtk_action_group_add_toggle_actions (font_group,
gtk_action_group_add_toggle_actions (wbcg->font_actions,
font_toggle_actions, G_N_ELEMENTS (font_toggle_actions), wbcg);
wbc_gtk_init_alignments (wbcg);
}
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* workbook-edit.c: Keeps track of the cell editing process.
* wbc-gtk-edit.c: Keeps track of the cell editing process.
*
* Copyright (C) 2006-2007 Jody Goldberg (jody@gnome.org)
* Copyright (C) 2000-2005 Miguel de Icaza (miguel@novell.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
* Jody Goldberg (jody@gnome.org)
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* (C) 2000-2005 Ximian, Inc.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#include <gnumeric-config.h>
#include <glib/gi18n-lib.h>
#include "gnumeric.h"
#include "workbook-edit.h"
#include "gnm-pane-impl.h"
#include "workbook-control-gui-priv.h"
#include "wbc-gtk-impl.h"
#include "workbook-view.h"
#include "workbook-priv.h"
#include "application.h"
......@@ -36,10 +46,11 @@
#include "value.h"
#include "widgets/gnumeric-expr-entry.h"
#include <gtk/gtk.h>
#include <string.h>
#include <goffice/utils/go-font.h>
#include <goffice/utils/go-locale.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
#include <string.h>
#define GNM_RESPONSE_REMOVE -1000
......@@ -111,9 +122,9 @@ wbcg_edit_finish (WBCGtk *wbcg, WBCEditResult result,
return TRUE;
}
g_return_val_if_fail (IS_SHEET (wbc->editing_sheet), TRUE);
g_return_val_if_fail (IS_SHEET (wbcg->editing_sheet), TRUE);
sheet = wbc->editing_sheet;
sheet = wbcg->editing_sheet;
sv = sheet_get_view (sheet, wbv);
/* Save the results before changing focus */
......@@ -240,9 +251,9 @@ wbcg_edit_finish (WBCGtk *wbcg, WBCEditResult result,
}
/* Stop editing */
wbc->editing = FALSE;
wbc->editing_sheet = NULL;
wbc->editing_cell = NULL;
wbcg->editing = FALSE;
wbcg->editing_sheet = NULL;
wbcg->editing_cell = NULL;
if (wbcg->edit_line.guru != NULL) {
GtkWidget *w = wbcg->edit_line.guru;
......@@ -643,7 +654,7 @@ wbcg_edit_add_markup (WBCGtk *wbcg, PangoAttribute *attr)
attr->start_index = 0;
attr->end_index = INT_MAX;
pango_attr_list_change (wbcg->edit_line.cur_fmt, attr);
g_signal_emit (G_OBJECT (wbcg), wbcg_signals [WBCG_MARKUP_CHANGED], 0);
wbc_gtk_markup_changer (wbcg);
}
/**
......@@ -958,9 +969,9 @@ wbcg_edit_start (WBCGtk *wbcg,
gtk_window_set_focus (wbcg_toplevel (wbcg),
(GtkWidget *) wbcg_get_entry (wbcg));
wbcg->wb_control.editing = TRUE;
wbcg->wb_control.editing_sheet = sv->sheet;
wbcg->wb_control.editing_cell = cell;
wbcg->editing = TRUE;
wbcg->editing_sheet = sv->sheet;
wbcg->editing_cell = cell;
/* If this assert fails, it means editing was not shut down
* properly before
......
......@@ -2,14 +2,18 @@
#define GNM_WBC_GTK_IMPL_H
#include "gnumeric.h"
#include "workbook-control-gui.h"
#include "wbc-gtk.h"
#include "workbook-control-priv.h"
#include <goffice/app/file.h>
#include "style.h"
#include "widgets/gnumeric-expr-entry.h"
#include <goffice/app/file.h>
#include <gtk/gtknotebook.h>
#include <gtk/gtkuimanager.h>
#include <goffice/gtk/go-action-combo-stack.h>
#include <goffice/gtk/go-action-combo-color.h>
#include <goffice/gtk/go-action-combo-text.h>
#include <goffice/gtk/go-action-combo-pixmaps.h>
#ifdef USE_HILDON
#include <hildon-widgets/hildon-program.h>
#endif
......@@ -110,35 +114,31 @@ struct _WBCGtk {
GHashTable *custom_uis;
guint idle_update_style_feedback;
/* When editing a cell: the cell (may be NULL) */
GnmCell *editing_cell;
Sheet *editing_sheet;
gboolean editing;
};
typedef struct {
WorkbookControlClass base;
/* signals */
void (*markup_changed) (WorkbookControlGUI const *wbcg);
} WorkbookControlGUIClass;
void (*markup_changed) (WBCGtk const *wbcg);
} WBCGtkClass;
#define WORKBOOK_CONTROL_GUI_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), WBC_GTK_TYPE, WorkbookControlGUIClass))
#define WORKBOOK_CONTROL_GUI_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), WBC_GTK_TYPE, WBCGtkClass))
#define GNM_RESPONSE_SAVE_ALL -1000
#define GNM_RESPONSE_DISCARD_ALL -1001
/* Protected functions */
void wbcg_set_toplevel (WorkbookControlGUI *wbcg, GtkWidget *w);
gboolean wbcg_close_control (WorkbookControlGUI *wbcg);
void scg_delete_sheet_if_possible (GtkWidget *ignored, SheetControlGUI *scg);
void wbcg_insert_sheet (GtkWidget *ignored, WorkbookControlGUI *wbcg);
void wbcg_append_sheet (GtkWidget *ignored, WorkbookControlGUI *wbcg);
void wbcg_clone_sheet (GtkWidget *ignored, WorkbookControlGUI *wbcg);
void wbcg_set_selection_halign (WorkbookControlGUI *wbcg, GnmHAlign halign);
void wbcg_set_selection_valign (WorkbookControlGUI *wbcg, GnmVAlign valign);
enum {
WBCG_MARKUP_CHANGED,
WBCG_LAST_SIGNAL
};
extern guint wbcg_signals [WBCG_LAST_SIGNAL];
gboolean wbc_gtk_close (WBCGtk *wbcg);
void wbcg_insert_sheet (GtkWidget *ignored, WBCGtk *wbcg);
void wbcg_append_sheet (GtkWidget *ignored, WBCGtk *wbcg);
void wbcg_clone_sheet (GtkWidget *ignored, WBCGtk *wbcg);
void wbc_gtk_init_actions (WBCGtk *wbcg);
void wbc_gtk_markup_changer (WBCGtk *wbcg);
#endif /* GNM_WBC_GTK_IMPL_H */
This diff is collapsed.
......@@ -24,6 +24,7 @@
#include "gnm-cell-combo-foo-view.h"
#include "gnm-cell-combo-foo-view-impl.h"
#include "wbc-gtk.h"
#include "sheet.h"
#include "sheet-control-gui.h"
#include "gnm-pane-impl.h"
......
......@@ -19,7 +19,7 @@
#include <gnumeric-config.h>
#include "gnumeric-cell-renderer-expr-entry.h"
#include "gnumeric-expr-entry.h"
#include "workbook-edit.h"
#include "wbc-gtk.h"
#define GNUMERIC_CELL_RENDERER_EXPR_ENTRY_PATH "gnumeric-cell-renderer-expr-entry-path"
......
......@@ -13,8 +13,7 @@
#include <gnumeric.h>
#include "gnumeric-expr-entry.h"
#include <workbook-edit.h>
#include <workbook-control-gui-priv.h>
#include <wbc-gtk-impl.h>
#include <sheet-control-gui-priv.h>
#include <sheet-merge.h>
#include <parse-util.h>
......@@ -447,7 +446,7 @@ cb_gee_key_press_event (GtkEntry *entry,
break;
/* Be careful to use the editing sheet */
sv = sheet_get_view (wbcg->wb_control.editing_sheet,
sv = sheet_get_view (wbcg->editing_sheet,
wb_control_view (WORKBOOK_CONTROL (wbcg)));
if (state & GDK_CONTROL_MASK)
......
......@@ -9,11 +9,6 @@ struct _WorkbookControl {
WorkbookView *wb_view;
/* When editing a cell: the cell (may be NULL) */
GnmCell *editing_cell;
Sheet *editing_sheet;
gboolean editing;
gulong clipboard_changed_signal;
};
typedef struct {
......
......@@ -359,11 +359,6 @@ workbook_control_init (GObject *obj)
{
WorkbookControl *wbc = WORKBOOK_CONTROL (obj);
/* We are not in edit mode */
wbc->editing = FALSE;
wbc->editing_sheet = NULL;
wbc->editing_cell = NULL;
wbc->clipboard_changed_signal = g_signal_connect (
gnm_app_get_app (),
"clipboard_modified",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment