1 #include <gnumeric-config.h>
2 #include <glib/gi18n.h>
4 #include "libgnumeric.h"
6 #include "command-context.h"
7 #include "io-context-gtk.h"
8 /* TODO: Get rid of this one */
9 #include "command-context-stderr.h"
11 #include "workbook-view.h"
12 #include <goffice/goffice.h>
13 #include "selection.h"
14 #include "sheet-view.h"
17 #include "sheet-control.h"
18 #include "gnumeric-paths.h"
19 #include "gnm-plugin.h"
20 #include "wbc-gtk-impl.h"
28 cb_kill_wbcg (WBCGtk
*wbcg
)
30 gboolean still_open
= wbc_gtk_close (wbcg
);
31 g_assert (!still_open
);
36 cb_exercise_pango (gpointer data
)
40 WorkbookControl
*wbc
= data
;
41 SheetView
*sv
= wb_control_cur_sheet_view (wbc
);
44 sv_selection_reset (sv
);
45 sv_selection_add_full (sv
, 0, 0, 0, 0, 40, STEP_SIZE
*TEST_STEPS
,
46 GNM_SELECTION_MODE_ADD
);
47 cmd_area_set_text (wbc
, sv
, "=rand()", NULL
);
48 } else if (state
< TEST_STEPS
) {
49 SHEET_VIEW_FOREACH_CONTROL(wb_control_cur_sheet_view (wbc
),
50 sc
, sc_set_top_left (sc
, 0, state
*STEP_SIZE
););
51 } else if (state
< (TEST_STEPS
*2)) {
52 SHEET_VIEW_FOREACH_CONTROL(wb_control_cur_sheet_view (wbc
),
53 sc
, sc_set_top_left (sc
, 0, (state
-TEST_STEPS
)*STEP_SIZE
););
54 } else if (state
== (TEST_STEPS
*2)) {
55 go_doc_set_dirty (wb_control_get_doc (wbc
), FALSE
);
56 g_object_unref (wb_control_get_workbook (wbc
));
59 if (state
++ < TEST_STEPS
*2)
61 g_idle_add ((GSourceFunc
)cb_kill_wbcg
, wbc
);
66 main (int argc
, char const **argv
)
72 argv
= gnm_pre_parse_init (argc
, argv
);
73 gtk_init (&argc
, (char ***)&argv
);
76 cc
= gnm_cmd_context_stderr_new ();
77 ioc
= go_io_context_new (cc
);
80 gnm_plugins_init (GO_CMD_CONTEXT (ioc
));
83 initial_workbook_open_complete
= TRUE
; /* make the last unref exit */
85 wbc
= wbc_gtk_new (NULL
, workbook_new_with_sheets (1), NULL
, NULL
);
87 g_idle_add (cb_exercise_pango
, wbc
);
92 gnm_pre_parse_shutdown ();