5 * ms-obj.h: MS Excel Graphic Object support for Gnumeric
8 * Jody Goldberg (jody@gnome.org)
9 * Michael Meeks (michael@ximian.com)
11 * (C) 1998-2001 Michael Meeks
12 * (C) 2002-2005 Jody Goldberg
15 #include "ms-excel-read.h"
16 #include "ms-excel-write.h"
18 #define MS_ANCHOR_SIZE 18
21 MSOT_GROUP00
= 0x00, /* ??? */
23 MSOT_RECTANGLE
= 0x02,
37 MSOT_SCROLLBAR
= 0x11,
54 MS_OBJ_ATTR_OUTLINE_HIDE
, /* true of style == 0 hides a line */
56 /* Integers & Enums */
57 MS_OBJ_ATTR_IS_INT_MASK
= 0x1000,
59 MS_OBJ_ATTR_FILL_TYPE
,
60 MS_OBJ_ATTR_FILL_SHADE_TYPE
,
61 MS_OBJ_ATTR_FILL_ANGLE
,
62 MS_OBJ_ATTR_FILL_FOCUS
,
63 MS_OBJ_ATTR_FILL_COLOR
,
64 MS_OBJ_ATTR_FILL_ALPHA
,
65 MS_OBJ_ATTR_FILL_PRESET
,
66 MS_OBJ_ATTR_FILL_BACKGROUND
,
67 MS_OBJ_ATTR_FILL_BACKGROUND_ALPHA
,
68 MS_OBJ_ATTR_OUTLINE_COLOR
,
69 MS_OBJ_ATTR_OUTLINE_WIDTH
,
70 MS_OBJ_ATTR_OUTLINE_STYLE
,
71 MS_OBJ_ATTR_SCROLLBAR_VALUE
,
72 MS_OBJ_ATTR_SCROLLBAR_MIN
,
73 MS_OBJ_ATTR_SCROLLBAR_MAX
,
74 MS_OBJ_ATTR_SCROLLBAR_INC
,
75 MS_OBJ_ATTR_SCROLLBAR_PAGE
,
76 MS_OBJ_ATTR_SCROLLBAR_HORIZ
,
77 MS_OBJ_ATTR_BLIP_CROP_TOP
,
78 MS_OBJ_ATTR_BLIP_CROP_BOTTOM
,
79 MS_OBJ_ATTR_BLIP_CROP_LEFT
,
80 MS_OBJ_ATTR_BLIP_CROP_RIGHT
,
81 MS_OBJ_ATTR_ARROW_START
,
82 MS_OBJ_ATTR_ARROW_START_WIDTH
,
83 MS_OBJ_ATTR_ARROW_START_LENGTH
,
84 MS_OBJ_ATTR_ARROW_END
,
85 MS_OBJ_ATTR_ARROW_END_WIDTH
,
86 MS_OBJ_ATTR_ARROW_END_LENGTH
,
89 MS_OBJ_ATTR_IS_PTR_MASK
= 0x2000,
91 MS_OBJ_ATTR_TEXT
, /* just the text, no markup */
93 MS_OBJ_ATTR_OBJ_ALT_TEXT
,
96 MS_OBJ_ATTR_IS_GARRAY_MASK
= 0x4000,
97 MS_OBJ_ATTR_POLYGON_COORDS
,
100 MS_OBJ_ATTR_IS_PANGO_ATTR_LIST_MASK
= 0x10000,
104 MS_OBJ_ATTR_IS_EXPR_MASK
= 0x20000,
105 MS_OBJ_ATTR_LINKED_TO_CELL
,
106 MS_OBJ_ATTR_INPUT_FROM
,
107 MS_OBJ_ATTR_MACRO_EXPR
,
110 MS_OBJ_ATTR_IS_GOBJECT_MASK
= 0x40000,
113 MS_OBJ_ATTR_MASK
= 0x77000
117 MSObjAttrID
const id
;
124 GnmExprTop
const *v_texpr
;
125 PangoAttrList
*v_markup
;
130 MSObjAttr
*ms_obj_attr_new_flag (MSObjAttrID id
);
131 MSObjAttr
*ms_obj_attr_new_uint (MSObjAttrID id
, guint32 val
);
132 MSObjAttr
*ms_obj_attr_new_int (MSObjAttrID id
, gint32 val
);
133 MSObjAttr
*ms_obj_attr_new_ptr (MSObjAttrID id
, gpointer val
);
134 MSObjAttr
*ms_obj_attr_new_array (MSObjAttrID id
, GArray
*array
);
135 MSObjAttr
*ms_obj_attr_new_expr (MSObjAttrID id
, GnmExprTop
const *texpr
);
136 MSObjAttr
*ms_obj_attr_new_markup (MSObjAttrID id
, PangoAttrList
*list
);
137 MSObjAttr
*ms_obj_attr_new_gobject (MSObjAttrID id
, GObject
*object
);
139 typedef GHashTable MSObjAttrBag
;
140 MSObjAttrBag
*ms_obj_attr_bag_new (void);
141 void ms_obj_attr_bag_destroy (MSObjAttrBag
*ab
);
142 void ms_obj_attr_bag_insert (MSObjAttrBag
*ab
,
144 MSObjAttr
*ms_obj_attr_bag_lookup (MSObjAttrBag
*ab
,
146 guint32
ms_obj_attr_get_uint (MSObjAttrBag
*ab
, MSObjAttrID id
,
147 guint32 default_value
);
148 gint32
ms_obj_attr_get_int (MSObjAttrBag
*ab
, MSObjAttrID id
,
149 gint32 default_value
);
150 gboolean
ms_obj_attr_get_ptr (MSObjAttrBag
*ab
, MSObjAttrID id
,
151 gpointer
*res
, gboolean steal
);
152 GArray
*ms_obj_attr_get_array (MSObjAttrBag
*ab
, MSObjAttrID id
,
153 GArray
*default_value
, gboolean steal
);
154 GnmExprTop
const *ms_obj_attr_get_expr (MSObjAttrBag
*ab
, MSObjAttrID id
,
155 GnmExprTop
const *default_value
,
157 PangoAttrList
*ms_obj_attr_get_markup (MSObjAttrBag
*ab
, MSObjAttrID id
,
158 PangoAttrList
*default_value
, gboolean steal
);
159 GObject
*ms_obj_attr_get_gobject (MSObjAttrBag
*attrs
, MSObjAttrID id
);
165 /* Type specific parameters */
166 SheetObject
*gnum_obj
;
168 char const *excel_type_name
;
170 /* a kludge for now until the indicator and the box have distinct objects */
171 GnmCellPos comment_pos
;
172 gboolean auto_combo
; /* Filter, Validation, ... */
176 MSObj
*ms_obj_new (MSObjAttrBag
*ab
);
177 gboolean
ms_read_OBJ (BiffQuery
*q
, MSContainer
*c
, MSObjAttrBag
*ab
);
178 void ms_obj_delete (MSObj
*obj
);
179 char *ms_read_TXO (BiffQuery
*q
, MSContainer
*c
, PangoAttrList
**markup
);
181 /********************************************************/
183 void ms_objv8_write_common (BiffPut
*bp
, int id
, int type
, guint16 flags
);
184 void ms_objv8_write_scrollbar_old (BiffPut
*bp
);
185 void ms_objv8_write_listbox (BiffPut
*bp
, guint8 lct
, gboolean filtered
);
187 void ms_objv8_write_note (BiffPut
*bp
);
189 void ms_objv8_write_checkbox (BiffPut
*bp
,
191 ExcelWriteSheet
*esheet
,
192 GnmExprTop
const *link_texpr
,
193 GnmNamedExpr
*macro_nexpr
);
194 void ms_objv8_write_radiobutton (BiffPut
*bp
,
196 ExcelWriteSheet
*esheet
,
197 GnmExprTop
const *link_texpr
,
198 GnmNamedExpr
*macro_nexpr
);
199 void ms_objv8_write_spinbutton (BiffPut
*bp
,
200 ExcelWriteSheet
*esheet
,
201 GtkAdjustment
*adj
, gboolean horiz
,
202 GnmExprTop
const *link_texpr
,
203 GnmNamedExpr
*macro_nexpr
);
204 void ms_objv8_write_scrollbar (BiffPut
*bp
,
205 ExcelWriteSheet
*esheet
,
206 GtkAdjustment
*adj
, gboolean horiz
,
207 GnmExprTop
const *link_texpr
,
208 GnmNamedExpr
*macro_nexpr
);
209 void ms_objv8_write_list (BiffPut
*bp
,
210 ExcelWriteSheet
*esheet
,
212 GnmExprTop
const *res_texpr
,
213 GnmExprTop
const *data_texpr
,
214 GnmNamedExpr
*macro_nexpr
);
215 void ms_objv8_write_button (BiffPut
*bp
,
216 ExcelWriteSheet
*esheet
,
217 GnmNamedExpr
*macro_nexpr
);
220 #endif /* GNM_MS_OBJ_H */