Revert, revert, try another thing
[gnumeric.git] / wizards / graphics / graphic-context.h
blob5025b71e9bae7c8a6bcaf6030e35a867e80140b0
1 #ifndef GNUMERIC_WIZARD_GRAPHICS_CONTEXT_H
2 #define GNUMERIC_WIZARD_GRAPHICS_CONTEXT_H
4 #include "str.h"
5 #include "expr.h"
6 #include "sheet-vector.h"
7 #include "idl/Graph.h"
9 typedef enum {
10 SERIES_COLUMNS,
11 SERIES_ROWS
12 } SeriesOrientation;
14 typedef struct {
15 ExprTree *name_expr;
16 String *entered_expr;
17 SheetVector *vector;
18 } DataRange;
20 DataRange *data_range_new (Workbook *wb, const char *name_expr);
21 DataRange *data_range_new_from_expr (Workbook *wb, const char *name_expr, const char *expression);
22 DataRange *data_range_new_from_vector (Workbook *wb, const char *name_expr, SheetVector *vector);
23 void data_range_destroy (DataRange *data_range, gboolean detach_from_sheet);
25 typedef struct {
26 guint signature;
27 GtkWidget *dialog_toplevel;
28 Workbook *workbook;
29 GladeXML *gui;
31 int current_page;
32 int last_graphic_type_page;
33 GtkNotebook *steps_notebook, *graphic_types_notebook;
35 int graphic_type;
37 /* Data for the various pages */
38 String *data_range;
39 SeriesOrientation series_location;
40 GList *data_range_list;
42 String *x_axis_label;
44 String *plot_title;
45 String *y_axis_label;
47 BonoboObjectClient *graphics_server;
48 BonoboClientSite *client_site;
50 /* Interface pointer for the Layout interface */
51 GNOME_Graph_Layout layout;
53 /* Interface pointer for the actual chart */
54 GNOME_Graph_Chart chart;
57 * A List of BonoboViewFrames
59 GList *view_frames;
61 gboolean do_create;
62 } WizardGraphicContext;
64 #define GC_SIGNATURE ((('G' << 8) | ('C' << 8)) | 'o')
65 #define IS_GRAPHIC_CONTEXT(gc) (gc->signature == GC_SIGNATURE)
67 WizardGraphicContext *graphic_context_new (Workbook *wb, GladeXML *gui);
68 BonoboViewFrame *graphic_context_new_chart_view_frame (WizardGraphicContext *gc);
70 void graphic_context_destroy (WizardGraphicContext *gc);
72 void graphic_context_data_range_remove (WizardGraphicContext *gc,
73 DataRange *data_range);
74 void graphic_context_data_range_add (WizardGraphicContext *gc,
75 DataRange *data_range);
78 * Wizardy functions have a graphic_wizard prefix, because they do
79 * magic.
81 void graphic_wizard_guess_series (WizardGraphicContext *gc,
82 SeriesOrientation orientation,
83 gboolean first_item_is_series_name);
85 #endif /* GNUMERIC_WIZARD_GRAPHICS_CONTEXT_H */